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.
{
public:
const Mdouble particleRadius = 0.5;
const Mdouble collisionTime = 0.05;
const Mdouble sizeDistribution = 1.5;
const Mdouble volumeFraction = 0.82;
Mdouble mass = species->getMassFromRadius(particleRadius);
species->setCollisionTimeAndNormalAndTangentialRestitutionCoefficient(
collisionTime, restitution, restitution, mass);
species->setSlidingFrictionCoefficient(0.5);
p.setRadius(particleRadius);
Mdouble rMin = 2.0 * particleRadius / (sizeDistribution + 1);
Mdouble rMax = sizeDistribution * rMin;
logger(
INFO,
"Inserting particles of diameter % to %, volumeFraction %", 2.0 * rMin, 2.0 * rMax,
volumeFraction);
Vec3D position = {0, 0, 0};
while (particleVolume + 0.5 *
p.getVolume() < particleVolumeMax) {
particleVolume +=
p.getVolume();
}
}
};
@ ONE_FILE
all data will be written into/ read from a single file called name_
double Mdouble
Definition: GeneralDefine.h:13
#define UNUSED
Definition: GeneralDefine.h:18
Species< LinearViscoelasticNormalSpecies, SlidingFrictionSpecies > LinearViscoelasticSlidingFrictionSpecies
Definition: LinearViscoelasticSlidingFrictionSpecies.h:12
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
float * p
Definition: Tutorial_Map_using.cpp:9
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:360
T * getObject(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
Definition: BaseHandler.h:621
Mdouble getXMin() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMin() returns XMin.
Definition: DPMBase.h:603
Mdouble getXMax() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMax() returns XMax.
Definition: DPMBase.h:610
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:386
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. LinearViscoelasticSpecies, etc.
Definition: DPMBase.h:1433
File fStatFile
An instance of class File to handle in- and output into a .fstat file.
Definition: DPMBase.h:1489
Mdouble getYMin() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMin() returns YMin.
Definition: DPMBase.h:616
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:400
File dataFile
An instance of class File to handle in- and output into a .data file.
Definition: DPMBase.h:1484
void setMin(const Vec3D &min)
Sets the minimum coordinates of the problem domain.
Definition: DPMBase.cc:1109
BoundaryHandler boundaryHandler
An object of the class BoundaryHandler which concerns insertion and deletion of particles into or fro...
Definition: DPMBase.h:1458
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created.
Definition: DPMBase.h:1443
RNG random
This is a random generator, often used for setting up the initial conditions etc.....
Definition: DPMBase.h:1438
Mdouble getYMax() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMax() returns XMax.
Definition: DPMBase.h:622
void setTimeStep(Mdouble newDt)
Sets a new value for the simulation time step.
Definition: DPMBase.cc:1225
void setTimeMax(Mdouble newTMax)
Sets a new value for the maximum simulation duration.
Definition: DPMBase.cc:864
void setMax(const Vec3D &max)
Sets the maximum coordinates of the problem domain.
Definition: DPMBase.cc:1073
void setGravity(Vec3D newGravity)
Sets a new value for the gravitational acceleration.
Definition: DPMBase.cc:1374
void setFileType(FileType fileType)
Sets the type of file needed to write into or read from. File::fileType_.
Definition: File.cc:193
Class which creates a boundary with Lees-Edwards type periodic boundary conditions.
Definition: LeesEdwardsBoundary.h:26
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:29
[Lees:headers]
Definition: LeesEdwardsSelfTest.cpp:13
LeesEdwardsSelfTest()
Definition: LeesEdwardsSelfTest.cpp:16
This adds on the hierarchical grid code for 2D problems.
Definition: Mercury2D.h:15
Mdouble getRandomNumber()
This is a random generating routine can be used for initial positions.
Definition: RNG.cc:123
A spherical particle is the most simple particle used in MercuryDPM.
Definition: SphericalParticle.h:16
Definition: Kernel/Math/Vector.h:30
Mdouble Y
Definition: Kernel/Math/Vector.h:45
Mdouble X
the vector components
Definition: Kernel/Math/Vector.h:45
double velocity(const double &t)
Angular velocity as function of time t.
Definition: jeffery_orbit.cc:107
const Mdouble pi
Definition: ExtendedMath.h:23
int main(
int argc,
char *argv[])
{
problem.setXBallsAdditionalArguments(
"-w0 -v0 -solidf -cmode 5");
logger(
INFO,
"Execute 'source LeesEdwardsSelfTest.sh' to get coarse-grained statistics");
helpers::writeToFile(
"LeesEdwardsSelfTest.sh",
"../MercuryCG/fstatistics LeesEdwardsSelfTest -stattype XY -w 0.25 -h 0.25 -tmin 2\n"
"../MercuryCG/fstatistics LeesEdwardsSelfTest -stattype Y -w 0.25 -h 0.1 -tmin 2 -o LeesEdwardsSelfTest.Y.stat");
logger(
INFO,
"Run 'LeesEdwardsSelfTest.m' in MATLAB/octave to visualise the statistical output");
"addpath('../MercuryCG/')\n"
"data = loadstatistics('LeesEdwardsSelfTest.stat');\n"
"colormap(jet)\n"
"contourf(data.x,data.y,data.VelocityX,20,'EdgeColor','none')\n"
"c = colorbar\n"
"c.Label.String = '\\rho';\n"
"title('Velocity')\n"
"xlabel('x')\n"
"ylabel('z');\n"
"axis equal\n"
"%% 1D velocity field v_x(y)\n"
"dataY = loadstatistics('LeesEdwardsSelfTest.Y.stat');\n"
"plot(dataY.y,dataY.VelocityX)\n"
"xlabel('y')\n"
"ylabel('v_x');\n"
"axis equal");
return 0;
}
int main(int argc, char *argv[])
Definition: T_protectiveWall.cpp:194
#define INFO(i)
Definition: mumps_solver.h:54
bool writeToFile(const std::string &filename, const std::string &filecontent)
Writes a string to a file.
Definition: FileIOHelpers.cc:29
Constructor for SteadyAxisymAdvectionDiffusion problem
Definition: steady_axisym_advection_diffusion.cc:213