MercuryDPM  Trunk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ChuteWithHopper.cc
Go to the documentation of this file.
1 //Copyright (c) 2013-2020, 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 #include "ChuteWithHopper.h"
29 #include <cstring>
30 #include <cmath>
31 
32 //This is a copy constructor for Chute problems
34 
42  : DPMBase(other), Chute(other)
43 {
44  constructor();
45 }
46 
55  : DPMBase(other), Chute(other)
56 {
57  constructor();
58 }
59 
68  : DPMBase(other), Chute(other)
69 {
70  constructor();
71 }
72 
81  : DPMBase(other), Chute(other)
82 {
83  constructor();
84 }
85 
90 {
91  constructor();
92 }
93 
98 {
100  hopperLift_ = 0.0;
101  setHopper(0.01, 0.01, 60.0, 0.08, 0.04);
102  hopperShift_ = 0.0;
103  hopperDimension_ = 1;
105 
107  isHopperCentred_ = false;
108 
109 }
110 
119 {
120  hopperFillingPercentage_ = hopperFillingPercentage;
121 }
122 
131 {
132 
133  // check time step ratio
135 
136  // create chute side walls (either periodic or solid, based on (the inherited)
137  // boolean Chute::isChutePeriodic_ data member).
138  setupSideWalls();
139 
140  // create insertion boundary for the hopper and set a fill percentage
148  setInsertionBoundary(b1Added);
149 
150  // create the chute bottom
151  createBottom();
152 
153  // create the hopper
154  addHopper();
155 }
156 
162 {
163  //hopper walls
164  //to create the finite hopper walls, we take vector between two wall points in xz-plane, then rotate clockwise and make unit length
165  // A\ /A
166  // \ / A,B,C denote three points on the left and right hopper walls which are used to construct the hopper
167  // \ / shift denotes the space by which the chute has to be shifted to the right such that the hopper is in the domain
168  // B| |B
169  // | |
170  // C| |
171  // |C
172 
173  Vec3D A, B, C, temp, normal;
174 
175  const Mdouble s = mathsFunc::sin(getChuteAngle());
176  const Mdouble c = mathsFunc::cos(getChuteAngle());
177  // height of the lowest part of the hopper (right C in diagram above) as compared to
178  // the vertical position of the start of the chute (left C in diagram above).
180 
181  // "0.5*(hopperLength_+hopperExitLength_) / tan(hopperAngle_)" is the minimum heigth of the hopper, to make sure things should flow down and not to the sides.
182  // hopperHeight_ is now an input variable
183  // hopperHeight_ = hopperLowestPoint_ + 1.1 * 0.5*(hopperLength_+hopperExitLength_) / tan(hopperAngle_);
184 
185  const Mdouble HopperCornerHeight =
188  //if (HopperCornerHeight<=0.0) { hopperHeight_ += -HopperCornerHeight + P0.getRadius(); HopperCornerHeight = P0.getRadius(); }
189 
190  // first we create the LEFT hopper wall
191 
192  // coordinates of A,B,C in (vertical parallel to flow, vertical normal to flow, horizontal) direction
193  A = Vec3D(-0.5 * (hopperLength_ - hopperExitLength_), 0.0, hopperHeight_);
194  B = Vec3D(0.0, 0.0, HopperCornerHeight);
195  C = Vec3D(0.0, 0.0, 0.0);
196 
197  // now rotate the coordinates of A,B,C to be in (x,y,z) direction
198  A = Vec3D(c * A.X - s * A.Z, 0.0, s * A.X + c * A.Z);
199  B = Vec3D(c * B.X - s * B.Z, 0.0, s * B.X + c * B.Z);
200  C = Vec3D(c * C.X - s * C.Z, 0.0, s * C.X + c * C.Z);
201 
202  // the position of A determines hopper shift and zmax
208  if (isHopperCentred_)
209  {
210  setHopperShift(-A.X + 40);
211  }
212  else
213  {
214  setHopperShift(-A.X);
215  }
216 
217  setZMax(A.Z);
218  A.X += hopperShift_;
219  B.X += hopperShift_;
220  C.X += hopperShift_;
221 
222  //This lifts the hopper a distance above the chute
223  A.Z += hopperLift_;
224  B.Z += hopperLift_;
225  C.Z += hopperLift_;
226 
227  //create a finite wall from B to A and from C to B on the left hand side
228  IntersectionOfWalls w_Left;
230  temp = B - A;
231  normal = Vec3D(temp.Z, 0.0, -temp.X) / std::sqrt(temp.getLengthSquared());
232  w_Left.addObject(normal, A);
233  temp = C - B;
234  normal = Vec3D(temp.Z, 0.0, -temp.X) / std::sqrt(temp.getLengthSquared());
235  w_Left.addObject(normal, B);
236  temp = A - C;
237  normal = Vec3D(temp.Z, 0.0, -temp.X) / std::sqrt(temp.getLengthSquared());
238  w_Left.addObject(normal, C);
240 
241  //next, do the same for the right wall
244  HopperCornerHeight);
247 
248  //This rotates the right points
249  A = Vec3D(c * A.X - s * A.Z + hopperShift_, 0.0, s * A.X + c * A.Z);
250  B = Vec3D(c * B.X - s * B.Z + hopperShift_, 0.0, s * B.X + c * B.Z);
251  C = Vec3D(c * C.X - s * C.Z + hopperShift_, 0.0, s * C.X + c * C.Z);
252 
253  //This lifts the hopper a distance above the chute
254  A.Z += hopperLift_;
255  B.Z += hopperLift_;
256  C.Z += hopperLift_;
257 
258  //create a finite wall from B to A and from C to B on the right hand side
259  IntersectionOfWalls w_Right;
260  w_Right.setSpecies(speciesHandler.getObject(0));
261  temp = A - B;
262  normal = Vec3D(temp.Z, 0.0, -temp.X) / std::sqrt(temp.getLengthSquared());
263  w_Right.addObject(normal, A);
264  temp = B - C;
265  normal = Vec3D(temp.Z, 0.0, -temp.X) / std::sqrt(temp.getLengthSquared());
266  w_Right.addObject(normal, B);
267  temp = C - A;
268  normal = Vec3D(temp.Z, 0.0, -temp.X) / std::sqrt(temp.getLengthSquared());
269  w_Right.addObject(normal, C);
270  wallHandler.copyAndAddObject(w_Right);
271 
272  setZMax(A.Z);
273 
274  // if hopperDimension_ == 2, create inclined hopper walls (like in the X-direction) also in the Y-direction.
275  // (Else, place vertical (possibly periodic) walls in Y-direction. -> not mentioned here, where is this arranged? (BvdH))
276  if (hopperDimension_ == 2)
277  {
278  //coordinates of A,B,C in (vertical parallel to flow,vertical normal to flow, horizontal) direction
279  A = Vec3D(0.0, (getYMax() - getYMin() - hopperLength_) / 2.0, hopperHeight_);
280  B = Vec3D(0.0, (getYMax() - getYMin() - hopperExitLength_) / 2.0, HopperCornerHeight);
281  C = Vec3D(0.0, (getYMax() - getYMin() - hopperExitLength_) / 2.0, 0.0);
282 
283  //now rotate the coordinates of A,B,C to be in (x,y,z) direction
284  A = Vec3D(c * A.X - s * A.Z, A.Y, s * A.X + c * A.Z);
285  B = Vec3D(c * B.X - s * B.Z, B.Y, s * B.X + c * B.Z);
286  C = Vec3D(c * C.X - s * C.Z, C.Y, s * C.X + c * C.Z);
287  // the position of A determines shift and zmax
288  A.X += hopperShift_;
289  B.X += hopperShift_;
290  C.X += hopperShift_;
291 
292  //This lifts the hopper a distance above the chute
293  A.Z += hopperLift_;
294  B.Z += hopperLift_;
295  C.Z += hopperLift_;
296 
297  //create a finite wall from B to A and from C to B
298  IntersectionOfWalls w_Back;
299  temp = B - A;
300  normal = Vec3D::cross(Vec3D(-c, 0, -s), temp) / std::sqrt(temp.getLengthSquared());
301  //normal = Vec3D(0.0,temp.Z,-temp.Y) / std::sqrt(temp.GetLength2());
302  w_Back.addObject(normal, A);
303  temp = C - B;
304  //normal = Vec3D(0.0,temp.Z,-temp.Y) / std::sqrt(temp.GetLength2());
305  normal = Vec3D::cross(Vec3D(-c, 0, -s), temp) / std::sqrt(temp.getLengthSquared());
306  w_Back.addObject(normal, B);
307  temp = A - C;
308  //normal = Vec3D(0.0,temp.Z,-temp.Y)/std::sqrt(temp.GetLength2());
309  normal = Vec3D::cross(Vec3D(-c, 0, -s), temp) / std::sqrt(temp.getLengthSquared());
310  w_Back.addObject(normal, C);
312 
313  //Now for the right y-wall
314  A = Vec3D(0.0, (getYMax() - getYMin() + hopperLength_) / 2.0, hopperHeight_);
315  B = Vec3D(0.0, (getYMax() - getYMin() + hopperExitLength_) / 2.0, HopperCornerHeight);
316  C = Vec3D(0.0, (getYMax() - getYMin() + hopperExitLength_) / 2.0, 0.0);
317 
318  //now rotate the coordinates of A,B,C to be in (x,y,z) direction
319  A = Vec3D(c * A.X - s * A.Z, A.Y, s * A.X + c * A.Z);
320  B = Vec3D(c * B.X - s * B.Z, B.Y, s * B.X + c * B.Z);
321  C = Vec3D(c * C.X - s * C.Z, C.Y, s * C.X + c * C.Z);
322  // the position of A determines shift and zmax
323  A.X += hopperShift_;
324  B.X += hopperShift_;
325  C.X += hopperShift_;
326 
327  //This lifts the hopper a distance above the chute
328  A.Z += hopperLift_;
329  B.Z += hopperLift_;
330  C.Z += hopperLift_;
331 
332  //create a finite wall from B to A and from C to B
333  IntersectionOfWalls w_Front;
334  temp = A - B;
335  normal = Vec3D::cross(Vec3D(-c, 0, -s), temp) / std::sqrt(temp.getLengthSquared());
336  //normal = Vec3D(0.0,-temp.Z,temp.Y) / std::sqrt(temp.GetLength2());
337  w_Front.addObject(normal, A);
338  temp = B - C;
339  //normal = Vec3D(0.0,-temp.Z,temp.Y) / std::sqrt(temp.GetLength2());
340  normal = Vec3D::cross(Vec3D(-c, 0, -s), temp) / std::sqrt(temp.getLengthSquared());
341  w_Front.addObject(normal, B);
342  temp = C - A;
343  //normal = Vec3D(0.0,-temp.Z,temp.Y)/std::sqrt(temp.GetLength2());
344  normal = Vec3D::cross(Vec3D(-c, 0, -s), temp) / std::sqrt(temp.getLengthSquared());
345  w_Front.addObject(normal, C);
346  wallHandler.copyAndAddObject(w_Front);
347  }
348 
349  //now shift the chute as well, i.e. apply the shift to all the fixed particles
350  // at the bottom of the chute
351  for (BaseParticle* particle : particleHandler)
352  {
353  particle->move(Vec3D(hopperShift_, 0.0, 0.0));
354  }
355 }
356 
363 {
364  hopperLowestPoint_ = hopperLowestPoint;
365 }
366 
368 {
369  return hopperLowestPoint_;
370 }
371 
384 void ChuteWithHopper::setHopper(Mdouble exitLength, Mdouble exitHeight, Mdouble angle, Mdouble length, Mdouble height)
385 {
386  // hopperCornerHeight: helper variable, just here to check some things
387  const Mdouble hopperCornerHeight =
388  height - 0.5 * (length - exitLength) / mathsFunc::tan(angle * constants::pi / 180.0);
389 
390  if (exitLength >= 0.0)
391  {
392  hopperExitLength_ = exitLength;
393  }
394  else
395  {
396  logger(ERROR, "[ChuteWithHopper::setHopper()] Hopper exit length must be greater than or equal to zero");
397  exit(-1);
398  }
399 
400  // hopperExitHeight_
401  if (exitHeight < 0.0)
402  {
403  logger(ERROR, "[ChuteWithHopper::setHopper()] Hopper exit height must be greater than or equal to zero");
404  exit(-1);
405  }
406  else if (exitHeight > hopperCornerHeight + mathsFunc::tan(getChuteAngle()) * exitLength)
407  {
408  logger(ERROR,
409  "[ChuteWithHopper::setHopper()] Hopper exit height (%) may not exceed height of hopper corner above chute bottom (%)",
410  exitHeight, hopperCornerHeight + mathsFunc::tan(getChuteAngle()) * exitLength);
411  exit(-1);
412  }
413  else //(exitHeight >= 0.0) /// \todo write check: exitHeight may NOT exceed vertical distance between chute base and hopper corner!
414  {
415  hopperExitHeight_ = exitHeight;
416  }
417 
419 
420  if (angle > 0.0 && angle < 90.0)
421  {
422  hopperAngle_ = angle * constants::pi / 180.0;
423  }
424  else
425  {
426  logger(ERROR, "[ChuteWithHopper::setHopper()] Hopper angle must in (0,90)");
427  exit(-1);
428  }
429 
430  if (length > exitLength)
431  {
432  hopperLength_ = length;
433  }
434  else
435  {
436  logger(ERROR, "[ChuteWithHopper::setHopper()] Hopper length must be greater than exit length");
437  exit(-1);
438  }
439 
440  // check hopper 'corner height', i.e. the vertical position of point 'B' as compared to the start of the hopper
441  // Mdouble hopperCornerHeight = height - 0.5 * (length - exitLength) / std::tan(hopperAngle_ * constants::pi / 180.0);
442  if (hopperCornerHeight <= 0.0)
443  {
444  // hopperHeight_ += -hopperCornerHeight + problem.getMaxInflowParticleRadius();
445  // hopperCornerHeight = problem.getMaxInflowParticleRadius();
446  logger(ERROR,
447  "[ChuteWithHopper::setHopper()] height of hopper corner (%) may not be below 0. Increase hopper height to fix.",
448  hopperCornerHeight);
449  exit(-1);
450  }
451  const Mdouble heightCompare = (getHopperLowestPoint() +
453 
454  logger(VERBOSE, " ");
455  logger(VERBOSE, "[ChuteWithHopper::setHopper()] Setting the following hopper geometrical properties:");
456  logger(VERBOSE, " hopperLowestPoint_: %, ", getHopperLowestPoint());
457  logger(VERBOSE, " hopperLength_: %, ", hopperLength_);
458  logger(VERBOSE, " hopperExitLength_: %, ", hopperExitLength_);
459  logger(VERBOSE, " hopperAngle_: %, ", hopperAngle_);
460  logger(VERBOSE, " height: %, ", height);
461  logger(VERBOSE, " comparing height: % ", heightCompare);
462  logger(VERBOSE, " ");
463 
464  //This a semi-ugly fix to check whether height>=Heightcompare and does not take into account rounding errors
465  if ((height - heightCompare) > -1e-6 * heightCompare)
466  {
467  hopperHeight_ = height;
468  }
469  else
470  {
471  logger(ERROR,
472  "[ChuteWithHopper::setHopper()] For these settings, hopper height must be greater then or equal to %, see drawing",
473  heightCompare);
474  exit(-1);
476  }
477 
478  logger(VERBOSE, " ");
479  logger(VERBOSE, "[ChuteWithHopper::setHopper()] Hopper geometry: ");
480  logger(VERBOSE, "hopperHeight_: \t %", hopperHeight_);
481  logger(VERBOSE, "hopperExitLength_: \t %", hopperExitLength_);
482  logger(VERBOSE, "hopperExitHeight_: \t %", hopperExitHeight_);
483  logger(VERBOSE, "hopperAngle_: \t %", hopperAngle_);
484  logger(VERBOSE, "hopperLength_: \t %", hopperLength_);
485  logger(VERBOSE, " ");
486 
487 }
488 
495 {
497 
498  return std::sqrt(2.0 * getGravity().getLength() * height);
499 }
500 
509 {
511  const Mdouble rmin = getMinInflowParticleRadius();
512 
513  if (rmin / dx < 10.)
514  logger(WARN,
515  "[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!",
516  rmin / dx);
517 
518  return rmin / dx;
519 }
520 
527 {
528  return getXMax() - hopperShift_;
529 }
530 
537 {
538  if (chuteLength >= 0.0)
539  {
540  setXMax(chuteLength + hopperShift_);
541  setXMin(0.0);
542  }
543  else
544  {
545  logger(WARN,
546  "[ChuteWithHopper::setChuteLength()] Chute length unchanged, value must be greater than or equal to zero");
547  }
548 }
549 
556 void ChuteWithHopper::setIsHopperCentred(bool isHopperCentred)
557 {
558  isHopperCentred_ = isHopperCentred;
559 }
560 
565 {
566  hopperLowerFillingHeight_ = hopperLowerFillingHeight;
567 }
568 
575 {
576  if (hopperShift >= 0.0)
577  {
578  //keeps the ChuteLength constant
579  setXMax(getXMax() + hopperShift - hopperShift_);
580  hopperShift_ = hopperShift;
581  }
582  else
583  {
584  logger(WARN,
585  "[ChuteWithHopper::setHopperShift()] Shift length unchanged, value must be greater than or equal to zero");
586  }
587 }
588 
593 void ChuteWithHopper::read(std::istream& is, ReadOptions opt)
594 {
595  Chute::read(is,opt);
598 }
599 
600 
610 void ChuteWithHopper::write(std::ostream& os, bool writeAllParticles) const
611 {
612  Chute::write(os, writeAllParticles);
613  os << hopperExitLength_ << " " << hopperExitHeight_ << " " << hopperLength_
614  << " " << hopperAngle_ << " " << hopperHeight_ << " " << hopperShift_ << " " << '\n';
615 }
616 
621 {
622  return hopperAngle_;
623 }
624 
629 {
630  return hopperLength_;
631 }
632 
637 {
638  return hopperExitLength_;
639 }
640 
645 {
646  return hopperHeight_;
647 }
648 
654 {
655  return hopperExitHeight_;
656 }
657 
664 {
665  return isHopperCentred_;
666 }
667 
675 {
677 }
678 
684 {
685  return hopperDimension_;
686 }
687 
693 {
694  hopperLift_ = hopperLift;
695 }
696 
702 {
703  return hopperLift_;
704 }
705 
711 {
712  return hopperShift_;
713 }
714 
719 void ChuteWithHopper::setHopperDimension(unsigned int hopperDimension)
720 {
721  hopperDimension_ = hopperDimension;
722 }
723 
727 void ChuteWithHopper::setIsHopperAlignedWithBottom(bool isHopperAlignedWithBottom)
728 {
729  isHopperAlignedWithBottom_ = isHopperAlignedWithBottom;
730 }
731 
738 bool ChuteWithHopper::readNextArgument(int& i, int argc, char* argv[])
739 {
740  if (!strcmp(argv[i], "-hopperLength"))
741  {
742  hopperLength_ = (atof(argv[i + 1]));
743  }
744  else if (!strcmp(argv[i], "-hopperHeight"))
745  {
746  hopperHeight_ = (atof(argv[i + 1]));
747  }
748  else if (!strcmp(argv[i], "-hopperAngle"))
749  {
750  hopperAngle_ = (atof(argv[i + 1]));
751  }
752  else if (!strcmp(argv[i], "-hopperExitLength"))
753  {
754  hopperExitLength_ = (atof(argv[i + 1]));
755  }
756  else if (!strcmp(argv[i], "-hopperExitHeight"))
757  {
758  hopperExitHeight_ = (atof(argv[i + 1]));
759  }
760  else if (!strcmp(argv[i], "-hopperLowerFillingHeight_"))
761  {
762  hopperLowerFillingHeight_ = (atof(argv[i + 1]));
763  }
764  else if (!strcmp(argv[i], "-isHopperCentred"))
765  {
766  isHopperCentred_ = static_cast<bool>(atoi(argv[i + 1]));
767  }
768  else if (!strcmp(argv[i], "-alignBase"))
769  {
770  isHopperAlignedWithBottom_ = static_cast<bool>(atoi(argv[i + 1]));
771  }
772  else if (!strcmp(argv[i], "-shift"))
773  {
774  hopperShift_ = (atof(argv[i + 1]));
775  }
776  else if (!strcmp(argv[i], "-lift"))
777  {
778  hopperLift_ = (atof(argv[i + 1]));
779  }
780  else
781  return Chute::readNextArgument(i, argc, argv); //if argv[i] is not found, check the commands in Chute
782  return true; //returns true if argv[i] is found
783 }
784 
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.
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)
Sets the value of XMax, the upper bound of the problem domain in the x-direction. ...
Definition: DPMBase.cc:1126
The DPMBase header includes quite a few header files, defining all the handlers, which are essential...
Definition: DPMBase.h:72
Mdouble X
the vector components
Definition: Vector.h:65
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 basic particle.
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")
double Mdouble
Definition: GeneralDefine.h:34
void write(std::ostream &os, bool writeAllParticles=true) const override
Writes setup properties to an ostream.
const std::complex< Mdouble > i
Definition: ExtendedMath.h:50
Mdouble getYMin() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMin() returns YMin...
Definition: DPMBase.h:599
Mdouble hopperLowestPoint_
The NEGATIVE z coordinate of the right C point (when the left C point is in the origin) ...
bool readNextArgument(int &i, int argc, char *argv[]) override
This method can be used for reading object properties from a string.
Definition: Chute.cc:518
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)
Sets the value of ZMax, the upper bound of the problem domain in the z-direction. ...
Definition: DPMBase.cc:1178
Mdouble hopperLowerFillingHeight_
Relative height (in [0,1)) above which the hopper is replenished with new particles.
void setChuteLength(Mdouble chuteLength) override
sets xMax to chuteLength+hopperlength_, and thus specifies the length off the runoff chute ...
void setSpecies(const ParticleSpecies *species)
void addObject(Vec3D normal, Vec3D point)
Adds a wall to the set of infinite walls, given a normal vector pointing into the wall (i...
void setHopperShift(Mdouble hopperShift)
Sets the shift in X-direction of the whole setup after rotation.
Boundary structure for boundaries used for insertion of particles.
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 cos(Mdouble x)
Definition: ExtendedMath.cc:64
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...
Definition: DPMBase.h:593
Mdouble getHopperLowestPoint() const
Returns the vertical distance of the lowest hopper point relative to the start of the chute...
Creates chutes with different bottoms. Inherits from Mercury3D (-> MercuryBase -> DPMBase)...
Definition: Chute.h:64
This is the base class for both Mercury2D and Mercury3D. Note the actually abstract grid is defined i...
Definition: MercuryBase.h:125
Mdouble getMaxInflowParticleRadius() const
Returns the maximum radius of inflow particles.
Definition: Chute.cc:882
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 sin(Mdouble x)
Definition: ExtendedMath.cc:44
Mdouble getTimeStepRatio() const
Returns smallest particle radius over maximum gravitational velocity.
const Mdouble pi
Definition: ExtendedMath.h:45
BoundaryHandler boundaryHandler
An object of the class BoundaryHandler which concerns insertion and deletion of particles into or fro...
Definition: DPMBase.h:1344
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.
bool readNextArgument(int &i, int argc, char *argv[]) override
Reads setup properties from a string.
Mdouble getFixedParticleRadius() const
Returns the particle radius of the fixed particles which constitute the (rough) chute bottom...
Definition: Chute.cc:634
T tan(T x)
Definition: ExtendedMath.h:176
void setupSideWalls()
Creates chute side walls (either solid or periodic)
Definition: Chute.cc:296
This adds on the hierarchical grid code for 3D problems.
Definition: Mercury3D.h:36
void setXMin(Mdouble newXMin)
Sets the value of XMin, the lower bound of the problem domain in the x-direction. ...
Definition: DPMBase.cc:971
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created...
Definition: DPMBase.h:1329
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.
Definition: BaseHandler.h:613
ChuteWithHopper()
This is the default constructor.
Vec3D getGravity() const
Returns the gravitational acceleration.
Definition: DPMBase.cc:1351
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.
Definition: BaseHandler.h:379
void read(std::istream &is, ReadOptions opt=ReadOptions::ReadAll) override
Reads all chute properties from an istream.
Definition: Chute.cc:139
Mdouble getHopperAngle() const
Returns the angle of the hopper entrance relative to the vertical.
void set(BaseParticle *particleToCopy, unsigned 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 setInsertionBoundary(InsertionBoundary *insertionBoundary)
Sets the chute insertion boundary.
Definition: Chute.cc:1013
static Vec3D cross(const Vec3D &a, const Vec3D &b)
Calculates the cross product of two Vec3D: .
Definition: Vector.cc:163
void read(std::istream &is, ReadOptions opt=ReadOptions::ReadAll) override
Reads setup properties from an istream.
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. LinearViscoelasticSpecies, etc.
Definition: DPMBase.h:1319
Mdouble getYMax() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMax() returns XMax...
Definition: DPMBase.h:605
Mdouble getChuteAngle() const
Returns the chute angle (in radians)
Definition: Chute.cc:742
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.
Definition: DPMBase.h:1339
virtual void createBottom()
Creates the chute bottom, which can be either flat or one of three flavours of rough.
Definition: Chute.cc:331
Mdouble getMinInflowParticleRadius() const
returns the minimum radius of inflow particles
Definition: Chute.cc:873
Inherits from InsertionBoundary Some images are useful to better understand the structure of both the...
void write(std::ostream &os, bool writeAllParticles=true) const override
This function writes the Chute properties to an ostream, and adds the properties of ALL chute particl...
Definition: Chute.cc:206
bool isHopperAlignedWithBottom_
This is the flag, which sets if the chute bottom is aligned with the hopper, by default it is...
static Mdouble getLengthSquared(const Vec3D &a)
Calculates the squared length of a Vec3D: .
Definition: Vector.h:316
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;.
void setIsHopperCentred(bool isHopperCentred)
Sets an extra shift in X-direction of the whole system.
Definition: Vector.h:49
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
Returns the simulation time step.
Definition: DPMBase.cc:1211
void constructor()
This is the actually constructor, get called by all constructors above.
void setupInitialConditions() override
Sets up the initial conditions for the problem.
Mdouble Z
Definition: Vector.h:65
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.
ReadOptions
Definition: DPMBase.h:240
unsigned int getMaxFailed() const
Returns the number of times a particle will be tried to be added to the insertion boundary...
Definition: Chute.cc:772