Merge branch 'main' of github.com:PhasicFlow/phasicFlow into main

This commit is contained in:
HRN 2025-02-28 11:37:11 +03:30
commit dc0504d2fa
5 changed files with 215 additions and 152 deletions

View File

@ -1,10 +1,15 @@
# Simulating a small rotating drum {#rotatingDrumSmall} # Simularing a rotating drum (v-1.0)
## 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 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.
<div align="center"><b> <div align="center">
a view of rotating drum <b>
A view of rotating drum
</b>
<b>
![](https://github.com/PhasicFlow/phasicFlow/blob/media/media/rotating-drum-s.png) ![](https://github.com/PhasicFlow/phasicFlow/blob/media/media/rotating-drum-s.png)
</b></div> </b></div>
*** ***
@ -12,35 +17,40 @@ 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. 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.
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 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`).
### 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 `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
</div> </div>
```C++ ```C++
positionParticles positionParticles // positions particles
{ {
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?
box // box for positioning particles mortonSorting Yes; // perform initial sorting based on morton code?
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
axisOrder (z y x); // axis order for filling the space with particles
} }
positionOrderedInfo regionType box; // other options: cylinder and sphere
boxInfo // box information for positioning particles
{ {
diameter 0.004; // minimum space between centers of particles min (-0.08 -0.08 0.015); // lower corner point of the box
numPoints 30000; // number of particles in the simulation
axisOrder (z y x); // axis order for filling the space with particles max ( 0.08 0.08 0.098); // upper corner point of the box
} }
} }
``` ```
@ -55,39 +65,45 @@ 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)
rotVelocity realx3 (0 0 0); // rotational velocity (rad/s) acceleration realx3 (0 0 0); // linear acceleration (m/s2)
shapeName word sphere1; // name of the particle shape
rVelocity realx3 (0 0 0); // rotational velocity (rad/s)
shapeName word sphere1; // name of the particle shape
} }
selectors selectors
{} {
}
} }
``` ```
Enter the following command in the terminal to create the particles and store them in `0` folder. Enter the following command in the terminal to create the particles and store them in `0` folder.
`> 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;
.
. rotatingAxisInfo // information for rotatingAxisMotion motion model
.
rotatingAxisMotionInfo
{ {
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
omega 1.214; // rotation speed (rad/s) p2 (0.0 0.0 1.0); // second point for the axis of rotation
omega 1.214; // rotation speed (rad/s)
} }
} }
``` ```
@ -100,36 +116,69 @@ in <b>settings/geometryDict</b> file
```C++ ```C++
surfaces surfaces
{ {
/*
A cylinder with begin and end radii 0.12 m and axis points at (0 0 0) and (0 0 0.1)
*/
cylinder cylinder
{ {
type cylinderWall; // type of the wall type cylinderWall; // type of the wall
p1 (0.0 0.0 0.0); // begin point of cylinder axis
p2 (0.0 0.0 0.1); // end point of cylinder axis p1 (0.0 0.0 0.0); // begin point of cylinder axis
radius1 0.12; // radius at p1
radius2 0.12; // radius at p2 p2 (0.0 0.0 0.1); // end point of cylinder axis
resolution 24; // number of divisions
material prop1; // material name of this wall radius1 0.12; // radius at p1
motion rotAxis; // motion component name
radius2 0.12; // radius at p2
resolution 24; // number of divisions
material prop1; // material name of this wall
motion rotAxis; // motion component name
} }
/*
This is a plane wall at the rear end of cylinder
*/
wall1 wall1
{ {
type planeWall; // type of the wall type planeWall; // type of the wall
p1 (-0.12 -0.12 0.0); // first point of the wall
p2 ( 0.12 -0.12 0.0); // second point p1 (-0.12 -0.12 0.0); // first point of the wall
p3 ( 0.12 0.12 0.0); // third point
p4 (-0.12 0.12 0.0); // fourth point p2 ( 0.12 -0.12 0.0); // second point
material prop1; // material name of the wall
motion rotAxis; // motion component name p3 ( 0.12 0.12 0.0); // third point
p4 (-0.12 0.12 0.0); // fourth point
material prop1; // material name of the wall
motion rotAxis; // motion component name
} }
/*
This is a plane wall at the front end of cylinder
*/
wall2 wall2
{ {
type planeWall; type planeWall; // type of the wall
p1 (-0.12 -0.12 0.1);
p2 ( 0.12 -0.12 0.1); p1 (-0.12 -0.12 0.1); // first point of the wall
p3 ( 0.12 0.12 0.1);
p4 (-0.12 0.12 0.1); p2 ( 0.12 -0.12 0.1); // second point
material prop1;
motion rotAxis; p3 ( 0.12 0.12 0.1); // third point
p4 (-0.12 0.12 0.1); // fourth point
material prop1; // material name of the wall
motion rotAxis; // motion component name
} }
} }
``` ```
@ -152,79 +201,140 @@ densities (1000.0); // density of materials [kg/m3]
. .
model model
{ {
contactForceModel nonLinearNonLimited; contactForceModel nonLinearNonLimited;
rollingFrictionModel normal; rollingFrictionModel normal;
Yeff (1.0e6); // Young modulus [Pa] Yeff (1.0e6); // Young modulus [Pa]
Geff (0.8e6); // Shear modulus [Pa] Geff (0.8e6); // Shear modulus [Pa]
nu (0.25); // Poisson's ratio [-] nu (0.25); // Poisson's ratio [-]
en (0.7); // coefficient of normal restitution en (0.7); // coefficient of normal restitution
et (1.0); // coefficient of tangential restitution mu (0.3); // dynamic friction
mu (0.3); // dynamic friction mur (0.1); // rolling friction
mur (0.1); // rolling friction
} }
``` ```
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. `method` specifies the algorithm for finding neighbor list for particle-particle contacts. `updateInterval` sets the number of iterations between each occurance of 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.
<div align="center"> <div align="center">
in <b>caseSetup/interaction</b> file in <b>caseSetup/interaction</b> file
</div> </div>
```C++ ```C++
contactListType sortedContactList;
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 adjustableBox Yes;
cellExtent 0.7; // bounding box for particle-wall search (> 0.5) }
}
}
``` ```
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/shape`, 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/shape</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) run rotatingDrumSmall;
startTime 0; // start time for simulation
endTime 10; // end time for simulation dt 0.00001; // time step for integration (s)
saveInterval 0.1; // time interval for saving the simulation
timePrecision 6; // maximum number of digits for time folder startTime 0; // start time for simulation
g (0 -9.8 0); // gravity vector (m/s2)
domain endTime 10; // end time for simulation
{
min (-0.12 -0.12 0); saveInterval 0.1; // time interval for saving the simulation
max (0.12 0.12 0.11);
} timePrecision 6; // maximum number of digits for time folder
integrationMethod AdamsBashforth2; // integration method
g (0 -9.8 0); // gravity vector (m/s2)
includeObjects (diameter); // save necessary (i.e., required) data on disk
// exclude unnecessary data from saving on disk
excludeObjects (rVelocity.dy1 pStructPosition.dy1 pStructVelocity.dy1);
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
``` ```
The dictionary `settings/domainDict` 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.
<div align="center">
in <b>settings/domainDict</b> file
</div>
```C++
// Simulation domain: every particles that goes outside this domain will be deleted
globalBox
{
min (-0.12 -0.12 0.00); // lower corner point of the box
max (0.12 0.12 0.11); // upper corner point of the box
}
boundaries
{
left
{
type exit; // other options: periodic, reflective
}
right
{
type exit; // other options: periodic, reflective
}
bottom
{
type exit; // other options: periodic, reflective
}
top
{
type exit; // other options: periodic, reflective
}
rear
{
type exit; // other options: periodic, reflective
}
front
{
type exit; // other options: periodic, reflective
}
}
```
## 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`. Enter the following command in the terminal. Depending on the computational power, it may take a few minutes to a few hours to complete.
@ -233,4 +343,4 @@ The solver for this simulation is `sphereGranFlow`. Enter the following command
## 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/`. 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/`.
`> pFlowToVTK` `> pFlowToVTK --binary`

View File

@ -40,8 +40,6 @@ model
en (0.7); // coefficient of normal restitution en (0.7); // coefficient of normal restitution
et (1.0); // coefficient of tangential restitution
mu (0.3); // dynamic friction mu (0.3); // dynamic friction
mur (0.1); // rolling friction mur (0.1); // rolling friction

View File

@ -1,12 +0,0 @@
/* -------------------------------*- C++ -*--------------------------------- *\
| phasicFlow File |
| copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */
objectName sphereDict;
objectType sphereShape;
fileFormat ASCII;
/*---------------------------------------------------------------------------*/
names (sphere1); // names of shapes
diameters (0.004); // diameter of shapes
materials (prop1); // material names for shapes

View File

@ -8,57 +8,40 @@ fileFormat ASCII;
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
globalBox // Simulation domain: every particles that goes outside this domain will be deleted globalBox // Simulation domain: every particles that goes outside this domain will be deleted
{ {
min (-0.12 -0.12 0.00); // lower corner point of the box min (-0.12 -0.12 0.00); // lower corner point of the box
max (0.12 0.12 0.11); // upper corner point of the box max (0.12 0.12 0.11); // upper corner point of the box
}
decomposition
{
direction z;
} }
boundaries boundaries
{ {
neighborListUpdateInterval 50; /* Determines how often (how many iterations) do you want to
rebuild the list of particles in the neighbor list
of all boundaries in the simulation domain */
updateInterval 10; // Determines how often do you want to update the new changes in the boundary
neighborLength 0.004; // The distance from the boundary plane within which particles are marked to be in the boundary list
left left
{ {
type exit; // other options: periodict, reflective type exit; // other options: periodict, reflective
} }
right right
{ {
type exit; // other options: periodict, reflective type exit; // other options: periodict, reflective
} }
bottom bottom
{ {
type exit; // other options: periodict, reflective type exit; // other options: periodict, reflective
} }
top top
{ {
type exit; // other options: periodict, reflective type exit; // other options: periodict, reflective
} }
rear rear
{ {
type exit; // other options: periodict, reflective type exit; // other options: periodict, reflective
} }
front front
{ {
type exit; // other options: periodict, reflective type exit; // other options: periodict, reflective
} }
} }

View File

@ -29,24 +29,8 @@ setFields
selectors 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
}
}
} }
positionParticles // positions particles positionParticles // positions particles