Particles on an inclined chute

Problem description

File ChuteDemo.cpp treats particles cascading down an inclined chute. The entire code of this problem can be viewed here: Particles on an inclined chute (code).

Headers

The following headers are included:

The particle species is manually set here, and therefore needs to be included. We're treating a chute problem here, and the Chute class needs to be included therefore as well. The particles, walls and boundaries classes are already implemented by the chute class and don't need inclusion here.

<tt> int %main()</tt>

Since the whole structure of the problem is already implemented in the Chute class, no separate class needs to be set up. The setup of initial conditions of the Chute class is shortly treated at the end of this section.
The main driver program starts by initialising a Chute object. Next, the most basic problem properties are set, namely its name (which determines the naming of the data output files), save count (which is the number of time steps skipped between every saved one), particle collision time (which is a species property, but also used in setting the time step), time step and maximum time. Note, that the total number of time steps saved to the output files is not directly set, but is equal to the maximum time divided by time step size and save count.

// Problem parameters
Chute problem;
problem.setName("ChuteDemo"); // data output file name
problem.setGravity({0,-1,0});
problem.setSaveCount(102); // number of time steps skipped between saves
Mdouble tc = 2.5e-3; // collision time
problem.setTimeStep(0.02 * tc); // actual time step
problem.setTimeMax(0.5); // maximum time
// NB: number of time steps saved to output files
// is timeMax/(timeStep*saveCount)
double Mdouble
Definition: GeneralDefine.h:34
Creates chutes with different bottoms. Inherits from Mercury3D (-> MercuryBase -> DPMBase).
Definition: Chute.h:65
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:408
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:422
void setTimeStep(Mdouble newDt)
Sets a new value for the simulation time step.
Definition: DPMBase.cc:1234
void setTimeMax(Mdouble newTMax)
Sets a new value for the maximum simulation duration.
Definition: DPMBase.cc:873
void setGravity(Vec3D newGravity)
Sets a new value for the gravitational acceleration.
Definition: DPMBase.cc:1383


Next, the particle properties are set. setFixedParticleRadius() sets the radius of the fixed chute bottom particles, while setInflowParticleRadius() sets the inflow particles to be monidisperse with the given particle radius. If inflow particles with random radii are desired, setMinInflowParticleRadius() and setMaxInflowParticleRadius() can be used instead to set the minimum and maximum particle radius, respectively.
The particle species (i.e. its intrinsic material properties) are set next, by specifying the density (species.setDensity()) and the characteristic collision time and coefficient of restitution (with a typical particle mass given; species.setCollisionTimeAndRestitutionCoefficient( \( t_c, r_c, m\))).

// Particle radii
problem.setFixedParticleRadius(0.001); // radius of fixed chute bottom particles
problem.setInflowParticleRadius(0.001); // radius of (monodisperse) inflow particles
// Particle species
LinearViscoelasticSpecies species; // initialise species
species.setHandler(&problem.speciesHandler); // assign problem species handler to species
species.setDensity(2000); // particle density
0.8, species.getMassFromRadius(problem.getInflowParticleRadius())); // material properties
problem.speciesHandler.copyAndAddObject(species); // assign species to problem species handler
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 setHandler(SpeciesHandler *handler)
Sets the pointer to the handler to which this species belongs.
Definition: BaseSpecies.cc:91
void setInflowParticleRadius(Mdouble inflowParticleRadius)
Sets the radius of the inflow particles to a single one (i.e. ensures a monodisperse inflow).
Definition: Chute.cc:848
Mdouble getInflowParticleRadius() const
Returns the average radius of inflow particles.
Definition: Chute.cc:929
void setFixedParticleRadius(Mdouble fixedParticleRadius)
Sets the particle radius of the fixed particles which constitute the (rough) chute bottom.
Definition: Chute.cc:653
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. LinearViscoelasticSpecies, etc.
Definition: DPMBase.h:1427
void setCollisionTimeAndRestitutionCoefficient(Mdouble tc, Mdouble eps, BaseParticle *p)
Sets k, disp such that it matches a given tc and eps for a collision of two copies of particle p.
Definition: LinearViscoelasticNormalSpecies.cc:212
void setDensity(Mdouble density)
Definition: ParticleSpecies.cc:108
Mdouble getMassFromRadius(Mdouble radius) const
Definition: ParticleSpecies.cc:123


The chute properties are subsequently set by specifying the chute's length, width and angle relative to the horizontal.

// Chute properties
problem.setChuteAngle(30.0); // set angle of chute relative to horizontal
problem.setXMax(0.1); // chute length = 0.1
problem.setYMax(2.0 * problem.getInflowParticleRadius()); // chute width = 1 particle diameter
void setChuteAngle(Mdouble chuteAngle)
Sets gravity vector according to chute angle (in degrees)
Definition: Chute.cc:768
void setYMax(Mdouble newYMax)
Sets the value of YMax, the upper bound of the problem domain in the y-direction.
Definition: DPMBase.cc:1191
void setXMax(Mdouble newXMax)
Sets the value of XMax, the upper bound of the problem domain in the x-direction.
Definition: DPMBase.cc:1165


The chute inflow parameters (besides the previously set inflow particle properties) are set by specifying the inflow height (in Z-direction), the mean iflow particle velocity (in X-direction), and the particle velocity variance (in ratio of the mean velocity).

// Inflow properties
problem.setInflowHeight(0.1); // particle inflow between 0 <= Z <= 0.1
problem.setInflowVelocity(0.1); // particle inflow mean velocity
problem.setInflowVelocityVariance(0.02); // particle inflow velocity variance (in ratio of the mean velocity)
//Write paraview data
//problem.setParticlesWriteVTK(true);
//problem.wallHandler.setWriteVTK(true);
void setInflowVelocityVariance(Mdouble inflowVelocityVariance)
Sets the inflow velocity variance.
Definition: Chute.cc:1010
void setInflowVelocity(Mdouble inflowVelocity)
Sets the average inflow velocity.
Definition: Chute.cc:983
void setInflowHeight(Mdouble inflowHeight)
Sets maximum inflow height (Z-direction)
Definition: Chute.cc:957


After all the problem parameters are specified, the simulation is run by calling the solve() method.

problem.solve();

\anchor ChuteSetupInitialConditions Chute::setupInitialConditions()

{
{
logger(FATAL, "[Chute::setupInitialConditions()] Chute % cannot "
"complete because no species have been defined.", getName());
}
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
@ FATAL
virtual unsigned int getNumberOfObjects() const
Gets the number of real Object in this BaseHandler. (i.e. no mpi or periodic particles)
Definition: BaseHandler.h:648
void setupInitialConditions() override
Creates bottom, side walls and a particle insertion boundary.
Definition: Chute.cc:242
const std::string & getName() const
Returns the name of the file. Does not allow to change it though.
Definition: DPMBase.cc:399

The setup of initial conditions of the Chute class starts by checking for the presence of a species, and returns an error if there is none. Make sure therefore that you assign a species to the Chute object's speciesHandler before you call the solve() method.
After that, the side walls (in the Y-direction) are set up by calling Chute::setSideWalls(). These are set to be solid, infinite walls by default, but can be set to be periodic instead by setting Chute::isChutePeriodic_ to be true.
A particle is then created (on the heap) which is assigned the first (and only) species in the speciesHandler which we earlier specified in the driver (ChuteDemo.cpp).
A ChuteInsertionBoundary is created, and its parameters subsequently set by its set() method. The set() method arguments are, respectively:

  • p: the previously specified particle
  • maxFailed_: internally used parameter
  • Vec3D(getXMin(), getYMin(), getZMin()): the first defining corner of the cuboidal insertion boundary
  • Vec3D(getXMax(), getYMax(), getZMax()): the second defining corner of the cuboidal insertion boundary
  • min- / maxInflowParticleRadius_: the minimum and maximum radii of inflow particles
  • fixedParticleRadius_: the particle radius making up the chute bottom
  • inflowVelocity(Variance)_: the mean velocity of inflow particles and the allowed variance about the mean

After setting the insertion boundary characteristics, it is added to the problem's boundaryHandler.
Lastly, the chute's bottom is created. The type of bottom created may be set by calling the Chute::setRoughBottomType() method in the driver, giving either of the following four arguments (which are of type enum RoughBottomType):

  • FLAT: just a flat wall (of the species given in the driver)
  • MONOLAYER_ORDERED: (a single layer of) fixed particles in a rectangular grid pattern
  • MONOLAYER_DISORDERED: (default) a single layer of randomly placed particles
  • MULTILAYER: a few layers of randomly placed particles, with a random variation in vertical position as well

Reference:

Thornton, A. R., Weinhart, T., Luding, S., & Bokhove, O. (2012). Frictional dependence of shallow-granular flows from discrete particle simulations. The European Physical Journal E, 35(12), 127.
Weinhart, T., Thornton, A. R., Luding, S., & Bokhove, O. (2012). Closure relations for shallow granular flows from particle simulations. Granular matter, 14(4), 531-552.

(Return to Overview of advanced tutorials)