MercuryDPM  Trunk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ChuteWithHopper.h
Go to the documentation of this file.
1 //Copyright (c) 2013-2020, 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 CHUTEWITHHOPPER_H
27 #define CHUTEWITHHOPPER_H
28 
29 #include "Chute.h"
30 
38 class ChuteWithHopper : public Chute
39 {
40 public:
41 
42 //Constructors:
47  explicit ChuteWithHopper(const Chute& other);
48 
52  explicit ChuteWithHopper(const Mercury3D& other);
53 
57  explicit ChuteWithHopper(const MercuryBase& other);
58 
62  explicit ChuteWithHopper(const DPMBase& other);
63 
68 
69 //Setters and getters:
70 
74  void setHopperFillingPercentage(Mdouble hopperFillingPercentage);
75 
80  void setHopperLowestPoint(Mdouble hopperLowestPoint);
81 
87 
92  Mdouble getChuteLength() const;
93 
97  void setChuteLength(Mdouble chuteLength) override;
98 
102  void setIsHopperCentred(bool isHopperCentred);
103 
107  void setHopperLowerFillingHeight(Mdouble hopperLowerFillingHeight);
108 
112  void setHopperShift(Mdouble hopperShift);
113 
117  void setHopperLift(Mdouble hopperLift);
118 
122  Mdouble getHopperLift() const;
123 
127  Mdouble getHopperShift() const;
128 
133  void setHopperDimension(unsigned int hopperDimension);
134 
138  void setIsHopperAlignedWithBottom(bool isHopperAlignedWithBottom);
139 
143  Mdouble getHopperAngle() const;
144 
148  Mdouble getHopperLength() const;
149 
154 
158  Mdouble getHopperHeight() const;
159 
164 
168  bool getIsHopperCentred() const;
169 
175 
179  unsigned int getHopperDimension() const;
180 
181 //Other member functions:
182 
186  void setupInitialConditions() override;
187 
191  void setHopper(Mdouble exitLength, Mdouble exitHeight, Mdouble angle, Mdouble length, Mdouble height);
192 
197 
201  Mdouble getTimeStepRatio() const;
202 
206  void read(std::istream& is, ReadOptions opt = ReadOptions::ReadAll) override;
207 
211  void write(std::ostream& os, bool writeAllParticles = true) const override;
212 
216  bool readNextArgument(int& i, int argc, char* argv[]) override;
217 
218 protected:
222  void addHopper();
223 
224 private:
225 
229  void constructor();
230 
231 //protected:
264 
272  unsigned int hopperDimension_;
285 };
286 
287 #endif
Mdouble getChuteLength() const
Allows chute length to be accessed.
void setHopperLowerFillingHeight(Mdouble hopperLowerFillingHeight)
Sets the height above which the hopper is filled with new particles.
unsigned int getHopperDimension() const
Returns whether the hopper has vertical (1) or inclined (2) walls in Y-direction. ...
Mdouble getHopperHeight() const
Returns the height of the hopper relative to the chute start.
Mdouble getHopperExitLength() const
Returns the width of the hopper exit.
The DPMBase header includes quite a few header files, defining all the handlers, which are essential...
Definition: DPMBase.h:72
void setHopperFillingPercentage(Mdouble hopperFillingPercentage)
Sets the hopper filling percentage.
void addHopper()
This creates the hopper on top of the chute, see diagram in class description for details of the poin...
Mdouble hopperExitHeight_
Dimension of the hopper exit in vertical direction.
Mdouble getHopperLift() const
Returns the hopper's lift above the chute bottom plane.
double Mdouble
Definition: GeneralDefine.h:34
void write(std::ostream &os, bool writeAllParticles=true) const override
Writes setup properties to an ostream.
const std::complex< Mdouble > i
Definition: ExtendedMath.h:50
Mdouble hopperLowestPoint_
The NEGATIVE z coordinate of the right C point (when the left C point is in the origin) ...
bool getIsHopperCentred() const
Returns whether the setup is shifted another 40 units in X-direction.
void setHopperLowestPoint(Mdouble hopperLowestPoint)
Sets the vertical distance of the lowest hopper point relative to the start of the chute...
Mdouble hopperLowerFillingHeight_
Relative height (in [0,1)) above which the hopper is replenished with new particles.
void setChuteLength(Mdouble chuteLength) override
sets xMax to chuteLength+hopperlength_, and thus specifies the length off the runoff chute ...
void setHopperShift(Mdouble hopperShift)
Sets the shift in X-direction of the whole setup after rotation.
void setHopperLift(Mdouble hopperLift)
This lifts the hopper above the plane of the chute (after rotation)
bool isHopperCentred_
If this flag is set, the hopper will be constructed in the xy-center of the domain, and not next to the xmin-domain boundary; by default off.
Mdouble getHopperLength() const
Returns the width of the hopper entrance.
Mdouble getHopperLowestPoint() const
Returns the vertical distance of the lowest hopper point relative to the start of the chute...
Creates chutes with different bottoms. Inherits from Mercury3D (-> MercuryBase -> DPMBase)...
Definition: Chute.h:64
This is the base class for both Mercury2D and Mercury3D. Note the actually abstract grid is defined i...
Definition: MercuryBase.h:125
void setHopperDimension(unsigned int hopperDimension)
Sets whether the hopper should have vertical (1) or inclined (2) walls in Y-direction.
Mdouble hopperShift_
The x position where the Chute starts (defined as the beginning of the hopper)
Mdouble getTimeStepRatio() const
Returns smallest particle radius over maximum gravitational velocity.
unsigned int hopperDimension_
This is the dimension of the hopper, my default it is one dimensional and hence does not have side wa...
Mdouble hopperLength_
Dimension of the hopper in vertical direction.
bool readNextArgument(int &i, int argc, char *argv[]) override
Reads setup properties from a string.
This adds on the hierarchical grid code for 3D problems.
Definition: Mercury3D.h:36
Mdouble getHopperExitHeight() const
Returns the height of the lowest hopper point above the chute.
ChuteWithHopper()
This is the default constructor.
Mdouble getHopperAngle() const
Returns the angle of the hopper entrance relative to the vertical.
ChuteWithHopper has a hopper as inflow.
void read(std::istream &is, ReadOptions opt=ReadOptions::ReadAll) override
Reads setup properties from an istream.
Mdouble getHopperShift() const
Returns the shift in X-direction of the whole setup after rotation.
bool isHopperAlignedWithBottom_
This is the flag, which sets if the chute bottom is aligned with the hopper, by default it is...
Mdouble hopperHeight_
Dimension of the hopper in horizontal direction.
Mdouble getHopperFillingPercentage() const
Returns the vertical percentage of the hopper insertion boundary which is filled. ...
Mdouble hopperAngle_
Angle between the two pieces of the hopper walls.
Mdouble hopperFillingPercentage_
This is which percentage of the hopper is used for creating new partices;.
void setIsHopperCentred(bool isHopperCentred)
Sets an extra shift in X-direction of the whole system.
void setHopper(Mdouble exitLength, Mdouble exitHeight, Mdouble angle, Mdouble length, Mdouble height)
Sets the hopper's geometrical properties.
Mdouble hopperLift_
This is the vertical distance the chute is lifted above the plane.
void constructor()
This is the actually constructor, get called by all constructors above.
void setupInitialConditions() override
Sets up the initial conditions for the problem.
void setIsHopperAlignedWithBottom(bool isHopperAlignedWithBottom)
Sets the alignment of hopper with chute bottom.
Mdouble getMaximumVelocityInducedByGravity() const
Returns the theoretical maximum particle velocity due to gravity.
Mdouble hopperExitLength_
Dimension of the hopper exit in vertical direction.
ReadOptions
Definition: DPMBase.h:240