Chute.h
Go to the documentation of this file.
1 //Copyright (c) 2013-2023, 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 
29 #include "Mercury3D.h"
30 
31 class InsertionBoundary;
32 
33 
52 {
54 };
55 
64 class Chute : public Mercury3D
65 {
66 public:
70  Chute();
71 
75  explicit Chute(const DPMBase& other);
76 
80  explicit Chute(const MercuryBase& other);
81 
85  explicit Chute(const Mercury3D& other);
86 
90  Chute(const Chute& other);
91 
96  void constructor();
97 
101  bool readNextArgument(int& i, int argc, char* argv[]) override;
102 
106  void setupSideWalls();
107 
111  void makeChutePeriodic();
112 
116  bool getIsPeriodic() const;
117 
121  void setupInitialConditions() override;
122 
126  void read(std::istream& is, ReadOptions opt = ReadOptions::ReadAll) override;
127 
132  void write(std::ostream& os, bool writeAllParticles = true) const override;
133 
134 //setters and getters
135 
140  void setFixedParticleRadius(Mdouble fixedParticleRadius);
141 
147 
152  void setFixedParticleSpacing(Mdouble fixedParticleSpacing);
153 
159 
163  void setRoughBottomType(RoughBottomType roughBottomType);
164 
169  void setRoughBottomType(std::string roughBottomTypeString);
170 
175 
179  void setChuteAngle(Mdouble chuteAngle);
180 
184  void setChuteAngleAndMagnitudeOfGravity(Mdouble chuteAngle, Mdouble gravity);
185 
186  //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;}
187 
191  Mdouble getChuteAngle() const;
192 
197 
201  void setMaxFailed(unsigned int maxFailed);
202 
206  unsigned int getMaxFailed() const;
207 
212  void setInflowParticleRadius(Mdouble inflowParticleRadius);
213 
217  void setInflowParticleRadius(Mdouble minInflowParticleRadius, Mdouble maxInflowParticleRadius);
218 
222  void setMinInflowParticleRadius(Mdouble minInflowParticleRadius);
223 
227  void setMaxInflowParticleRadius(Mdouble maxInflowParticleRadius);
228 
233 
238 
243 
247  void setInflowHeight(Mdouble inflowHeight);
248 
252  Mdouble getInflowHeight() const;
253 
257  void setInflowVelocity(Mdouble inflowVelocity);
258 
262  Mdouble getInflowVelocity() const;
263 
267  void setInflowVelocityVariance(Mdouble inflowVelocityVariance);
268 
273 
277  void setChuteWidth(Mdouble chuteWidth);
278 
282  Mdouble getChuteWidth() const;
283 
287  virtual void setChuteLength(Mdouble chuteLength);
288 
292  Mdouble getChuteLength() const;
293 
297  void setInsertionBoundary(InsertionBoundary* insertionBoundary);
298 
299 protected:
303  void actionsBeforeTimeStep() override;
304 
308  void cleanChute();
309 
313  virtual void createBottom();
314 
316  virtual void addFlowParticlesCompactly();
317 
319 
323  void printTime() const override;
324 
325 private:
326 
368  unsigned int maxFailed_;
378 
379 };
380 
381 #endif
RoughBottomType
enum for determining the type of rough bottom (if any) of the chute. Either of the enum options can b...
Definition: Chute.h:52
@ FLAT
Definition: Chute.h:53
@ MONOLAYER_TRIANGULAR
Definition: Chute.h:53
@ MONOLAYER_DISORDERED
Definition: Chute.h:53
@ MONOLAYER_ORDERED
Definition: Chute.h:53
@ MULTILAYER
Definition: Chute.h:53
Creates chutes with different bottoms. Inherits from Mercury3D (-> MercuryBase -> DPMBase).
Definition: Chute.h:65
Mdouble fixedParticleSpacing_
spacing of the fixed particles at the bottom (center distance / diameter - 1)
Definition: Chute.h:338
void setChuteWidth(Mdouble chuteWidth)
Sets the chute width (Y-direction)
Definition: Chute.cc:1039
void read(std::istream &is, ReadOptions opt=ReadOptions::ReadAll) override
Reads all chute properties from an istream.
Definition: Chute.cc:139
void actionsBeforeTimeStep() override
Calls Chute::cleanChute().
Definition: Chute.cc:225
void setInflowParticleRadius(Mdouble inflowParticleRadius)
Sets the radius of the inflow particles to a single one (i.e. ensures a monodisperse inflow).
Definition: Chute.cc:848
void setRoughBottomType(RoughBottomType roughBottomType)
Sets the type of rough bottom of the chute.
Definition: Chute.cc:714
Chute()
This is the default constructor. All it does is set sensible defaults.
Definition: Chute.cc:42
virtual void setChuteLength(Mdouble chuteLength)
Sets the chute length (X-direction)
Definition: Chute.cc:1059
void setupInitialConditions() override
Creates bottom, side walls and a particle insertion boundary.
Definition: Chute.cc:242
void setInflowVelocityVariance(Mdouble inflowVelocityVariance)
Sets the inflow velocity variance.
Definition: Chute.cc:1010
Mdouble fixedParticleRadius_
radius of the fixed particles at the bottom
Definition: Chute.h:334
void printTime() const override
prints time, max time and number of particles
Definition: Chute.cc:234
Mdouble getFixedParticleRadius() const
Returns the particle radius of the fixed particles which constitute the (rough) chute bottom.
Definition: Chute.cc:671
Mdouble getMaxInflowParticleRadius() const
Returns the maximum radius of inflow particles.
Definition: Chute.cc:947
Mdouble inflowVelocityVariance_
Inflow velocity variance in x-direction (in ratio of inflowVelocity_)
Definition: Chute.h:354
Mdouble getInflowHeight() const
Returns the maximum inflow height (Z-direction)
Definition: Chute.cc:974
void setInsertionBoundary(InsertionBoundary *insertionBoundary)
Sets the chute insertion boundary.
Definition: Chute.cc:1078
Mdouble chuteAngle_
chute angle in degrees
Definition: Chute.h:330
Mdouble getFixedParticleSpacing() const
Returns the particle radius of the fixed particles which constitute the (rough) chute bottom; used in...
Definition: Chute.cc:699
virtual void createBottom()
Creates the chute bottom, which can be either flat or one of three flavours of rough.
Definition: Chute.cc:323
void setMaxInflowParticleRadius(Mdouble maxInflowParticleRadius)
Sets the maximum radius of inflow particles.
Definition: Chute.cc:912
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:827
Mdouble inflowVelocity_
Average inflow velocity in x-direction.
Definition: Chute.h:350
bool readNextArgument(int &i, int argc, char *argv[]) override
This method can be used for reading object properties from a string.
Definition: Chute.cc:555
void setChuteAngleAndMagnitudeOfGravity(Mdouble chuteAngle, Mdouble gravity)
Sets gravity vector according to chute angle (in degrees)
Definition: Chute.cc:789
void setMinInflowParticleRadius(Mdouble minInflowParticleRadius)
sets the minimum radius of inflow particles
Definition: Chute.cc:895
bool isChutePeriodic_
Determines whether the chute has periodic (TRUE) or solid (FALSE) walls in the Y-direction.
Definition: Chute.h:377
Mdouble getChuteLength() const
Returns the chute length (X-direction)
Definition: Chute.cc:1069
virtual SphericalParticle createFlowParticle()
Definition: Chute.cc:1105
void setInflowVelocity(Mdouble inflowVelocity)
Sets the average inflow velocity.
Definition: Chute.cc:983
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:206
unsigned int getMaxFailed() const
Returns the number of times a particle will be tried to be added to the insertion boundary.
Definition: Chute.cc:837
Mdouble getMinInflowParticleRadius() const
returns the minimum radius of inflow particles
Definition: Chute.cc:938
Mdouble getInflowParticleRadius() const
Returns the average radius of inflow particles.
Definition: Chute.cc:929
RoughBottomType getRoughBottomType() const
Returns the type of (rough) bottom of the chute.
Definition: Chute.cc:754
Mdouble minInflowParticleRadius_
minimal radius of inflowing particles
Definition: Chute.h:342
bool getIsPeriodic() const
Returns whether the chute is periodic in Y.
Definition: Chute.cc:642
Mdouble maxInflowParticleRadius_
maximal radius of inflowing particles
Definition: Chute.h:346
RoughBottomType roughBottomType_
Determines the type of rough bottom created (if any). See also the enum RoughBottomType at the beginn...
Definition: Chute.h:363
Mdouble getChuteWidth() const
Returns the chute width (Y-direction)
Definition: Chute.cc:1049
void setFixedParticleSpacing(Mdouble fixedParticleSpacing)
Sets the spacing of the fixed particles which constitute the (rough) chute bottom; used in triangular...
Definition: Chute.cc:682
void constructor()
This is the actual constructor METHOD; it is called by all constructors above (except the default cop...
Definition: Chute.cc:118
Mdouble getInflowVelocity() const
Returns the average inflow velocity.
Definition: Chute.cc:1000
virtual void addFlowParticlesCompactly()
Add initial flow particles in a dense packing.
Definition: Chute.cc:1083
void setChuteAngle(Mdouble chuteAngle)
Sets gravity vector according to chute angle (in degrees)
Definition: Chute.cc:768
Mdouble getInflowVelocityVariance() const
Returns the inflow velocity variance.
Definition: Chute.cc:1029
void setInflowHeight(Mdouble inflowHeight)
Sets maximum inflow height (Z-direction)
Definition: Chute.cc:957
unsigned int maxFailed_
indicates how many attempts are made to insert a new particle into the insertion boundary before the ...
Definition: Chute.h:368
void setupSideWalls()
Creates chute side walls (either solid or periodic)
Definition: Chute.cc:288
Mdouble getChuteAngle() const
Returns the chute angle (in radians)
Definition: Chute.cc:807
InsertionBoundary * insertionBoundary_
(Pointer to) the Chute's insertion boundary
Definition: Chute.h:372
Mdouble inflowHeight_
Height of inflow.
Definition: Chute.h:358
void cleanChute()
Deletes all outflow particles once every 100 time steps.
Definition: Chute.cc:509
void makeChutePeriodic()
This makes the chute periodic in Y.
Definition: Chute.cc:632
void setFixedParticleRadius(Mdouble fixedParticleRadius)
Sets the particle radius of the fixed particles which constitute the (rough) chute bottom.
Definition: Chute.cc:653
Mdouble getChuteAngleDegrees() const
Returns the chute angle (in degrees)
Definition: Chute.cc:816
The DPMBase header includes quite a few header files, defining all the handlers, which are essential....
Definition: DPMBase.h:77
ReadOptions
Definition: DPMBase.h:254
Boundary structure for boundaries used for insertion of particles.
Definition: InsertionBoundary.h:50
This adds on the hierarchical grid code for 3D problems.
Definition: Mercury3D.h:37
This is the base class for both Mercury2D and Mercury3D. Note the actually abstract grid is defined i...
Definition: MercuryBase.h:126
A spherical particle is the most simple particle used in MercuryDPM.
Definition: SphericalParticle.h:37
const std::complex< Mdouble > i
Definition: ExtendedMath.h:51