26 #include "scr/Chute.h"
46 setInflowParticleRadius(.5);
47 setFixedParticleRadius(.5);
53 setSlidingStiffness(2.0/7.0*getStiffness());
56 setSlidingDissipation(getDissipation());
57 setSlidingFrictionCoefficient(0.5);
60 setChuteAngle(24.0, 1.0);
70 Mdouble minCell = 2.*min(getFixedParticleRadius(),getMinInflowParticleRadius());
71 Mdouble maxCell = 2.*max(getFixedParticleRadius(),getMaxInflowParticleRadius());
72 if ((minCell==maxCell)|(minCell==0.)) set_HGRID_max_levels(1);
73 else set_HGRID_max_levels(2);
74 set_HGRID_cell_to_cell_ratio (1.0000001*maxCell/minCell);
78 if (speciesHandler.getNumberOfObjects()>1)
return speciesHandler.getMixedObject(1,0)->getSlidingFrictionCoefficient();
79 else return getSlidingFrictionCoefficient();
84 speciesHandler.getMixedObject(1, 0)->setSlidingFrictionCoefficient(new_);
89 static bool created=
false;
91 speciesHandler.copyAndAddObject(speciesHandler.getObject(0));
93 for (
unsigned int i=0;
i<particleHandler.getNumberOfObjects();
i++) {
94 if (particleHandler.getObject(
i)->isFixed()) particleHandler.getObject(
i)->setSpecies(speciesHandler.getObject(1));
101 name <<
"H" << getInflowHeight()
102 <<
"A" << getChuteAngleDegrees()
103 <<
"L" <<
round(100.*getFixedParticleRadius()*2.)/100.
104 <<
"M" << getSlidingFrictionCoefficient()
105 <<
"B" << getSlidingFrictionCoefficientBottom();
106 setName(
name.str().c_str());
122 Mdouble Lambdas[] = {0, 3./6., 4./6., 5./6., 1, 2};
123 setFixedParticleRadius(Lambdas[study_num]/2.);
124 setSlidingFrictionCoefficient(0.5);
125 }
else if (study_num < 9) {
127 Mdouble MuAll[] = {0, 1., 1e20};
128 setSlidingFrictionCoefficient(MuAll[study_num-6]);
129 setFixedParticleRadius(0.5);
130 }
else if (study_num < 12) {
132 Mdouble MuBottom[] = {0, 1., 1e20};
133 setSlidingFrictionCoefficient(0.5);
134 setSlidingFrictionCoefficientBottom(MuBottom[study_num-9]);
135 setFixedParticleRadius(0.5);
136 }
else if (study_num < 14) {
138 Mdouble MuBottom[] = {0.25, 0.125};
139 setSlidingFrictionCoefficient(0.5);
140 setSlidingFrictionCoefficientBottom(MuBottom[study_num-12]);
141 setFixedParticleRadius(0.5);
142 }
else if (study_num < 16) {
144 Mdouble MuAll[] = {0.25, 0.125};
145 setSlidingFrictionCoefficient(MuAll[study_num-14]);
146 setFixedParticleRadius(0.5);
147 }
else if (study_num < 21) {
149 Mdouble Lambdas[] = {1./6., 2./6., 1.5, 4, 1./12};
150 setFixedParticleRadius(Lambdas[study_num-16]/2.);
151 setSlidingFrictionCoefficient(0.5);
152 }
else if (study_num < 26) {
154 Mdouble MuBottom[] = {1./16.,1./32.,1./64.,1./128.,1./1024.};
155 setSlidingFrictionCoefficient(0.5);
156 setSlidingFrictionCoefficientBottom(MuBottom[study_num-21]);
157 setFixedParticleRadius(0.5);
158 }
else if (study_num < 29) {
160 Mdouble MuBottom[] = {1./16.,1./128.,1./1024.};
161 setSlidingFrictionCoefficient(0.5);
162 setSlidingFrictionCoefficientBottom(MuBottom[study_num-26]);
163 setFixedParticleRadius(0.25);
164 }
else if (study_num < 33) {
166 Mdouble MuBottom[] = {1./16.,1./128.,1./1024.,0};
167 setSlidingFrictionCoefficient(0.5);
168 setSlidingFrictionCoefficientBottom(MuBottom[study_num-29]);
169 setFixedParticleRadius(0);
170 }
else if (study_num < 37) {
171 cout <<
"S" << study_num << endl;
173 Mdouble Mu[] = {1e20,1,1./64,0};
174 setSlidingFrictionCoefficient(Mu[study_num-33]);
175 setSlidingFrictionCoefficientBottom(0.5);
176 setFixedParticleRadius(1);
179 cout <<
"Study is complete " << endl;
187 Mdouble Heights[] = {10, 20, 30, 40};
188 Mdouble Angles[] = {20, 22, 24, 26, 28, 30, 40, 50, 60};
189 setInflowHeight(Heights[study_num[1]-1]);
190 setChuteAngle(Angles[study_num[2]-1]);
191 set_study(study_num[0]);
201 particleHandler.set_StorageCapacity(particleHandler.getNumberOfObjects()+getChuteLength()*getChuteWidth()*getZMax());
207 for (
unsigned int i=0;
i<particleHandler.getNumberOfObjects();
i++)
208 if (particleHandler.getObject(
i)->isFixed())
209 particleHandler.getObject(
i)->setSpecies(speciesHandler.getObject(1));
213 if (getFixedParticleRadius()) {
214 wallHandler.getObject(0)->set(
Vec3D(0,0,-1), 3.4*MaxInflowParticleRadius);
216 wallHandler.getObject(0)->set(
Vec3D(0,0,-1), 0.);
219 set_NWallPeriodic(2);
220 WallsPeriodic[0].set(
Vec3D( 1.0, 0.0, 0.0), getXMin(), getXMax());
221 WallsPeriodic[1].set(
Vec3D( 0.0, 1.0, 0.0), getYMin(), getYMax());
223 add_flow_particles();
225 cout << endl <<
"Status before solve:" << endl;
227 <<
"tc=" << getCollisionTime()
228 <<
", eps=" << getRestitutionCoefficient()
230 <<
", InflowHeight/zmax=" << getInflowHeight()/getZMax()
235 cout <<
"Nmax" << particleHandler.getStorageCapacity() << endl;
236 set_HGRID_num_buckets_to_power(particleHandler.getNumberOfObjects()*1.5);
242 set_HGRID_num_buckets_to_power(particleHandler.getStorageCapacity());
243 hGridActionsBeforeTimeLoop();
244 hGridActionsBeforeTimeStep();
245 unsigned int N=particleHandler.getNumberOfObjects()+getChuteLength()*getChuteWidth()*InflowHeight;
246 particleHandler.set_StorageCapacity(N);
248 setZMax(1.2*InflowHeight);
252 while (particleHandler.getNumberOfObjects()<N){
253 create_inflow_particle();
254 if (IsInsertable(P0)) {
256 }
else InflowHeight += .0001* MaxInflowParticleRadius;
259 set_HGRID_num_buckets_to_power();
260 write(std::cout,
false);
266 P0.setRadius(random.get_RN(MinInflowParticleRadius,MaxInflowParticleRadius));
269 P0.getPosition().X = random.get_RN(getXMin()+2.0*P0.getRadius(),getXMax());
270 P0.getPosition().Y = random.get_RN(getYMin()+2.0*P0.getRadius(),getYMax());
271 P0.getPosition().Z = random.get_RN(getZMin()+2.0*P0.getRadius(),getInflowHeight());
272 P0.setVelocity(
Vec3D(0.0,0.0,0.0));
280 cout <<
"t=" << setprecision(3) << left << setw(6) << getTime()
281 <<
", tmax=" << setprecision(3) << left << setw(6) << getTimeMax()
282 <<
", N=" << setprecision(3) << left << setw(6) << particleHandler.getNumberOfObjects()
289 if (!strcmp(argv[
i],
"-muBottom")) {
290 setSlidingFrictionCoefficientBottom(atof(argv[
i+1]));
291 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
virtual void createBaseSpecies()
Definition: obsolete_codes/SilbertPeriodic.h:87
void set_study(vector< int > study_num)
Definition: obsolete_codes/SilbertPeriodic.h:186
void setSlidingFrictionCoefficientBottom(Mdouble new_)
Definition: obsolete_codes/SilbertPeriodic.h:82
void add_flow_particles()
Definition: obsolete_codes/SilbertPeriodic.h:240
void create_inflow_particle()
Definition: obsolete_codes/SilbertPeriodic.h:264
void set_study()
Definition: obsolete_codes/SilbertPeriodic.h:99
void set_H(Mdouble new_)
Definition: obsolete_codes/SilbertPeriodic.h:276
SilbertPeriodic()
Definition: obsolete_codes/SilbertPeriodic.h:34
void printTime()
Definition: obsolete_codes/SilbertPeriodic.h:279
void actionsBeforeTimeStep() override
A virtual function which allows to define operations to be executed before the new time step.
Definition: obsolete_codes/SilbertPeriodic.h:195
Mdouble get_H()
Definition: obsolete_codes/SilbertPeriodic.h:277
void fix_hgrid()
Definition: obsolete_codes/SilbertPeriodic.h:67
Mdouble getSlidingFrictionCoefficientBottom()
Definition: obsolete_codes/SilbertPeriodic.h:77
void set_study(int study_num)
Definition: obsolete_codes/SilbertPeriodic.h:110
void setupInitialConditions() override
This function allows to set the initial conditions for our problem to be solved, by default particle ...
Definition: obsolete_codes/SilbertPeriodic.h:198
int readNextArgument(unsigned int &i, unsigned int argc, char *argv[])
Definition: obsolete_codes/SilbertPeriodic.h:288
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
std::string name
Definition: MercuryProb.h:48