MercuryDPM  0.10
 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-2014, 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 #include "Chute.h"
29 #include "FiniteWall.h"
30 //#include "Statistics.h"
31 
38 class ChuteWithHopper : public Chute {
39 protected:
56 private:
59 
61  unsigned int hopper_dim;
62 
64  bool align_base;
65 
68 
71 
72 
73 
74 public:
75 
77  ChuteWithHopper(Chute& other) : MD(other), Chute(other) {constructor();}
78  ChuteWithHopper(HGRID_3D& other) : MD(other), Chute(other) {constructor();}
79  ChuteWithHopper(HGRID_base& other) : MD(other), Chute(other) {constructor();}
80  ChuteWithHopper(MD& other) : MD(other), Chute(other) {constructor();}
81 
84 
86  void constructor()
87  {
88  lowerFillHeight=0.5;
89  lift=0.0;
90  set_Hopper(0.01, 0.01, 60.0, 0.08, 0.04);
91  shift = 0.0;
92  hopper_dim=1;
93  align_base=true;
94 
95  fill_percent=50.0;
96  centerHopper=false;
97 
98  }
99 
101 
103  {
105  //std::cout << shift << " " << get_xmax() << " " << getParticleHandler().getNumberOfObjects() << std::endl;
106  add_hopper();
107  }
108 
110  void add_hopper() {
111  //hopper walls
112  //to create the finite hopper walls, we take vector between two wall points in xz-plane, then rotate clockwise and make unit length
113  // A\ /A
114  // \ / A,B,C denote three points on the left and right hopper walls which are used to construct the hopper
115  // \ / shift denotes the space by which the chute has to be shifted to the right such that the hopper is in the domain
116  // B| |B
117  // | |
118  // | |C
119  // C|
120 
121  Vec3D A, B, C, temp, normal;
122 
123  Mdouble s = sin(get_ChuteAngle());
124  Mdouble c = cos(get_ChuteAngle());
126 
128  //HopperHeight is now an input variable
129  //HopperHeight = HopperLowestPoint + 1.1 * 0.5*(HopperLength+HopperExitLength) / tan(HopperAngle);
130 
131  Mdouble HopperCornerHeight = HopperHeight - 0.5*(HopperLength-HopperExitLength) / tan(HopperAngle);
132  // Waarom had ik deze ook al weer gecomment?
133  //if (HopperCornerHeight<=0.0) { HopperHeight += -HopperCornerHeight + P0.get_Radius(); HopperCornerHeight = P0.get_Radius(); }
134 
135 
136  //first we create the left hopper wall
137 
138  //coordinates of A,B,C in (vertical parallel to flow,vertical normal to flow, horizontal) direction
140  B = Vec3D(0.0, 0.0, HopperCornerHeight);
141  C = Vec3D(0.0, 0.0, 0.0);
142 
143 
144 
145  //now rotate the coordinates of A,B,C to be in (x,y,z) direction
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);
149  // the position of A determines shift and zmax
151  if (centerHopper) set_shift(-A.X+40);
152  else set_shift(-A.X);
153  set_zmax(A.Z);
154  A.X +=shift;
155  B.X +=shift;
156  C.X +=shift;
157 
158  //This lifts the hopper a distance above the chute
159  A.Z+=lift;
160  B.Z+=lift;
161  C.Z+=lift;
162 
163  //create a finite wall from B to A and from C to B on the left hand side
164  FiniteWall w_Left;
165  temp = B-A;
166  normal = Vec3D(temp.Z,0.0,-temp.X) / sqrt(temp.GetLength2());
167  w_Left.add_finite_wall(normal, Dot(normal,A));
168  temp = C-B;
169  normal = Vec3D(temp.Z,0.0,-temp.X) / sqrt(temp.GetLength2());
170  w_Left.add_finite_wall(normal, Dot(normal,B));
171  temp = A-C;
172  normal = Vec3D(temp.Z,0.0,-temp.X)/sqrt(temp.GetLength2());
173  w_Left.add_finite_wall(normal,Dot(normal,C));
174  getWallHandler().copyAndAddWall(w_Left);
175 
176  //next, do the same for the right wall
178  B = Vec3D(0.5*(HopperLength+HopperExitLength)-0.5*(HopperLength-HopperExitLength), 0.0, HopperCornerHeight);
180 
181  //This rotates the right points
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);
185 
186  //This lifts the hopper a distance above the chute
187  A.Z+=lift;
188  B.Z+=lift;
189  C.Z+=lift;
190 
191  //create a finite wall from B to A and from C to B on the right hand side
192  FiniteWall w_Right;
193  temp = A-B;
194  normal = Vec3D(temp.Z,0.0,-temp.X) / sqrt(temp.GetLength2());
195  w_Right.add_finite_wall(normal, Dot(normal,A));
196  temp = B-C;
197  normal = Vec3D(temp.Z,0.0,-temp.X) / sqrt(temp.GetLength2());
198  w_Right.add_finite_wall(normal, Dot(normal,B));
199  temp = C-A;
200  normal = Vec3D(temp.Z,0.0,-temp.X) / sqrt(temp.GetLength2());
201  w_Right.add_finite_wall(normal, Dot(normal,C));
202  getWallHandler().copyAndAddWall(w_Right);
203 
204  set_zmax(A.Z);
205 
206  if (hopper_dim == 2)
207  {
208  //coordinates of A,B,C in (vertical parallel to flow,vertical normal to flow, horizontal) direction
209  A = Vec3D(0.0, (get_ymax()-get_ymin()-HopperLength)/2.0, HopperHeight);
210  B = Vec3D(0.0, (get_ymax()-get_ymin()-HopperExitLength)/2.0, HopperCornerHeight);
211  C = Vec3D(0.0, (get_ymax()-get_ymin()-HopperExitLength)/2.0, 0.0);
212 
213 
214 
215  //now rotate the coordinates of A,B,C to be in (x,y,z) direction
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);
219  // the position of A determines shift and zmax
220  A.X +=shift;
221  B.X +=shift;
222  C.X +=shift;
223 
224  //This lifts the hopper a distance above the chute
225  A.Z+=lift;
226  B.Z+=lift;
227  C.Z+=lift;
228 
229 
230 
231  //create a finite wall from B to A and from C to B
232  FiniteWall w_Back;
233  temp = B-A;
234  normal=Cross(Vec3D(-c,0,-s),temp)/sqrt(temp.GetLength2());
235  //normal = Vec3D(0.0,temp.Z,-temp.Y) / sqrt(temp.GetLength2());
236  w_Back.add_finite_wall(normal, Dot(normal,A));
237  temp = C-B;
238  //normal = Vec3D(0.0,temp.Z,-temp.Y) / sqrt(temp.GetLength2());
239  normal=Cross(Vec3D(-c,0,-s),temp)/sqrt(temp.GetLength2());
240  w_Back.add_finite_wall(normal, Dot(normal,B));
241  temp = A-C;
242  //normal = Vec3D(0.0,temp.Z,-temp.Y)/sqrt(temp.GetLength2());
243  normal=Cross(Vec3D(-c,0,-s),temp)/sqrt(temp.GetLength2());
244  w_Back.add_finite_wall(normal,Dot(normal,C));
245  getWallHandler().copyAndAddWall(w_Back);
246 
247  //Now for the right y-wall
248  A = Vec3D(0.0, (get_ymax()-get_ymin()+HopperLength)/2.0,HopperHeight);
249  B = Vec3D(0.0, (get_ymax()-get_ymin()+HopperExitLength)/2.0,HopperCornerHeight);
250  C = Vec3D(0.0, (get_ymax()-get_ymin()+HopperExitLength)/2.0,0.0);
251 
252  //now rotate the coordinates of A,B,C to be in (x,y,z) direction
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);
256  // the position of A determines shift and zmax
257  A.X +=shift;
258  B.X +=shift;
259  C.X +=shift;
260 
261  //This lifts the hopper a distance above the chute
262  A.Z+=lift;
263  B.Z+=lift;
264  C.Z+=lift;
265 
266  //create a finite wall from B to A and from C to B
267  FiniteWall w_Front;
268  temp = A-B;
269  normal=Cross(Vec3D(-c,0,-s),temp)/sqrt(temp.GetLength2());
270  //normal = Vec3D(0.0,-temp.Z,temp.Y) / sqrt(temp.GetLength2());
271  w_Front.add_finite_wall(normal, Dot(normal,A));
272  temp = B-C;
273  //normal = Vec3D(0.0,-temp.Z,temp.Y) / sqrt(temp.GetLength2());
274  normal=Cross(Vec3D(-c,0,-s),temp)/sqrt(temp.GetLength2());
275  w_Front.add_finite_wall(normal, Dot(normal,B));
276  temp = C-A;
277  //normal = Vec3D(0.0,-temp.Z,temp.Y)/sqrt(temp.GetLength2());
278  normal=Cross(Vec3D(-c,0,-s),temp)/sqrt(temp.GetLength2());
279  w_Front.add_finite_wall(normal,Dot(normal,C));
280  getWallHandler().copyAndAddWall(w_Front);
281  }
282 
283 
284  //now shift the fixed particles at the bottom so that they begin where the chute begins
285  for (std::vector<BaseParticle*>::iterator it= getParticleHandler().begin(); it!=getParticleHandler().end(); ++it) {
286  (*it)->move(Vec3D(shift,0.0,0.0));
287  #ifdef USE_SIMPLE_VERLET_INTEGRATION
288  (*it)->movePrevious(Vec3D(shift,0.0,0.0));
289  #endif
290  }
291  }
292 
293 
299  virtual void create_inflow_particle()
300  {
301 
302 
303  //use this formula to obtain bidispersed particles
304  //P0.Radius = random(0.0,1.0)<0.1?MinInflowParticleRadius:MaxInflowParticleRadius;
305 
306  //the following formula yields polydispersed particle radii:
307 
310 
311  //Define an orthogonal coordinate system this is usful in the hopper, see diagram in html documentation for details.
312  static Mdouble s = sin(get_ChuteAngle());
313  static Mdouble c = cos(get_ChuteAngle());
314  static Mdouble Ht = tan(HopperAngle);
315  static Mdouble Hc = cos(HopperAngle);
316  static Vec3D AB = Vec3D(c,0.0,s);
317  static Vec3D AC = Vec3D(-s,0.0,c);
318  static Vec3D AD = Vec3D(0.0,1.0,0.0);
319 
320  //Point A is located in the centre of the hopper.
321  static Vec3D A = Vec3D
322  (
323  centerHopper?40:0.0,
324  (get_ymax()-get_ymin())/2.0,
326  )
327  + AB*0.5*HopperLength
328  + AC*(-0.5*HopperLength/Ht);
329 
330  Mdouble gamma = random.get_RN((100.0-fill_percent)/100.0,1.0);
331 
332 
333  // Mdouble gamma = random(lowerFillHeight,1.0);
334 
335  Mdouble delta;
336 
337  if (hopper_dim==1)
338  {
339 
340 
341  //For the one dimensional delta is a random distance between the two walls the -minus 2 particle radii is to stop
345  //delta = random(ymin+P0.Radius,ymax-P0.Radius);
346 
347  delta = random.get_RN(-0.5,0.5)*(get_ymax()-get_ymin()-2.0*P0.get_Radius());
348 
349 
350  }
351  else
352  {
353 
354  delta= (random.get_RN(-1.0,1.0)*(0.5*gamma*HopperLength -P0.get_Radius()/Hc));
355 
356  }
357  P0.set_Position( A
358  + AC * (gamma*0.5*HopperLength/Ht)
359 
360  + AB * (random.get_RN(-1.0,1.0)*(0.5*gamma*HopperLength - P0.get_Radius()/Hc))
361  + AD*delta);
362 
363 
364  P0.move(Vec3D(0.0,0.0,lift));
365  }
366 
368  HopperLowestPoint=point;
369  }
371  return HopperLowestPoint;
372  }
373 
374 
375  void set_Hopper(Mdouble ExitLength, Mdouble ExitHeight, Mdouble Angle, Mdouble Length, Mdouble Height){
376 
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;
379 
381 
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;
383 
384  if (Length>ExitLength) {HopperLength = Length;} else std::cerr << "WARNING : Hopper length must be greater than exit length" << std::endl;
385 
386  //std::cout<<"HopperLowestPoint: "<<get_HopperLowestPoint()<<", HopperLength: "<<HopperLength<<", HopperExitLength: "<<HopperExitLength<<", HopperAngle: "<<HopperAngle<<", Height: "<<fixed<<setprecision(15)<<setw(20)<<Height<<"comparing height: "<<setprecision(15)<<setw(20)<<(get_HopperLowestPoint() + 0.5*(HopperLength+HopperExitLength) / tan(HopperAngle))<<std::endl;
387 
388  Mdouble HeightCompare = (get_HopperLowestPoint() + 0.5*(HopperLength+HopperExitLength) / tan(HopperAngle));
389  //This a semi-ugly fix to check wether Height>=Heightcompare and not take into account rounding errors
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;
392 
393  //std::cout<<" "<<std::endl;
394  //std::cout<<"ChuteWithHopper::set_Hopper:"<<std::endl;
395  //std::cout<<"HopperHeight: "<<HopperHeight<<std::endl;
396  //std::cout<<"HopperExitLength: "<<HopperExitLength<<std::endl;
397  //std::cout<<"HopperExitHeight: "<<HopperExitHeight<<std::endl;
398  //std::cout<<"HopperAngle: "<<HopperAngle<<std::endl;
399  //std::cout<<"HopperLength: "<<HopperLength<<std::endl;
400  //std::cout<<" "<<std::endl;
401 
402  }
403 
405 
407  Mdouble height = HopperHeight+(get_xmax()-shift)*sin(ChuteAngle);
408 
409  return sqrt(2.0*9.8*height);
410  }
411 
413 
415 
417  void set_ChuteLength(Mdouble 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;}
418 
419  void set_centerHopper(bool new_){centerHopper=new_; }
420 
422 
423  void set_shift(Mdouble 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;}
424 
426  virtual void read(std::istream& is) {
427  Chute::read(is);
429  >> HopperAngle >> HopperHeight >> shift;
430  }
431 
433  virtual void write(std::ostream& os) {
434  Chute::write(os);
435  os << HopperExitLength << " " << HopperExitHeight << " " << HopperLength
436  << " " << HopperAngle << " " << HopperHeight << " " << shift << " " << std::endl;
437  }
438 
439  virtual void print(std::ostream& os) {
440  Chute::print(os);
441  os
442  << "HopperExitLength:" << HopperExitLength
443  << ", HopperExitHeight:" << HopperExitHeight
444  << ", HopperLength:" << HopperLength
445  << ", HopperAngle:" << HopperAngle
446  << ", HopperHeight:" << HopperHeight
447  << std::endl;
448  }
449 
451  void lift_hopper(Mdouble distance){lift=distance;}
453 
454  void set_hopper_dim(Mdouble new_hopper_dim){hopper_dim=new_hopper_dim;}
455 
456  void set_align_base(bool new_align){align_base=new_align;}
457 
458  int readNextArgument(unsigned int& i, unsigned int argc, char *argv[]) {
459  if (!strcmp(argv[i],"-hopperLength")) {
460  HopperLength=(atof(argv[i+1]));
461  } else if (!strcmp(argv[i],"-hopperHeight")) {
462  HopperHeight=(atof(argv[i+1]));
463  } else if (!strcmp(argv[i],"-hopperAngle")) {
464  HopperAngle=(atof(argv[i+1]));
465  } else if (!strcmp(argv[i],"-hopperExitLength")) {
466  HopperExitLength=(atof(argv[i+1]));
467  } else if (!strcmp(argv[i],"-hopperExitHeight")) {
468  HopperExitHeight=(atof(argv[i+1]));
469  } else if (!strcmp(argv[i],"-lowerFillHeight")) {
470  lowerFillHeight=(atof(argv[i+1]));
471  } else if (!strcmp(argv[i],"-centerHopper")) {
472  centerHopper=(atoi(argv[i+1]));
473  } else if (!strcmp(argv[i],"-alignBase")) {
474  align_base=(atoi(argv[i+1]));
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]));
479  } else return Chute::readNextArgument(i, argc, argv); //if argv[i] is not found, check the commands in Chute
480  return true; //returns true if argv[i] is found
481  }
482 
483 };
484 #endif
Mdouble MinInflowParticleRadius
Definition: Chute.h:254
This is the base class for both HGRID_2D and HGRID_3D.
Definition: HGRID_base.h:43
void set_zmax(Mdouble new_zmax)
Sets ymax and walls, assuming the standard definition of walls as in the default constructor.
Definition: MD.h:334
void set_lowerFillHeight(Mdouble new_)
Mdouble X
Definition: Vector.h:44
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[])
Definition: Chute.cc:414
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.
Definition: RNG.cc:32
virtual void read(std::istream &is)
This function reads all chute data.
Matrix3D Cross(const Vec3D &A, const Matrix3D &B)
Definition: Matrix.h:198
void set_xmin(Mdouble new_xmin)
Sets xmin and walls, assuming the standard definition of walls as in the default constructor.
Definition: MD.h:318
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.
Definition: MD.h:655
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()
RNG random
Definition: MD.h:515
Mdouble get_ymax()
Gets ymax.
Definition: MD.h:311
friend Mdouble GetLength2(const Vec3D &A)
Definition: Vector.h:183
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...
Definition: Chute.h:34
This adds on the hierarchical grid code for 3D problems.
Definition: HGRID_3D.h:35
ChuteWithHopper(MD &other)
Mdouble shift
The x position where the Chute starts (defined as the beginning of the hopper)
WallHandler & getWallHandler()
Definition: MD.h:148
Mdouble get_ymin()
Gets ymin.
Definition: MD.h:309
Mdouble HopperHeight
Dimension of the hopper in horizontal direction.
ChuteWithHopper(HGRID_3D &other)
const Mdouble pi
Definition: ExtendedMath.h:54
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.
Definition: WallHandler.cc:84
double Mdouble
Definition: ExtendedMath.h:33
void setup_particles_initial_conditions()
initialize particle position, velocity, radius
Definition: Chute.cc:229
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.
Definition: BaseHandler.h:233
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
Definition: Chute.h:262
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.
Definition: Chute.cc:88
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.
Definition: MD.h:70
Mdouble gamma(Mdouble gamma_in)
This is the gamma function returns the true value for the half integer value.
Definition: ExtendedMath.cc:37
Mdouble ChuteAngle
Definition: Chute.h:252
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.
Definition: FiniteWall.h:57
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
Definition: Chute.h:255
void read(std::istream &is)
This function reads all chute data.
Definition: Chute.cc:46
ParticleHandler & getParticleHandler()
Definition: MD.h:147
Mdouble get_lift_hopper()
Mdouble get_xmax()
Get xmax.
Definition: MD.h:307
void set_shift(Mdouble new_)
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:40
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)
Mdouble Z
Definition: Vector.h:44
virtual void write(std::ostream &os)
This function writes all chute data.
Definition: Chute.cc:70
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)
Definition: Chute.h:108
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.
Definition: MD.h:328