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

Classes

class  ChutePeriodic
 

Functions

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

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)
65 {
67 
68  // Problem parameters
69  md.setName("Lawine");
70  md.fStatFile.setFileType(FileType::ONE_FILE);
71  md.dataFile.setFileType(FileType::ONE_FILE);
72  md.autoNumber();
73  md.setTimeMax(100);
74 
75  // Particle properties
76  md.setDensity(2400.0);
77  md.setInflowParticleRadius(2.5e-3);//d=5mm
78  md.speciesHandler.getObject(0)->setCollisionTimeAndRestitutionCoefficient(5e-4, 0.8);
79  md.setTimeStep(1e-5);
80  md.setTimeMax(25);
81  md.speciesHandler.getObject(0)->setSlidingDissipation(md.get_dissipation());
82  md.speciesHandler.getObject(0)->setSlidingStiffness(2./7.*md.speciesHandler.getObject(0)->getStiffness());
83  md.speciesHandler.getObject(0)->setSlidingFrictionCoefficient(0.5);
84  cout << "friction angle " << atan(md.getSlidingFrictionCoefficient())*180./pi << endl;
85  md.setFixedParticleRadius(0);
86  md.setFixedParticleRadius(md.getInflowParticleRadius());
87  md.setRoughBottomType(MONOLAYER_ORDERED);
88 
89  // Chute properties
90  md.setChuteAngle(0.0);
91  md.setChuteWidth(450e-3);
92  md.setZMax(150e-3);//initial height 150-200mm
93  md.setChuteLength(1);
94  md.setMaxFailed(1000);
95 
96  if (argc>1&&argv[1][0]!='-') {
97  double ratio = pow(atof(argv[1]),1./3.);
98  md.set_hopperLength_(md.getZMax()/mathsFunc::square(ratio));
99  md.setChuteWidth(md.getChuteWidth()*ratio);
100  md.setZMax(md.getZMax()*ratio);
101  argc--; argv++;
102  } else md.set_hopperLength_(md.getZMax());
103 
104 
105  cout << "hopperLength_=" << md.get_hopperLength_() << endl;
106  cout << "ChuteWidth=" << md.getChuteWidth() << endl;
107  cout << "zmax=" << md.getZMax() << endl;
108  cout << "Maximum allowed speed of particles: " << md.getMaximumVelocity() << endl;
109  md.setSaveCount(.5e4);
110  cout << "dt=" << md.getTimeStep() << endl;
111 
112  //This set to colouring based of size and small vectors
113  md.setXBallsColourMode(7);
114  md.setXBallsVectorScale(1);
115 
116  //solve
117  md.readArguments(argc, argv);
118  md.solve();
119 
120  md.write(std::cout,false);
121  md.writeRestartFile();
122  md.writeRestartFile();
123 
124 }
@ MONOLAYER_ORDERED
Definition: Chute.h:32
Array< double, 1, 3 > e(1./3., 0.5, 2.)
@ ONE_FILE
all data will be written into/ read from a single file called name_
Matrix2d md
Definition: MatrixBase_cast.cpp:1
Definition: chute_periodic_autorun.cpp:16
EIGEN_DEVICE_FUNC const GlobalUnaryPowReturnType< Derived, ScalarExponent > pow(const Eigen::ArrayBase< Derived > &x, const ScalarExponent &exponent)
Definition: GlobalFunctions.h:137
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 atan(const bfloat16 &a)
Definition: BFloat16.h:636
const Mdouble pi
Definition: ExtendedMath.h:23
T square(const T val)
squares a number
Definition: ExtendedMath.h:86

References Eigen::bfloat16_impl::atan(), e(), md, MONOLAYER_ORDERED, ONE_FILE, constants::pi, Eigen::bfloat16_impl::pow(), and mathsFunc::square().