51 FunnelInflowHeight = -1;
54 FunnelPointOnAxis.setZero();
60 setLastSavedTimeStep(1);
68 FunnelPointOnAxis =
Vec3D(0.5 * (getXMax() + getXMin()), 0.5 * (getYMax() + getYMin()), 0);
69 Mdouble PossibleRadius = 0.5 * (getXMax() - getXMin());
70 if (FunnelMaxRadius == -1)
71 FunnelMaxRadius = PossibleRadius;
72 if (FunnelMinRadius == -1)
73 FunnelMinRadius = FunnelMaxRadius / 3.;
74 if (FunnelHeight == -1)
76 setZMax(getZMax() + FunnelHeight);
77 if (FunnelInflowHeight == -1)
78 FunnelInflowHeight = min(FunnelHeight / 4., 25. * getInflowParticleRadius());
86 species->setCollisionTimeAndRestitutionCoefficient(tc, 2.0 / 3.0, species->getMassFromRadius(0.5 * (getMinInflowParticleRadius() + getMaxInflowParticleRadius())));
87 setTimeStep(tc / 10.);
89 species->setSlidingStiffness(2. / 7. * species->getStiffness());
90 species->setSlidingDissipation(2. / 7. * species->getDissipation());
91 species->setSlidingFrictionCoefficient(0.4);
92 species->setRollingStiffness(2. / 7. * species->getStiffness());
93 species->setRollingDissipation(2. / 7. * species->getDissipation());
94 species->setRollingFrictionCoefficient(0.1);
103 Vec3D A(FunnelMinRadius, 0, getZMax() - FunnelHeight);
104 Vec3D B(FunnelMaxRadius, 0, getZMax());
105 Vec3D C(FunnelMaxRadius, 0, getZMax() - FunnelHeight);
112 wallHandler.copyAndAddObject(w0);
114 write(std::cout,
false);
126 P0.setRadius(random.getRandomNumber(getMinInflowParticleRadius(), getMaxInflowParticleRadius()));
128 Mdouble R = random.getRandomNumber(0, FunnelMaxRadius - P0.getRadius());
131 double zhat = random.getRandomNumber(getZMax() - FunnelInflowHeight + P0.getRadius(), getZMax() - P0.getRadius());
134 P0.setPosition(FunnelPointOnAxis +
Vec3D(xhat * c - zhat * s,
R *
mathsFunc::sin(
A), zhat * c + xhat * s));
135 P0.setVelocity(
Vec3D(0, 0, 0));
136 P0.setSpecies(speciesHandler.getObject(0));
141 unsigned int failed = 0;
144 while (failed <= max_failed)
146 create_inflow_particle();
147 if (checkParticleForInteraction (P0))
149 particleHandler.copyAndAddObject(P0);
163 static int count = 0, maxcount = 100;
164 if (count > maxcount)
168 for (
unsigned int i = 0;
i < particleHandler.getNumberOfObjects();)
170 if (particleHandler.getObject(
i)->getPosition().Z < getZMin())
172 particleHandler.removeObject(
i);
184 if (!strcmp(argv[
i],
"-inflowHeight"))
186 setInflowHeight(atof(argv[
i + 1]));
187 setZMax(atof(argv[
i + 1]));
189 else if (!strcmp(argv[
i],
"-FunnelMinRadius"))
191 set_FunnelMinRadius(atof(argv[
i + 1]));
193 else if (!strcmp(argv[
i],
"-FunnelMaxRadius"))
195 set_FunnelMaxRadius(atof(argv[
i + 1]));
197 else if (!strcmp(argv[
i],
"-FunnelHeight"))
199 set_FunnelHeight(atof(argv[
i + 1]));
201 else if (!strcmp(argv[
i],
"-FunnelInflowHeight"))
203 set_FunnelInflowHeight(atof(argv[
i + 1]));
212 FunnelMinRadius = new_;
217 FunnelMaxRadius = new_;
227 if (FunnelHeight < new_)
229 logger(
ERROR,
"FunnelInflowHeight=% < FunnelHeight=%", new_);
231 FunnelInflowHeight = new_;
dominoes D
Definition: Domino.cpp:76
Species< LinearViscoelasticNormalSpecies, FrictionSpecies > LinearViscoelasticFrictionSpecies
Definition: LinearViscoelasticFrictionSpecies.h:34
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
@ R
Definition: StatisticsVector.h:42
@ A
Definition: StatisticsVector.h:42
Definition: AxisymmetricHopper.h:36
void set_FunnelInflowHeight(Mdouble new_)
Definition: AxisymmetricHopper.h:225
void add_particles()
Definition: AxisymmetricHopper.h:139
void set_FunnelMinRadius(Mdouble new_)
Definition: AxisymmetricHopper.h:210
Mdouble FunnelMinRadius
Definition: AxisymmetricHopper.h:237
void set_FunnelHeight(Mdouble new_)
Definition: AxisymmetricHopper.h:220
void set_FunnelMaxRadius(Mdouble new_)
Definition: AxisymmetricHopper.h:215
Vec3D FunnelPointOnAxis
Definition: AxisymmetricHopper.h:236
bool readNextArgument(int &i, int argc, char *argv[]) override
Interprets the i^th command-line argument.
Definition: AxisymmetricHopper.h:182
void create_inflow_particle()
Definition: AxisymmetricHopper.h:123
Mdouble FunnelHeight
Definition: AxisymmetricHopper.h:239
Mdouble FunnelMaxRadius
Definition: AxisymmetricHopper.h:238
SphericalParticle P0
Definition: AxisymmetricHopper.h:241
unsigned int num_created
Definition: AxisymmetricHopper.h:243
Mdouble FunnelInflowHeight
Definition: AxisymmetricHopper.h:240
virtual void cleanChute()
Definition: AxisymmetricHopper.h:160
void setupInitialConditions() override
This function allows to set the initial conditions for our problem to be solved, by default particle ...
Definition: AxisymmetricHopper.h:57
AxisymmetricHopper()
Definition: AxisymmetricHopper.h:39
unsigned int max_failed
Definition: AxisymmetricHopper.h:242
void actionsBeforeTimeStep() override
A virtual function which allows to define operations to be executed before the new time step.
Definition: AxisymmetricHopper.h:117
Use AxisymmetricIntersectionOfWalls to Screw Screw::read Screw::read Screw::read define axisymmetric ...
Definition: AxisymmetricIntersectionOfWalls.h:126
void setAxis(Vec3D a)
Definition: AxisymmetricIntersectionOfWalls.cc:152
virtual void setPosition(const Vec3D &position)
Sets the position of this BaseInteractable.
Definition: BaseInteractable.h:239
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
void addObject(Vec3D normal, Vec3D point)
Adds a wall to the set of infinite walls, given a normal vector pointing into the wall (i....
Definition: IntersectionOfWalls.cc:138
void setSpecies(const ParticleSpecies *species)
sets species of subwalls as well
Definition: IntersectionOfWalls.cc:72
A spherical particle is the most simple particle used in MercuryDPM.
Definition: SphericalParticle.h:37
static Vec3D cross(const Vec3D &a, const Vec3D &b)
Calculates the cross product of two Vec3D: .
Definition: Vector.cc:163
Mdouble getLength() const
Calculates the length of this Vec3D: .
Definition: Vector.cc:320
const Mdouble pi
Definition: ExtendedMath.h:45
const std::complex< Mdouble > i
Definition: ExtendedMath.h:51
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:96
Mdouble cos(Mdouble x)
Definition: ExtendedMath.cc:64
Mdouble sin(Mdouble x)
Definition: ExtendedMath.cc:44