MercuryDPM  Beta
 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-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 #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
142  BaseParticle* p1 = new BaseParticle();
148  setInsertionBoundary(dynamic_cast<InsertionBoundary*>(boundaryHandler.getLastObject()));
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  Mdouble s = sin(getChuteAngle());
176  Mdouble c = 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  Mdouble HopperCornerHeight = hopperHeight_ - 0.5 * (hopperLength_ - hopperExitLength_) / tan(hopperAngle_);
186  // Waarom had ik deze ook al weer gecomment?
187  //if (HopperCornerHeight<=0.0) { hopperHeight_ += -HopperCornerHeight + P0.getRadius(); HopperCornerHeight = P0.getRadius(); }
188 
189  // first we create the LEFT hopper wall
190 
191  // coordinates of A,B,C in (vertical parallel to flow, vertical normal to flow, horizontal) direction
192  A = Vec3D(-0.5 * (hopperLength_ - hopperExitLength_), 0.0, hopperHeight_);
193  B = Vec3D(0.0, 0.0, HopperCornerHeight);
194  C = Vec3D(0.0, 0.0, 0.0);
195 
196  // now rotate the coordinates of A,B,C to be in (x,y,z) direction
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);
200 
201  // the position of A determines hopper shift and zmax
207  if (isHopperCentred_)
208  setHopperShift(-A.X + 40);
209  else
210  setHopperShift(-A.X);
211 
212  setZMax(A.Z);
213  A.X += hopperShift_;
214  B.X += hopperShift_;
215  C.X += hopperShift_;
216 
217  //This lifts the hopper a distance above the chute
218  A.Z += hopperLift_;
219  B.Z += hopperLift_;
220  C.Z += hopperLift_;
221 
222  //create a finite wall from B to A and from C to B on the left hand side
223  IntersectionOfWalls w_Left;
224  temp = B - A;
225  normal = Vec3D(temp.Z, 0.0, -temp.X) / sqrt(temp.getLengthSquared());
226  w_Left.addObject(normal, A);
227  temp = C - B;
228  normal = Vec3D(temp.Z, 0.0, -temp.X) / sqrt(temp.getLengthSquared());
229  w_Left.addObject(normal, B);
230  temp = A - C;
231  normal = Vec3D(temp.Z, 0.0, -temp.X) / sqrt(temp.getLengthSquared());
232  w_Left.addObject(normal, C);
234 
235  //next, do the same for the right wall
237  B = Vec3D(0.5 * (hopperLength_ + hopperExitLength_) - 0.5 * (hopperLength_ - hopperExitLength_), 0.0, HopperCornerHeight);
239 
240  //This rotates the right points
241  A = Vec3D(c * A.X - s * A.Z + hopperShift_, 0.0, s * A.X + c * A.Z);
242  B = Vec3D(c * B.X - s * B.Z + hopperShift_, 0.0, s * B.X + c * B.Z);
243  C = Vec3D(c * C.X - s * C.Z + hopperShift_, 0.0, s * C.X + c * C.Z);
244 
245  //This lifts the hopper a distance above the chute
246  A.Z += hopperLift_;
247  B.Z += hopperLift_;
248  C.Z += hopperLift_;
249 
250  //create a finite wall from B to A and from C to B on the right hand side
251  IntersectionOfWalls w_Right;
252  temp = A - B;
253  normal = Vec3D(temp.Z, 0.0, -temp.X) / sqrt(temp.getLengthSquared());
254  w_Right.addObject(normal, A);
255  temp = B - C;
256  normal = Vec3D(temp.Z, 0.0, -temp.X) / sqrt(temp.getLengthSquared());
257  w_Right.addObject(normal, B);
258  temp = C - A;
259  normal = Vec3D(temp.Z, 0.0, -temp.X) / sqrt(temp.getLengthSquared());
260  w_Right.addObject(normal, C);
261  wallHandler.copyAndAddObject(w_Right);
262 
263  setZMax(A.Z);
264 
265  // if hopperDimension_ == 2, create inclined hopper walls (like in the X-direction) also in the Y-direction.
266  // (Else, place vertical (possibly periodic) walls in Y-direction. -> not mentioned here, where is this arranged? (BvdH))
267  if (hopperDimension_ == 2)
268  {
269  //coordinates of A,B,C in (vertical parallel to flow,vertical normal to flow, horizontal) direction
270  A = Vec3D(0.0, (getYMax() - getYMin() - hopperLength_) / 2.0, hopperHeight_);
271  B = Vec3D(0.0, (getYMax() - getYMin() - hopperExitLength_) / 2.0, HopperCornerHeight);
272  C = Vec3D(0.0, (getYMax() - getYMin() - hopperExitLength_) / 2.0, 0.0);
273 
274  //now rotate the coordinates of A,B,C to be in (x,y,z) direction
275  A = Vec3D(c * A.X - s * A.Z, A.Y, s * A.X + c * A.Z);
276  B = Vec3D(c * B.X - s * B.Z, B.Y, s * B.X + c * B.Z);
277  C = Vec3D(c * C.X - s * C.Z, C.Y, s * C.X + c * C.Z);
278  // the position of A determines shift and zmax
279  A.X += hopperShift_;
280  B.X += hopperShift_;
281  C.X += hopperShift_;
282 
283  //This lifts the hopper a distance above the chute
284  A.Z += hopperLift_;
285  B.Z += hopperLift_;
286  C.Z += hopperLift_;
287 
288  //create a finite wall from B to A and from C to B
289  IntersectionOfWalls w_Back;
290  temp = B - A;
291  normal = Vec3D::cross(Vec3D(-c, 0, -s), temp) / sqrt(temp.getLengthSquared());
292  //normal = Vec3D(0.0,temp.Z,-temp.Y) / sqrt(temp.GetLength2());
293  w_Back.addObject(normal, A);
294  temp = C - B;
295  //normal = Vec3D(0.0,temp.Z,-temp.Y) / sqrt(temp.GetLength2());
296  normal = Vec3D::cross(Vec3D(-c, 0, -s), temp) / sqrt(temp.getLengthSquared());
297  w_Back.addObject(normal, B);
298  temp = A - C;
299  //normal = Vec3D(0.0,temp.Z,-temp.Y)/sqrt(temp.GetLength2());
300  normal = Vec3D::cross(Vec3D(-c, 0, -s), temp) / sqrt(temp.getLengthSquared());
301  w_Back.addObject(normal, C);
303 
304  //Now for the right y-wall
305  A = Vec3D(0.0, (getYMax() - getYMin() + hopperLength_) / 2.0, hopperHeight_);
306  B = Vec3D(0.0, (getYMax() - getYMin() + hopperExitLength_) / 2.0, HopperCornerHeight);
307  C = Vec3D(0.0, (getYMax() - getYMin() + hopperExitLength_) / 2.0, 0.0);
308 
309  //now rotate the coordinates of A,B,C to be in (x,y,z) direction
310  A = Vec3D(c * A.X - s * A.Z, A.Y, s * A.X + c * A.Z);
311  B = Vec3D(c * B.X - s * B.Z, B.Y, s * B.X + c * B.Z);
312  C = Vec3D(c * C.X - s * C.Z, C.Y, s * C.X + c * C.Z);
313  // the position of A determines shift and zmax
314  A.X += hopperShift_;
315  B.X += hopperShift_;
316  C.X += hopperShift_;
317 
318  //This lifts the hopper a distance above the chute
319  A.Z += hopperLift_;
320  B.Z += hopperLift_;
321  C.Z += hopperLift_;
322 
323  //create a finite wall from B to A and from C to B
324  IntersectionOfWalls w_Front;
325  temp = A - B;
326  normal = Vec3D::cross(Vec3D(-c, 0, -s), temp) / sqrt(temp.getLengthSquared());
327  //normal = Vec3D(0.0,-temp.Z,temp.Y) / sqrt(temp.GetLength2());
328  w_Front.addObject(normal, A);
329  temp = B - C;
330  //normal = Vec3D(0.0,-temp.Z,temp.Y) / sqrt(temp.GetLength2());
331  normal = Vec3D::cross(Vec3D(-c, 0, -s), temp) / sqrt(temp.getLengthSquared());
332  w_Front.addObject(normal, B);
333  temp = C - A;
334  //normal = Vec3D(0.0,-temp.Z,temp.Y)/sqrt(temp.GetLength2());
335  normal = Vec3D::cross(Vec3D(-c, 0, -s), temp) / sqrt(temp.getLengthSquared());
336  w_Front.addObject(normal, C);
337  wallHandler.copyAndAddObject(w_Front);
338  }
339 
340  //now shift the chute as well, i.e. apply the shift to all the fixed particles
341  // at the bottom of the chute
342  for (std::vector<BaseParticle*>::iterator it = particleHandler.begin(); it != particleHandler.end(); ++it)
343  {
344  (*it)->move(Vec3D(hopperShift_, 0.0, 0.0));
345  }
346 }
347 
354 {
355  hopperLowestPoint_ = hopperLowestPoint;
356 }
358 {
359  return hopperLowestPoint_;
360 }
361 
374 void ChuteWithHopper::setHopper(Mdouble ExitLength, Mdouble ExitHeight, Mdouble Angle, Mdouble Length, Mdouble Height)
375 {
376  // HopperCornerHeight: helper variable, just here to check some things
377  Mdouble HopperCornerHeight = Height - 0.5 * (Length - ExitLength) / std::tan(Angle * constants::pi / 180.0);
378 
379  if (ExitLength >= 0.0)
380  {
381  hopperExitLength_ = ExitLength;
382  }
383  else
384  {
385  logger(ERROR,"[ChuteWithHopper::setHopper()] Hopper exit length must be greater than or equal to zero");
386  exit(-1);
387  }
388 
389  // hopperExitHeight_
390  if (ExitHeight < 0.0)
391  {
392  logger(ERROR,"[ChuteWithHopper::setHopper()] Hopper exit height must be greater than or equal to zero");
393  exit(-1);
394  }
395  else if(ExitHeight > HopperCornerHeight + std::tan(getChuteAngle())*ExitLength )
396  {
397  logger(ERROR,"[ChuteWithHopper::setHopper()] Hopper exit height (%) may not exceed height of hopper corner above chute bottom (%)", ExitHeight, HopperCornerHeight + std::tan(getChuteAngle())*ExitLength );
398  exit(-1);
399  }
400  else //(ExitHeight >= 0.0) /// \todo write check: ExitHeight may NOT exceed vertical distance between chute base and hopper corner!
401  {
402  hopperExitHeight_ = ExitHeight;
403  }
404 
406 
407  if (Angle > 0.0 && Angle < 90.0)
408  {
409  hopperAngle_ = Angle * constants::pi / 180.0;
410  }
411  else
412  {
413  logger(ERROR,"[ChuteWithHopper::setHopper()] Hopper angle must in (0,90)");
414  exit(-1);
415  }
416 
417  if (Length > ExitLength)
418  {
419  hopperLength_ = Length;
420  }
421  else
422  {
423  logger(ERROR,"[ChuteWithHopper::setHopper()] Hopper length must be greater than exit length");
424  exit(-1);
425  }
426 
427  // check hopper 'corner height', i.e. the vertical position of point 'B' as compared to the start of the hopper
428  // Mdouble HopperCornerHeight = Height - 0.5 * (Length - ExitLength) / std::tan(hopperAngle_ * constants::pi / 180.0);
429  if (HopperCornerHeight <= 0.0)
430  {
431  // hopperHeight_ += -HopperCornerHeight + problem.getMaxInflowParticleRadius();
432  // HopperCornerHeight = problem.getMaxInflowParticleRadius();
433  logger(ERROR,"[ChuteWithHopper::setHopper()] height of hopper corner (%) may not be below 0. Increase hopper height to fix.", HopperCornerHeight);
434  exit(-1);
435  }
436 
437  logger(VERBOSE, " ");
438  logger(VERBOSE, "[ChuteWithHopper::setHopper()] Setting the following hopper geometrical properties:");
439  logger(VERBOSE, " hopperLowestPoint_: %, ", getHopperLowestPoint());
440  logger(VERBOSE, " hopperLength_: %, ", hopperLength_);
441  logger(VERBOSE, " hopperExitLength_: %, ", hopperExitLength_);
442  logger(VERBOSE, " hopperAngle_: %, ", hopperAngle_);
443  logger(VERBOSE, " Height: %, ", Height);
444  logger(VERBOSE, " comparing height: % ", getHopperLowestPoint() + 0.5*(hopperLength_+hopperExitLength_) / tan(hopperAngle_));
445  logger(VERBOSE, " ");
446 
447  Mdouble HeightCompare = (getHopperLowestPoint() + 0.5 * (hopperLength_ + hopperExitLength_) / tan(hopperAngle_));
448  //This a semi-ugly fix to check whether Height>=Heightcompare and does not take into account rounding errors
449  if ((Height - HeightCompare) > -1e-6 * HeightCompare)
450  {
451  hopperHeight_ = Height;
452  }
453  else
454  {
455  logger(ERROR,"[ChuteWithHopper::setHopper()] For these settings, hopper height must be greater then or equal to %, see drawing", HeightCompare);
456  exit(-1);
458  }
459 
460  logger(VERBOSE, " ");
461  logger(VERBOSE, "[ChuteWithHopper::setHopper()] Hopper geometry: ");
462  logger(VERBOSE, "hopperHeight_: \t %", hopperHeight_);
463  logger(VERBOSE, "hopperExitLength_: \t %", hopperExitLength_);
464  logger(VERBOSE, "hopperExitHeight_: \t %", hopperExitHeight_);
465  logger(VERBOSE, "hopperAngle_: \t %", hopperAngle_);
466  logger(VERBOSE, "hopperLength_: \t %", hopperLength_);
467  logger(VERBOSE, " ");
468 
469 }
470 
477 {
478  Mdouble height = hopperHeight_ + (getXMax() - hopperShift_) * sin(getChuteAngle());
479 
480  return sqrt(2.0 * getGravity().getLength() * height);
481 }
482 
491 {
494 
495  if (rmin/dx < 10.)
496  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);
497 
498  return rmin/dx;
499 }
500 
507 {
508  return getXMax() - hopperShift_;
509 }
510 
517 {
518  if (chuteLength >= 0.0)
519  {
520  setXMax(chuteLength + hopperShift_);
521  setXMin(0.0);
522  }
523  else
524  logger(WARN,"[ChuteWithHopper::setChuteLength()] Chute length unchanged, value must be greater than or equal to zero");
525 }
526 
533 void ChuteWithHopper::setIsHopperCentred(bool isHopperCentred)
534 {
535  isHopperCentred_ = isHopperCentred;
536 }
537 
542 {
543  hopperLowerFillingHeight_ = hopperLowerFillingHeight;
544 }
545 
552 {
553  if (hopperShift >= 0.0)
554  {
555  //keeps the ChuteLength constant
556  setXMax(getXMax() + hopperShift - hopperShift_);
557  hopperShift_ = hopperShift;
558  }
559  else
560  logger(WARN, "[ChuteWithHopper::setHopperShift()] Shift length unchanged, value must be greater than or equal to zero");
561 }
562 
567 void ChuteWithHopper::read(std::istream& is)
568 {
569  Chute::read(is);
572 }
573 
574 
584 void ChuteWithHopper::write(std::ostream& os, bool writeAllParticles) const
585 {
586  Chute::write(os, writeAllParticles);
587  os << hopperExitLength_ << " " << hopperExitHeight_ << " " << hopperLength_
588  << " " << hopperAngle_ << " " << hopperHeight_ << " " << hopperShift_ << " " << std::endl;
589 }
590 
595 {
596  return hopperAngle_;
597 }
598 
603 {
604  return hopperLength_;
605 }
606 
611 {
612  return hopperExitLength_;
613 }
614 
619 {
620  return hopperHeight_;
621 }
622 
628 {
629  return hopperExitHeight_;
630 }
631 
638 {
639  return isHopperCentred_;
640 }
641 
649 {
651 }
652 
658 {
659  return hopperDimension_;
660 }
661 
667 {
668  hopperLift_ = hopperLift;
669 }
670 
676 {
677  return hopperLift_;
678 }
679 
685 {
686  return hopperShift_;
687 }
688 
694 {
695  hopperDimension_ = hopperDimension;
696 }
697 
701 void ChuteWithHopper::setIsHopperAlignedWithBottom(bool isHopperAlignedWithBottom)
702 {
703  isHopperAlignedWithBottom_ = isHopperAlignedWithBottom;
704 }
705 
712 bool ChuteWithHopper::readNextArgument(int& i, int argc, char *argv[])
713 {
714  if (!strcmp(argv[i], "-hopperLength"))
715  {
716  hopperLength_ = (atof(argv[i + 1]));
717  }
718  else if (!strcmp(argv[i], "-hopperHeight"))
719  {
720  hopperHeight_ = (atof(argv[i + 1]));
721  }
722  else if (!strcmp(argv[i], "-hopperAngle"))
723  {
724  hopperAngle_ = (atof(argv[i + 1]));
725  }
726  else if (!strcmp(argv[i], "-hopperExitLength"))
727  {
728  hopperExitLength_ = (atof(argv[i + 1]));
729  }
730  else if (!strcmp(argv[i], "-hopperExitHeight"))
731  {
732  hopperExitHeight_ = (atof(argv[i + 1]));
733  }
734  else if (!strcmp(argv[i], "-hopperLowerFillingHeight_"))
735  {
736  hopperLowerFillingHeight_ = (atof(argv[i + 1]));
737  }
738  else if (!strcmp(argv[i], "-isHopperCentred"))
739  {
740  isHopperCentred_ = (atoi(argv[i + 1]));
741  }
742  else if (!strcmp(argv[i], "-alignBase"))
743  {
744  isHopperAlignedWithBottom_ = (atoi(argv[i + 1]));
745  }
746  else if (!strcmp(argv[i], "-shift"))
747  {
748  hopperShift_ = (atof(argv[i + 1]));
749  }
750  else if (!strcmp(argv[i], "-lift"))
751  {
752  hopperLift_ = (atof(argv[i + 1]));
753  }
754  else
755  return Chute::readNextArgument(i, argc, argv); //if argv[i] is not found, check the commands in Chute
756  return true; //returns true if argv[i] is found
757 }
758 
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: .
Definition: Vector.cc:304
void setXMax(Mdouble newXMax)
If the length of the problem domain in x-direction is XMax - XMin, this method sets XMax...
Definition: DPMBase.cc:309
The DPMBase header includes quite a few header files, defining all the handlers, which are essential...
Definition: DPMBase.h:61
Mdouble X
the vector components
Definition: Vector.h:52
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...
Mdouble getHopperLength()
Returns the width of the hopper entrance.
A IntersectionOfWalls is convex polygon defined as an intersection of InfiniteWall's.
Mdouble hopperExitHeight_
Dimension of the hopper exit in vertical direction.
Mdouble getChuteLength()
Allows chute length to be accessed.
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
Mdouble getHopperShift()
Returns the shift in X-direction of the whole setup after rotation.
void setHopper(Mdouble ExitLength, Mdouble ExitHeight, Mdouble Angle, Mdouble Length, Mdouble Height)
Sets the hopper's geometrical properties.
Mdouble getYMin() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMin() returns YMin...
Definition: DPMBase.cc:238
const std::vector< T * >::const_iterator end() const
Gets the end of the const_iterator over all BaseBoundary in this BaseHandler.
Definition: BaseHandler.h:494
double Mdouble
Mdouble hopperLowestPoint_
The NEGATIVE z coordinate of the right C point (when the left C point is in the origin) ...
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...
Definition: DPMBase.cc:338
Mdouble hopperLowerFillingHeight_
Relative height (in [0,1)) above which the hopper is replenished with new particles.
void setSpecies(const ParticleSpecies *species)
Mdouble getHopperLowestPoint()
Returns the vertical distance of the lowest hopper point relative to the start of the chute...
bool getIsHopperCentred()
Returns whether the setup is shifted another 40 units in X-direction.
Mdouble getHopperAngle()
Returns the angle of the hopper entrance relative to the vertical.
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.
const std::vector< T * >::const_iterator begin() const
Gets the begin of the const_iterator over all Object in this BaseHandler.
Definition: BaseHandler.h:482
Mdouble getXMax() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMax() returns XMax...
Definition: DPMBase.cc:231
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...
Definition: Chute.cc:180
Creates chutes with different bottoms. Inherits from Mercury3D (-> MercuryBase -> DPMBase)...
Definition: Chute.h:62
This is the base class for both Mercury2D and Mercury3D. Note the actually abstract grid is defined i...
Definition: MercuryBase.h:74
Mdouble getMaxInflowParticleRadius() const
Returns the maximum radius of inflow particles.
Definition: Chute.cc:789
Mdouble hopperShift_
The x position where the Chute starts (defined as the beginning of the hopper)
U * copyAndAddObject(const U &O)
Creates a copy of a Object and adds it to the BaseHandler.
Definition: BaseHandler.h:268
const Mdouble pi
Definition: ExtendedMath.h:42
BoundaryHandler boundaryHandler
An object of the class BoundaryHandler which concerns insertion and deletion of particles into or fro...
Definition: DPMBase.h:888
unsigned int getHopperDimension()
Returns whether the hopper has vertical (1) or inclined (2) walls in Y-direction. ...
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...
Definition: Chute.cc:552
void setupSideWalls()
Creates chute side walls (either solid or periodic)
Definition: Chute.cc:254
This adds on the hierarchical grid code for 3D problems.
Definition: Mercury3D.h:35
void setXMin(Mdouble newXMin)
If the length of the problem domain in x-direction is XMax - XMin, this method sets XMin...
Definition: DPMBase.cc:266
Mdouble getHopperFillingPercentage()
Returns the vertical percentage of the hopper insertion boundary which is filled. ...
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created...
Definition: DPMBase.h:878
T * getObject(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
Definition: BaseHandler.h:415
Mdouble getHopperHeight()
Returns the height of the hopper relative to the chute start.
Mdouble getHopperExitHeight()
Returns the height of the lowest hopper point above the chute.
ChuteWithHopper()
This is the default constructor.
Vec3D getGravity() const
Returns the gravity vector.
Definition: DPMBase.cc:438
bool readNextArgument(int &i, int argc, char *argv[])
This method can be used for reading object properties from a string.
Definition: Chute.cc:444
void setInsertionBoundary(InsertionBoundary *insertionBoundary)
Sets the chute insertion boundary.
Definition: Chute.cc:920
static Vec3D cross(const Vec3D &a, const Vec3D &b)
Calculates the cross product of two Vec3D: .
Definition: Vector.cc:268
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...
Definition: DPMBase.h:868
Mdouble getHopperLift()
Returns the hopper's lift above the chute bottom plane.
Mdouble getYMax() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMax() returns XMax...
Definition: DPMBase.cc:245
virtual void read(std::istream &is)
Reads setup properties from an istream.
Mdouble getChuteAngle() const
Returns the chute angle (in radians)
Definition: Chute.cc:653
WallHandler wallHandler
An object of the class WallHandler. Contains pointers to all the walls created.
Definition: DPMBase.h:883
virtual void createBottom()
Creates the chute bottom, which can be either flat or one of three flavours of rough.
Definition: Chute.cc:288
Mdouble getHopperExitLength()
Returns the width of the hopper exit.
Mdouble getMinInflowParticleRadius() const
returns the minimum radius of inflow particles
Definition: Chute.cc:780
Inherits from InsertionBoundary Some images are useful to better understand the structure of both the...
Mdouble getMaximumVelocityInducedByGravity()
Returns the theoretical maximum particle velocity due to gravity.
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.
Definition: Chute.cc:133
Mdouble hopperHeight_
Dimension of the hopper in horizontal direction.
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.
Definition: BaseHandler.h:452
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).
Definition: Vector.h:45
void setHopperDimension(Mdouble hopperDimension)
Sets whether the hopper should have vertical (1) or inclined (2) walls in Y-direction.
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.
Definition: DPMBase.cc:368
void constructor()
This is the actually constructor, get called by all constructors above.
Mdouble Z
Definition: Vector.h:52
void setIsHopperAlignedWithBottom(bool isHopperAlignedWithBottom)
Sets the alignment of hopper with chute bottom.
Mdouble getTimeStepRatio()
Returns smallest particle radius over maximum gravitational velocity.
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...
Definition: Chute.cc:680