173 Vec3D A, B, C, temp, normal;
193 B =
Vec3D(0.0, 0.0, HopperCornerHeight);
194 C =
Vec3D(0.0, 0.0, 0.0);
197 A =
Vec3D(c * A.
X - s * A.
Z, 0.0, s * A.
X + c * A.
Z);
198 B =
Vec3D(c * B.
X - s * B.
Z, 0.0, s * B.
X + c * B.
Z);
199 C =
Vec3D(c * C.
X - s * C.
Z, 0.0, s * C.
X + c * C.
Z);
275 A =
Vec3D(c * A.X - s * A.Z, A.Y, s * A.X + c * A.Z);
276 B =
Vec3D(c * B.X - s * B.Z, B.Y, s * B.X + c * B.Z);
277 C =
Vec3D(c * C.X - s * C.Z, C.Y, s * C.X + c * C.Z);
310 A =
Vec3D(c * A.X - s * A.Z, A.Y, s * A.X + c * A.Z);
311 B =
Vec3D(c * B.X - s * B.Z, B.Y, s * B.X + c * B.Z);
312 C =
Vec3D(c * C.X - s * C.Z, C.Y, s * C.X + c * C.Z);
377 Mdouble HopperCornerHeight = Height - 0.5 * (Length - ExitLength) / std::tan(Angle *
constants::pi / 180.0);
379 if (ExitLength >= 0.0)
385 logger(
ERROR,
"[ChuteWithHopper::setHopper()] Hopper exit length must be greater than or equal to zero");
390 if (ExitHeight < 0.0)
392 logger(
ERROR,
"[ChuteWithHopper::setHopper()] Hopper exit height must be greater than or equal to zero");
395 else if(ExitHeight > HopperCornerHeight + std::tan(
getChuteAngle())*ExitLength )
397 logger(
ERROR,
"[ChuteWithHopper::setHopper()] Hopper exit height (%) may not exceed height of hopper corner above chute bottom (%)", ExitHeight, HopperCornerHeight + std::tan(
getChuteAngle())*ExitLength );
407 if (Angle > 0.0 && Angle < 90.0)
413 logger(
ERROR,
"[ChuteWithHopper::setHopper()] Hopper angle must in (0,90)");
417 if (Length > ExitLength)
423 logger(
ERROR,
"[ChuteWithHopper::setHopper()] Hopper length must be greater than exit length");
429 if (HopperCornerHeight <= 0.0)
433 logger(
ERROR,
"[ChuteWithHopper::setHopper()] height of hopper corner (%) may not be below 0. Increase hopper height to fix.", HopperCornerHeight);
438 logger(
VERBOSE,
"[ChuteWithHopper::setHopper()] Setting the following hopper geometrical properties:");
449 if ((Height - HeightCompare) > -1e-6 * HeightCompare)
455 logger(
ERROR,
"[ChuteWithHopper::setHopper()] For these settings, hopper height must be greater then or equal to %, see drawing", HeightCompare);
461 logger(
VERBOSE,
"[ChuteWithHopper::setHopper()] Hopper geometry: ");
480 return sqrt(2.0 *
getGravity().getLength() * height);
496 logger(
WARN,
"[ChuteWithHopper::getTimeStepRatio()] ratio of minimum particle radius over max distance travelled per time step due to gravity is only %; consider reducing the time step size!",rmin/dx);
518 if (chuteLength >= 0.0)
524 logger(
WARN,
"[ChuteWithHopper::setChuteLength()] Chute length unchanged, value must be greater than or equal to zero");
553 if (hopperShift >= 0.0)
560 logger(
WARN,
"[ChuteWithHopper::setHopperShift()] Shift length unchanged, value must be greater than or equal to zero");
714 if (!strcmp(argv[i],
"-hopperLength"))
718 else if (!strcmp(argv[i],
"-hopperHeight"))
722 else if (!strcmp(argv[i],
"-hopperAngle"))
726 else if (!strcmp(argv[i],
"-hopperExitLength"))
730 else if (!strcmp(argv[i],
"-hopperExitHeight"))
734 else if (!strcmp(argv[i],
"-hopperLowerFillingHeight_"))
738 else if (!strcmp(argv[i],
"-isHopperCentred"))
742 else if (!strcmp(argv[i],
"-alignBase"))
746 else if (!strcmp(argv[i],
"-shift"))
750 else if (!strcmp(argv[i],
"-lift"))
void setHopperLowerFillingHeight(Mdouble hopperLowerFillingHeight)
Sets the height above which the hopper is filled with new particles.
static Mdouble getLengthSquared(const Vec3D &a)
Calculates the squared length of a Vec3D: .
void setXMax(Mdouble newXMax)
If the length of the problem domain in x-direction is XMax - XMin, this method sets XMax...
The DPMBase header includes quite a few header files, defining all the handlers, which are essential...
Mdouble X
the vector components
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 getHopperLength()
Returns the width of the hopper entrance.
A IntersectionOfWalls is convex polygon defined as an intersection of InfiniteWall's.
Mdouble hopperExitHeight_
Dimension of the hopper exit in vertical direction.
Mdouble getChuteLength()
Allows chute length to be accessed.
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
Mdouble getHopperShift()
Returns the shift in X-direction of the whole setup after rotation.
void setHopper(Mdouble ExitLength, Mdouble ExitHeight, Mdouble Angle, Mdouble Length, Mdouble Height)
Sets the hopper's geometrical properties.
Mdouble getYMin() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMin() returns YMin...
const std::vector< T * >::const_iterator end() const
Gets the end of the const_iterator over all BaseBoundary in this BaseHandler.
Mdouble hopperLowestPoint_
The NEGATIVE z coordinate of the right C point (when the left C point is in the origin) ...
void setHopperLowestPoint(Mdouble hopperLowestPoint)
Sets the vertical distance of the lowest hopper point relative to the start of the chute...
void setZMax(Mdouble newZMax)
If the length of the problem domain in z-direction is XMax - XMin, this method sets ZMax...
Mdouble hopperLowerFillingHeight_
Relative height (in [0,1)) above which the hopper is replenished with new particles.
void setSpecies(const ParticleSpecies *species)
Mdouble getHopperLowestPoint()
Returns the vertical distance of the lowest hopper point relative to the start of the chute...
bool getIsHopperCentred()
Returns whether the setup is shifted another 40 units in X-direction.
Mdouble getHopperAngle()
Returns the angle of the hopper entrance relative to the vertical.
void addObject(Vec3D normal, Vec3D point)
Adds a wall to the set of infinite walls, given an outward normal vector s.t. normal*x=normal*point.
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.
const std::vector< T * >::const_iterator begin() const
Gets the begin of the const_iterator over all Object in this BaseHandler.
Mdouble getXMax() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMax() returns XMax...
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...
Creates chutes with different bottoms. Inherits from Mercury3D (-> MercuryBase -> DPMBase)...
This is the base class for both Mercury2D and Mercury3D. Note the actually abstract grid is defined i...
Mdouble getMaxInflowParticleRadius() const
Returns the maximum radius of inflow particles.
Mdouble hopperShift_
The x position where the Chute starts (defined as the beginning of the hopper)
U * copyAndAddObject(const U &O)
Creates a copy of a Object and adds it to the BaseHandler.
BoundaryHandler boundaryHandler
An object of the class BoundaryHandler which concerns insertion and deletion of particles into or fro...
unsigned int getHopperDimension()
Returns whether the hopper has vertical (1) or inclined (2) walls in Y-direction. ...
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.
Mdouble getFixedParticleRadius() const
Returns the particle radius of the fixed particles which constitute the (rough) chute bottom...
void setupSideWalls()
Creates chute side walls (either solid or periodic)
This adds on the hierarchical grid code for 3D problems.
void setXMin(Mdouble newXMin)
If the length of the problem domain in x-direction is XMax - XMin, this method sets XMin...
Mdouble getHopperFillingPercentage()
Returns the vertical percentage of the hopper insertion boundary which is filled. ...
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created...
T * getObject(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
Mdouble getHopperHeight()
Returns the height of the hopper relative to the chute start.
Mdouble getHopperExitHeight()
Returns the height of the lowest hopper point above the chute.
ChuteWithHopper()
This is the default constructor.
Vec3D getGravity() const
Returns the gravity vector.
bool readNextArgument(int &i, int argc, char *argv[])
This method can be used for reading object properties from a string.
void setInsertionBoundary(InsertionBoundary *insertionBoundary)
Sets the chute insertion boundary.
static Vec3D cross(const Vec3D &a, const Vec3D &b)
Calculates the cross product of two Vec3D: .
bool readNextArgument(int &i, int argc, char *argv[])
Reads setup properties from a string.
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. elastic, linear visco-elastic... et cetera...
Mdouble getHopperLift()
Returns the hopper's lift above the chute bottom plane.
Mdouble getYMax() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMax() returns XMax...
virtual void read(std::istream &is)
Reads setup properties from an istream.
Mdouble getChuteAngle() const
Returns the chute angle (in radians)
WallHandler wallHandler
An object of the class WallHandler. Contains pointers to all the walls created.
virtual void createBottom()
Creates the chute bottom, which can be either flat or one of three flavours of rough.
Mdouble getHopperExitLength()
Returns the width of the hopper exit.
Mdouble getMinInflowParticleRadius() const
returns the minimum radius of inflow particles
Inherits from InsertionBoundary Some images are useful to better understand the structure of both the...
Mdouble getMaximumVelocityInducedByGravity()
Returns the theoretical maximum particle velocity due to gravity.
void setChuteLength(Mdouble chuteLength)
sets xMax to chuteLength+hopperlength_, and thus specifies the length off the runoff chute ...
bool isHopperAlignedWithBottom_
This is the flag, which sets if the chute bottom is aligned with the hopper, by default it is...
void set(BaseParticle *particleToCopy, int maxFailed, double yMin, double yMax, double radMin, double radMax, double chuteAngle, double fixedParticleRadius, bool isHopperCentred_, int hopperDim, double hopperAngle, double hopperLength, double hopperExitLength, double hopperHeight, double lift, double fillPercent)
Sets all boundary properties at once.
void read(std::istream &is)
Reads all chute properties from an istream.
Mdouble hopperHeight_
Dimension of the hopper in horizontal direction.
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;.
T * getLastObject()
Gets a pointer to the last Object in this BaseHandler.
void setIsHopperCentred(bool isHopperCentred)
Sets an extra shift in X-direction of the whole system.
virtual void setupInitialConditions()
Sets up the initial conditions for the problem.
void write(std::ostream &os, bool writeAllParticles=true) const
Writes setup properties to an ostream.
Implementation of a 3D vector (by Vitaliy).
void setHopperDimension(Mdouble hopperDimension)
Sets whether the hopper should have vertical (1) or inclined (2) walls in Y-direction.
Mdouble hopperLift_
This is the vertical distance the chute is lifted above the plane.
Mdouble getTimeStep() const
Allows the time step dt to be accessed.
void constructor()
This is the actually constructor, get called by all constructors above.
void setIsHopperAlignedWithBottom(bool isHopperAlignedWithBottom)
Sets the alignment of hopper with chute bottom.
Mdouble getTimeStepRatio()
Returns smallest particle radius over maximum gravitational velocity.
Mdouble hopperExitLength_
Dimension of the hopper exit in vertical direction.
unsigned int getMaxFailed() const
Returns the number of times a particle will be tried to be added to the insertion boundary...