Tutorial9_InclinedPlane.cpp File Reference

Classes

class  Tutorial9
 [T9:headers] More...
 

Functions

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

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)

[T9:class]

[T9:main]

[T9:speciesProp]

[T9:speciesProp]

[T9:paraviewOutput]

[T9:paraviewOutput]

[T9: solve]

[T9: solve]

63 {
64 
65  // Instantiate an object of class Tutorial 9
67 
68  // Problem setup
69  problem.setName("Tutorial9");
70  problem.removeOldFiles();
71  double angle = constants::pi / 180.0 * 20.0;
72  problem.setGravity(Vec3D(sin(angle), 0.0, -cos(angle)) * 9.81);
73  problem.setXMax(0.3);
74  problem.setYMax(0.3);
75  problem.setZMax(0.05);
76  problem.setTimeMax(0.4);
77 
78  // Set the species (material properties such as density and stiffness) of particles and walls
79  // (in this case, particle-0 and the wall are made from species-0, particle-1 belongs to species-1, particle-2 belongs to species-2)
80 
82  // Species-0 properties
84  // The normal spring stiffness and normal dissipation is computed and set as
85  // For collision time tc=0.005 and restitution coefficient rc=0.88,
86  species0.setDensity(2500.0);//sets the species type_0 density
87  species0.setStiffness(259.018);//sets the spring stiffness.
88  species0.setDissipation(0.0334);//sets the dissipation.
89  species0.setSlidingStiffness(2.0 / 7.0 * species0.getStiffness());
90  species0.setRollingStiffness(2.0 / 5.0 * species0.getStiffness());
91  species0.setSlidingFrictionCoefficient(0.0);
92  species0.setRollingFrictionCoefficient(0.0);
93  auto ptrToSp0=problem.speciesHandler.copyAndAddObject(species0);
94 
95  // Species-1 properties
97  species1.setDensity(2500.0);//sets the species type-1 density
98  species1.setStiffness(259.018);//sets the spring stiffness
99  species1.setDissipation(0.0334);//sets the dissipation
100  species1.setSlidingStiffness(2.0 / 7.0 * species1.getStiffness());
101  species1.setRollingStiffness(2.0 / 5.0 * species1.getStiffness());
102  species1.setSlidingFrictionCoefficient(0.5);
103  species1.setRollingFrictionCoefficient(0.0);
104  auto ptrToSp1=problem.speciesHandler.copyAndAddObject(species1);
105 
106  // Properties of contacts between species-0 and species-1
107  // (no new species is defined since the mixed species is automatically created)
108  auto species01 = problem.speciesHandler.getMixedObject(ptrToSp0,ptrToSp1);
109  species01->setStiffness(259.018);//sets the spring stiffness
110  species01->setDissipation(0.0334);//sets the dissipation
111  species01->setSlidingStiffness(2.0 / 7.0 * species01->getStiffness());
112  species01->setRollingStiffness(2.0 / 5.0 * species01->getStiffness());
113  species01->setSlidingFrictionCoefficient(0.5);
114  species01->setRollingFrictionCoefficient(0.0);
115 
116  // Species 2 properties
118  species2.setDensity(2500.0);//sets the species type-2 density
119  species2.setStiffness(258.5);//sets the spring stiffness
120  species2.setDissipation(0.0);//sets the dissipation
121  species2.setSlidingStiffness(2.0 / 7.0 * species2.getStiffness());
122  species2.setRollingStiffness(2.0 / 5.0 * species2.getStiffness());
123  species2.setSlidingFrictionCoefficient(0.5);
124  species2.setRollingFrictionCoefficient(0.5);
125  auto ptrToSp2 = problem.speciesHandler.copyAndAddObject(species2);
126 
127  // Properties of contacts between species-0 and species-2
128  auto species02 = problem.speciesHandler.getMixedObject(ptrToSp0, ptrToSp2);
129  species02->setStiffness(259.018);//sets the stiffness
130  species02->setDissipation(0.0334);//sets the dissipation
131  species02->setSlidingStiffness(2.0 / 7.0 * species02->getStiffness());
132  species02->setRollingStiffness(2.0 / 5.0 * species02->getStiffness());
133  species02->setSlidingFrictionCoefficient(0.5);
134  species02->setRollingFrictionCoefficient(0.5);
135 
136  // Note: Properties of contacts between species-0 and species-1 are never defined, since no contacts between those
137  // two materials occurs in this simulation; note: if no properties are defined, then default properties are assumed,
138  // mostly harmonic means of the properties of both individual species
140 
141  //Output
142  problem.setSaveCount(25);
143  problem.dataFile.setFileType(FileType::ONE_FILE);
144  problem.restartFile.setFileType(FileType::ONE_FILE);
145  problem.fStatFile.setFileType(FileType::ONE_FILE);
146  problem.eneFile.setFileType(FileType::NO_FILE);
147 
149  // whether the wall geometry is written into a vtu file (either once initially or for several time steps)
150  problem.wallHandler.setWriteVTK(FileType::ONE_FILE);
151  // whether the particle positions are written into a vtu file
152  problem.setParticlesWriteVTK(true);
154 
156  // set a time step 1/50th of collision time
157  problem.setTimeStep(0.005 / 50.0);
158  // start the solver (calls setupInitialConditions and initiates time loop)
159  problem.solve(argc, argv);
161  return 0;
162 }
AnnoyingScalar cos(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:136
AnnoyingScalar sin(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:137
@ NO_FILE
file will not be created/read
@ ONE_FILE
all data will be written into/ read from a single file called name_
void setRollingFrictionCoefficient(Mdouble new_mu)
Allows the (dynamic) Coulomb friction coefficient to be changed; also sets mu_s by default.
Definition: FrictionSpecies.cc:165
void setRollingStiffness(Mdouble new_kt)
Allows the spring constant to be changed.
Definition: FrictionSpecies.cc:128
Mdouble getStiffness() const
Allows the spring constant to be accessed.
Definition: LinearViscoelasticNormalSpecies.cc:83
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
void setSlidingStiffness(Mdouble new_kt)
Allows the spring constant to be changed.
Definition: SlidingFrictionSpecies.cc:83
void setSlidingFrictionCoefficient(Mdouble new_mu)
Allows the (dynamic) Coulomb friction coefficient to be changed; also sets mu_s by default.
Definition: SlidingFrictionSpecies.cc:120
[T9:headers]
Definition: Tutorial9_InclinedPlane.cpp:23
Definition: Kernel/Math/Vector.h:30
double angle(const double &t)
Angular position as a function of time t.
Definition: jeffery_orbit.cc:98
const Mdouble pi
Definition: ExtendedMath.h:23
Constructor for SteadyAxisymAdvectionDiffusion problem
Definition: steady_axisym_advection_diffusion.cc:213

References Jeffery_Solution::angle(), cos(), LinearViscoelasticNormalSpecies::getStiffness(), NO_FILE, ONE_FILE, constants::pi, problem, ParticleSpecies::setDensity(), LinearViscoelasticNormalSpecies::setDissipation(), FrictionSpecies::setRollingFrictionCoefficient(), FrictionSpecies::setRollingStiffness(), SlidingFrictionSpecies::setSlidingFrictionCoefficient(), SlidingFrictionSpecies::setSlidingStiffness(), LinearViscoelasticNormalSpecies::setStiffness(), and sin().