Lawine.cpp File Reference
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cmath>
#include <sys/types.h>
#include <sys/stat.h>
#include "scr/Chute.h"

Classes

class  ChutePeriodic
 

Functions

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

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)
86 {
87  ChutePeriodic md;
88 
89  // Problem parameters
90  md.setName("Lawine");
93  md.autoNumber();
94  md.setTimeMax(100);
95 
96  // Particle properties
97  md.setDensity(2400.0);
98  md.setInflowParticleRadius(2.5e-3);//d=5mm
99  md.speciesHandler.getObject(0)->setCollisionTimeAndRestitutionCoefficient(5e-4, 0.8);
100  md.setTimeStep(1e-5);
101  md.setTimeMax(25);
102  md.speciesHandler.getObject(0)->setSlidingDissipation(md.get_dissipation());
103  md.speciesHandler.getObject(0)->setSlidingStiffness(2./7.*md.speciesHandler.getObject(0)->getStiffness());
104  md.speciesHandler.getObject(0)->setSlidingFrictionCoefficient(0.5);
105  cout << "friction angle " << atan(md.getSlidingFrictionCoefficient())*180./pi << endl;
109 
110  // Chute properties
111  md.setChuteAngle(0.0);
112  md.setChuteWidth(450e-3);
113  md.setZMax(150e-3);//initial height 150-200mm
114  md.setChuteLength(1);
115  md.setMaxFailed(1000);
116 
117  if (argc>1&&argv[1][0]!='-') {
118  double ratio = pow(atof(argv[1]),1./3.);
120  md.setChuteWidth(md.getChuteWidth()*ratio);
121  md.setZMax(md.getZMax()*ratio);
122  argc--; argv++;
123  } else md.set_hopperLength_(md.getZMax());
124 
125 
126  cout << "hopperLength_=" << md.get_hopperLength_() << endl;
127  cout << "ChuteWidth=" << md.getChuteWidth() << endl;
128  cout << "zmax=" << md.getZMax() << endl;
129  cout << "Maximum allowed speed of particles: " << md.getMaximumVelocity() << endl;
130  md.setSaveCount(.5e4);
131  cout << "dt=" << md.getTimeStep() << endl;
132 
133  //This set to colouring based of size and small vectors
134  md.setXBallsColourMode(7);
135  md.setXBallsVectorScale(1);
136 
137  //solve
138  md.readArguments(argc, argv);
139  md.solve();
140 
141  md.write(std::cout,false);
142  md.writeRestartFile();
143  md.writeRestartFile();
144 
145 }
@ MONOLAYER_ORDERED
Definition: Chute.h:53
@ ONE_FILE
all data will be written into/ read from a single file called name_
T * getObject(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
Definition: BaseHandler.h:613
Definition: chute_periodic_autorun.cpp:37
void set_hopperLength_(double new_)
Definition: Lawine.cpp:76
double get_hopperLength_()
Definition: Lawine.cpp:77
void setChuteWidth(Mdouble chuteWidth)
Sets the chute width (Y-direction)
Definition: Chute.cc:1039
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 setRoughBottomType(RoughBottomType roughBottomType)
Sets the type of rough bottom of the chute.
Definition: Chute.cc:714
virtual void setChuteLength(Mdouble chuteLength)
Sets the chute length (X-direction)
Definition: Chute.cc:1059
void setMaxFailed(unsigned int maxFailed)
Sets the number of times a particle will be tried to be added to the insertion boundary.
Definition: Chute.cc:827
void write(std::ostream &os, bool writeAllParticles=true) const override
This function writes the Chute properties to an ostream, and adds the properties of ALL chute particl...
Definition: Chute.cc:206
Mdouble getInflowParticleRadius() const
Returns the average radius of inflow particles.
Definition: Chute.cc:929
Mdouble getChuteWidth() const
Returns the chute width (Y-direction)
Definition: Chute.cc:1049
void setChuteAngle(Mdouble chuteAngle)
Sets gravity vector according to chute angle (in degrees)
Definition: Chute.cc:768
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
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. LinearViscoelasticSpecies, etc.
Definition: DPMBase.h:1427
File fStatFile
An instance of class File to handle in- and output into a .fstat file.
Definition: DPMBase.h:1483
void autoNumber()
The autoNumber() function calls three functions: setRunNumber(), readRunNumberFromFile() and incremen...
Definition: DPMBase.cc:539
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
bool readArguments(int argc, char *argv[])
Can interpret main function input arguments that are passed by the driver codes.
Definition: DPMBase.cc:4391
File dataFile
An instance of class File to handle in- and output into a .data file.
Definition: DPMBase.h:1478
virtual void writeRestartFile()
Stores all the particle data for current save time step to a "restart" file, which is a file simply i...
Definition: DPMBase.cc:2942
void setZMax(Mdouble newZMax)
Sets the value of ZMax, the upper bound of the problem domain in the z-direction.
Definition: DPMBase.cc:1217
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
void setXBallsVectorScale(double newVScale)
Set the scale of vectors in xballs.
Definition: DPMBase.cc:1320
void setXBallsColourMode(int newCMode)
Set the xballs output mode.
Definition: DPMBase.cc:1300
Mdouble getZMax() const
If the length of the problem domain in z-direction is ZMax - ZMin, then getZMax() returns ZMax.
Definition: DPMBase.h:650
void setFileType(FileType fileType)
Sets the type of file needed to write into or read from. File::fileType_.
Definition: File.cc:215
const Mdouble pi
Definition: ExtendedMath.h:45
T square(const T val)
squares a number
Definition: ExtendedMath.h:106

References DPMBase::autoNumber(), DPMBase::dataFile, DPMBase::fStatFile, ChutePeriodic::get_hopperLength_(), Chute::getChuteWidth(), Chute::getInflowParticleRadius(), BaseHandler< T >::getObject(), DPMBase::getTimeStep(), DPMBase::getZMax(), MONOLAYER_ORDERED, ONE_FILE, constants::pi, DPMBase::readArguments(), ChutePeriodic::set_hopperLength_(), Chute::setChuteAngle(), Chute::setChuteLength(), Chute::setChuteWidth(), File::setFileType(), Chute::setFixedParticleRadius(), Chute::setInflowParticleRadius(), Chute::setMaxFailed(), DPMBase::setName(), Chute::setRoughBottomType(), DPMBase::setSaveCount(), DPMBase::setTimeMax(), DPMBase::setTimeStep(), DPMBase::setXBallsColourMode(), DPMBase::setXBallsVectorScale(), DPMBase::setZMax(), DPMBase::solve(), DPMBase::speciesHandler, mathsFunc::square(), Chute::write(), and DPMBase::writeRestartFile().