HopperSelfTest.cpp File Reference
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cmath>
#include "Species/LinearViscoelasticSlidingFrictionSpecies.h"
#include "ChuteWithHopper.h"

Functions

int main ()
 [CH:headers] More...
 

Function Documentation

◆ main()

int main ( )

[CH:headers]

[CH:headers] [CH:main]

40 {
41 
42  //Problem parameters
43  ChuteWithHopper problem;
44  problem.setName("HopperSelfTest");
45  Mdouble tc = 4.0e-4; // particle collision time
46  problem.setTimeStep(0.02 * tc);
47  problem.setTimeMax(0.01);
48 
49 
50  //Particle properties
51  problem.setInflowParticleRadius(0.32e-3, 0.40e-3);
52  problem.setFixedParticleRadius(0.36e-3);
53 
55  species.setHandler(&problem.speciesHandler);
56  species.setDensity(2400.0);
57  Mdouble meanRadius = 0.5 * (problem.getMinInflowParticleRadius() + problem.getMaxInflowParticleRadius());
58  Mdouble mass = species.getMassFromRadius(meanRadius);
59  species.setCollisionTimeAndRestitutionCoefficient(tc, 0.95, mass);
60  species.setSlidingFrictionCoefficient(0.5);
61  problem.speciesHandler.copyAndAddObject(species);
62 
63  //Chute properties
64  problem.setRoughBottomType(MONOLAYER_ORDERED); // try also MONOLAYER_DISORDERED, MULTILAYER or FLAT
65  problem.setChuteAngleAndMagnitudeOfGravity(10.0,9.8); // in degrees (relative to horizontal)
66  problem.setChuteLength(40.0e-3);
67  problem.setChuteWidth(3.2e-3 / 2.0);
68 
69  //Hopper properties
70  Mdouble ExitHeight = 10.0e-3;
71  Mdouble ExitLength = ExitHeight;
72  Mdouble hopperAngle_ = 60.0;
73  Mdouble hopperLength_ = 4.0 * ExitLength;
74 
75 // Mdouble hopperLowestPoint_ = ExitHeight - ExitLength * std::tan(problem.getChuteAngle());
76 // Mdouble hopperHeight_ = hopperLowestPoint_ + 1.1 * 0.5 * (hopperLength_ + ExitLength) / std::tan(hopperAngle_ * constants::pi / 180.0); // NB: this is not DEDUCED, but SET!!! (BvdH)
77 
78  Mdouble hopperHeight_ = 24.1139e-3;
79  problem.setHopper(ExitLength, ExitHeight, hopperAngle_, hopperLength_, hopperHeight_);
80 
81  // Output properties
82  problem.setSaveCount(51);
83 
84  //'time step ratio': size of minimum particle over maximum distance travelled
85  // by any particle per time step (i.e., should be >> 1 )
86  logger(INFO, "time step ratio: %", problem.getTimeStepRatio());
87 
88  //solve
89  problem.solve();
90 }
@ MONOLAYER_ORDERED
Definition: Chute.h:53
double Mdouble
Definition: GeneralDefine.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
void setHandler(SpeciesHandler *handler)
Sets the pointer to the handler to which this species belongs.
Definition: BaseSpecies.cc:91
ChuteWithHopper has a hopper as inflow.
Definition: ChuteWithHopper.h:39
Mdouble getTimeStepRatio() const
Returns smallest particle radius over maximum gravitational velocity.
Definition: ChuteWithHopper.cc:513
void setHopper(Mdouble exitLength, Mdouble exitHeight, Mdouble angle, Mdouble length, Mdouble height)
Sets the hopper's geometrical properties.
Definition: ChuteWithHopper.cc:389
void setChuteLength(Mdouble chuteLength) override
sets xMax to chuteLength+hopperlength_, and thus specifies the length off the runoff chute
Definition: ChuteWithHopper.cc:541
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
Mdouble getMaxInflowParticleRadius() const
Returns the maximum radius of inflow particles.
Definition: Chute.cc:947
void setChuteAngleAndMagnitudeOfGravity(Mdouble chuteAngle, Mdouble gravity)
Sets gravity vector according to chute angle (in degrees)
Definition: Chute.cc:789
Mdouble getMinInflowParticleRadius() const
returns the minimum radius of inflow particles
Definition: Chute.cc:938
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
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 setDensity(Mdouble density)
Definition: ParticleSpecies.cc:108
Mdouble getMassFromRadius(Mdouble radius) const
Definition: ParticleSpecies.cc:123
Contains material and contact force properties.
Definition: Species.h:35

References BaseHandler< T >::copyAndAddObject(), ParticleSpecies::getMassFromRadius(), Chute::getMaxInflowParticleRadius(), Chute::getMinInflowParticleRadius(), ChuteWithHopper::getTimeStepRatio(), INFO, logger, MONOLAYER_ORDERED, Chute::setChuteAngleAndMagnitudeOfGravity(), ChuteWithHopper::setChuteLength(), Chute::setChuteWidth(), ParticleSpecies::setDensity(), Chute::setFixedParticleRadius(), BaseSpecies::setHandler(), ChuteWithHopper::setHopper(), Chute::setInflowParticleRadius(), DPMBase::setName(), Chute::setRoughBottomType(), DPMBase::setSaveCount(), DPMBase::setTimeMax(), DPMBase::setTimeStep(), DPMBase::solve(), and DPMBase::speciesHandler.