Tutorial1_ParticleInOuterSpace.cpp File Reference

Classes

class  Tutorial1
 [T1:headers] More...
 

Functions

int main (int argc, char *argv[])
 [T1:class] More...
 

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)

[T1:class]

[T1:main]

[T1:problemSetup]

[T1:problemSetup]

[T1:speciesProp]

[T1:speciesProp]

[T1:output]

[T1:output]

[T1:paraviewOutput]

[T1:paraviewOutput]

[T1:solve]

[T1:solve]

46 {
47  // Instantiate an object of class Tutorial1
49 
50  // Problem setup: set file name, gravity, domain size, simulation time
52  problem.setName("Tutorial1");
53  problem.setGravity(Vec3D(0.0, 0.0, 0.0));
54  problem.setXMax(1.0);
55  problem.setYMax(1.0);
56  problem.setZMax(1.0);
57  problem.setTimeMax(1.0);
59 
60  // Set the species (material properties such as density and stiffness) of particles and walls
61  // (in this case, both are assumed to consist of the same material)
64  species.setDensity(2500.0); //sets the species type_0 density in kg/m3
65  // The normal spring stiffness and normal dissipation is computed such that
66  // collision time tc=0.005 and restitution coefficient rc=1.0
67  species.setStiffness(258.5);//sets the spring stiffness in kN/m.
68  species.setDissipation(0.0); //sets the dissipation.
69  problem.speciesHandler.copyAndAddObject(species);
71 
72  // Define what output gets written
74  // number of time steps skipped between saves (i.e. every 10-th time step is written to file)
75  problem.setSaveCount(50);
76  // creates file with particle positions, velocities, radii for multiple time steps (for plotting)
77  problem.dataFile.setFileType(FileType::ONE_FILE);
78  // file with contact forces, overlaps for multiple time steps (for plotting)
79  problem.fStatFile.setFileType(FileType::NO_FILE);
80  // file with all parameters of the last saved time step (for restarting)
81  problem.restartFile.setFileType(FileType::ONE_FILE);
82  // writes global properties like kinetic/potential energy and center of mass (for quick analysis)
83  problem.eneFile.setFileType(FileType::NO_FILE);
85 
87  // whether the wall geometry is written into a vtu file (either once initially or for several time steps)
88  problem.wallHandler.setWriteVTK(FileType::ONE_FILE);
89  // whether the particle positions are written into a vtu file
90  problem.setParticlesWriteVTK(true);
92 
94  // set a time step 1/50th of collision time
95  problem.setTimeStep(0.005 / 50.0);
96  // start the solver (calls setupInitialConditions and initiates time loop)
97  problem.solve(argc, argv);
99 
100  return 0;
101 }
@ NO_FILE
file will not be created/read
@ ONE_FILE
all data will be written into/ read from a single file called name_
void setDissipation(Mdouble dissipation)
Allows the normal dissipation to be changed.
Definition: LinearViscoelasticNormalSpecies.cc:96
void setStiffness(Mdouble new_k)
Allows the spring constant to be changed.
Definition: LinearViscoelasticNormalSpecies.cc:72
void setDensity(Mdouble density)
Definition: ParticleSpecies.cc:88
[T1:headers]
Definition: Tutorial1_ParticleInOuterSpace.cpp:22
Definition: Kernel/Math/Vector.h:30
Constructor for SteadyAxisymAdvectionDiffusion problem
Definition: steady_axisym_advection_diffusion.cc:213

References NO_FILE, ONE_FILE, problem, ParticleSpecies::setDensity(), LinearViscoelasticNormalSpecies::setDissipation(), and LinearViscoelasticNormalSpecies::setStiffness().