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

Classes

class  SegregationWithHopper
 

Functions

int main ()
 

Function Documentation

◆ main()

int main ( )
67 {
69 
70  // Problem parameters
71  problem.setName("segregation");
72  //Should be 10 for full length problem, but here I keep it low for a test case
73  problem.setTimeMax(10);
74 
75 
76  // Particle properties
77  auto species = problem.speciesHandler.copyAndAddObject(LinearViscoelasticFrictionSpecies());
78 
79  species->setDensity(2400.0);
80 
81  problem.setInflowParticleRadius(0.3e-3,0.60e-3);
82  double mass = 0.5*species->getMassFromRadius(0.5*(problem.getMinInflowParticleRadius() + problem.getMaxInflowParticleRadius()));
83  species->setCollisionTimeAndRestitutionCoefficient(4e-4,0.6,mass);
84  species->setSlidingDissipation(species->getDissipation());
85  species->setSlidingFrictionCoefficient(0.8);
86  problem.setFixedParticleRadius(0.3e-3);
87  problem.setRoughBottomType(MONOLAYER_DISORDERED);
88 
89  // Chute properties
90  problem.setChuteAngle(25.0);
91  problem.setChuteLength(600.0e-3);
92  problem.setChuteWidth(3e-3);
93  problem.setMaxFailed(6);
94  problem.makeChutePeriodic();
95  double ExitHeight = 12.0e-3, ExitLength = 1.0 * ExitHeight, hopperAngle_ = 60.0, hopperLength_ = 6.0 * ExitLength;
96  Mdouble hopperLowestPoint_ = ExitHeight - ExitLength * tan(problem.getChuteAngle());
97  Mdouble hopperHeight_ =
98  hopperLowestPoint_ + 1.1 * 0.5 * (hopperLength_ + ExitLength) / tan(hopperAngle_ * constants::pi / 180.0);
99  Mdouble HopperCornerHeight =
100  hopperHeight_ - 0.5 * (hopperLength_ - ExitLength) / tan(hopperAngle_ * constants::pi / 180.0);
101  if (HopperCornerHeight <= 0.0)
102  {
103  hopperHeight_ += -HopperCornerHeight + problem.getMaxInflowParticleRadius();
104  HopperCornerHeight = problem.getMaxInflowParticleRadius();
105  }
106  problem.setHopper(ExitLength, ExitHeight, hopperAngle_, hopperLength_, hopperHeight_);
107 
108  //solve
109  //std::cout << "Maximum allowed speed of particles: " << problem.particleHandler.getSmallestParticle()->calculateMaximumVelocity() << std::endl; // speed allowed before particles move through each other!
110  problem.setTimeStep(0.02 * species->getCollisionTime(mass));
112  problem.getTimeStep()));
113 
114  logger(INFO, "dt=%", problem.getTimeStep());
115 
116  problem.autoNumber();
117  problem.write(std::cout, false);
118  problem.writeRestartFile();
119 
120  //This set to colouring based of size and small vectors
121  problem.setXBallsColourMode(7);
122  problem.setXBallsVectorScale(1);
123  problem.setXBallsScale(20.0);
124  problem.setXBallsAdditionalArguments("-v0 -solidf");
125 
126 
127  problem.solve();
128  problem.write(std::cout);
129  //problem.HGRID_base::write(std::cout);
130 
131 
132  //std::cout << problem << std::endl;
133  problem.writeRestartFile();
134 }
@ MONOLAYER_DISORDERED
Definition: Chute.h:32
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Species< LinearViscoelasticNormalSpecies, FrictionSpecies > LinearViscoelasticFrictionSpecies
Definition: LinearViscoelasticFrictionSpecies.h:12
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
Definition: Chute/segregation_with_hopper.cpp:17
#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_DISORDERED, constants::pi, problem, and Eigen::bfloat16_impl::tan().