Readme.md is updated.

This commit is contained in:
ramin1728
2025-01-01 14:26:27 +03:30
parent 8299a3120c
commit 6a15125376

View File

@ -1,6 +1,6 @@
# Simulating a small rotating drum {#rotatingDrumSmall} # Simulating a small rotating drum {#rotatingDrumSmall}
## Problem definition ## Problem definition
The problem is to simulate a rotating drum with the diameter 0.24 m and the length 0.1 m rotating at 11.6 rpm. It is filled with 30,000 4-mm spherical particles. The timestep for integration is 0.00001 s. The problem is to simulate a rotating drum with a diameter of 0.24 m and a length of 0.1 m, rotating at 11.6 rpm. It is filled with 30,000 spherical particles with a diameter of 4 mm. The time step for integration is 0.00001 s.
<div align="center"><b> <div align="center"><b>
a view of rotating drum a view of rotating drum
@ -10,14 +10,52 @@ a view of rotating drum
*** ***
## Setting up the case ## Setting up the case
PhasicFlow simulation case setup is based on the text-based scripts that we provide in two folders located in the simulation case folder: `settings` and `caseSetup` (You can find the case setup files in the above folders. The PhasicFlow simulation case setup is based on the text-based scripts that we provide in two folders located in the simulation case folder: `settings` and `caseSetup` (You can find the case setup files in the above mentioned folders.
All the commands should be entered in the terminal while the current working directory is the simulation case folder (at the top of the `caseSetup` and `settings`). All commands should be entered in the terminal with the current working directory being the simulation case folder (at the top of the `caseSetup` and `settings` folders).
### Creating particles ### Creating particles
Open the file `settings/particlesDict`. Two dictionaries, `positionParticles` and `setFields` position particles and set the field values for the particles. Open the file `settings/particlesDict`. Two dictionaries, `positionParticles` and `setFields` position particles and set the field values for the particles.
In dictionary `positionParticles`, the positioning `method` is `positionOrdered`, which position particles in order in the space defined by `box`. `box` space is defined by two corner points `min` and `max`. In dictionary `positionOrderedInfo`, `numPoints` defines number of particles; `diameter`, the distance between two adjacent particles, and `axisOrder` defines the axis order for filling the space by particles. In dictionary `setFields`, dictionary `defaultValue` defines the initial value for particle fields (here, `velocity`, `acceleration`, `rotVelocity`, and `shapeName`). Note that `shapeName` field should be consistent with the name of shape that you later set for shapes (here one shape with name `sphere1`).
<div align="center">
in <b>settings/particlesDict</b> file
</div>
```C++
setFields
{
defaultValue
{
velocity realx3 (0 0 0); // linear velocity (m/s)
acceleration realx3 (0 0 0); // linear acceleration (m/s2)
rotVelocity realx3 (0 0 0); // rotational velocity (rad/s)
shapeName word sphere1; // name of the particle shape
}
selectors
{
shapeAssigne
{
selector stridedRange; // other options: box, cylinder, sphere, randomPoints
stridedRangeInfo
{
begin 0; // begin index of points
end 30000; // end index of points
stride 3; // stride for selector
}
fieldValue // fields that the selector is applied to
{
shapeName word sphere1; // sets shapeName of the selected points to largeSphere
}
}
}
}
In dictionary `positionParticles`, the positioning `method` is `ordered`, which position particles in order in the space defined by `box`. `box` space is defined by two corner points `min` and `max`. In dictionary `orderedInfo`, `numPoints` defines number of particles; `diameter`, the distance between two adjacent particles, and `axisOrder` defines the axis order for filling the space by particles.
<div align="center"> <div align="center">
in <b>settings/particlesDict</b> file in <b>settings/particlesDict</b> file
@ -26,22 +64,25 @@ in <b>settings/particlesDict</b> file
```C++ ```C++
positionParticles positionParticles
{ {
method positionOrdered; // ordered positioning method ordered; // other options: random and empty
maxNumberOfParticles 40000; // maximum number of particles in the simulation mortonSorting Yes; // perform initial sorting based on morton code
mortonSorting Yes; // perform initial sorting based on morton code?
box // box for positioning particles orderedInfo
{ {
min (-0.08 -0.08 0.015); // lower corner point of the box diameter 0.004; // minimum space between centers of particles
max ( 0.08 0.08 0.098); // upper corner point of the box numPoints 30000; // number of particles in the simulation
}
positionOrderedInfo
{
diameter 0.004; // minimum space between centers of particles
numPoints 30000; // number of particles in the simulation
axisOrder (z y x); // axis order for filling the space with particles axisOrder (z y x); // axis order for filling the space with particles
} }
regionType box; // other options: cylinder and sphere
boxInfo // box information for positioning particles
{
min (-0.08 -0.08 0.015); // lower corner point of the box
max ( 0.08 0.08 0.098); // upper corner point of the box
} }
``` ```
In dictionary `setFields`, dictionary `defaultValue` defines the initial value for particle fields (here, `velocity`, `acceleration`, `rotVelocity`, and `shapeName`). Note that `shapeName` field should be consistent with the name of shape that you later set for shapes (here one shape with name `sphere1`). In dictionary `setFields`, dictionary `defaultValue` defines the initial value for particle fields (here, `velocity`, `acceleration`, `rotVelocity`, and `shapeName`). Note that `shapeName` field should be consistent with the name of shape that you later set for shapes (here one shape with name `sphere1`).
@ -55,10 +96,10 @@ setFields
{ {
defaultValue defaultValue
{ {
velocity realx3 (0 0 0); // linear velocity (m/s) velocity realx3 (0 0 0); // linear velocity (m/s)
acceleration realx3 (0 0 0); // linear acceleration (m/s2) acceleration realx3 (0 0 0); // linear acceleration (m/s2)
rotVelocity realx3 (0 0 0); // rotational velocity (rad/s) rotVelocity realx3 (0 0 0); // rotational velocity (rad/s)
shapeName word sphere1; // name of the particle shape shapeName word sphere1; // name of the particle shape
} }
selectors selectors
{} {}
@ -70,24 +111,24 @@ Enter the following command in the terminal to create the particles and store th
`> particlesPhasicFlow` `> particlesPhasicFlow`
### Creating geometry ### Creating geometry
In file `settings/geometryDict` , you can provide information for creating geometry. Each simulation should have a `motionModel` that defines a model for moving the surfaces in the simulation. `rotatingAxisMotion` model defines a fixed axis which rotates around itself. The dictionary `rotAxis` defines an motion component with `p1` and `p2` as the end points of the axis and `omega` as the rotation speed in rad/s. You can define more than one motion component in a simulation. In file `settings/geometryDict` , you can provide information for creating geometry. Each simulation should have a `motionModel` that defines a model for moving the surfaces in the simulation. `rotatingAxis` model defines a fixed axis which rotates around itself. The dictionary `rotAxis` defines an motion component with `p1` and `p2` as the end points of the axis and `omega` as the rotation speed in rad/s. You can define more than one motion component in a simulation.
<div align="center"> <div align="center">
in <b>settings/geometryDict</b> file in <b>settings/geometryDict</b> file
</div> </div>
```C++ ```C++
motionModel rotatingAxisMotion; motionModel rotatingAxis;
. .
. .
. .
rotatingAxisMotionInfo rotatingAxisInfo
{ {
rotAxis rotAxis
{ {
p1 (0.0 0.0 0.0); // first point for the axis of rotation p1 (0.0 0.0 0.0); // first point for the axis of rotation
p2 (0.0 0.0 1.0); // second point for the axis of rotation p2 (0.0 0.0 1.0); // second point for the axis of rotation
omega 1.214; // rotation speed (rad/s) omega 1.214; // rotation speed (rad/s)
} }
} }
``` ```
@ -138,7 +179,7 @@ Enter the following command in the terminal to create the geometry and store it
`> geometryPhasicFlow` `> geometryPhasicFlow`
### Defining properties and interactions ### Defining properties and interactions
In the file `caseSetup/interaction` , you find properties of materials. `materials` defines a list of material names in the simulation and `densities` sets the corresponding density of each material name. model dictionary defines the interaction model for particle-particle and particle-wall interactions. `contactForceModel` selects the model for mechanical contacts (here nonlinear model with limited tangential displacement) and `rollingFrictionModel` selects the model for calculating rolling friction. Other required prosperities should be defined in this dictionary. In the file `caseSetup/interaction` , you find properties of materials. `materials` defines a list of material names in the simulation and `densities` sets the corresponding density of each material name. model dictionary defines the interaction model for particle-particle and particle-wall interactions. `contactForceModel` selects the model for mechanical contacts (here nonlinear model with limited tangential displacement) and `rollingFrictionModel` selects the model for calculating rolling friction. Other required Properties should be defined in this dictionary.
<div align="center"> <div align="center">
in <b>caseSetup/interaction</b> file in <b>caseSetup/interaction</b> file
@ -165,7 +206,7 @@ model
} }
``` ```
Dictionary `contactSearch` sets the methods for particle-particle and particle-wall contact search. `method` specifies the algorithm for finding neighbor list for particle-particle contacts and `wallMapping` shows how particles are mapped onto walls for finding neighbor list for particle-wall contacts. `updateFrequency` sets the frequency for updating neighbor list and `sizeRatio` sets the size of enlarged cells (with respect to particle diameter) for finding neighbor list. Larger `sizeRatio` include more particles in the neighbor list and you require to update it less frequent. Dictionary `contactSearch` sets the methods for particle-particle and particle-wall contact search. Larger `sizeRatio` include more particles in the neighbor list and you require to update it less frequent.
<div align="center"> <div align="center">
in <b>caseSetup/interaction</b> file in <b>caseSetup/interaction</b> file
@ -174,63 +215,60 @@ in <b>caseSetup/interaction</b> file
```C++ ```C++
contactSearch contactSearch
{ {
method NBS; // method for broad search particle-particle
wallMapping cellsSimple; // method for broad search particle-wall method NBS; // method for broad search
updateInterval 10;
NBSInfo sizeRatio 1.1;
{
updateFrequency 20; // each 20 timesteps, update neighbor list
sizeRatio 1.1; // bounding box size to particle diameter (max)
}
cellsSimpleInfo cellExtent 0.55;
{
updateFrequency 20; // each 20 timesteps, update neighbor list
cellExtent 0.7; // bounding box for particle-wall search (> 0.5)
}
} adjustableBox Yes;
}
``` ```
In the file `caseSetup/sphereShape`, you can define a list of `names` for shapes (`shapeName` in particle field), a list of diameters for shapes and their `properties` names. In the file `caseSetup/shapes`, you can define a list of `names` for shapes (`shapeName` in particle field), a list of diameters for shapes and their `properties` names.
<div align="center"> <div align="center">
in <b>caseSetup/sphereShape</b> file in <b>caseSetup/shapes</b> file
</div> </div>
```C++ ```C++
names (sphere1); // names of shapes names (sphere1); // names of shapes
diameters (0.004); // diameter of shapes diameters (0.004); // diameter of shapes
materials (prop1); // material names for shapes materials (prop1); // material names for shapes
``` ```
Other settings for the simulation can be set in file `settings/settingsDict`. The dictionary `domain` defines the a rectangular bounding box with two corner points for the simulation. Each particle that gets out of this box, will be deleted automatically. Other settings for the simulation can be set in file `settings/settingsDict`.
<div align="center"> <div align="center">
in <b>settings/settingsDict</b> file in <b>settings/settingsDict</b> file
</div> </div>
```C++ ```C++
dt 0.00001; // time step for integration (s) dt 0.00001; // time step for integration (s)
startTime 0; // start time for simulation startTime 0; // start time for simulation
endTime 10; // end time for simulation endTime 10; // end time for simulation
saveInterval 0.1; // time interval for saving the simulation saveInterval 0.1; // time interval for saving the simulation
timePrecision 6; // maximum number of digits for time folder timePrecision 6; // maximum number of digits for time folder
g (0 -9.8 0); // gravity vector (m/s2) g (0 -9.8 0); // gravity vector (m/s2)
domain
{ includeObjects (diameter); // save necessary (i.e., required) data on disk
min (-0.12 -0.12 0); // exclude unnecessary data from saving on disk
max (0.12 0.12 0.11); excludeObjects (rVelocity.dy1 pStructPosition.dy1 pStructVelocity.dy1);
}
integrationMethod AdamsBashforth2; // integration method integrationMethod AdamsBashforth2; // integration method
writeFormat ascii; // data writting format (ascii or binary)
timersReport Yes; // report timers (Yes or No)
timersReportInterval 0.01; // time interval for reporting timers
``` ```
## Running the case ## Running the case
The solver for this simulation is `sphereGranFlow`. Enter the following command in the terminal. Depending on the computational power, it may take a few minutes to a few hours to complete. The solver for this simulation is `sphereGranFlow`. Type the following command in a terminal. Depending on your computer's computation power, it may take from a few minutes to a few hours to complete.
`> sphereGranFlow` `> sphereGranFlow`
## Post processing ## Post processing
After finishing the simulation, you can render the results in Paraview. To convert the results to VTK format, just enter the following command in the terminal. This will converts all the results (particles and geometry) to VTK format and store them in folder `VTK/`. When the simulation is finished, you can render the results in Paraview. To convert the results to VTK format, just type the following command in a terminal. This will convert all results (particles and geometry) to VTK format and save them in the folder `VTK/`.
`> pFlowToVTK` `> pFlowToVTK`