DensitySizeSegregation.cpp File Reference
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cmath>
#include "Chute.h"
#include "Boundaries/PeriodicBoundary.h"
#include "Walls/InfiniteWall.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <Species/LinearViscoelasticFrictionSpecies.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 
)
Todo:
TW:should be lightest particle, but computeMass has to be automated first
362 {
363  SegregationPeriodic problem;
364 
365  // Problem parameters, name tmax and two types of particles
366  problem.setName("DensitySizeSegregation");
367  //This should be set to 100 for full problems.
368  problem.setTimeMax(50000);
371 
372 
373 
374 
375  // Chute properties
376  problem.setFixedParticleRadius(0.5);
378  problem.setChuteAngleAndMagnitudeOfGravity(26.0, 1.0);
379  problem.setChuteLength(20);
380  problem.setChuteWidth(10);
381  problem.setZMax(70);
382  problem.setMaxFailed(6);
383  problem.makeChutePeriodic();
384 
385  //solve
387  //std::cout << "Maximum allowed speed of particles: " << problem.particleHandler.getSmallestParticle()->calculateMaximumVelocity() << std::endl; // speed allowed before particles move through each other!
388  problem.setTimeStep(5.e-3 / 50.0);//initially it was auto-set
389  //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)
391  //problem.setSaveCount(helpers::getSaveCountFromNumberOfSavesAndTimeMaxAndTimeStep(20*60,getTimeMax(),getTimeStep()));
392  //problem.setSaveCount(1);
393  logger(INFO, "dt=%", problem.getTimeStep());
394 
395  problem.autoNumber();
396 
397 
398  //This set to colouring based of size and small vectors
399  problem.setXBallsColourMode(7);
400  problem.setXBallsVectorScale(1);
401  problem.setXBallsAdditionalArguments("-v0 -solidf");
402 
403 
404  //solves the problems
405  problem.solve();
406 
407  //Make sure the restart data is upto date at the end
408  problem.writeRestartFile();
409 }
@ MULTILAYER
Definition: Chute.h:53
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
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 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 setChuteAngleAndMagnitudeOfGravity(Mdouble chuteAngle, Mdouble gravity)
Sets gravity vector according to chute angle (in degrees)
Definition: Chute.cc:789
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 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
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 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
Mdouble getTimeMax() const
Returns the maximum simulation duration.
Definition: DPMBase.cc:888
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 DPMBase::autoNumber(), BaseHandler< T >::copyAndAddObject(), BaseHandler< T >::getObject(), helpers::getSaveCountFromNumberOfSavesAndTimeMaxAndTimeStep(), DPMBase::getTimeMax(), DPMBase::getTimeStep(), INFO, logger, Chute::makeChutePeriodic(), MULTILAYER, Chute::setChuteAngleAndMagnitudeOfGravity(), Chute::setChuteLength(), Chute::setChuteWidth(), Chute::setFixedParticleRadius(), Chute::setMaxFailed(), DPMBase::setName(), Chute::setRoughBottomType(), DPMBase::setSaveCount(), DPMBase::setTimeMax(), DPMBase::setTimeStep(), DPMBase::setXBallsAdditionalArguments(), DPMBase::setXBallsColourMode(), DPMBase::setXBallsVectorScale(), DPMBase::setZMax(), DPMBase::solve(), DPMBase::speciesHandler, and DPMBase::writeRestartFile().