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

Classes

class  SegregationWithHopper
 

Functions

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

Function Documentation

◆ main()

int main ( int argc  UNUSED,
char *argv[]  UNUSED 
)
73 {
74  SegregationWithHopper problem;
75 
76  // Problem parameters
77  problem.setName("segregation");
78  //Should be 10 for full length problem, but here I keep it low for a test case
79  problem.setTimeMax(10);
80 
81 
82  // Particle properties
83  problem.setDensity(2400.0);
84 
85  problem.setInflowParticleRadius(0.3e-3,0.60e-3);
86  problem.speciesHandler.getObject(0)->setCollisionTimeAndRestitutionCoefficient(4e-4, 0.6);
87  problem.speciesHandler.getObject(0)->setSlidingDissipation(problem.get_dissipation());
88  problem.speciesHandler.getObject(0)->setSlidingFrictionCoefficient(0.8);
89  problem.setFixedParticleRadius(0.3e-3);
91 
92 
93  // Chute properties
94  problem.setChuteAngle(25.0);
95  problem.setChuteLength(600.0e-3);
96  problem.setChuteWidth(3e-3);
97  problem.setMaxFailed(6);
98  problem.makeChutePeriodic();
99  double ExitHeight = 12.0e-3, ExitLength = 1.0 * ExitHeight, hopperAngle_ = 60.0, hopperLength_ = 6.0 * ExitLength;
100  problem.set_Hopper(ExitLength,ExitHeight,hopperAngle_,hopperLength_);
101 
102  //solve
103  cout << "Maximum allowed speed of particles: " << problem.getMaximumVelocity() << endl; // speed allowed before particles move through each other!
104  problem.setTimeStep();
106  cout << "dt=" << problem.getTimeStep() << endl;
107 
108  problem.auto_number();
109  problem.write(std::cout,false);
110  problem.save_info_to_disk();
111 
112  //This set to colouring based of size and small vectors
113  problem.setXBallsColourMode(7);
114  problem.setXBallsVectorScale(1);
115  problem.setXBallsScale(20.0);
116 
117 
118  problem.solve();
119  problem.write(cout);
120  //problem.HGRID_base::write(cout);
121 
122 
123  //cout << problem << endl;
124  problem.writeRestartFile();
125 }
@ 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 setChuteLength(Mdouble chuteLength) override
sets xMax to chuteLength+hopperlength_, and thus specifies the length off the runoff chute
Definition: ChuteWithHopper.cc:541
void write(std::ostream &os, bool writeAllParticles=true) const override
Writes setup properties to an ostream.
Definition: ChuteWithHopper.cc:615
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
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
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 setXBallsScale(Mdouble newScale)
Sets the scale of the view (either normal, zoom in or zoom out) to display in xballs....
Definition: DPMBase.cc:1363
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
Definition: Chute/segregation_with_hopper.cpp:38
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::getTimeMax(), DPMBase::getTimeStep(), Chute::makeChutePeriodic(), MONOLAYER_DISORDERED, Chute::setChuteAngle(), ChuteWithHopper::setChuteLength(), Chute::setChuteWidth(), Chute::setFixedParticleRadius(), Chute::setInflowParticleRadius(), Chute::setMaxFailed(), DPMBase::setName(), Chute::setRoughBottomType(), DPMBase::setSaveCount(), DPMBase::setTimeMax(), DPMBase::setTimeStep(), DPMBase::setXBallsColourMode(), DPMBase::setXBallsScale(), DPMBase::setXBallsVectorScale(), DPMBase::solve(), DPMBase::speciesHandler, ChuteWithHopper::write(), and DPMBase::writeRestartFile().