26 #ifndef CHUTEWITHHOPPER_H
27 #define CHUTEWITHHOPPER_H
121 Vec3D A, B, C, temp, normal;
140 B =
Vec3D(0.0, 0.0, HopperCornerHeight);
141 C =
Vec3D(0.0, 0.0, 0.0);
146 A =
Vec3D(c*A.
X-s*A.
Z, 0.0, s*A.
X+c*A.
Z);
147 B =
Vec3D(c*B.
X-s*B.
Z, 0.0, s*B.
X+c*B.
Z);
148 C =
Vec3D(c*C.
X-s*C.
Z, 0.0, s*C.
X+c*C.
Z);
182 A =
Vec3D(c*A.X-s*A.Z+
shift, 0.0, s*A.X+c*A.Z);
183 B =
Vec3D(c*B.X-s*B.Z+
shift, 0.0, s*B.X+c*B.Z);
184 C =
Vec3D(c*C.X-s*C.Z+
shift, 0.0, s*C.X+c*C.Z);
216 A =
Vec3D(c*A.X-s*A.Z, A.Y, s*A.X+c*A.Z);
217 B =
Vec3D(c*B.X-s*B.Z, B.Y, s*B.X+c*B.Z);
218 C =
Vec3D(c*C.X-s*C.Z, C.Y, s*C.X+c*C.Z);
253 A =
Vec3D(c*A.X-s*A.Z, A.Y, s*A.X+c*A.Z);
254 B =
Vec3D(c*B.X-s*B.Z, B.Y, s*B.X+c*B.Z);
255 C =
Vec3D(c*C.X-s*C.Z, C.Y, s*C.X+c*C.Z);
287 #ifdef USE_SIMPLE_VERLET_INTEGRATION
377 if (ExitLength>=0.0) {
HopperExitLength = ExitLength;}
else std::cerr <<
"WARNING : Hopper exit length must be greater than or equal to zero" << std::endl;
378 if (ExitHeight>=0.0) {
HopperExitHeight = ExitHeight;}
else std::cerr <<
"WARNING : Hopper exit height must be greater than or equal to zero" << std::endl;
382 if (Angle>0.0&&Angle<90.0) {
HopperAngle = Angle*
constants::pi/180.0;}
else std::cerr <<
"WARNING : Hopper angle must in (0,90)" << std::endl;
384 if (Length>ExitLength) {
HopperLength = Length;}
else std::cerr <<
"WARNING : Hopper length must be greater than exit length" << std::endl;
390 if ((Height-HeightCompare)>-1e-6*HeightCompare) {
HopperHeight = Height;}
else std::cerr <<
"WARNING : For these settings, hopper height must be greater then or equal to "<<HeightCompare <<
", see drawing" << std::endl;
409 return sqrt(2.0*9.8*height);
426 virtual void read(std::istream& is) {
433 virtual void write(std::ostream& os) {
439 virtual void print(std::ostream& os) {
459 if (!strcmp(argv[i],
"-hopperLength")) {
461 }
else if (!strcmp(argv[i],
"-hopperHeight")) {
463 }
else if (!strcmp(argv[i],
"-hopperAngle")) {
465 }
else if (!strcmp(argv[i],
"-hopperExitLength")) {
467 }
else if (!strcmp(argv[i],
"-hopperExitHeight")) {
469 }
else if (!strcmp(argv[i],
"-lowerFillHeight")) {
471 }
else if (!strcmp(argv[i],
"-centerHopper")) {
473 }
else if (!strcmp(argv[i],
"-alignBase")) {
475 }
else if (!strcmp(argv[i],
"-shift")) {
476 shift=(atof(argv[i+1]));
477 }
else if (!strcmp(argv[i],
"-lift")) {
478 lift=(atof(argv[i+1]));
Mdouble MinInflowParticleRadius
This is the base class for both HGRID_2D and HGRID_3D.
void set_zmax(Mdouble new_zmax)
Sets ymax and walls, assuming the standard definition of walls as in the default constructor.
void set_lowerFillHeight(Mdouble new_)
ChuteWithHopper(Chute &other)
This is a copy constructor for Chute problems.
void compute_particle_mass(std::vector< CSpecies > &Species)
Compute Particle mass function, which required a reference to the Species vector. It copmuters the Pa...
int readNextArgument(unsigned int &i, unsigned int argc, char *argv[])
void set_Hopper(Mdouble ExitLength, Mdouble ExitHeight, Mdouble Angle, Mdouble Length, Mdouble Height)
Mdouble get_ChuteLength()
Allows chute length to be accessed.
Mdouble get_RN(Mdouble min, Mdouble max)
This is a random generating routine can be used for initial positions.
virtual void read(std::istream &is)
This function reads all chute data.
Matrix3D Cross(const Vec3D &A, const Matrix3D &B)
void set_xmin(Mdouble new_xmin)
Sets xmin and walls, assuming the standard definition of walls as in the default constructor.
void set_centerHopper(bool new_)
bool align_base
This is the flag, which sets if the chute bottom is aligned with the hopper, by default it is...
std::vector< CSpecies > Species
These are the particle parameters like dissipation etc.
bool centerHopper
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 fill_percent
This is which percentage of the hopper is used for creating new partices;.
void set_align_base(bool new_align)
Mdouble get_HopperLowestPoint()
Mdouble get_ymax()
Gets ymax.
friend Mdouble GetLength2(const Vec3D &A)
Mdouble get_Radius() const
void lift_hopper(Mdouble distance)
This lifts the hopper above the plane of the chute.
Chute adds three new effects to the HGrid: the gravity direction can be set using the ChuteAngle vari...
This adds on the hierarchical grid code for 3D problems.
ChuteWithHopper(MD &other)
Mdouble shift
The x position where the Chute starts (defined as the beginning of the hopper)
WallHandler & getWallHandler()
Mdouble get_ymin()
Gets ymin.
Mdouble HopperHeight
Dimension of the hopper in horizontal direction.
ChuteWithHopper(HGRID_3D &other)
void set_ChuteLength(Mdouble new_)
Allows chute length to be changed.
void copyAndAddWall(const BaseWall &B)
Creates a copy of a BaseWall and adds it to the WallHandler.
void setup_particles_initial_conditions()
initialize particle position, velocity, radius
Mdouble HopperExitLength
Dimension of the hopper exit in vertical direction.
const std::vector< T * >::const_iterator end() const
Gets the end of the const_iterator over all BaseBoundary in this BaseHandler.
Mdouble HopperAngle
Angle between the two pieces of the hopper walls.
ChuteWithHopper()
This is the default constructor.
void set_HopperFillPercentage(Mdouble new_fill)
TangentialSpringParticle P0
void move(const Vec3D &_new)
ChuteWithHopper has a hopper as inflow.
ChuteWithHopper(HGRID_base &other)
void print(std::ostream &os, bool print_all=false)
This function std::couts all chute data.
void set_Radius(const Mdouble _new)
void set_HopperLowestPoint(Mdouble point)
void set_hopper_dim(Mdouble new_hopper_dim)
A class that defines and solves a MD problem.
Mdouble gamma(Mdouble gamma_in)
This is the gamma function returns the true value for the half integer value.
void add_finite_wall(Vec3D normal, Vec3D point)
Adds a wall to the set of finite walls, given an outward normal vector s.t. normal*x=normal*point.
Mdouble get_MaximumVelocityInducedByGravity()
Allows chute length to be accessed.
Mdouble HopperExitHeight
Dimension of the hopper exit in vertical direction.
void add_hopper()
This creates the hopper on top of the chute, see diagram in class description for details of the poin...
Mdouble MaxInflowParticleRadius
void read(std::istream &is)
This function reads all chute data.
ParticleHandler & getParticleHandler()
Mdouble get_lift_hopper()
Mdouble get_xmax()
Get xmax.
void set_shift(Mdouble new_)
Implementation of a 3D vector (by Vitaliy).
virtual void print(std::ostream &os)
void constructor()
This is the actually constructor, get called by all constructors above.
Mdouble lift
This is the vertical distance the chute is lifted above the plane.
void set_Position(const Vec3D &_new)
virtual void write(std::ostream &os)
This function writes all chute data.
Mdouble HopperLowestPoint
The z coordinate of the right C point (when the left C point is in the origin)
virtual void write(std::ostream &os)
This function writes all chute data.
unsigned int hopper_dim
This is the dimension of the hopper, my default it is one dimensional and hence does not have side wa...
virtual void setup_particles_initial_conditions()
initialize particle position, velocity, radius
int readNextArgument(unsigned int &i, unsigned int argc, char *argv[])
virtual void create_inflow_particle()
This creates an inflow particle in the top 50% of the hopper i.e.
Mdouble get_ChuteAngle()
Gets chute angle (in radians)
Mdouble lowerFillHeight
Relative height (in [0,1)) above which the hopper is replenished with new particles.
Mdouble HopperLength
Dimension of the hopper in vertical direction.
void set_xmax(Mdouble new_xmax)
Sets xmax and walls, assuming the standard definition of walls as in the default constructor.