FreeFallHertzMindlinUnitTest.cpp File Reference

Classes

class  FreeFallHertzMindlinUnitTest
 

Functions

int main (int argc, char *argv[])
 

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)
38 {
39  logger(INFO, "Single particle bouncing vertically on the bottom plate");
40 
41  //The monosized 3 mm perfect-spherical tungsten particles are simulated.
42  //Poisson Ratio is 0.28,
43  //bulk density is 19250 Kg/m^3,
44  //Young modulus 4.11E11 Pa,
45  //restitution coefficient is 0.95,
46  //Hertz-Mindlin model is used to describe the contact force between neighboring particles.
47  Mdouble poissonRatio = 0.28;
48  Mdouble density = 10000*6.0/constants::pi;
49  Mdouble elasticModulus = 4.11e11; //100 times too soft
50  Mdouble restitution = 0.5;
51 
52  // Make the problem and set the name
54  dpm.setName("FreeFallHertzMindlinUnitTest");
55  dpm.setGravity(Vec3D(0,-10,0));
56  dpm.setParticleDimensions(3);
57 
58  //Set the species of the particle and wall, and its properties
60  species.setDensity(density);
61  species.setEffectiveElasticModulusAndRestitutionCoefficient(elasticModulus, restitution);
62  //https://en.wikipedia.org/wiki/Shear_modulus#References
63  species.setEffectiveShearModulus(0.5 * elasticModulus / (1 + poissonRatio));
64  species.setSlidingFrictionCoefficient(1.0);
65  dpm.speciesHandler.copyAndAddObject(species);
66 
67  //set the parameters for the solver
68  dpm.setSaveCount(40);
71  Mdouble relativeVelocity = 0.1;
72  Mdouble tc = species.getCollisionTime(2.0*dpm.radius, species.getDensity(), relativeVelocity);
73  logger(INFO,"Collision time %", tc);
74  dpm.setTimeStep(0.02*tc);
75  dpm.setTimeMax(0.1);
76 
77  //solve the system, the single particle will now bounce on the plate
78  dpm.solve(argc, argv);
79 
80  helpers::writeToFile("FreeFallHertzMindlinUnitTest.gnu",
81  "set xlabel 't'; p 'FreeFallHertzMindlinUnitTest.ene' u 1:(sqrt($3)) t 'sqrt(E_kin)' w lp");
82  logger(INFO,"type 'gnuplot FreeFallHertzMindlinUnitTest.gnu' to check energy conservation");
83 }
@ NO_FILE
file will not be created/read
@ ONE_FILE
all data will be written into/ read from a single file called name_
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
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
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
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:400
void setParticleDimensions(unsigned int particleDimensions)
Sets the particle dimensionality.
Definition: DPMBase.cc:1439
WallHandler wallHandler
An object of the class WallHandler. Contains pointers to all the walls created.
Definition: DPMBase.h:1453
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 solve()
The work horse of the code.
Definition: DPMBase.cc:4334
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
Definition: FreeFallHertzMindlinUnitTest.cpp:13
Mdouble radius
Definition: FreeFallHertzMindlinUnitTest.cpp:34
void setDensity(Mdouble density)
Definition: ParticleSpecies.cc:88
Mdouble getDensity() const
Allows density_ to be accessed.
Definition: ParticleSpecies.cc:98
Contains material and contact force properties.
Definition: Species.h:14
Definition: Kernel/Math/Vector.h:30
void setWriteVTK(FileType)
Sets whether walls are written into a VTK file.
Definition: WallHandler.cc:445
#define INFO(i)
Definition: mumps_solver.h:54
density
Definition: UniformPSDSelfTest.py:19
const Mdouble pi
Definition: ExtendedMath.h:23
bool writeToFile(const std::string &filename, const std::string &filecontent)
Writes a string to a file.
Definition: FileIOHelpers.cc:29

References BaseHandler< T >::copyAndAddObject(), UniformPSDSelfTest::density, DPMBase::fStatFile, ParticleSpecies::getDensity(), INFO, logger, NO_FILE, ONE_FILE, constants::pi, FreeFallHertzMindlinUnitTest::radius, ParticleSpecies::setDensity(), File::setFileType(), DPMBase::setGravity(), DPMBase::setName(), DPMBase::setParticleDimensions(), DPMBase::setSaveCount(), DPMBase::setTimeMax(), DPMBase::setTimeStep(), WallHandler::setWriteVTK(), DPMBase::solve(), DPMBase::speciesHandler, DPMBase::wallHandler, and helpers::writeToFile().