ChuteDemo.cpp File Reference
#include <iostream>
#include <Species/LinearViscoelasticSpecies.h>
#include "Chute.h"

Functions

int main ()
 [ChuteDemo:include] More...
 

Function Documentation

◆ main()

int main ( )

[ChuteDemo:include]

[ChuteDemo:include]

[ChuteDemo:initial]

[ChuteDemo:initial]

[ChuteDemo:particles]

[ChuteDemo:particles]

[ChuteDemo:chute]

[ChuteDemo:chute]

[ChuteDemo:inflow]

[ChuteDemo:inflow]

35 {
36 
38  // Problem parameters
39  Chute problem;
40 
41  problem.setName("ChuteDemo"); // data output file name
42  problem.setGravity({0,-1,0});
43  problem.setSaveCount(102); // number of time steps skipped between saves
44  Mdouble tc = 2.5e-3; // collision time
45  problem.setTimeStep(0.02 * tc); // actual time step
46  problem.setTimeMax(0.5); // maximum time
47  // NB: number of time steps saved to output files
48  // is timeMax/(timeStep*saveCount)
50 
52  // Particle radii
53  problem.setFixedParticleRadius(0.001); // radius of fixed chute bottom particles
54  problem.setInflowParticleRadius(0.001); // radius of (monodisperse) inflow particles
55 
56  // Particle species
57  LinearViscoelasticSpecies species; // initialise species
58  species.setHandler(&problem.speciesHandler); // assign problem species handler to species
59  species.setDensity(2000); // particle density
61  0.8, species.getMassFromRadius(problem.getInflowParticleRadius())); // material properties
62  problem.speciesHandler.copyAndAddObject(species); // assign species to problem species handler
63 
65 
67  // Chute properties
68  problem.setChuteAngle(30.0); // set angle of chute relative to horizontal
69  problem.setXMax(0.1); // chute length = 0.1
70  problem.setYMax(2.0 * problem.getInflowParticleRadius()); // chute width = 1 particle diameter
72 
74  // Inflow properties
75  problem.setInflowHeight(0.1); // particle inflow between 0 <= Z <= 0.1
76  problem.setInflowVelocity(0.1); // particle inflow mean velocity
77  problem.setInflowVelocityVariance(0.02); // particle inflow velocity variance (in ratio of the mean velocity)
78  //Write paraview data
79  //problem.setParticlesWriteVTK(true);
80  //problem.wallHandler.setWriteVTK(true);
82 
83 
84  /*problem.setParticlesWriteVTK(true);
85  problem.wallHandler.setWriteVTK(true);*/
86 
87 
88  //solve
89  problem.solve();
90 } // the end
double Mdouble
Definition: GeneralDefine.h:34
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
Creates chutes with different bottoms. Inherits from Mercury3D (-> MercuryBase -> DPMBase).
Definition: Chute.h:65
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
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
Mdouble getInflowParticleRadius() const
Returns the average radius of inflow particles.
Definition: Chute.cc:929
void setChuteAngle(Mdouble chuteAngle)
Sets gravity vector according to chute angle (in degrees)
Definition: Chute.cc:768
void setInflowHeight(Mdouble inflowHeight)
Sets maximum inflow height (Z-direction)
Definition: Chute.cc:957
void setFixedParticleRadius(Mdouble fixedParticleRadius)
Sets the particle radius of the fixed particles which constitute the (rough) chute bottom.
Definition: Chute.cc:653
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:408
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. LinearViscoelasticSpecies, etc.
Definition: DPMBase.h:1427
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 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
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 solve()
The work horse of the code.
Definition: DPMBase.cc:4270
void setGravity(Vec3D newGravity)
Sets a new value for the gravitational acceleration.
Definition: DPMBase.cc:1383
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

References BaseHandler< T >::copyAndAddObject(), Chute::getInflowParticleRadius(), ParticleSpecies::getMassFromRadius(), Chute::setChuteAngle(), LinearViscoelasticNormalSpecies::setCollisionTimeAndRestitutionCoefficient(), ParticleSpecies::setDensity(), Chute::setFixedParticleRadius(), DPMBase::setGravity(), BaseSpecies::setHandler(), Chute::setInflowHeight(), Chute::setInflowParticleRadius(), Chute::setInflowVelocity(), Chute::setInflowVelocityVariance(), DPMBase::setName(), DPMBase::setSaveCount(), DPMBase::setTimeMax(), DPMBase::setTimeStep(), DPMBase::setXMax(), DPMBase::setYMax(), DPMBase::solve(), and DPMBase::speciesHandler.