Chute.h
Go to the documentation of this file.
1 // This file is part of the MercuryDPM project (https://www.mercurydpm.org).
2 // Copyright (c), The MercuryDPM Developers Team. All rights reserved.
3 // License: BSD 3-Clause License; see the LICENSE file in the root directory.
4 
5 #ifndef CHUTE_H
6 #define CHUTE_H
7 
8 #include "Mercury3D.h"
9 
10 class InsertionBoundary;
11 
12 
31 {
33 };
34 
43 class Chute : public Mercury3D
44 {
45 public:
49  Chute();
50 
54  explicit Chute(const DPMBase& other);
55 
59  explicit Chute(const MercuryBase& other);
60 
64  explicit Chute(const Mercury3D& other);
65 
69  Chute(const Chute& other);
70 
75  void constructor();
76 
80  bool readNextArgument(int& i, int argc, char* argv[]) override;
81 
85  void setupSideWalls();
86 
90  void makeChutePeriodic();
91 
95  bool getIsPeriodic() const;
96 
100  void setupInitialConditions() override;
101 
105  void read(std::istream& is, ReadOptions opt = ReadOptions::ReadAll) override;
106 
111  void write(std::ostream& os, bool writeAllParticles = true) const override;
112 
113 //setters and getters
114 
119  void setFixedParticleRadius(Mdouble fixedParticleRadius);
120 
126 
131  void setFixedParticleSpacing(Mdouble fixedParticleSpacing);
132 
138 
142  void setRoughBottomType(RoughBottomType roughBottomType);
143 
148  void setRoughBottomType(std::string roughBottomTypeString);
149 
154 
158  void setChuteAngle(Mdouble chuteAngle);
159 
164 
165  //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;}
166 
170  Mdouble getChuteAngle() const;
171 
176 
180  void setMaxFailed(unsigned int maxFailed);
181 
185  unsigned int getMaxFailed() const;
186 
191  void setInflowParticleRadius(Mdouble inflowParticleRadius);
192 
196  void setInflowParticleRadius(Mdouble minInflowParticleRadius, Mdouble maxInflowParticleRadius);
197 
201  void setMinInflowParticleRadius(Mdouble minInflowParticleRadius);
202 
206  void setMaxInflowParticleRadius(Mdouble maxInflowParticleRadius);
207 
212 
217 
222 
226  void setInflowHeight(Mdouble inflowHeight);
227 
231  Mdouble getInflowHeight() const;
232 
236  void setInflowVelocity(Mdouble inflowVelocity);
237 
241  Mdouble getInflowVelocity() const;
242 
246  void setInflowVelocityVariance(Mdouble inflowVelocityVariance);
247 
252 
256  void setChuteWidth(Mdouble chuteWidth);
257 
261  Mdouble getChuteWidth() const;
262 
266  virtual void setChuteLength(Mdouble chuteLength);
267 
271  Mdouble getChuteLength() const;
272 
276  void setInsertionBoundary(InsertionBoundary* insertionBoundary);
277 
278 protected:
282  void actionsBeforeTimeStep() override;
283 
287  void cleanChute();
288 
292  virtual void createBottom();
293 
295  virtual void addFlowParticlesCompactly();
296 
298 
302  void printTime() const override;
303 
304 private:
305 
347  unsigned int maxFailed_;
357 
358 };
359 
360 #endif
int i
Definition: BiCGSTAB_step_by_step.cpp:9
RoughBottomType
enum for determining the type of rough bottom (if any) of the chute. Either of the enum options can b...
Definition: Chute.h:31
@ FLAT
Definition: Chute.h:32
@ MONOLAYER_TRIANGULAR
Definition: Chute.h:32
@ MONOLAYER_DISORDERED
Definition: Chute.h:32
@ MONOLAYER_ORDERED
Definition: Chute.h:32
@ MULTILAYER
Definition: Chute.h:32
Creates chutes with different bottoms. Inherits from Mercury3D (-> MercuryBase -> DPMBase).
Definition: Chute.h:44
Mdouble fixedParticleSpacing_
spacing of the fixed particles at the bottom (center distance / diameter - 1)
Definition: Chute.h:317
void setChuteWidth(Mdouble chuteWidth)
Sets the chute width (Y-direction)
Definition: Chute.cc:1018
void read(std::istream &is, ReadOptions opt=ReadOptions::ReadAll) override
Reads all chute properties from an istream.
Definition: Chute.cc:118
void actionsBeforeTimeStep() override
Calls Chute::cleanChute().
Definition: Chute.cc:204
void setInflowParticleRadius(Mdouble inflowParticleRadius)
Sets the radius of the inflow particles to a single one (i.e. ensures a monodisperse inflow).
Definition: Chute.cc:827
void setRoughBottomType(RoughBottomType roughBottomType)
Sets the type of rough bottom of the chute.
Definition: Chute.cc:693
Chute()
This is the default constructor. All it does is set sensible defaults.
Definition: Chute.cc:21
virtual void setChuteLength(Mdouble chuteLength)
Sets the chute length (X-direction)
Definition: Chute.cc:1038
void setupInitialConditions() override
Creates bottom, side walls and a particle insertion boundary.
Definition: Chute.cc:221
void setInflowVelocityVariance(Mdouble inflowVelocityVariance)
Sets the inflow velocity variance.
Definition: Chute.cc:989
Mdouble fixedParticleRadius_
radius of the fixed particles at the bottom
Definition: Chute.h:313
void printTime() const override
prints time, max time and number of particles
Definition: Chute.cc:213
Mdouble getFixedParticleRadius() const
Returns the particle radius of the fixed particles which constitute the (rough) chute bottom.
Definition: Chute.cc:650
Mdouble getMaxInflowParticleRadius() const
Returns the maximum radius of inflow particles.
Definition: Chute.cc:926
Mdouble inflowVelocityVariance_
Inflow velocity variance in x-direction (in ratio of inflowVelocity_)
Definition: Chute.h:333
Mdouble getInflowHeight() const
Returns the maximum inflow height (Z-direction)
Definition: Chute.cc:953
void setInsertionBoundary(InsertionBoundary *insertionBoundary)
Sets the chute insertion boundary.
Definition: Chute.cc:1057
Mdouble chuteAngle_
chute angle in degrees
Definition: Chute.h:309
Mdouble getFixedParticleSpacing() const
Returns the particle radius of the fixed particles which constitute the (rough) chute bottom; used in...
Definition: Chute.cc:678
virtual void createBottom()
Creates the chute bottom, which can be either flat or one of three flavours of rough.
Definition: Chute.cc:302
void setMaxInflowParticleRadius(Mdouble maxInflowParticleRadius)
Sets the maximum radius of inflow particles.
Definition: Chute.cc:891
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:806
Mdouble inflowVelocity_
Average inflow velocity in x-direction.
Definition: Chute.h:329
bool readNextArgument(int &i, int argc, char *argv[]) override
This method can be used for reading object properties from a string.
Definition: Chute.cc:534
void setChuteAngleAndMagnitudeOfGravity(Mdouble chuteAngle, Mdouble gravity)
Sets gravity vector according to chute angle (in degrees)
Definition: Chute.cc:768
void setMinInflowParticleRadius(Mdouble minInflowParticleRadius)
sets the minimum radius of inflow particles
Definition: Chute.cc:874
bool isChutePeriodic_
Determines whether the chute has periodic (TRUE) or solid (FALSE) walls in the Y-direction.
Definition: Chute.h:356
Mdouble getChuteLength() const
Returns the chute length (X-direction)
Definition: Chute.cc:1048
virtual SphericalParticle createFlowParticle()
Definition: Chute.cc:1084
void setInflowVelocity(Mdouble inflowVelocity)
Sets the average inflow velocity.
Definition: Chute.cc:962
void write(std::ostream &os, bool writeAllParticles=true) const override
This function writes the Chute properties to an ostream, and adds the properties of ALL chute particl...
Definition: Chute.cc:185
unsigned int getMaxFailed() const
Returns the number of times a particle will be tried to be added to the insertion boundary.
Definition: Chute.cc:816
Mdouble getMinInflowParticleRadius() const
returns the minimum radius of inflow particles
Definition: Chute.cc:917
Mdouble getInflowParticleRadius() const
Returns the average radius of inflow particles.
Definition: Chute.cc:908
RoughBottomType getRoughBottomType() const
Returns the type of (rough) bottom of the chute.
Definition: Chute.cc:733
Mdouble minInflowParticleRadius_
minimal radius of inflowing particles
Definition: Chute.h:321
bool getIsPeriodic() const
Returns whether the chute is periodic in Y.
Definition: Chute.cc:621
Mdouble maxInflowParticleRadius_
maximal radius of inflowing particles
Definition: Chute.h:325
RoughBottomType roughBottomType_
Determines the type of rough bottom created (if any). See also the enum RoughBottomType at the beginn...
Definition: Chute.h:342
Mdouble getChuteWidth() const
Returns the chute width (Y-direction)
Definition: Chute.cc:1028
void setFixedParticleSpacing(Mdouble fixedParticleSpacing)
Sets the spacing of the fixed particles which constitute the (rough) chute bottom; used in triangular...
Definition: Chute.cc:661
void constructor()
This is the actual constructor METHOD; it is called by all constructors above (except the default cop...
Definition: Chute.cc:97
Mdouble getInflowVelocity() const
Returns the average inflow velocity.
Definition: Chute.cc:979
virtual void addFlowParticlesCompactly()
Add initial flow particles in a dense packing.
Definition: Chute.cc:1062
void setChuteAngle(Mdouble chuteAngle)
Sets gravity vector according to chute angle (in degrees)
Definition: Chute.cc:747
Mdouble getInflowVelocityVariance() const
Returns the inflow velocity variance.
Definition: Chute.cc:1008
void setInflowHeight(Mdouble inflowHeight)
Sets maximum inflow height (Z-direction)
Definition: Chute.cc:936
unsigned int maxFailed_
indicates how many attempts are made to insert a new particle into the insertion boundary before the ...
Definition: Chute.h:347
void setupSideWalls()
Creates chute side walls (either solid or periodic)
Definition: Chute.cc:267
Mdouble getChuteAngle() const
Returns the chute angle (in radians)
Definition: Chute.cc:786
InsertionBoundary * insertionBoundary_
(Pointer to) the Chute's insertion boundary
Definition: Chute.h:351
Mdouble inflowHeight_
Height of inflow.
Definition: Chute.h:337
void cleanChute()
Deletes all outflow particles once every 100 time steps.
Definition: Chute.cc:488
void makeChutePeriodic()
This makes the chute periodic in Y.
Definition: Chute.cc:611
void setFixedParticleRadius(Mdouble fixedParticleRadius)
Sets the particle radius of the fixed particles which constitute the (rough) chute bottom.
Definition: Chute.cc:632
Mdouble getChuteAngleDegrees() const
Returns the chute angle (in degrees)
Definition: Chute.cc:795
The DPMBase header includes quite a few header files, defining all the handlers, which are essential....
Definition: DPMBase.h:56
ReadOptions
Definition: DPMBase.h:233
Boundary structure for boundaries used for insertion of particles.
Definition: InsertionBoundary.h:29
This adds on the hierarchical grid code for 3D problems.
Definition: Mercury3D.h:16
This is the base class for both Mercury2D and Mercury3D. Note the actually abstract grid is defined i...
Definition: MercuryBase.h:105
A spherical particle is the most simple particle used in MercuryDPM.
Definition: SphericalParticle.h:16
Definition: MortaringCantileverCompareToNonMortaring.cpp:176
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286