 |
revision: v0.14
|
Go to the documentation of this file.
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;
Mdouble RelLoopSize
Definition: Siegen.h:151
Definition: SiegenRail.cpp:31
Mdouble TangentialVelocity
Definition: Siegen.h:153
T square(const T val)
squares a number
Definition: ExtendedMath.h:106
void fix_hgrid()
Definition: obsolete_codes/SilbertPeriodic.h:67
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:420
Slide(double NormalForce)
Definition: SiegenSlide.cpp:34
void setupInitialConditions()
This function allows to set the initial conditions for our problem to be solved, by default particle ...
Definition: obsolete_codes/SilbertPeriodic.h:198
void printTime()
Definition: obsolete_codes/SilbertPeriodic.h:279
Mdouble getSlidingFrictionCoefficientBottom()
Definition: obsolete_codes/SilbertPeriodic.h:77
Mdouble getTimeStep() const
Returns the simulation time step.
Definition: DPMBase.cc:1241
bool readNextArgument(int &i, int argc, char *argv[]) override
This method can be used for reading object properties from a string.
Definition: Chute.cc:510
const Mdouble pi
Definition: ExtendedMath.h:45
Mdouble LoopTime
Definition: Siegen.h:154
int main(int argc UNUSED, char *argv[] UNUSED)
Definition: SiegenRail.cpp:144
void fixParticle()
Fix Particle function. It fixes a Particle by setting its inverse mass and inertia and velocities to ...
Definition: BaseParticle.cc:165
void create_inflow_particle()
Definition: obsolete_codes/SilbertPeriodic.h:264
void setPosition(const Vec3D &position)
Sets the position of this BaseInteractable.
Definition: BaseInteractable.h:239
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
const Vec3D & getForce() const
Returns the force on this BaseInteractable.
Definition: BaseInteractable.h:126
RNG random
This is a random generator, often used for setting up the initial conditions etc.....
Definition: DPMBase.h:1390
unsigned int getNumberOfObjects() const override
Returns the number of objects in the container. In parallel code this practice is forbidden to avoid ...
Definition: ParticleHandler.cc:1315
Mdouble X
the vector components
Definition: Vector.h:65
void setYMax(Mdouble newYMax)
Sets the value of YMax, the upper bound of the problem domain in the y-direction.
Definition: DPMBase.cc:1182
void setInfiniteInertia()
Sets the particle's inertia_ to 'infinite' (1e20) and its invInertia_ to 0.
Definition: BaseParticle.cc:520
int main(int argc UNUSED, char *argv[] UNUSED)
Definition: SiegenRestitutionSelfTest.cpp:62
virtual void createBaseSpecies()
Definition: obsolete_codes/SilbertPeriodic.h:87
void actionsBeforeTimeStep()
A virtual function which allows to define operations to be executed before the new time step.
Definition: SiegenRail.cpp:96
LL< Log::INFO > INFO
Info log level.
Definition: Logger.cc:55
int readNextArgument(unsigned int &i, unsigned int argc, char *argv[])
Definition: obsolete_codes/SilbertPeriodic.h:288
virtual const Vec3D & getVelocity() const
Returns the velocity of this interactable.
Definition: BaseInteractable.cc:329
virtual void setRadius(Mdouble radius)
Sets the particle's radius_ (and adjusts the mass_ accordingly, based on the particle's species)
Definition: BaseParticle.cc:542
@ MULTILAYER
Definition: Chute.h:53
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: Helpers.cc:374
void solve()
The work horse of the code.
Definition: DPMBase.cc:4003
Slide()
Definition: SiegenRestitutionSelfTest.cpp:35
void writeEneTimeStep(std::ostream &os) const
Write the global kinetic, potential energy, etc. in the system.
Definition: SiegenRail.cpp:131
Slide(Mdouble AngleDeg=0)
Definition: SiegenRail.cpp:34
void setZMax(Mdouble newZMax)
Sets the value of ZMax, the upper bound of the problem domain in the z-direction.
Definition: DPMBase.cc:1208
double Mdouble
Definition: GeneralDefine.h:34
void create_rough_wall(double Radius)
Definition: SiegenSlide.cpp:97
Mdouble getRadius() const
Returns the particle's radius.
Definition: BaseParticle.h:348
void actionsBeforeTimeLoop()
A virtual function. Allows one to carry out any operations before the start of the time loop.
Definition: SiegenSlide.cpp:68
void setVelocity(const Vec3D &velocity)
set the velocity of the BaseInteractable.
Definition: BaseInteractable.cc:350
void set_study(int study_num)
Definition: obsolete_codes/SilbertPeriodic.h:110
Vec3D getMax() const
Definition: DPMBase.h:643
LL< Log::VERBOSE > VERBOSE
Verbose information.
Definition: Logger.cc:57
virtual void write(std::ostream &os, bool writeAllParticles=true) const
Definition: DPMBase.cc:3409
Mdouble Angle
Definition: Siegen.h:152
Mdouble sin(Mdouble x)
Definition: ExtendedMath.cc:44
void set_study()
Definition: obsolete_codes/SilbertPeriodic.h:99
Mdouble getTime() const
Returns the current simulation time.
Definition: DPMBase.cc:805
Contains material and contact force properties.
Definition: Species.h:35
Mdouble round(const Mdouble value, unsigned precision)
Definition: Helpers.cc:598
Definition: flowRuleDiego_HeightAngle.cpp:35
A spherical particle is the most simple particle used in MercuryDPM.
Definition: SphericalParticle.h:37
WallHandler wallHandler
An object of the class WallHandler. Contains pointers to all the walls created.
Definition: DPMBase.h:1405
void setTimeMax(Mdouble newTMax)
Sets a new value for the maximum simulation duration.
Definition: DPMBase.cc:870
Mdouble Y
Definition: Vector.h:65
void setGravity(Vec3D newGravity)
Sets a new value for the gravitational acceleration.
Definition: DPMBase.cc:1374
void actionsBeforeTimeStep()
A virtual function which allows to define operations to be executed before the new time step.
Definition: obsolete_codes/SilbertPeriodic.h:195
A infinite wall fills the half-space {point: (position_-point)*normal_<=0}.
Definition: InfiniteWall.h:48
LinearViscoelasticFrictionSpecies * species
Definition: Siegen.h:155
const std::complex< Mdouble > i
Definition: ExtendedMath.h:51
void setYMin(Mdouble newYMin)
Sets the value of YMin, the lower bound of the problem domain in the y-direction.
Definition: DPMBase.cc:1025
MERCURY_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: Helpers.cc:346
void add_flow_particles()
Definition: obsolete_codes/SilbertPeriodic.h:240
T * getObject(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
Definition: BaseHandler.h:613
#define UNUSED
Definition: GeneralDefine.h:39
std::enable_if<!std::is_pointer< U >::value, U * >::type copyAndAddObject(const U &object)
Creates a copy of a Object and adds it to the BaseHandler.
Definition: BaseHandler.h:379
Mdouble getRandomNumber()
This is a random generating routine can be used for initial positions.
Definition: RNG.cc:142
virtual void clear()
Empties the whole BaseHandler by removing all Objects and setting all other variables to 0.
Definition: BaseHandler.h:528
Mdouble relOverlap
Definition: Siegen.h:149
Mdouble NormalForce
Definition: Siegen.h:150
void set_Walls(Mdouble Angle)
Definition: SiegenRail.cpp:63
void set_study(vector< int > study_num)
Definition: obsolete_codes/SilbertPeriodic.h:186
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created.
Definition: DPMBase.h:1395
Mdouble Z
Definition: Vector.h:65
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:406
SilbertPeriodic()
Definition: obsolete_codes/SilbertPeriodic.h:34
Mdouble getMass() const
Returns the particle's mass.
Definition: BaseParticle.h:322
void set(Vec3D normal, Vec3D point)
Defines a standard wall, given an outward normal vector s.t. normal*x=normal*point for all x of the w...
Definition: InfiniteWall.cc:118
Creates chutes with different bottoms. Inherits from Mercury3D (-> MercuryBase -> DPMBase).
Definition: Chute.h:65
std::string name
Definition: MercuryProb.h:48
void setZMin(Mdouble newZMin)
Sets the value of ZMin, the lower bound of the problem domain in the z-direction.
Definition: DPMBase.cc:1049
int main(int argc UNUSED, char *argv[] UNUSED)
Definition: SiegenSlide.cpp:133
void setSlidingFrictionCoefficientBottom(Mdouble new_)
Definition: obsolete_codes/SilbertPeriodic.h:82
Mdouble cos(Mdouble x)
Definition: ExtendedMath.cc:64
Mdouble get_H()
Definition: obsolete_codes/SilbertPeriodic.h:277
const Vec3D & getPosition() const
Returns the position of this BaseInteractable.
Definition: BaseInteractable.h:218
Mdouble getTimeMax() const
Returns the maximum simulation duration.
Definition: DPMBase.cc:885
void set_H(Mdouble new_)
Definition: obsolete_codes/SilbertPeriodic.h:276