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);
281 A =
Vec3D(c * A.X - s * A.Z, A.Y, s * A.X + c * A.Z);
282 B =
Vec3D(c * B.X - s * B.Z, B.Y, s * B.X + c * B.Z);
283 C =
Vec3D(c * C.X - s * C.Z, C.Y, s * C.X + c * C.Z);
316 A =
Vec3D(c * A.X - s * A.Z, A.Y, s * A.X + c * A.Z);
317 B =
Vec3D(c * B.X - s * B.Z, B.Y, s * B.X + c * B.Z);
318 C =
Vec3D(c * C.X - s * C.Z, C.Y, s * C.X + c * C.Z);
386 if (exitLength >= 0.0)
392 logger(
ERROR,
"[ChuteWithHopper::setHopper()] Hopper exit length must be greater than or equal to zero");
397 if (exitHeight < 0.0)
399 logger(
ERROR,
"[ChuteWithHopper::setHopper()] Hopper exit height must be greater than or equal to zero");
404 logger(
ERROR,
"[ChuteWithHopper::setHopper()] Hopper exit height (%) may not exceed height of hopper corner above chute bottom (%)",
415 if (angle > 0.0 && angle < 90.0)
421 logger(
ERROR,
"[ChuteWithHopper::setHopper()] Hopper angle must in (0,90)");
425 if (length > exitLength)
431 logger(
ERROR,
"[ChuteWithHopper::setHopper()] Hopper length must be greater than exit length");
437 if (hopperCornerHeight <= 0.0)
441 logger(
ERROR,
"[ChuteWithHopper::setHopper()] height of hopper corner (%) may not be below 0. Increase hopper height to fix.",
448 logger(
VERBOSE,
"[ChuteWithHopper::setHopper()] Setting the following hopper geometrical properties:");
458 if ((height - heightCompare) > -1e-6 * heightCompare)
464 logger(
ERROR,
"[ChuteWithHopper::setHopper()] For these settings, hopper height must be greater then or equal to %, see drawing",
471 logger(
VERBOSE,
"[ChuteWithHopper::setHopper()] Hopper geometry: ");
490 return std::sqrt(2.0 *
getGravity().getLength() * height);
506 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);
528 if (chuteLength >= 0.0)
535 logger(
WARN,
"[ChuteWithHopper::setChuteLength()] Chute length unchanged, value must be greater than or equal to zero");
565 if (hopperShift >= 0.0)
573 logger(
WARN,
"[ChuteWithHopper::setHopperShift()] Shift length unchanged, value must be greater than or equal to zero");
728 if (!strcmp(argv[i],
"-hopperLength"))
732 else if (!strcmp(argv[i],
"-hopperHeight"))
736 else if (!strcmp(argv[i],
"-hopperAngle"))
740 else if (!strcmp(argv[i],
"-hopperExitLength"))
744 else if (!strcmp(argv[i],
"-hopperExitHeight"))
748 else if (!strcmp(argv[i],
"-hopperLowerFillingHeight_"))
752 else if (!strcmp(argv[i],
"-isHopperCentred"))
756 else if (!strcmp(argv[i],
"-alignBase"))
760 else if (!strcmp(argv[i],
"-shift"))
764 else if (!strcmp(argv[i],
"-lift"))
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.
static Mdouble getLengthSquared(const Vec3D &a)
Calculates the squared length of a Vec3D: .
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.
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...
A IntersectionOfWalls is convex polygon defined as an intersection of InfiniteWall's.
Mdouble hopperExitHeight_
Dimension of the hopper exit in vertical direction.
Mdouble getHopperLift() const
Returns the hopper's lift above the chute bottom plane.
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
Mdouble getYMin() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMin() returns YMin...
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...
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)
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.
void setSpecies(const ParticleSpecies *species)
sets species of subwalls as well
Mdouble getHopperLength() const
Returns the width of the hopper entrance.
Mdouble getXMax() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMax() returns XMax...
Mdouble getHopperLowestPoint() const
Returns the vertical distance of the lowest hopper point relative to the start of the chute...
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.
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.
BoundaryHandler boundaryHandler
An object of the class BoundaryHandler which concerns insertion and deletion of particles into or fro...
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...
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created...
Mdouble getHopperExitHeight() const
Returns the height of the lowest hopper point above the chute.
T * getObject(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
ChuteWithHopper()
This is the default constructor.
Vec3D getGravity() const
Returns the gravity vector.
std::enable_if<!std::is_pointer< U >::value, U * >::type copyAndAddObject(const U &object)
Creates a copy of a Object and adds it to the BaseHandler.
bool readNextArgument(int &i, int argc, char *argv[])
This method can be used for reading object properties from a string.
Mdouble getHopperAngle() const
Returns the angle of the hopper entrance relative to the vertical.
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 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)
Mdouble getHopperShift() const
Returns the shift in X-direction of the whole setup after rotation.
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 getMinInflowParticleRadius() const
returns the minimum radius of inflow particles
Inherits from InsertionBoundary Some images are useful to better understand the structure of both the...
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 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;.
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 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.
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 getMaximumVelocityInducedByGravity() const
Returns the theoretical maximum particle velocity due to gravity.
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...