14 #ifndef HorizontalMixer_h
15 #define HorizontalMixer_h
73 Mdouble length = screwTopHeight-screwBaseHeight;
74 Mdouble numTurns = length/windingLength;
103 {{
Vec3D(-.3,0,-1),
Vec3D(coreTopRadius,0,coreTopHeight)},
123 Vec3D normalWall =
Vec3D(outerTopHeight,0,outerBaseRadius-outerTopRadius);
125 Vec3D positionWall =
Vec3D(outerBaseRadius,0,0);
142 Mdouble screwBaseHeight = 0.11;
154 Mdouble coreBottomHeight = .491;
155 Mdouble coreBottomRadius = 0.27;
159 Mdouble outerBaseRadius =1.208;
160 Mdouble outerTopCenter = screwCenter;
162 Mdouble outerTopHeight = 1.995;
164 setXMax(screwCenter+outerTopRadius);
167 setXMin(screwCenter-outerTopRadius);
171 setScrewWalls(
s, screwCenter, screwBaseHeight, screwBaseRadius, screwTopHeight, windingLength, minR, lowerR, diffR, thickness);
172 setScrewCore(
s, screwCenter, screwBaseHeight, coreTopHeight, coreTopRadius, coreBottomHeight, coreBottomRadius);
190 p0.setVelocity(
Vec3D(0.0, 0.0, 0.0));
205 p0.setVelocity(
Vec3D(0.0, 0.0, 0.0));
209 p1.setVelocity(
Vec3D(0.0, 0.0, 0.0));
217 unsigned counter = 0;
222 minDistance =
p0.getRadius();
226 if (
w->getDistanceAndNormal(
p0, distance,
normal) && distance<minDistance)
228 minDistance=distance;
229 if (distance<0)
break;
233 if (minDistance<
p0.getRadius() && minDistance>0)
239 logger(
INFO,
"Inserted particles: %", counter);
250 p0.setVelocity(
Vec3D(0.0, 0.0, 0.0));
258 unsigned counter = 0;
267 if (
w->getDistanceAndNormal(
p0, distance,
normal))
279 logger(
INFO,
"Inserted particles: %", counter);
295 "%% read in first file, to get the initial positions\n"
296 "f = fopen('" +
getName() +
"_7.vtu');\n"
298 "line = textscan(f,'%s %s %s %s %s %s %s',1,'Delimiter','\\n');\n"
299 "% number of particles\n"
300 "N = textscan(line{5}{1}(24:end),'%d',1); N=N{1};\n"
302 "P = textscan(f,'%f %f %f',N);\n"
303 "%scatter(P{1},P{2})\n"
305 "%% define a new speciesIndex, based on position, to color particles\n"
306 "index = 1000*P{1};\n"
307 "%% read in second file, a write out again with modified index\n"
308 "f = fopen('" +
getName() +
"_250.vtu');\n"
309 "g = fopen('Particle.vtu','w');\n"
311 "line = textscan(f,'%s',3*N+15,'Delimiter','\\n');\n"
312 "for i=1:length(line{1}), fprintf(g,'%s\\n',line{1}{i}); end\n"
314 "textscan(f,'%f',N,'Delimiter','\\n');\n"
315 "fprintf(g,'%f\\n',index);\n"
317 "line = textscan(f,'%s','Delimiter','\\n');\n"
318 "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.
Vector3f p0
Definition: MatrixBase_all.cpp:2
Vector3f p1
Definition: MatrixBase_all.cpp:2
RowVector3d w
Definition: Matrix_resize_int.cpp:3
float * p
Definition: Tutorial_Map_using.cpp:9
Use AxisymmetricIntersectionOfWalls to Screw Screw::read Screw::read Screw::read define axisymmetric ...
Definition: AxisymmetricIntersectionOfWalls.h:105
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:360
T * getObject(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
Definition: BaseHandler.h:621
void setAngularVelocity(const Vec3D &angularVelocity)
set the angular velocity of the BaseInteractble.
Definition: BaseInteractable.cc:338
Mdouble getXMin() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMin() returns XMin.
Definition: DPMBase.h:603
Mdouble getXMax() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMax() returns XMax.
Definition: DPMBase.h:610
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. LinearViscoelasticSpecies, etc.
Definition: DPMBase.h:1433
File fStatFile
An instance of class File to handle in- and output into a .fstat file.
Definition: DPMBase.h:1489
void setYMin(Mdouble newYMin)
Sets the value of YMin, the lower bound of the problem domain in the y-direction.
Definition: DPMBase.cc:1025
Mdouble getYMin() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMin() returns YMin.
Definition: DPMBase.h:616
Mdouble getTimeStep() const
Returns the simulation time step.
Definition: DPMBase.cc:1241
const std::string & getName() const
Returns the name of the file. Does not allow to change it though.
Definition: DPMBase.cc:377
Mdouble getTime() const
Returns the current simulation time.
Definition: DPMBase.cc:799
Mdouble getKineticEnergy() const
Returns the global kinetic energy stored in the system.
Definition: DPMBase.cc:1535
WallHandler wallHandler
An object of the class WallHandler. Contains pointers to all the walls created.
Definition: DPMBase.h:1453
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 setZMin(Mdouble newZMin)
Sets the value of ZMin, the lower bound of the problem domain in the z-direction.
Definition: DPMBase.cc:1049
void setXMax(Mdouble newXMax)
Sets the value of XMax, the upper bound of the problem domain in the x-direction.
Definition: DPMBase.cc:1156
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created.
Definition: DPMBase.h:1443
void setZMax(Mdouble newZMax)
Sets the value of ZMax, the upper bound of the problem domain in the z-direction.
Definition: DPMBase.cc:1208
void setParticlesWriteVTK(bool writeParticlesVTK)
Sets whether particles are written in a VTK file.
Definition: DPMBase.cc:933
RNG random
This is a random generator, often used for setting up the initial conditions etc.....
Definition: DPMBase.h:1438
Mdouble getYMax() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMax() returns XMax.
Definition: DPMBase.h:622
void setXMin(Mdouble newXMin)
Sets the value of XMin, the lower bound of the problem domain in the x-direction.
Definition: DPMBase.cc:1001
Mdouble getTimeMax() const
Returns the maximum simulation duration.
Definition: DPMBase.cc:879
void setGravity(Vec3D newGravity)
Sets a new value for the gravitational acceleration.
Definition: DPMBase.cc:1374
Mdouble getElasticEnergy() const
Returns the global elastic energy within the system.
Definition: DPMBase.cc:1521
Mdouble getZMin() const
If the length of the problem domain in z-direction is ZMax - ZMin, then getZMin() returns ZMin.
Definition: DPMBase.h:628
void setFileType(FileType fileType)
Sets the type of file needed to write into or read from. File::fileType_.
Definition: File.cc:193
A HorizontalBaseScrew is a copy of AxisymmetricIntersectionOfWalls, with an additional,...
Definition: HorizontalBaseScrew.h:18
Definition: HorizontalMixer.h:18
HorizontalMixer(Mdouble particleRadius, Mdouble rotationSpeed, Mdouble timeMin, Mdouble fillHeight)
Constructor, turns off fstat output by default.
Definition: HorizontalMixer.h:57
void introduceParticlesAtWall()
Definition: HorizontalMixer.h:197
void printTime() const override
Displays the current simulation time and the maximum simulation duration.
Definition: HorizontalMixer.h:282
void actionsAfterTimeStep() override
A virtual function which allows to define operations to be executed after time step.
Definition: HorizontalMixer.h:288
void introduceParticlesInDomain(Mdouble polydispersity=1)
Definition: HorizontalMixer.h:242
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:116
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:96
void setupInitialConditions() override
This function allows to set the initial conditions for our problem to be solved, by default particle ...
Definition: HorizontalMixer.h:134
void introduceSingleParticle(Vec3D p)
Definition: HorizontalMixer.h:182
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:39
Mdouble fillHeight_
Definition: HorizontalMixer.h:43
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:66
Mdouble timeMin
The time where the screw begins to spin.
Definition: HorizontalMixer.h:35
Mdouble rotationSpeed
The rotation speed of the screw.
Definition: HorizontalMixer.h:31
void writeScript()
Definition: HorizontalMixer.h:292
Mdouble particleRadius
The mean radius of the particles in the feeder.
Definition: HorizontalMixer.h:23
bool haveOuterWalls
Definition: HorizontalMixer.h:49
HorizontalScrew * screw
Pointer to the right screw.
Definition: HorizontalMixer.h:27
This function defines an Archimedes' screw in the z-direction from a (constant) starting point,...
Definition: HorizontalScrew.h:18
void move_time(Mdouble dt)
Rotate the HorizontalScrew for a period dt, so that the offset_ changes with omega_*dt.
Definition: HorizontalScrew.cc:253
A infinite wall fills the half-space {point: (position_-point)*normal_<=0}.
Definition: InfiniteWall.h:27
This adds on the hierarchical grid code for 3D problems.
Definition: Mercury3D.h:16
void clear() override
Empties the whole ParticleHandler by removing all BaseParticle.
Definition: ParticleHandler.cc:971
Definition: ParticleSpecies.h:16
Mdouble getRandomNumber()
This is a random generating routine can be used for initial positions.
Definition: RNG.cc:123
A spherical particle is the most simple particle used in MercuryDPM.
Definition: SphericalParticle.h:16
Definition: Kernel/Math/Vector.h:30
void normalise()
Makes this Vec3D unit length.
Definition: Vector.cc:103
void setWriteVTK(FileType)
Sets whether walls are written into a VTK file.
Definition: WallHandler.cc:445
RealScalar s
Definition: level1_cplx_impl.h:130
void normal(const Vector< double > &x, Vector< double > &normal)
Definition: free_surface_rotation.cc:65
const Mdouble pi
Definition: ExtendedMath.h:23
std::string getPath()
Definition: FileIOHelpers.cc:206
bool writeToFile(const std::string &filename, const std::string &filecontent)
Writes a string to a file.
Definition: FileIOHelpers.cc:29
void start(const unsigned &i)
(Re-)start i-th timer
Definition: oomph_utilities.cc:243