MercuryDPM  Beta
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Chute.h
Go to the documentation of this file.
1 //Copyright (c) 2013-2014, The MercuryDPM Developers Team. All rights reserved.
2 //For the list of developers, see <http://www.MercuryDPM.org/Team>.
3 //
4 //Redistribution and use in source and binary forms, with or without
5 //modification, are permitted provided that the following conditions are met:
6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above copyright
9 // notice, this list of conditions and the following disclaimer in the
10 // documentation and/or other materials provided with the distribution.
11 // * Neither the name MercuryDPM nor the
12 // names of its contributors may be used to endorse or promote products
13 // derived from this software without specific prior written permission.
14 //
15 //THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16 //ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 //WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 //DISCLAIMED. IN NO EVENT SHALL THE MERCURYDPM DEVELOPERS TEAM BE LIABLE FOR ANY
19 //DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 //(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 //LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22 //ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 //(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 //SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 
26 #ifndef CHUTE_H
27 #define CHUTE_H
28 #include "Mercury3D.h"
29 
30 class InsertionBoundary;
31 
32 
51 {
53 };
62 class Chute : public Mercury3D
63 {
64 public:
68  Chute();
69 
73  Chute(const DPMBase& other);
74 
78  Chute(const MercuryBase& other);
79 
83  Chute(const Mercury3D& other);
84 
88  Chute(const Chute& other);
89 
94  void constructor();
95 
99  bool readNextArgument(int& i, int argc, char *argv[]);
100 
104  void setupSideWalls();
105 
109  void makeChutePeriodic();
110 
114  bool getIsPeriodic() const;
115 
119  void setupInitialConditions();
120 
124  void read(std::istream& is);
125 
130  void write(std::ostream& os, bool writeAllParticles = true) const;
131 
132 //setters and getters
133 
138  void setFixedParticleRadius(Mdouble fixedParticleRadius);
139 
145 
149  void setRoughBottomType(RoughBottomType roughBottomType);
150 
155  void setRoughBottomType(std::string roughBottomTypeString);
156 
161 
165  void setChuteAngle(Mdouble chuteAngle);
166 
170  void setChuteAngleAndMagnitudeOfGravity(Mdouble chuteAngle, Mdouble gravity);
171 
172  //void setChuteAngle(Mdouble new_, Mdouble gravity){if (new_>=0.0&&new_<=90.0) {ChuteAngle = new_; setGravity(Vec3D(sin(ChuteAngle*pi/180.0), 0.0, -cos(ChuteAngle*pi/180.0))*gravity);} else std::cerr << "WARNING : Chute angle must be within [0,90]" << std::endl;}
173 
177  Mdouble getChuteAngle() const;
178 
183 
187  void setMaxFailed(unsigned int maxFailed);
188 
192  unsigned int getMaxFailed() const;
193 
198  void setInflowParticleRadius(Mdouble inflowParticleRadius);
199 
203  void setInflowParticleRadius(Mdouble minInflowParticleRadius, Mdouble maxInflowParticleRadius);
204 
208  void setMinInflowParticleRadius(Mdouble minInflowParticleRadius);
209 
213  void setMaxInflowParticleRadius(Mdouble maxInflowParticleRadius);
214 
219 
224 
229 
233  void setInflowHeight(Mdouble inflowHeight);
234 
238  Mdouble getInflowHeight() const;
239 
243  void setInflowVelocity(Mdouble inflowVelocity);
244 
248  Mdouble getInflowVelocity() const;
249 
253  void setInflowVelocityVariance(Mdouble inflowVelocityVariance);
254 
259 
263  void setChuteWidth(Mdouble chuteWidth);
264 
268  Mdouble getChuteWidth() const;
269 
273  virtual void setChuteLength(Mdouble chuteLength);
274 
278  Mdouble getChuteLength() const;
279 
283  int getNCreated() const;
284 
288  void increaseNCreated();
289 
293  void setInsertionBoundary(InsertionBoundary* insertionBoundary);
294 
295 protected:
299  void actionsBeforeTimeStep();
300 
304  void cleanChute();
305 
309  virtual void createBottom();
310 
314  void printTime() const;
315 
316 private:
317 
355  unsigned int maxFailed_;
365 
366 };
367 
368 #endif
void setInflowVelocity(Mdouble inflowVelocity)
Sets the average inflow velocity.
Definition: Chute.cc:825
void setInflowHeight(Mdouble inflowHeight)
Sets maximum inflow height (Z-direction)
Definition: Chute.cc:799
RoughBottomType
enum for determining the type of rough bottom (if any) of the chute. Either of the enum options can b...
Definition: Chute.h:50
The DPMBase header includes quite a few header files, defining all the handlers, which are essential...
Definition: DPMBase.h:61
void setChuteAngleAndMagnitudeOfGravity(Mdouble chuteAngle, Mdouble gravity)
Sets gravity vector according to chute angle (in degrees)
Definition: Chute.cc:637
unsigned int maxFailed_
indicates how many attempts are made to insert a new particle into the insertion boundary before the ...
Definition: Chute.h:355
void setChuteWidth(Mdouble chuteWidth)
Sets the chute width (Y-direction)
Definition: Chute.cc:881
Mdouble minInflowParticleRadius_
minimal radius of inflowing particles
Definition: Chute.h:329
bool isChutePeriodic_
Determines whether the chute has periodic (TRUE) or solid (FALSE) walls in the Y-direction.
Definition: Chute.h:364
void setMaxFailed(unsigned int maxFailed)
Sets the number of times a particle will be tried to be added to the insertion boundary.
Definition: Chute.cc:671
Mdouble getInflowVelocityVariance() const
Returns the inflow velocity variance.
Definition: Chute.cc:871
double Mdouble
int getNCreated() const
void setMaxInflowParticleRadius(Mdouble maxInflowParticleRadius)
Sets the maximum radius of inflow particles.
Definition: Chute.cc:754
Mdouble getChuteLength() const
Returns the chute length (X-direction)
Definition: Chute.cc:911
void setChuteAngle(Mdouble chuteAngle)
Sets gravity vector according to chute angle (in degrees)
Definition: Chute.cc:616
Definition: Chute.h:52
Boundary structure for boundaries used for insertion of particles.
void setRoughBottomType(RoughBottomType roughBottomType)
Sets the type of rough bottom of the chute.
Definition: Chute.cc:567
Mdouble getChuteAngleDegrees() const
Returns the chute angle (in degrees)
Definition: Chute.cc:662
Mdouble getInflowVelocity() const
Returns the average inflow velocity.
Definition: Chute.cc:842
Mdouble getInflowParticleRadius() const
Returns the average radius of inflow particles.
Definition: Chute.cc:771
void write(std::ostream &os, bool writeAllParticles=true) const
This function writes the Chute properties to an ostream, and adds the properties of ALL chute particl...
Definition: Chute.cc:180
RoughBottomType getRoughBottomType() const
Returns the type of (rough) bottom of the chute.
Definition: Chute.cc:605
Creates chutes with different bottoms. Inherits from Mercury3D (-> MercuryBase -> DPMBase)...
Definition: Chute.h:62
This is the base class for both Mercury2D and Mercury3D. Note the actually abstract grid is defined i...
Definition: MercuryBase.h:74
Mdouble getMaxInflowParticleRadius() const
Returns the maximum radius of inflow particles.
Definition: Chute.cc:789
bool getIsPeriodic() const
Returns whether the chute is periodic in Y.
Definition: Chute.cc:531
Mdouble getChuteWidth() const
Returns the chute width (Y-direction)
Definition: Chute.cc:891
Mdouble getFixedParticleRadius() const
Returns the particle radius of the fixed particles which constitute the (rough) chute bottom...
Definition: Chute.cc:552
void actionsBeforeTimeStep()
Calls Chute::cleanChute().
Definition: Chute.cc:207
void setupSideWalls()
Creates chute side walls (either solid or periodic)
Definition: Chute.cc:254
This adds on the hierarchical grid code for 3D problems.
Definition: Mercury3D.h:35
RoughBottomType roughBottomType_
Determines the type of rough bottom created (if any). See also the enum RoughBottomType at the beginn...
Definition: Chute.h:350
bool readNextArgument(int &i, int argc, char *argv[])
This method can be used for reading object properties from a string.
Definition: Chute.cc:444
void setInsertionBoundary(InsertionBoundary *insertionBoundary)
Sets the chute insertion boundary.
Definition: Chute.cc:920
void setInflowParticleRadius(Mdouble inflowParticleRadius)
Sets the radius of the inflow particles to a single one (i.e. ensures a monodisperse inflow)...
Definition: Chute.cc:691
void setInflowVelocityVariance(Mdouble inflowVelocityVariance)
Sets the inflow velocity variance.
Definition: Chute.cc:852
void setupInitialConditions()
Creates bottom, side walls and a particle insertion boundary.
Definition: Chute.cc:228
void constructor()
This is the actual constructor METHOD; it is called by all constructors above (except the default cop...
Definition: Chute.cc:114
Mdouble getChuteAngle() const
Returns the chute angle (in radians)
Definition: Chute.cc:653
void setFixedParticleRadius(Mdouble fixedParticleRadius)
Sets the particle radius of the fixed particles which constitute the (rough) chute bottom...
Definition: Chute.cc:540
virtual void createBottom()
Creates the chute bottom, which can be either flat or one of three flavours of rough.
Definition: Chute.cc:288
void cleanChute()
Deletes all outflow particles once every 100 time steps.
Definition: Chute.cc:409
void setMinInflowParticleRadius(Mdouble minInflowParticleRadius)
sets the minimum radius of inflow particles
Definition: Chute.cc:737
Chute()
This is the default constructor. All it does is set sensible defaults.
Definition: Chute.cc:42
Mdouble getMinInflowParticleRadius() const
returns the minimum radius of inflow particles
Definition: Chute.cc:780
void increaseNCreated()
virtual void setChuteLength(Mdouble chuteLength)
Sets the chute length (X-direction)
Definition: Chute.cc:901
Mdouble inflowVelocity_
Average inflow velocity in x-direction.
Definition: Chute.h:337
void read(std::istream &is)
Reads all chute properties from an istream.
Definition: Chute.cc:133
Mdouble inflowHeight_
Height of inflow.
Definition: Chute.h:345
InsertionBoundary * insertionBoundary_
(Pointer to) the Chute's insertion boundary
Definition: Chute.h:359
Mdouble chuteAngle_
chute angle in degrees
Definition: Chute.h:321
void printTime() const
prints time, max time and number of particles
Definition: Chute.cc:216
Mdouble fixedParticleRadius_
radius of the fixed particles at the bottom
Definition: Chute.h:325
Mdouble inflowVelocityVariance_
Inflow velocity variance in x-direction (in ratio of inflowVelocity_)
Definition: Chute.h:341
void makeChutePeriodic()
This makes the chute periodic in Y.
Definition: Chute.cc:521
Mdouble getInflowHeight() const
Returns the maximum inflow height (Z-direction)
Definition: Chute.cc:816
unsigned int getMaxFailed() const
Returns the number of times a particle will be tried to be added to the insertion boundary...
Definition: Chute.cc:680
Mdouble maxInflowParticleRadius_
maximal radius of inflowing particles
Definition: Chute.h:333