26 #include "scr/Chute.h"
46 setInflowParticleRadius(.5);
47 setFixedParticleRadius(.5);
53 double tc=5e-3, r=0.97,
beta=0.44, mu=0.092, mur=0.042;
54 setCollisionTimeAndNormalAndTangentialRestitutionCoefficient(tc,r,
beta,1.0,1.0);
55 setSlidingFrictionCoefficient(mu);
56 setSlidingFrictionCoefficientr();
59 setChuteAngle(24.0, 1.0);
69 double minCell = 2.*min(getFixedParticleRadius(),getMinInflowParticleRadius());
70 double maxCell = 2.*max(getFixedParticleRadius(),getMaxInflowParticleRadius());
71 if ((minCell==maxCell)|(minCell==0.)) set_HGRID_max_levels(1);
72 else set_HGRID_max_levels(2);
73 set_HGRID_cell_to_cell_ratio (1.0000001*maxCell/minCell);
77 if (speciesHandler.getNumberOfObjects()>1)
return speciesHandler.getMixedObject(1,0)->getSlidingFrictionCoefficient();
78 else return getSlidingFrictionCoefficient();
83 speciesHandler.getMixedObject(1, 0)->setSlidingFrictionCoefficient(new_);
88 static bool created=
false;
90 speciesHandler.copyAndAddObject(speciesHandler.getObject(0));
92 for (
int i=0;
i<get_N();
i++) {
93 if (Particles[
i].is_fixed()) Particles[
i].indSpecies=1;
100 name <<
"H" << getInflowHeight()
101 <<
"A" << getChuteAngleDegrees()
102 <<
"L" <<
round(100.*getFixedParticleRadius()*2.)/100.
103 <<
"M" << getSlidingFrictionCoefficient()
104 <<
"B" << getSlidingFrictionCoefficientBottom();
105 setName(
name.str().c_str());
121 double Lambdas[] = {0, 3./6., 4./6., 5./6., 1, 2};
122 setFixedParticleRadius(Lambdas[study_num]/2.);
125 cout <<
"Study is complete " << endl;
133 double Heights[] = {10, 20, 30, 40};
134 double Angles[] = {20, 22, 24, 26, 28, 30, 40, 50, 60};
135 setInflowHeight(Heights[study_num[1]-1]);
136 setChuteAngle(Angles[study_num[2]-1]);
137 set_study(study_num[0]);
147 set_Nmax(get_N()+getChuteLength()*getChuteWidth()*getZMax());
153 for (
int i=0;
i<get_N();
i++)
154 if (Particles[
i].is_fixed())
155 Particles[
i].indSpecies=1;
159 if (getFixedParticleRadius()) {
160 wallHandler.getObject(0)->set(
Vec3D(0,0,-1), 3.4*MaxInflowParticleRadius);
162 wallHandler.getObject(0)->set(
Vec3D(0,0,-1), 0.);
165 set_NWallPeriodic(2);
166 WallsPeriodic[0].set(
Vec3D( 1.0, 0.0, 0.0), getXMin(), getXMax());
167 WallsPeriodic[1].set(
Vec3D( 0.0, 1.0, 0.0), getYMin(), getYMax());
169 add_flow_particles();
171 cout << endl <<
"Status before solve:" << endl;
173 <<
"tc=" << getCollisionTime()
174 <<
", eps=" << getRestitutionCoefficient()
176 <<
", InflowHeight/zmax=" << getInflowHeight()/getZMax()
181 cout <<
"Nmax" << get_Nmax() << endl;
182 set_HGRID_num_buckets_to_power(get_N()*1.5);
188 set_HGRID_num_buckets_to_power(get_Nmax());
189 hGridActionsBeforeTimeLoop();
190 hGridActionsBeforeTimeStep();
191 unsigned int N=get_N()+getChuteLength()*getChuteWidth()*InflowHeight;
193 double H = InflowHeight;
194 setZMax(1.2*InflowHeight);
198 while (Particles.size()<N){
199 create_inflow_particle();
200 if (IsInsertable(P0)) {
202 }
else InflowHeight += .0001* MaxInflowParticleRadius;
205 set_HGRID_num_buckets_to_power();
206 write(std::cout,
false);
212 P0.Radius = MaxInflowParticleRadius;
215 P0.Position.X = random(getXMin()+2.0*P0.Radius,getXMax());
216 P0.Position.Y = random(getYMin()+2.0*P0.Radius,getYMax());
217 P0.Position.Z = random(getZMin()+2.0*P0.Radius,getInflowHeight());
218 P0.Velocity =
Vec3D(0.0,0.0,0.0);
222 void set_H(
double new_) {InflowHeight=new_; setZMax(InflowHeight);}
223 double get_H() {
return InflowHeight;}
226 cout <<
"t=" << setprecision(3) << left << setw(6) << getTime()
227 <<
", tmax=" << setprecision(3) << left << setw(6) << getTimeMax()
228 <<
", N=" << setprecision(3) << left << setw(6) << Particles.size()
235 if (!strcmp(argv[
i],
"-muBottom")) {
236 setSlidingFrictionCoefficientBottom(atof(argv[
i+1]));
237 cout <<
"muB=" << getSlidingFrictionCoefficientBottom() << endl;
@ MULTILAYER
Definition: Chute.h:53
Creates chutes with different bottoms. Inherits from Mercury3D (-> MercuryBase -> DPMBase).
Definition: Chute.h:65
bool readNextArgument(int &i, int argc, char *argv[]) override
This method can be used for reading object properties from a string.
Definition: Chute.cc:555
Definition: flowRuleDiego_HeightAngle.cpp:35
void createBaseSpecies()
Definition: obsolete_codes/GlasPeriodic.h:86
void set_study(vector< int > study_num)
Definition: obsolete_codes/GlasPeriodic.h:132
int readNextArgument(unsigned int &i, unsigned int &argc, char *argv[])
Definition: obsolete_codes/GlasPeriodic.h:234
void setSlidingFrictionCoefficientBottom(double new_)
Definition: obsolete_codes/GlasPeriodic.h:81
void add_flow_particles()
Definition: obsolete_codes/GlasPeriodic.h:186
void create_inflow_particle()
Definition: obsolete_codes/GlasPeriodic.h:210
void set_study()
Definition: obsolete_codes/GlasPeriodic.h:98
SilbertPeriodic()
Definition: obsolete_codes/GlasPeriodic.h:34
void printTime()
Definition: obsolete_codes/GlasPeriodic.h:225
void actionsBeforeTimeStep() override
A virtual function which allows to define operations to be executed before the new time step.
Definition: obsolete_codes/GlasPeriodic.h:141
double get_H()
Definition: obsolete_codes/GlasPeriodic.h:223
void fix_hgrid()
Definition: obsolete_codes/GlasPeriodic.h:66
void set_H(double new_)
Definition: obsolete_codes/GlasPeriodic.h:222
void set_study(int study_num)
Definition: obsolete_codes/GlasPeriodic.h:109
double getSlidingFrictionCoefficientBottom()
Definition: obsolete_codes/GlasPeriodic.h:76
void setupInitialConditions() override
This function allows to set the initial conditions for our problem to be solved, by default particle ...
Definition: obsolete_codes/GlasPeriodic.h:144
Contains material and contact force properties.
Definition: Species.h:35
const Mdouble pi
Definition: ExtendedMath.h:45
const std::complex< Mdouble > i
Definition: ExtendedMath.h:51
Mdouble round(Mdouble value, unsigned int precision)
rounds a floating point number with a given precision
Definition: MathHelpers.cc:28
MERCURYDPM_DEPRECATED Mdouble getMaximumVelocity(Mdouble k, Mdouble disp, Mdouble radius, Mdouble mass)
Calculates the maximum relative velocity allowed for a normal collision of two particles of radius r ...
Definition: FormulaHelpers.cc:68
Mdouble beta(Mdouble z, Mdouble w)
This is the beta function, returns the approximation based on cmath's implementation of ln(gamma)
Definition: ExtendedMath.cc:164
std::string name
Definition: MercuryProb.h:48