Lees Edward

Problem description:

Now we study a more complex situation, in which a continuum formulation makes sense: granular media sheared at a constant rate The code can be found in LeesEdwardsSelfTest.cpp.

Granular media sheared.

Headers

Before the main function

{
public:
void setupInitialConditions() override {
//set parameters to define the species properties
setName("LeesEdwardsSelfTest");
const Mdouble particleRadius = 0.5; // such that diameter is one
const Mdouble collisionTime = 0.05; //relatively stiff particles
const Mdouble restitution = 0.95; //restitution close to glass particles
const Mdouble sizeDistribution = 1.5;
const Mdouble volumeFraction = 0.82;
const Mdouble velocity = 15.0;
//define species
species->setDensity(4.0 / constants::pi); //such that particle mass is one
Mdouble mass = species->getMassFromRadius(particleRadius);
species->setCollisionTimeAndNormalAndTangentialRestitutionCoefficient(
collisionTime, restitution, restitution, mass); //set stiffness and dissipation
species->setSlidingFrictionCoefficient(0.5);
setTimeStep(0.02 * species->getCollisionTime(mass));
setTimeMax(4.0); //run until the situation is static
//set domain size
setMin({0, 0, 0});
setMax({15, 15, 1});
//set gravity
setGravity({0, 0, 0});
//define leesEdwardsBoundary
LeesEdwardsBoundary leesEdwardsBoundary;
leesEdwardsBoundary.set(
[velocity](double time) { return time * velocity; },
[velocity](double time UNUSED) { return velocity; },
boundaryHandler.copyAndAddObject(leesEdwardsBoundary);
//define common particle properties
p.setRadius(particleRadius);
Mdouble rMin = 2.0 * particleRadius / (sizeDistribution + 1);
Mdouble rMax = sizeDistribution * rMin;
p.setRadius(rMax);
logger(INFO, "Inserting particles of diameter % to %, volumeFraction %", 2.0 * rMin, 2.0 * rMax,
volumeFraction);
Mdouble particleVolumeMax = volumeFraction * (getXMax() - getXMin()) * (getYMax() - getYMin());
Mdouble particleVolume = 0;
Vec3D position = {0, 0, 0};
while (particleVolume + 0.5 * p.getVolume() < particleVolumeMax) {
p.setPosition(position);
particleVolume += p.getVolume();
}
}
};
@ ONE_FILE
all data will be written into/ read from a single file called name_
double Mdouble
Definition: GeneralDefine.h:34
#define UNUSED
Definition: GeneralDefine.h:39
Species< LinearViscoelasticNormalSpecies, SlidingFrictionSpecies > LinearViscoelasticSlidingFrictionSpecies
Definition: LinearViscoelasticSlidingFrictionSpecies.h:34
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
@ INFO
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
T * getObject(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
Definition: BaseHandler.h:613
virtual void setPosition(const Vec3D &position)
Sets the position of this BaseInteractable.
Definition: BaseInteractable.h:239
virtual Mdouble getVolume() const
Get Particle volume function, which required a reference to the Species vector. It returns the volume...
Definition: BaseParticle.cc:143
virtual void setRadius(Mdouble radius)
Sets the particle's radius_ (and adjusts the mass_ accordingly, based on the particle's species)
Definition: BaseParticle.cc:553
void setSpecies(const ParticleSpecies *species)
Definition: BaseParticle.cc:818
Mdouble getXMin() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMin() returns XMin.
Definition: DPMBase.h:619
Mdouble getXMax() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMax() returns XMax.
Definition: DPMBase.h:626
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
File fStatFile
An instance of class File to handle in- and output into a .fstat file.
Definition: DPMBase.h:1483
Mdouble getYMin() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMin() returns YMin.
Definition: DPMBase.h:632
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:422
File dataFile
An instance of class File to handle in- and output into a .data file.
Definition: DPMBase.h:1478
void setMin(const Vec3D &min)
Sets the minimum coordinates of the problem domain.
Definition: DPMBase.cc:1118
BoundaryHandler boundaryHandler
An object of the class BoundaryHandler which concerns insertion and deletion of particles into or fro...
Definition: DPMBase.h:1452
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created.
Definition: DPMBase.h:1437
RNG random
This is a random generator, often used for setting up the initial conditions etc.....
Definition: DPMBase.h:1432
Mdouble getYMax() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMax() returns XMax.
Definition: DPMBase.h:638
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 setMax(const Vec3D &max)
Sets the maximum coordinates of the problem domain.
Definition: DPMBase.cc:1082
void setGravity(Vec3D newGravity)
Sets a new value for the gravitational acceleration.
Definition: DPMBase.cc:1383
void setFileType(FileType fileType)
Sets the type of file needed to write into or read from. File::fileType_.
Definition: File.cc:215
Class which creates a boundary with Lees-Edwards type periodic boundary conditions.
Definition: LeesEdwardsBoundary.h:47
void set(std::function< Mdouble(Mdouble)> shift, std::function< Mdouble(Mdouble)> velocity, Mdouble left, Mdouble right, Mdouble down, Mdouble up)
Sets all boundary properties.
Definition: LeesEdwardsBoundary.cc:50
[Lees:headers]
Definition: LeesEdwardsSelfTest.cpp:34
void setupInitialConditions() override
This function allows to set the initial conditions for our problem to be solved, by default particle ...
Definition: LeesEdwardsSelfTest.cpp:37
This adds on the hierarchical grid code for 2D problems.
Definition: Mercury2D.h:36
Mdouble getRandomNumber()
This is a random generating routine can be used for initial positions.
Definition: RNG.cc:143
A spherical particle is the most simple particle used in MercuryDPM.
Definition: SphericalParticle.h:37
Definition: Vector.h:51
Mdouble Y
Definition: Vector.h:66
Mdouble X
the vector components
Definition: Vector.h:66
const Mdouble pi
Definition: ExtendedMath.h:45

Main function

Reference:

Lees, A. W., & Edwards, S. F. (1972). The computer study of transport processes under extreme conditions. Journal of Physics C: Solid State Physics, 5(15), 1921.
Granular Flow: From Dilute to Jammed States.

(Return to Overview of advanced tutorials)