117 Vec3D A, B, C, temp, normal;
123 if (HopperCornerHeight<=0.0) {
HopperHeight += -HopperCornerHeight +
P0.Radius; HopperCornerHeight =
P0.Radius; }
129 B =
Vec3D(0.0, 0.0, HopperCornerHeight);
130 C =
Vec3D(0.0, 0.0, 0.0);
135 A =
Vec3D(c*A.
X-s*A.
Z, 0.0, s*A.
X+c*A.
Z);
136 B =
Vec3D(c*B.
X-s*B.
Z, 0.0, s*B.
X+c*B.
Z);
137 C =
Vec3D(c*C.
X-s*C.
Z, 0.0, s*C.
X+c*C.
Z);
155 Walls[n].add_finite_wall(normal, Dot(normal,A));
158 Walls[n].add_finite_wall(normal, Dot(normal,B));
161 Walls[n].add_finite_wall(normal,Dot(normal,C));
174 A =
Vec3D(c*A.X-s*A.Z+
shift, 0.0, s*A.X+c*A.Z);
175 B =
Vec3D(c*B.X-s*B.Z+
shift, 0.0, s*B.X+c*B.Z);
176 C =
Vec3D(c*C.X-s*C.Z+
shift, 0.0, s*C.X+c*C.Z);
185 Walls[n+1].add_finite_wall(normal, Dot(normal,A));
188 Walls[n+1].add_finite_wall(normal, Dot(normal,B));
191 Walls[n+1].add_finite_wall(normal, Dot(normal,C));
209 A =
Vec3D(c*A.X-s*A.Z, A.Y, s*A.X+c*A.Z);
210 B =
Vec3D(c*B.X-s*B.Z, B.Y, s*B.X+c*B.Z);
211 C =
Vec3D(c*C.X-s*C.Z, C.Y, s*C.X+c*C.Z);
228 Walls[n+2].add_finite_wall(normal, Dot(normal,A));
232 Walls[n+2].add_finite_wall(normal, Dot(normal,B));
236 Walls[n+2].add_finite_wall(normal,Dot(normal,C));
245 A =
Vec3D(c*A.X-s*A.Z, A.Y, s*A.X+c*A.Z);
246 B =
Vec3D(c*B.X-s*B.Z, B.Y, s*B.X+c*B.Z);
247 C =
Vec3D(c*C.X-s*C.Z, C.Y, s*C.X+c*C.Z);
262 Walls[n+3].add_finite_wall(normal, Dot(normal,A));
266 Walls[n+3].add_finite_wall(normal, Dot(normal,B));
270 Walls[n+3].add_finite_wall(normal,Dot(normal,C));
288 for (vector<CParticle>::iterator it= this->Particles.begin(); it!=this->Particles.end(); ++it) {
289 it->Position.X +=
shift;
290 #ifdef USE_SIMPLE_VERLET_INTEGRATION
291 it->PrevPosition.X +=
shift;
368 void set_Hopper(
double ExitLength,
double ExitHeight,
double Angle,
double Length){
369 if (ExitLength>=0.0) {
HopperExitLength = ExitLength;}
else std::cerr <<
"WARNING : Hopper exit length must be greater than or equal to zero" << std::endl;
370 if (ExitHeight>=0.0) {
HopperExitHeight = ExitHeight;}
else std::cerr <<
"WARNING : Hopper exit height must be greater than or equal to zero" << std::endl;
371 if (Angle>0.0&&Angle<90.0) {
HopperAngle = Angle*
pi/180.0;}
else std::cerr <<
"WARNING : Hopper angle must in (0,90)" << std::endl;
372 if (Length>ExitLength) {
HopperLength = Length;}
else std::cerr <<
"WARNING : Hopper length must be greater than exit length" << std::endl;
378 return sqrt(2.0*9.8*height);
384 void set_ChuteLength(
double new_){
if (new_>=0.0) {
set_xmax(new_+
shift);
set_xmin(0.0);}
else std::cerr <<
"WARNING : Chute length unchanged, value must be greater than or equal to zero" << std::endl;}
390 void set_shift(
double new_){
if (new_>=0.0) {
set_xmax(
get_xmax()+new_-
shift);
shift = new_;}
else std::cerr <<
"WARNING : Shift length unchanged, value must be greater than or equal to zero" << std::endl;}
393 virtual void read(std::istream& is) {
400 virtual void write(std::ostream& os) {
406 virtual void print(std::ostream& os) {
426 if (!strcmp(argv[i],
"-hopperLength")) {
428 }
else if (!strcmp(argv[i],
"-hopperHeight")) {
430 }
else if (!strcmp(argv[i],
"-hopperAngle")) {
432 }
else if (!strcmp(argv[i],
"-hopperExitLength")) {
434 }
else if (!strcmp(argv[i],
"-hopperExitHeight")) {
436 }
else if (!strcmp(argv[i],
"-lowerFillHeight")) {
438 }
else if (!strcmp(argv[i],
"-centerHopper")) {
440 }
else if (!strcmp(argv[i],
"-alignBase")) {
442 }
else if (!strcmp(argv[i],
"-shift")) {
443 shift=(atof(argv[i+1]));
444 }
else if (!strcmp(argv[i],
"-lift")) {
445 lift=(atof(argv[i+1]));
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 write(std::ostream &os)
This function writes all chute data.
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.
double HopperExitLength
Dimension of the hopper exit in vertical direction.
void set_shift(double new_)
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[])
Matrix3D Cross(const Vec3D &A, const Matrix3D &B)
virtual void create_inflow_particle()
This creates an inflow particle in the top 50% of the hopper i.e.
void set_xmin(Mdouble new_xmin)
Sets xmin and walls, assuming the standard definition of walls as in the default constructor.
void set_lowerFillHeight(double new_)
double lift
This is the vertical distance the chute is lifted above the plane.
std::vector< CSpecies > Species
These are the particle parameters like dissipation etc.
ChuteWithHopperAndInset(HGRID_base &other)
int readNextArgument(unsigned int &i, unsigned int argc, char *argv[])
double HopperHeight
Dimension of the hopper in horizontal direction.
void add_hopper()
This create the hopper on top of the chute, see diagram in class description for details of the point...
Mdouble get_ymax()
Gets ymax.
friend Mdouble GetLength2(const Vec3D &A)
ChuteWithHopperAndInset(Chute &other)
This is a copy constructor for Chute problems.
ChuteWithHopperAndInset(HGRID_3D &other)
bool align_base
This is the flag, which sets if the chute bottom is aligned with the hopper, by default it is...
void constructor()
The actually constructor.
Chute adds three new effects to the HGrid: the gravity direction can be set using the ChuteAngle vari...
virtual void setup_particles_initial_conditions()
initialize particle position, velocity, radius
double shift
The x position where the Chute starts (defined as the beginning of the hopper)
ChuteWithHopperAndInset has a hopper as inflow.
This adds on the hierarchical grid code for 3D problems.
void lift_hopper(double distance)
This lifts the hopper above the plane of the chute.
Mdouble get_ymin()
Gets ymin.
double HopperLength
Dimension of the hopper in vertical direction.
double lowerFillHeight
Relative height (in [0,1)) above which teh hopper is replenished with new particles.
void setup_particles_initial_conditions()
initialize particle position, velocity, radius
bool centerHopper
If theis 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 set_ChuteLength(double new_)
Allows chute length to be changed.
double HopperAngle
Angle between the two pieces of the hopper walls.
void set_align_base(bool new_align)
TangentialSpringParticle P0
double fill_percent
This is which percentage of the hopper is used for creating new partices;.
ChuteWithHopperAndInset()
This is the default constructor.
void print(std::ostream &os, bool print_all=false)
This function std::couts all chute data.
void set_centerHopper(bool new_)
void set_HopperFillPercentage(double new_fill)
virtual void read(std::istream &is)
This function reads all chute data.
A class that defines and solves a MD problem.
double get_MaximumVelocityInducedByGravity()
Allows chute length to be accessed.
Mdouble gamma(Mdouble gamma_in)
This is the gamma function returns the true value for the half integer value.
Mdouble MaxInflowParticleRadius
void read(std::istream &is)
This function reads all chute data.
Mdouble get_xmax()
Get xmax.
Implementation of a 3D vector (by Vitaliy).
double get_ChuteLength()
Allows chute length to be accessed.
Mdouble HopperLowestPoint
The z coordinate of the right C point (when the left C point is in the origin)
double HopperExitHeight
Dimension of the hopper exit in vertical direction.
virtual void write(std::ostream &os)
This function writes all chute data.
void set_Hopper(double ExitLength, double ExitHeight, double Angle, double Length)
ChuteWithHopperAndInset(MD &other)
void set_hopper_dim(double new_hopper_dim)
Mdouble get_ChuteAngle()
Gets chute angle (in radians)
void set_xmax(Mdouble new_xmax)
Sets xmax and walls, assuming the standard definition of walls as in the default constructor.
virtual void print(std::ostream &os)