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

Classes

class  SegregationPeriodic
 This class does segregation problems in a periodic chute. More...
 

Functions

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

Function Documentation

◆ main()

int main ( int argc  UNUSED,
char *argv[]  UNUSED 
)
173 {
174  SegregationPeriodic problem;
175 
176  // Problem parameters
177  problem.setName("segregation");
178  problem.setTimeMax(100);
179 
180 
181  // Particle properties
182  problem.setDensity(2400.0);
183 
184  problem.setInflowParticleRadius(0.3e-3,0.60e-3);
185  problem.speciesHandler.getObject(0)->setCollisionTimeAndRestitutionCoefficient(4e-4, 0.6);
186  problem.speciesHandler.getObject(0)->setSlidingDissipation(problem.get_dissipation());
187  problem.speciesHandler.getObject(0)->setSlidingFrictionCoefficient(0.8);
188  problem.setFixedParticleRadius(0.3e-3);
190 
191 
192  // Chute properties
193  problem.setChuteAngle(25.0);
194  problem.setChuteLength(50.0e-3);
195  problem.setChuteWidth(3e-3);
196  problem.setMaxFailed(6);
197  problem.makeChutePeriodic();
198 
199  //solve
200  cout << "Maximum allowed speed of particles: " << problem.getMaximumVelocity() << endl; // speed allowed before particles move through each other!
201  problem.setTimeStep();
202  //This is based on the fact in general you get too much data, so prob at worst you want to turn it into a 20 at 60fps (which is its self overkill)
203  problem.setSaveCount(helpers::getSaveCountFromNumberOfSavesAndTimeMaxAndTimeStep(20*60,getTimeMax(),getTimeStep()));
204  //problem.setSaveCount(1);
205  cout << "dt=" << problem.getTimeStep() << endl;
206 
207  problem.auto_number();
208 
209 
210  //This set to colouring based of size and small vectors
211  problem.setXBallsColourMode(7);
212  problem.setXBallsVectorScale(1);
213  problem.setXBallsAdditionalArguments("-sort -v0 -solidf");
214 
215  //problem.setSaveCount(1000);
216 
217  problem.solve();
218  //problem.HGRID_base::write(cout);
219 
220 
221  //cout << problem << endl;
222  problem.writeRestartFile();
223 }
@ MONOLAYER_DISORDERED
Definition: Chute.h:53
T * getObject(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
Definition: BaseHandler.h:613
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 setChuteAngle(Mdouble chuteAngle)
Sets gravity vector according to chute angle (in degrees)
Definition: Chute.cc:768
void makeChutePeriodic()
This makes the chute periodic in Y.
Definition: Chute.cc:632
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
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
void setXBallsAdditionalArguments(std::string newXBArgs)
Set the additional arguments for xballs.
Definition: DPMBase.cc:1347
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 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
This class does segregation problems in a periodic chute.
Definition: Chute/segregation.cpp:39
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 >::getObject(), helpers::getSaveCountFromNumberOfSavesAndTimeMaxAndTimeStep(), DPMBase::getTimeStep(), Chute::makeChutePeriodic(), MONOLAYER_DISORDERED, Chute::setChuteAngle(), Chute::setChuteLength(), Chute::setChuteWidth(), Chute::setFixedParticleRadius(), Chute::setInflowParticleRadius(), Chute::setMaxFailed(), DPMBase::setName(), Chute::setRoughBottomType(), DPMBase::setSaveCount(), DPMBase::setTimeMax(), DPMBase::setTimeStep(), DPMBase::setXBallsAdditionalArguments(), DPMBase::setXBallsColourMode(), DPMBase::setXBallsVectorScale(), DPMBase::solve(), DPMBase::speciesHandler, and DPMBase::writeRestartFile().