10 #ifndef HorizontalMixer_h
11 #define HorizontalMixer_h
68 Vec3D start =
Vec3D(screwCenter, 0, screwBaseHeight);
69 Mdouble length = screwTopHeight-screwBaseHeight;
70 Mdouble numTurns = length/windingLength;
99 {{
Vec3D(-.3,0,-1),
Vec3D(coreTopRadius,0,coreTopHeight)},
100 {
Vec3D(-1,0,0),
Vec3D(coreTopRadius,0,0)}},s));
107 {
Vec3D(-1,0,0),
Vec3D(coreBottomRadius,0,0)}},s));
116 Vec3D normal = (
Vec3D(outerTopCenter,0,outerTopHeight)-
Vec3D(screwCenter,0,0));
119 Vec3D normalWall =
Vec3D(outerTopHeight,0,outerBaseRadius-outerTopRadius);
121 Vec3D positionWall =
Vec3D(outerBaseRadius,0,0);
138 Mdouble screwBaseHeight = 0.11;
150 Mdouble coreBottomHeight = .491;
151 Mdouble coreBottomRadius = 0.27;
155 Mdouble outerBaseRadius =1.208;
156 Mdouble outerTopCenter = screwCenter;
158 Mdouble outerTopHeight = 1.995;
160 setXMax(screwCenter+outerTopRadius);
163 setXMin(screwCenter-outerTopRadius);
167 setScrewWalls(s, screwCenter, screwBaseHeight, screwBaseRadius, screwTopHeight, windingLength, minR, lowerR, diffR, thickness);
168 setScrewCore(s, screwCenter, screwBaseHeight, coreTopHeight, coreTopRadius, coreBottomHeight, coreBottomRadius);
213 unsigned counter = 0;
222 if (w->getDistanceAndNormal(p0, distance, normal) && distance<minDistance)
224 minDistance=distance;
225 if (distance<0)
break;
229 if (minDistance<p0.
getRadius() && minDistance>0)
235 logger(
INFO,
"Inserted particles: %", counter);
254 unsigned counter = 0;
263 if (w->getDistanceAndNormal(p0, distance, normal))
275 logger(
INFO,
"Inserted particles: %", counter);
291 "%% read in first file, to get the initial positions\n"
292 "f = fopen('" +
getName() +
"_7.vtu');\n"
294 "line = textscan(f,'%s %s %s %s %s %s %s',1,'Delimiter','\\n');\n"
295 "% number of particles\n"
296 "N = textscan(line{5}{1}(24:end),'%d',1); N=N{1};\n"
298 "P = textscan(f,'%f %f %f',N);\n"
299 "%scatter(P{1},P{2})\n"
301 "%% define a new speciesIndex, based on position, to color particles\n"
302 "index = 1000*P{1};\n"
303 "%% read in second file, a write out again with modified index\n"
304 "f = fopen('" +
getName() +
"_250.vtu');\n"
305 "g = fopen('Particle.vtu','w');\n"
307 "line = textscan(f,'%s',3*N+15,'Delimiter','\\n');\n"
308 "for i=1:length(line{1}), fprintf(g,'%s\\n',line{1}{i}); end\n"
310 "textscan(f,'%f',N,'Delimiter','\\n');\n"
311 "fprintf(g,'%f\\n',index);\n"
313 "line = textscan(f,'%s','Delimiter','\\n');\n"
314 "for i=1:length(line{1}), fprintf(g,'%s\\n',line{1}{i}); end\n"
@ MULTIPLE_FILES
each time-step will be written into/read from separate files numbered consecutively: name_....
@ NO_FILE
file will not be created/read
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
Use AxisymmetricIntersectionOfWalls to Screw Screw::read Screw::read Screw::read define axisymmetric ...
Definition: AxisymmetricIntersectionOfWalls.h:126
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
T * getObject(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
Definition: BaseHandler.h:613
void setAngularVelocity(const Vec3D &angularVelocity)
set the angular velocity of the BaseInteractble.
Definition: BaseInteractable.cc:360
void setVelocity(const Vec3D &velocity)
set the velocity of the BaseInteractable.
Definition: BaseInteractable.cc:350
virtual void setPosition(const Vec3D &position)
Sets the position of this BaseInteractable.
Definition: BaseInteractable.h:239
const Vec3D & getPosition() const
Returns the position of this BaseInteractable.
Definition: BaseInteractable.h:218
Mdouble getRadius() const
Returns the particle's radius.
Definition: BaseParticle.h:348
virtual void setRadius(Mdouble radius)
Sets the particle's radius_ (and adjusts the mass_ accordingly, based on the particle's species)
Definition: BaseParticle.cc:553
void setSpecies(const ParticleSpecies *species)
Definition: BaseParticle.cc:818
Mdouble getXMin() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMin() returns XMin.
Definition: DPMBase.h:619
Mdouble getXMax() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMax() returns XMax.
Definition: DPMBase.h:626
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. LinearViscoelasticSpecies, etc.
Definition: DPMBase.h:1427
File fStatFile
An instance of class File to handle in- and output into a .fstat file.
Definition: DPMBase.h:1483
void setYMin(Mdouble newYMin)
Sets the value of YMin, the lower bound of the problem domain in the y-direction.
Definition: DPMBase.cc:1034
Mdouble getYMin() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMin() returns YMin.
Definition: DPMBase.h:632
Mdouble getTimeStep() const
Returns the simulation time step.
Definition: DPMBase.cc:1250
const std::string & getName() const
Returns the name of the file. Does not allow to change it though.
Definition: DPMBase.cc:399
Mdouble getTime() const
Returns the current simulation time.
Definition: DPMBase.cc:808
Mdouble getKineticEnergy() const
Returns the global kinetic energy stored in the system.
Definition: DPMBase.cc:1544
WallHandler wallHandler
An object of the class WallHandler. Contains pointers to all the walls created.
Definition: DPMBase.h:1447
void setYMax(Mdouble newYMax)
Sets the value of YMax, the upper bound of the problem domain in the y-direction.
Definition: DPMBase.cc:1191
void setZMin(Mdouble newZMin)
Sets the value of ZMin, the lower bound of the problem domain in the z-direction.
Definition: DPMBase.cc:1058
void setXMax(Mdouble newXMax)
Sets the value of XMax, the upper bound of the problem domain in the x-direction.
Definition: DPMBase.cc:1165
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created.
Definition: DPMBase.h:1437
void setZMax(Mdouble newZMax)
Sets the value of ZMax, the upper bound of the problem domain in the z-direction.
Definition: DPMBase.cc:1217
void setParticlesWriteVTK(bool writeParticlesVTK)
Sets whether particles are written in a VTK file.
Definition: DPMBase.cc:942
RNG random
This is a random generator, often used for setting up the initial conditions etc.....
Definition: DPMBase.h:1432
Mdouble getYMax() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMax() returns XMax.
Definition: DPMBase.h:638
void setXMin(Mdouble newXMin)
Sets the value of XMin, the lower bound of the problem domain in the x-direction.
Definition: DPMBase.cc:1010
Mdouble getTimeMax() const
Returns the maximum simulation duration.
Definition: DPMBase.cc:888
void setGravity(Vec3D newGravity)
Sets a new value for the gravitational acceleration.
Definition: DPMBase.cc:1383
Mdouble getElasticEnergy() const
Returns the global elastic energy within the system.
Definition: DPMBase.cc:1530
Mdouble getZMin() const
If the length of the problem domain in z-direction is ZMax - ZMin, then getZMin() returns ZMin.
Definition: DPMBase.h:644
void setFileType(FileType fileType)
Sets the type of file needed to write into or read from. File::fileType_.
Definition: File.cc:215
A HorizontalBaseScrew is a copy of AxisymmetricIntersectionOfWalls, with an additional,...
Definition: HorizontalBaseScrew.h:39
Definition: HorizontalMixer.h:14
HorizontalMixer(Mdouble particleRadius, Mdouble rotationSpeed, Mdouble timeMin, Mdouble fillHeight)
Constructor, turns off fstat output by default.
Definition: HorizontalMixer.h:53
void introduceParticlesAtWall()
Definition: HorizontalMixer.h:193
void printTime() const override
Displays the current simulation time and the maximum simulation duration.
Definition: HorizontalMixer.h:278
void actionsAfterTimeStep() override
A virtual function which allows to define operations to be executed after time step.
Definition: HorizontalMixer.h:284
void introduceParticlesInDomain(Mdouble polydispersity=1)
Definition: HorizontalMixer.h:238
virtual void setOuterWalls(const ParticleSpecies *s, Mdouble outerBaseRadius, Mdouble screwCenter, Mdouble outerTopCenter, Mdouble outerTopRadius, Mdouble outerTopHeight)
sets other walls that define the outer boundary
Definition: HorizontalMixer.h:112
virtual void setScrewCore(const ParticleSpecies *s, Mdouble screwCenter, Mdouble screwBaseHeight, Mdouble coreTopHeight, Mdouble coreTopRadius, Mdouble coreBottomHeight, Mdouble coreBottomRadius)
sets four walls, leftScrewCore, rightScrewCore, leftScrewBottom, rightScrewBottom
Definition: HorizontalMixer.h:92
void setupInitialConditions() override
This function allows to set the initial conditions for our problem to be solved, by default particle ...
Definition: HorizontalMixer.h:130
void introduceSingleParticle(Vec3D p)
Definition: HorizontalMixer.h:178
std::vector< unsigned > bladeMounts_
The index number of all mounted blades (the blades mounts are numbered 0-11, with the i-th blade moun...
Definition: HorizontalMixer.h:35
Mdouble fillHeight_
Definition: HorizontalMixer.h:39
void setScrewWalls(const ParticleSpecies *s, Mdouble screwCenter, Mdouble screwBaseHeight, Mdouble screwBaseRadius, Mdouble screwTopHeight, Mdouble windingLength, Mdouble minR, Mdouble lowerR, Mdouble diffR, Mdouble thickness)
sets four walls, leftScrew, rightScrew, leftBaseScrew, rightBaseScrew
Definition: HorizontalMixer.h:62
Mdouble timeMin
The time where the screw begins to spin.
Definition: HorizontalMixer.h:31
Mdouble rotationSpeed
The rotation speed of the screw.
Definition: HorizontalMixer.h:27
void writeScript()
Definition: HorizontalMixer.h:288
Mdouble particleRadius
The mean radius of the particles in the feeder.
Definition: HorizontalMixer.h:19
bool haveOuterWalls
Definition: HorizontalMixer.h:45
HorizontalScrew * screw
Pointer to the right screw.
Definition: HorizontalMixer.h:23
This function defines an Archimedes' screw in the z-direction from a (constant) starting point,...
Definition: HorizontalScrew.h:39
void move_time(Mdouble dt)
Rotate the HorizontalScrew for a period dt, so that the offset_ changes with omega_*dt.
Definition: HorizontalScrew.cc:274
A infinite wall fills the half-space {point: (position_-point)*normal_<=0}.
Definition: InfiniteWall.h:48
This adds on the hierarchical grid code for 3D problems.
Definition: Mercury3D.h:37
void clear() override
Empties the whole ParticleHandler by removing all BaseParticle.
Definition: ParticleHandler.cc:977
Definition: ParticleSpecies.h:37
Mdouble getRandomNumber()
This is a random generating routine can be used for initial positions.
Definition: RNG.cc:143
A spherical particle is the most simple particle used in MercuryDPM.
Definition: SphericalParticle.h:37
Mdouble Y
Definition: Vector.h:66
Mdouble Z
Definition: Vector.h:66
Mdouble X
the vector components
Definition: Vector.h:66
void normalise()
Makes this Vec3D unit length.
Definition: Vector.cc:123
void setWriteVTK(FileType)
Sets whether walls are written into a VTK file.
Definition: WallHandler.cc:467
const Mdouble pi
Definition: ExtendedMath.h:45
std::string getPath()
Definition: FileIOHelpers.cc:224
bool writeToFile(std::string filename, std::string filecontent)
Writes a string to a file.
Definition: FileIOHelpers.cc:58