no_seg.cpp File Reference
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cmath>
#include <Species/LinearViscoelasticFrictionSpecies.h>
#include "Chute.h"

Functions

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

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)

A quasi-2D inclined plane with inflow conditions on the left boundary, and deletion of particles when they exit the domain.

38 {
39  //Print description
40  logger(INFO, "\nDescription: A quasi-2D inclined plane with inflow conditions on the left boundary, and deletion of"
41  " particles when they exit the domain.");
42 
43  // Problem parameters
44  Chute problem;
45  problem.setName("chute_demo");
46  problem.setTimeMax(0.5);
47 
48  // Particle properties
49  problem.setFixedParticleRadius(0.001);
50  problem.setInflowParticleRadius(0.001);
51 
53  double mass = 0.5*species->getMassFromRadius(0.5*(problem.getMinInflowParticleRadius() + problem.getMaxInflowParticleRadius()));
54  species->setCollisionTimeAndRestitutionCoefficient(2.5e-3,0.8,mass);
55  species->setSlidingDissipation(0.0);
56  problem.setTimeStep(0.02 * 2.5e-3);
57 
58 
59  // Chute properties
60  problem.setChuteAngle(30.0);
61  problem.setXMax(0.1);
62  problem.setYMax(2.0*problem.getInflowParticleRadius());
63 
64  // Inflow properties
65  problem.setInflowHeight(0.1);
66  problem.setInflowVelocity(0.1);
67  problem.setInflowVelocityVariance(0.02);
68 
69  // Output properties
71  problem.dataFile.setSaveCount(100*problem.restartFile.getSaveCount());
72  problem.eneFile.setSaveCount(100*problem.restartFile.getSaveCount());
73 // problem.setSaveCount(helpers::getSaveCountFromNumberOfSavesAndTimeMaxAndTimeStep(1,problem.getTimeMax(),problem.getTimeStep())); //minimize output to the last time step
74 // problem.set_number_of_saves_data(100); //allow enough data output so the evolution can be viewed in xballs
75 // problem.set_number_of_saves_ene(100);
76 
77  //solve
78  problem.solve(argc, argv);
79 }
Species< LinearViscoelasticNormalSpecies, FrictionSpecies > LinearViscoelasticFrictionSpecies
Definition: LinearViscoelasticFrictionSpecies.h:34
LL< Log::INFO > INFO
Info log level.
Definition: Logger.cc:55
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:379
Creates chutes with different bottoms. Inherits from Mercury3D (-> MercuryBase -> DPMBase).
Definition: Chute.h:65
void setInflowParticleRadius(Mdouble inflowParticleRadius)
Sets the radius of the inflow particles to a single one (i.e. ensures a monodisperse inflow).
Definition: Chute.cc:848
void setInflowVelocityVariance(Mdouble inflowVelocityVariance)
Sets the inflow velocity variance.
Definition: Chute.cc:1010
Mdouble getMaxInflowParticleRadius() const
Returns the maximum radius of inflow particles.
Definition: Chute.cc:947
void setInflowVelocity(Mdouble inflowVelocity)
Sets the average inflow velocity.
Definition: Chute.cc:983
Mdouble getMinInflowParticleRadius() const
returns the minimum radius of inflow particles
Definition: Chute.cc:938
Mdouble getInflowParticleRadius() const
Returns the average radius of inflow particles.
Definition: Chute.cc:929
void setChuteAngle(Mdouble chuteAngle)
Sets gravity vector according to chute angle (in degrees)
Definition: Chute.cc:768
void setInflowHeight(Mdouble inflowHeight)
Sets maximum inflow height (Z-direction)
Definition: Chute.cc:957
void setFixedParticleRadius(Mdouble fixedParticleRadius)
Sets the particle radius of the fixed particles which constitute the (rough) chute bottom.
Definition: Chute.cc:653
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:408
File eneFile
An instance of class File to handle in- and output into a .ene file.
Definition: DPMBase.h:1488
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. LinearViscoelasticSpecies, etc.
Definition: DPMBase.h:1427
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:422
Mdouble getTimeStep() const
Returns the simulation time step.
Definition: DPMBase.cc:1250
File dataFile
An instance of class File to handle in- and output into a .data file.
Definition: DPMBase.h:1478
void setYMax(Mdouble newYMax)
Sets the value of YMax, the upper bound of the problem domain in the y-direction.
Definition: DPMBase.cc:1191
File restartFile
An instance of class File to handle in- and output into a .restart file.
Definition: DPMBase.h:1493
void setXMax(Mdouble newXMax)
Sets the value of XMax, the upper bound of the problem domain in the x-direction.
Definition: DPMBase.cc:1165
void setTimeStep(Mdouble newDt)
Sets a new value for the simulation time step.
Definition: DPMBase.cc:1234
void setTimeMax(Mdouble newTMax)
Sets a new value for the maximum simulation duration.
Definition: DPMBase.cc:873
void solve()
The work horse of the code.
Definition: DPMBase.cc:4270
Mdouble getTimeMax() const
Returns the maximum simulation duration.
Definition: DPMBase.cc:888
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_.
Definition: File.cc:273
unsigned int getSaveCount() const
Gets File::saveCount_.
Definition: File.cc:255
unsigned int getSaveCountFromNumberOfSavesAndTimeMaxAndTimeStep(unsigned int numberOfSaves, Mdouble timeMax, Mdouble timeStep)
Returns the correct saveCount if the total number of saves, the final time and the time step is known...
Definition: FormulaHelpers.cc:96

References BaseHandler< T >::copyAndAddObject(), DPMBase::dataFile, DPMBase::eneFile, Chute::getInflowParticleRadius(), Chute::getMaxInflowParticleRadius(), Chute::getMinInflowParticleRadius(), File::getSaveCount(), helpers::getSaveCountFromNumberOfSavesAndTimeMaxAndTimeStep(), DPMBase::getTimeMax(), DPMBase::getTimeStep(), INFO, logger, DPMBase::restartFile, Chute::setChuteAngle(), Chute::setFixedParticleRadius(), Chute::setInflowHeight(), Chute::setInflowParticleRadius(), Chute::setInflowVelocity(), Chute::setInflowVelocityVariance(), DPMBase::setName(), DPMBase::setSaveCount(), File::setSaveCount(), DPMBase::setTimeMax(), DPMBase::setTimeStep(), DPMBase::setXMax(), DPMBase::setYMax(), DPMBase::solve(), and DPMBase::speciesHandler.