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

Functions

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

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)

A three-dimensional hopper inflow.

17 {
18  //Print description
19  logger(INFO, "Description: A three-dimensional hopper inflow.\n\n");
20 
21  // Problem parameters
23  problem.setName("hopper_3d_demo");
24  problem.setTimeMax(2.0); //Should be 10 for full length problem, but here I keep it low for a test case
25 
26  // Particle properties
28  species.setDensity(2400.0);
29  species.setCollisionTimeAndRestitutionCoefficient(4e-3, 0.6, 2400);
30  species.setSlidingDissipation(species.getDissipation());
31  species.setSlidingFrictionCoefficient(0.8);
32  problem.speciesHandler.copyAndAddObject(species);
33 
34 
35  // Chute properties
36  problem.setChuteAngle(30.0);
37  problem.setChuteLength(50.0);
38  problem.setChuteWidth(100);
39  problem.setInflowParticleRadius(0.5, 0.5);
40  problem.setFixedParticleRadius(0.0);
41  problem.setRoughBottomType(MONOLAYER_ORDERED);
42 
43  problem.setMaxFailed(6);
44  problem.makeChutePeriodic();
45  problem.setTimeStep(4e-3 / 50);
46 
47  // Hopper properties
48  problem.setHopperDimension(2);
49  problem.setHopperLift(20);
50  Mdouble ExitHeight = 4.0, ExitLength = 1.0 * ExitHeight, hopperAngle_ = 45.0, hopperLength_ = 3.0 * ExitLength;
51  Mdouble hopperLowestPoint_ = ExitHeight - ExitLength * tan(problem.getChuteAngle());
52  Mdouble hopperHeight_ =
53  hopperLowestPoint_ + 1.1 * 0.5 * (hopperLength_ + ExitLength) / tan(hopperAngle_ * constants::pi / 180.0);
54  Mdouble HopperCornerHeight =
55  hopperHeight_ - 0.5 * (hopperLength_ - ExitLength) / tan(hopperAngle_ * constants::pi / 180.0);
56  if (HopperCornerHeight <= 0.0)
57  {
58  hopperHeight_ += -HopperCornerHeight + problem.getInflowParticleRadius();
59  HopperCornerHeight = problem.getInflowParticleRadius();
60  }
61  problem.setHopper(ExitLength, ExitHeight, hopperAngle_, hopperLength_, hopperHeight_);
62 
63  // Output properties
65  problem.getTimeStep()));
66  problem.restartFile.setSaveCount(problem.getTimeMax() / problem.getTimeStep());
67  problem.setXBallsAdditionalArguments("-sort -v0 -solidf -drotphi 0.05 -v0 -oh -200 -p 20 -noborder 3");
68  problem.setParticlesWriteVTK(true);
69 
70  //solve
71  problem.solve(argc, argv);
72 }
@ MONOLAYER_ORDERED
Definition: Chute.h:32
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
ChuteWithHopper has a hopper as inflow.
Definition: ChuteWithHopper.h:18
void setDensity(Mdouble density)
Definition: ParticleSpecies.cc:88
Contains material and contact force properties.
Definition: Species.h:14
#define INFO(i)
Definition: mumps_solver.h:54
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 tan(const bfloat16 &a)
Definition: BFloat16.h:633
const Mdouble pi
Definition: ExtendedMath.h:23
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:75
Constructor for SteadyAxisymAdvectionDiffusion problem
Definition: steady_axisym_advection_diffusion.cc:213

References e(), helpers::getSaveCountFromNumberOfSavesAndTimeMaxAndTimeStep(), INFO, logger, MONOLAYER_ORDERED, constants::pi, problem, ParticleSpecies::setDensity(), and Eigen::bfloat16_impl::tan().