Chute with hopper

Problem description:

Hopper3dDemo.cpp treats particles which flow from a hopper onto an inclined chute below. The entire code of this problem can be viewed here: Particles on a chute with a multilayered bottom (code).

Headers

#include <sstream>
#include <iostream>
#include <iomanip>
#include <cmath>

Before the main function

Main function

int main()
{
//Problem parameters
ChuteWithHopper problem;
problem.setName("HopperSelfTest");
Mdouble tc = 4.0e-4; // particle collision time
problem.setTimeStep(0.02 * tc);
problem.setTimeMax(0.01);
//Particle properties
problem.setInflowParticleRadius(0.32e-3, 0.40e-3);
problem.setFixedParticleRadius(0.36e-3);
species.setHandler(&problem.speciesHandler);
species.setDensity(2400.0);
Mdouble meanRadius = 0.5 * (problem.getMinInflowParticleRadius() + problem.getMaxInflowParticleRadius());
Mdouble mass = species.getMassFromRadius(meanRadius);
species.setCollisionTimeAndRestitutionCoefficient(tc, 0.95, mass);
species.setSlidingFrictionCoefficient(0.5);
problem.speciesHandler.copyAndAddObject(species);
//Chute properties
problem.setRoughBottomType(MONOLAYER_ORDERED); // try also MONOLAYER_DISORDERED, MULTILAYER or FLAT
problem.setChuteAngleAndMagnitudeOfGravity(10.0,9.8); // in degrees (relative to horizontal)
problem.setChuteLength(40.0e-3);
problem.setChuteWidth(3.2e-3 / 2.0);
//Hopper properties
Mdouble ExitHeight = 10.0e-3;
Mdouble ExitLength = ExitHeight;
Mdouble hopperAngle_ = 60.0;
Mdouble hopperLength_ = 4.0 * ExitLength;
// Mdouble hopperLowestPoint_ = ExitHeight - ExitLength * std::tan(problem.getChuteAngle());
// Mdouble hopperHeight_ = hopperLowestPoint_ + 1.1 * 0.5 * (hopperLength_ + ExitLength) / std::tan(hopperAngle_ * constants::pi / 180.0); // NB: this is not DEDUCED, but SET!!! (BvdH)
Mdouble hopperHeight_ = 24.1139e-3;
problem.setHopper(ExitLength, ExitHeight, hopperAngle_, hopperLength_, hopperHeight_);
// Output properties
problem.setSaveCount(51);
//'time step ratio': size of minimum particle over maximum distance travelled
// by any particle per time step (i.e., should be >> 1 )
logger(INFO, "time step ratio: %", problem.getTimeStepRatio());
//solve
problem.solve();
}
@ 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.
int main(int argc, char *argv[])
Definition: T_protectiveWall.cpp:215
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

(Return to Overview of advanced tutorials)