GranularCollapseDemo.cpp File Reference
#include <iostream>
#include "Mercury3D.h"
#include "Species/HertzianViscoelasticMindlinSpecies.h"
#include "Walls/InfiniteWall.h"

Classes

class  GranularCollapse
 

Functions

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

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)
112 {
114  problem.setName("granular_collapse_sqellipsoids");
115  logger(INFO, "Modified from 'MercurySimpleDemos/InsertionBoundarySelfTest.cpp'");
116 
117  // [GranularCollapse : particle properties]
118  problem.species->setDensity(950); // 2000;
119 
120  double input1 = 50; //1000; // 500; 1000; 15500;
121  double input2 = 1.5; // magnifying scale (geq 1)
122  if (argc > 1)
123  {
124  input1 = atof(argv[1]);
125  input2 = atof(argv[2]);
126  }
127  problem.nMax = input1;
128  problem.radScale = input2;
129  logger(INFO, "Number of particles = %\n"
130  "Half-length scale = %", problem.nMax, problem.radScale);
131 
132  problem.radMax = 5.e-3; //1.e-3; 4.5e-3; 4.e-3
133  problem.radMin = problem.radMax / problem.radScale / std::sqrt(problem.radScale);
134  // [GranularCollapse : particle properties]
135 
136  // [GranularCollapse : contact properties]
137  problem.species->setEffectiveElasticModulusAndRestitutionCoefficient(1.e7, 0.7); //1.e5
138 // //normal forces
139 // problem.species->setStiffness(2e4); //1e5; 2e4; 8e3; 1e4
140 // problem.species->setDissipation(0.5); //0.5; 0.25; 0.3; dissipation <= sqrt(2*stiffness*MinParticleMass) to avoid overdamping
141 // //tangential forces : sliding
142 // problem.species->setSlidingFrictionCoefficient(0.5);
143 // problem.species->setSlidingStiffness(problem.species->getStiffness()*0.2);
144 // problem.species->setSlidingDissipation(problem.species->getDissipation()*0.2);
145 // //normal torques : spin
146 // problem.species->setTorsionFrictionCoefficient(problem.species->getSlidingFrictionCoefficient()*0.05);
147 // problem.species->setTorsionStiffness(problem.species->getStiffness()*0.1);
148 // problem.species->setTorsionDissipation(problem.species->getDissipation()*0.05);
149 // //tangential torques : rolling
150 // problem.species->setRollingFrictionCoefficient(problem.species->getSlidingFrictionCoefficient()*0.05);
151 // problem.species->setRollingStiffness(problem.species->getStiffness()*0.1);
152 // problem.species->setRollingDissipation(problem.species->getDissipation()*0.05);
153  // [GranularCollapse : contact properties]
154 
155  // [GranularCollapse : test normal forces]
156  //(from 'MercurySimpleDemos/HourGlass3DDemo.cpp')
157  //Calculates collision time for two copies of a particle of given dissipation_, k, effective mass
158  double MinParticleMass = problem.species->getDensity() * 4. / 3. * constants::pi * mathsFunc::cubic(problem.radMin);
159  logger(INFO, "MinParticleMass = %%3\n", std::scientific, MinParticleMass, Flusher::NO_FLUSH);
160  //Calculates collision time for two copies of a particle of given dissipation_, k, effective mass
161  double tc = problem.species->getCollisionTime(2 * problem.radMin, problem.species->getDensity(), 1.0);
162  logger(INFO, "tc = %%", tc, std::defaultfloat);
163 // //Calculates restitution coefficient for two copies of given dissipation_, k, effective mass
164 // double r = problem.species->getRestitutionCoefficient(MinParticleMass);
165 // std::cout << "r = " << r << std::endl;
166  //Calculates the maximum relative velocity allowed for a normal collision of two particles of radius r and particle mass m (for higher velocities particles could pass through each other)
167  //std::cout << "vmax=" << helpers::getMaximumVelocity(species->getStiffness(), HGgetSpecies(0)->getDissipation(), HG.MinParticleRadius, MinParticleMass) << std::endl;
168  // [GranularCollapse : test normal forces]
169 
170  // [GranularCollapse : time parameters]
171  problem.setTimeStep(tc / 50); // 1e-4; // (tc / 50);
172  problem.setTimeMax(2.5); //5; //15;
173  problem.openGate = .7 * problem.getTimeMax();
174  problem.setSaveCount(500);
175  // [GranularCollapse : time parameters]
176 
177  // [GranularCollapse : contact detection]
178  problem.setHGridMaxLevels(2);
179  // [GranularCollapse : contact detection]
180 
181  problem.setSuperquadricParticlesWriteVTK(true);
182  problem.wallHandler.setWriteVTK(FileType::ONE_FILE);
183  problem.solve(); //argc,argv
184  return 0;
185 } // [GranularCollapse : main]
AnnoyingScalar sqrt(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:134
@ 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.
Definition: GranularCollapseDemo.cpp:15
#define INFO(i)
Definition: mumps_solver.h:54
const Mdouble pi
Definition: ExtendedMath.h:23
T cubic(const T val)
calculates the cube of a number
Definition: ExtendedMath.h:95
Constructor for SteadyAxisymAdvectionDiffusion problem
Definition: steady_axisym_advection_diffusion.cc:213

References mathsFunc::cubic(), INFO, logger, NO_FLUSH, ONE_FILE, constants::pi, problem, and sqrt().