Merge pull request #214 from PhasicFlow/postprocessPhasicFlow

readme.md files update
This commit is contained in:
PhasicFlow 2025-04-25 16:42:06 +03:30 committed by GitHub
commit 3fc121ef2b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
76 changed files with 1697 additions and 1206 deletions

40
tutorials/README.md Normal file
View File

@ -0,0 +1,40 @@
# phasicFlow Tutorials
This directory contains various tutorial examples to help you learn how to use phasicFlow for different particle simulation scenarios. Each tutorial provides a complete working example with configuration files and instructions.
## 1. Sphere DEM Simulations (`sphereGranFlow`)
The most comprehensive collection of tutorials using spherical particles for DEM simulations:
- [Rotating Drum (Small)](./sphereGranFlow/rotatingDrumSmall/) - Simple rotating drum simulation with 30,000 spherical particles (4 mm diameter)
- [Rotating Drum (Medium)](./sphereGranFlow/rotatingDrumMedium/) - Medium-sized rotating drum simulation
- [Rotating Drum with Baffles](./sphereGranFlow/RotatingDrumWithBaffles/) - Rotating drum with internal baffles and binary particle mixture
- [Rotating Drum with Periodic Boundaries](./sphereGranFlow/drum-PeriodicBoundary/) - Simulates an "infinite length" drum using periodic boundaries
- [V-blender](./sphereGranFlow/V-blender/) - V-shaped blender simulation for particle mixing
- [Tote Blender](./sphereGranFlow/toteBlender/) - Double pedestal tote blender simulation with 24,000 particles
- [Binary System of Particles](./sphereGranFlow/binarySystemOfParticles/) - Demonstrates particle segregation in a rotating drum with two particle sizes
- [Screw Conveyor](./sphereGranFlow/screwConveyor/) - Simulates particle transport using a screw conveyor
- [Conveyor Belt](./sphereGranFlow/conveyorBelt/) - Simulates particles on a moving conveyor belt
- [Rotary Air Lock Valve](./sphereGranFlow/RotaryAirLockValve/) - Simulates a rotary air lock valve with particle insertion
- [Layered Silo Filling](./sphereGranFlow/layeredSiloFilling/) - Demonstrates filling a silo with layers of particles
- [Homogenization Silo (Periodic Boundaries)](./sphereGranFlow/homogenizationSilo-PeriodicBoundary/) - Simulates homogenization in a silo with periodic boundaries
## 2. Course-grained (Grain) DEM Simulations (`grainGranFlow`)
Tutorials for simulations with non-spherical (grain-shaped) particles:
- [Rotating Drum](./grainGranFlow/rotatingDrum/) - Demonstrates non-spherical grain particles in a rotating drum
## 3. Geometry Iteration (`iterateGeometry`)
Tutorials focused on geometry handling and visualization:
- [Inclined Screw Conveyor](./iterateGeometry/inclinedScrewConveyor/) - Visualizes the geometry of an inclined screw conveyor without particles
## 4. Post-processing (`postprocessPhasicFlow`)
Tutorials focused on post-processing and analysis:
- [Segregation Analysis](./postprocessPhasicFlow/segregation/) - Demonstrates how to analyze particle segregation in simulation results

View File

@ -44,8 +44,8 @@ positionParticles
orderedInfo orderedInfo
{ {
// minimum space between centers of particles // minimum distance between particles centers
diameter 0.001; distance 0.001;
// number of particles in the simulation // number of particles in the simulation
numPoints 50000; numPoints 50000;

View File

@ -24,7 +24,7 @@ positionParticles
positionOrderedInfo positionOrderedInfo
{ {
diameter 0.005; // minimum space between centers of particles distance 0.005; // minimum distance between particles centers
numPoints 30000; // number of particles in the simulation numPoints 30000; // number of particles in the simulation
axisOrder (z x y); // axis order for filling the space with particles axisOrder (z x y); // axis order for filling the space with particles
} }
@ -41,7 +41,7 @@ setFields
{ {
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)
r Velocity realx3 (0 0 0); // rotational velocity (rad/s) rVelocity realx3 (0 0 0); // rotational velocity (rad/s)
shapeName word smallSphere; // name of the particle shape shapeName word smallSphere; // name of the particle shape
} }
@ -54,6 +54,7 @@ setFields
{ {
begin 0; // begin index of points begin 0; // begin index of points
end 29999; // end index of points end 29999; // end index of points
number 10000; // number of points to be selected
} }
fieldValue // fields that the selector is applied to fieldValue // fields that the selector is applied to
{ {

View File

@ -0,0 +1,7 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
ls | grep -P "^(([0-9]+\.?[0-9]*)|(\.[0-9]+))$" | xargs -d"\n" rm -rf
rm -rf VTK
#------------------------------------------------------------------------------

View File

@ -0,0 +1,21 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
echo "\n<--------------------------------------------------------------------->"
echo "1) Creating particles"
echo "<--------------------------------------------------------------------->\n"
particlesPhasicFlow
echo "\n<--------------------------------------------------------------------->"
echo "2) Creating geometry"
echo "<--------------------------------------------------------------------->\n"
geometryPhasicFlow
echo "\n<--------------------------------------------------------------------->"
echo "3) Running the case"
echo "<--------------------------------------------------------------------->\n"
sphereGranFlow
#------------------------------------------------------------------------------

View File

@ -6,7 +6,9 @@ objectName domainDict;
objectType dictionary; objectType dictionary;
fileFormat ASCII; fileFormat ASCII;
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
globalBox // Simulation domain: every particles that goes outside this domain will be deleted
// Simulation domain: every particles that goes outside this domain will be deleted
globalBox
{ {
min (0.397538 0.178212 0.00); min (0.397538 0.178212 0.00);

View File

@ -25,10 +25,12 @@ g (0 -9.8 0); // gravity vector (m/s2)
includeObjects (diameter mass); includeObjects (diameter mass);
// exclude unnecessary data from saving on disk // exclude unnecessary data from saving on disk
excludeObjects (rVelocity.dy1 pStructPosition.dy1 pStructVelocity.dy1); excludeObjects ();
integrationMethod AdamsBashforth2; integrationMethod AdamsBashforth2;
integrationHistory off;
writeFormat ascii; // data writting format (ascii or binary) writeFormat ascii; // data writting format (ascii or binary)
timersReport Yes; // report timers: Yes or No timersReport Yes; // report timers: Yes or No

View File

@ -1,4 +1,5 @@
# Problem Definition (v-1.0) # Problem Definition (v-1.0)
The problem is to simulate a rotating drum with a diameter of 0.24 m, a length of 0.1 m and 6 baffles rotating at 15 rpm. This drum is filled with 20000 particles, the integration time step is 0.00001 s. There are 2 types of particles in this drum, each of which is inserted during the simulation to fill the drum. The problem is to simulate a rotating drum with a diameter of 0.24 m, a length of 0.1 m and 6 baffles rotating at 15 rpm. This drum is filled with 20000 particles, the integration time step is 0.00001 s. There are 2 types of particles in this drum, each of which is inserted during the simulation to fill the drum.
* **12500** Particles with **4 mm** diameter, at the rate of 12500 particles/s for 1 sec. * **12500** Particles with **4 mm** diameter, at the rate of 12500 particles/s for 1 sec.
* **7500** Particles with **5mm** diameter, at the rate of 7500 particles/s for 1 sec. * **7500** Particles with **5mm** diameter, at the rate of 7500 particles/s for 1 sec.
@ -15,10 +16,13 @@ The problem is to simulate a rotating drum with a diameter of 0.24 m, a length o
</html> </html>
# Setting up the Case # Setting up the Case
As it has been explained in the previous cases, the simulation case setup is based on text-based scripts. Here, the simulation case setup are sorted in three folders: `caseSetup`, `setting` and `stl`. As it has been explained in the previous cases, the simulation case setup is based on text-based scripts. Here, the simulation case setup are sorted in three folders: `caseSetup`, `setting` and `stl`.
## Defining small and large particles ## Defining small and large particles
Then in the `caseSetup/shapes` the diameter and the material name of the particles are defined. Two sizes are defined: 4 and 5 mm. Then in the `caseSetup/shapes` the diameter and the material name of the particles are defined. Two sizes are defined: 4 and 5 mm.
```C++ ```C++
// names of shapes // names of shapes
names (smallSphere largeSphere); names (smallSphere largeSphere);
@ -28,8 +32,8 @@ diameters (0.004 0.005);
materials (lightMat heavyMat); materials (lightMat heavyMat);
``` ```
## Particle Insertion ## Particle Insertion
In this case we have two regions for inserting the particles. In both regions we define the insertion rate, the start and end time of the insertion, information about the volume of space through which the particles are inserted. The insertion phase in the simulation is performed between times 0 and 1 second. In this case we have two regions for inserting the particles. In both regions we define the insertion rate, the start and end time of the insertion, information about the volume of space through which the particles are inserted. The insertion phase in the simulation is performed between times 0 and 1 second.
For example, for the insertion region for inserting light particles is shown below. For example, for the insertion region for inserting light particles is shown below.
@ -39,31 +43,44 @@ in <b>caseSetup/particleInsertion</b> file
```C++ ```C++
// Right Layer Region // Right Region
layerrightregion right_region
{ {
// type of insertion region // type of insertion region
timeControl simulationTime;
regionType cylinder; regionType cylinder;
// insertion rate (particles/s) // insertion rate (particles/s)
rate 12500; rate 12500;
// Start time of LightParticles insertion (s)
timeControl simulationTime;
// Start time of insertion (s)
startTime 0; startTime 0;
// End time of LightParticles insertion (s) // End time of insertion (s)
endTime 1; endTime 1;
// Time Interval of LightParticles insertion (s) // Time Interval of insertion (s)
insertionInterval 0.025; insertionInterval 0.025;
cylinderInfo cylinderInfo
{ {
// Coordinates of cylinderRegion (m,m,m) // Coordinates of cylinderRegion (m,m,m)
p2 (-0.15 0.25 0.05); p2 (-0.15 0.25 0.05);
p1 (-0.15 0.24 0.05); p1 (-0.15 0.24 0.05);
// radius of cylinder (m) // radius of cylinder (m)
radius 0.035; radius 0.035;
} }
setFields
{
velocity realx3 (0.0 -0.6 0.0); // initial velocity of inserted particles
}
mixture
{
smallSphere 1; // mixture composition of inserted particles
}
} }
``` ```
## Interaction between particles and walls ## Interaction between particles and walls
The `caseSetup/interaction` file defines the material names and properties as well as the interaction parameters: the interaction between the particles and the shell of the rotating drum. Since we define 3 materials for simulation, the interaction matrix is 3x3, while we only need to enter upper triangle elements (interactions are symmetric). The `caseSetup/interaction` file defines the material names and properties as well as the interaction parameters: the interaction between the particles and the shell of the rotating drum. Since we define 3 materials for simulation, the interaction matrix is 3x3, while we only need to enter upper triangle elements (interactions are symmetric).
@ -78,31 +95,32 @@ densities (1000 1500 2500);
heavyMat-heavyMat heavyMat-wallMat heavyMat-heavyMat heavyMat-wallMat
wallMat-wallMat ); wallMat-wallMat );
*/ */
// Young modulus [Pa] // Young modulus [Pa]
Yeff (1.0e6 1.0e6 1.0e6 Yeff (1.0e6 1.0e6 1.0e6
1.0e6 1.0e6 1.0e6 1.0e6
1.0e6); 1.0e6);
// Shear modulus [Pa] // Shear modulus [Pa]
Geff (0.8e6 0.8e6 0.8e6 Geff (0.8e6 0.8e6 0.8e6
0.8e6 0.8e6 0.8e6 0.8e6
0.8e6); 0.8e6);
// Poisson's ratio [-] // Poisson's ratio [-]
nu (0.25 0.25 0.25 nu (0.25 0.25 0.25
0.25 0.25 0.25 0.25
0.25); 0.25);
// coefficient of normal restitution // coefficient of normal restitution
en (0.97 0.97 0.85 en (0.97 0.97 0.85
0.97 0.85 0.97 0.85
1.00); 1.00);
// dynamic friction // dynamic friction
mu (0.65 0.65 0.35 mu (0.65 0.65 0.35
0.65 0.35 0.65 0.35
0.35); 0.35);
// rolling friction // rolling friction
mur (0.1 0.1 0.1 mur (0.1 0.1 0.1
0.1 0.1 0.1 0.1
0.1); 0.1);
``` ```
## Settings ## Settings
### Geometry ### Geometry
In the `settings/geometryDict` file, the geometry and axis of rotation is defined for the drum. The geometry is composed of a body, front and rear ends. In the `settings/geometryDict` file, the geometry and axis of rotation is defined for the drum. The geometry is composed of a body, front and rear ends.
@ -163,7 +181,9 @@ surfaces
In this part of `geometryDict` the information of rotating axis and speed of rotation are defined. The start of rotation is at 2 s. The first 2 seconds of simulation is for allowing particles to settle donw in the drum. In this part of `geometryDict` the information of rotating axis and speed of rotation are defined. The start of rotation is at 2 s. The first 2 seconds of simulation is for allowing particles to settle donw in the drum.
```C++ ```C++
motionModel rotatingAxis; motionModel rotatingAxis;
rotatingAxisInfo rotatingAxisInfo
{ {
rotAxis rotAxis
@ -181,7 +201,9 @@ rotatingAxisInfo
} }
} }
``` ```
## Performing Simulation ## Performing Simulation
To run simulations, type the following commands in the terminal one at a time. To run simulations, type the following commands in the terminal one at a time.
Enter `particlesPhasicFlow` command to create the initial fields for particles. Enter `particlesPhasicFlow` command to create the initial fields for particles.

View File

@ -6,6 +6,7 @@ objectName interaction;
objectType dicrionary; objectType dicrionary;
fileFormat ASCII; fileFormat ASCII;
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
materials (lightMat heavyMat wallMat); // a list of materials names materials (lightMat heavyMat wallMat); // a list of materials names
densities (1000 1500 2500); // density of materials [kg/m3] densities (1000 1500 2500); // density of materials [kg/m3]
@ -14,7 +15,7 @@ contactListType sortedContactList;
contactSearch contactSearch
{ {
method NBS; // method for broad search method NBS;
updateInterval 10; updateInterval 10;

View File

@ -6,14 +6,14 @@ objectName particleInsertion;
objectType dicrionary; objectType dicrionary;
fileFormat ASCII; fileFormat ASCII;
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
active Yes; // is insertion active -> Yes or No active Yes; // is insertion active -> Yes or No
/* /*
Two layers of particles are packed one-by-one using 1 insertion steps Two layers of particles are packed one-by-one using 1 insertion steps
*/ */
right_region
layerrightregion // Right Layer Region
{ {
timeControl simulationTime; timeControl simulationTime;
@ -21,11 +21,11 @@ layerrightregion // Right Layer Region
rate 12500; // Right Region Particles Insertion Rate (particles/s) rate 12500; // Right Region Particles Insertion Rate (particles/s)
startTime 0; // Start time of LightParticles insertion (s) startTime 0; // Start time of insertion (s)
endTime 1; // End time of LightParticles insertion (s) endTime 1; // End time of insertion (s)
insertionInterval 0.025; // Time Interval of LightParticles insertion (s) insertionInterval 0.025; // Time Interval of particles insertion (s)
cylinderInfo cylinderInfo
{ {
@ -47,7 +47,7 @@ layerrightregion // Right Layer Region
} }
} }
layerleftregion // Left Layer Region left_region
{ {
timeControl simulationTime; timeControl simulationTime;
@ -55,11 +55,11 @@ layerleftregion // Left Layer Region
rate 7500; // Left Region Particles Insertion Rate (particles/s) rate 7500; // Left Region Particles Insertion Rate (particles/s)
startTime 0; // Start time of LightParticles insertion (s) startTime 0; // Start time of insertion (s)
endTime 1; // End time of LightParticles insertion (s) endTime 1; // End time of insertion (s)
insertionInterval 0.025; // Time Interval of LightParticles insertion (s) insertionInterval 0.025; // Time Interval of insertion (s)
cylinderInfo cylinderInfo
{ {

View File

@ -6,6 +6,7 @@ objectName sphereDict;
objectType sphereShape; objectType sphereShape;
fileFormat ASCII; fileFormat ASCII;
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
names (smallSphere largeSphere); // names of shapes names (smallSphere largeSphere); // names of shapes
diameters (0.004 0.005); // diameter of shapes (m) diameters (0.004 0.005); // diameter of shapes (m)

View File

@ -6,7 +6,9 @@ objectName domainDict;
objectType dictionary; objectType dictionary;
fileFormat ASCII; fileFormat ASCII;
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
globalBox // Simulation domain: every particles that goes outside this domain will be deleted
// Simulation domain: every particles that goes outside this domain will be deleted
globalBox
{ {
min (-0.328 0.095 -0.025); // lower corner point of the box min (-0.328 0.095 -0.025); // lower corner point of the box
@ -22,26 +24,26 @@ boundaries
right right
{ {
type exit; // other options: periodict, reflective type exit; // other options: periodic, reflective
} }
bottom bottom
{ {
type exit; // other options: periodict, reflective type exit; // other options: periodic, reflective
} }
top top
{ {
type exit; // other options: periodict, reflective type exit; // other options: periodic, reflective
} }
rear rear
{ {
type exit; // other options: periodict, reflective type exit; // other options: periodic, reflective
} }
front front
{ {
type exit; // other options: periodict, reflective type exit; // other options: periodic, reflective
} }
} }

View File

@ -6,6 +6,7 @@ objectName geometryDict;
objectType dictionary; objectType dictionary;
fileFormat ASCII; fileFormat ASCII;
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
motionModel rotatingAxis; motionModel rotatingAxis;
rotatingAxisInfo rotatingAxisInfo

View File

@ -10,9 +10,7 @@ setFields
{ {
/* /*
Default value for fields defined for particles Default value for fields defined for particles
These fields should always be defined for simulations with These fields should always be defined for simulations with
spherical particles. spherical particles.
*/ */
@ -29,30 +27,13 @@ setFields
selectors selectors
{ {
shapeAssigne
{
selector stridedRange; // other options: box, cylinder, sphere, randomPoints
stridedRangeInfo
{
begin 0; // begin index of points
end 20000; // 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
{ {
method empty; // other options: random and ordered method empty; // other options: random, file and ordered
} }

View File

@ -20,14 +20,16 @@ timePrecision 6; // maximum number of digits for time
g (0 -9.8 0); // gravity vector (m/s2) g (0 -9.8 0); // gravity vector (m/s2)
// save necessary (i.e., required) data on disk // save necessary data on disk
includeObjects (diameter); includeObjects (diameter);
// exclude unnecessary data from saving on disk // exclude unnecessary data from saving on disk
excludeObjects (rVelocity.dy1 pStructPosition.dy1 pStructVelocity.dy1); excludeObjects ();
integrationMethod AdamsBashforth2; // integration method integrationMethod AdamsBashforth2; // integration method
integrationHistory off; // to sace space on disk
writeFormat ascii; // data writting format (ascii or binary) writeFormat ascii; // data writting format (ascii or binary)
timersReport Yes; // report timers (Yes or No) timersReport Yes; // report timers (Yes or No)

View File

@ -0,0 +1,251 @@
# V-blender Simulation (phasicFlow v-1.0)
This tutorial demonstrates the simulation of a V-blender, a common mixing device used in pharmaceutical and powder processing industries. The V-blender consists of a V-shaped vessel that rotates around a horizontal axis, allowing for efficient mixing of particulate materials.
<div align ="center">
<img src="./v-blender.png" style="width: 400px;">
</div>
<div align ="center">
<b>
V-blender simulation with two layers of particles
</b>
</div>
## Problem Definition
The simulation represents a V-blender with the following characteristics:
- The blender is initially empty and is filled with two different particle types in sequence
- First layer: Small particles (10 mm diameter) are inserted from the right side
- Second layer: Slightly larger particles (10.1 mm diameter) are inserted from the left side
- The blender begins rotation at t = 3.0 s and continues until t = 10.0 s
- The rotation speed is set to 3.14 rad/s (approximately 0.5 Hz or 30 RPM)
- The simulation runs for a total of 10 seconds
## Case Setup
The simulation case setup files are organized in the `settings/` and `caseSetup/` folders.
### Particles Definition
Two particle types are defined in the `caseSetup/shapes` file:
```C++
names (smallSphere largeSphere); // names of particles
diameters (0.01 0.0101); // diameter of particles (m)
materials (lightMat lightMat); // material names for particles
```
Both particle types share the same material properties but differ slightly in size to allow for visual distinction during mixing.
### Particle Insertion
Particles are inserted in two sequential phases, as defined in `caseSetup/particleInsertion`:
```C++
active Yes; // is insertion active -> Yes or No
rightregion
{
timeControl simulationTime; // Controls insertion based on simulation time
regionType cylinder; // Defines a cylindrical insertion region
rate 10000; // Inserts 10,000 particles per second
startTime 0.0; // Starts inserting at t = 0s (beginning of simulation)
endTime 1.0; // Stops inserting at t = 1s
insertionInterval 0.025; // Inserts particles every 0.025s
// (40 insertion events during the 1s period)
cylinderInfo {
// Defines cylinder endpoints and radius
p1 (0.0950615 0.12 0.5011585); // First endpoint coordinates (x,y,z) in meters
p2 (0.1150615 0.12 0.4811585); // Second endpoint coordinates (x,y,z) in meters
radius 0.1; // Cylinder radius in meters
}
setFields {
// Initial properties for inserted particles
velocity realx3 (1.2 0.0 -1.2); // Initial velocity vector (x,y,z) in m/s
// Particles move to the right and downward
}
mixture {
// Particle type distribution
smallSphere 1; // 100% of inserted particles are "smallSphere" type
}
}
leftregion
{
timeControl simulationTime; // Controls insertion based on simulation time
regionType cylinder; // Defines a cylindrical insertion region
rate 10000; // Inserts 10,000 particles per second
startTime 1.5; // Starts inserting at t = 1.5s
// (after the first insertion phase)
endTime 2.5; // Stops inserting at t = 2.5s
insertionInterval 0.025; // Inserts particles every 0.025s
// (40 insertion events during the 1s period)
cylinderInfo {
// Defines cylinder endpoints and radius
p1 (0.7562545 0.12 0.50079); // First endpoint coordinates (x,y,z) in meters
p2 (0.7362545 0.12 0.48079); // Second endpoint coordinates (x,y,z) in meters
radius 0.1; // Cylinder radius in meters
}
setFields {
// Initial properties for inserted particles
velocity realx3 (-1.2 0.0 -1.2); // Initial velocity vector (x,y,z) in m/s
// Particles move to the left and downward
}
mixture {
// Particle type distribution
largeSphere 1; // 100% of inserted particles are "largeSphere" type
}
}
```
#### Detailed Explanation of Insertion Parameters
1. **`rightregion` Dictionary**:
- Creates a cylindrical insertion region on the right side of the V-blender
- Active during t=0s to t=1s at the beginning of the simulation
- Particles are inserted from randomly generated positions within the cylinder
- Inserts "smallSphere" particles with 10mm diameter
- Initial velocity (1.2, 0.0, -1.2) m/s directs particles toward the center and bottom of the blender
- 40 insertion events occur (every 0.025s), each adding approximately 250 particles
2. **`leftregion` Dictionary**:
- Creates a symmetrical cylindrical insertion region on the left side of the V-blender
- Active during t=1.5s to t=2.5s, after the first batch of particles has settled
- Inserts "largeSphere" particles with 10.1mm diameter
- Initial velocity (-1.2, 0.0, -1.2) m/s directs particles toward the center and bottom of the blender
- Mirror image of the first insertion but with slightly larger particles
3. **Insertion Region Selection**:
- Cylindrical insertion regions are positioned above each arm of the V-blender
- This arrangement ensures particles fall naturally into the V-blender without initial overlap
4. **Timing Strategy**:
- Sequential insertion with a 0.5s gap between phases allows the first batch to settle
- All particles settle for 0.5s after the second insertion (t=2.5s to t=3.0s)
- Blender rotation begins after all particles have settled (t=3.0s)
### Geometry and Motion
The V-blender geometry is defined in `settings/geometryDict` using an STL file:
```C++
motionModel rotatingAxis; // motion model: rotating object around an axis
rotatingAxisInfo // information for rotatingAxis motion model
{
rotAxis
{
p1 (0.128228 0.116446 0.297901); // first point for the axis of rotation
p2 (0.722596 0.116459 0.297901); // second point for the axis of rotation
omega 3.14; // rotation speed (rad/s)
startTime 3; // start time of rotation
endTime 10; // end time of rotation
}
}
```
The blender starts rotating at t = 3.0 s, after both particle types have been inserted and allowed to settle.
### Simulation Domain and Boundaries
The simulation domain is defined in `settings/domainDict`:
```C++
globalBox
{
min (-0.1 -0.4 0); // lower corner point of the box
max (0.86 0.6 0.6); // upper corner point of the box
}
```
All boundaries are set to "exit" type, meaning particles that go outside the domain will be deleted.
### Particle Interaction Properties
Material properties and interaction parameters are defined in `caseSetup/interaction`:
```C++
materials (wallMat lightMat); // a list of materials names
densities (1000 1000); // density of materials [kg/m3]
// Contact force models
model
{
contactForceModel nonLinearNonLimited;
rollingFrictionModel normal;
// Material properties
Yeff (1.0e6 1.0e6
1.0e6); // Young modulus [Pa]
Geff (0.8e6 0.8e6
0.8e6); // Shear modulus [Pa]
nu (0.25 0.25
0.25); // Poisson's ratio [-]
en (0.97 0.85
0.97); // coefficient of normal restitution
mu (0.65 0.35
0.65); // dynamic friction
mur (0.1 0.1
0.1); // rolling friction
}
```
## Running the Simulation
To run this simulation, execute the following commands in sequence:
1. First, create the geometry:
```
geometryPhasicFlow
```
2. Next, initialize the particle system (note: starts with zero particles):
```
particlesPhasicFlow
```
3. Finally, run the simulation:
```
sphereGranFlow
```
The simulation will automatically insert particles according to the defined schedule and begin rotating the V-blender at the specified time.
## Visualizing Results
After the simulation completes, you can convert the results to VTK format for visualization:
```
pFlowToVTK --binary
```
The VTK files will be stored in a new directory called `./VTK` and can be visualized using tools like ParaView or VisIt.
## Expected Behavior
During the simulation, you should observe:
1. Initial filling with small particles from the right side (0-1s)
2. A brief settling period (1-1.5s)
3. Filling with large particles from the left side (1.5-2.5s)
4. Another settling period (2.5-3s)
5. Rotation of the V-blender causing mixing of the two particle types (3-10s)

View File

@ -6,6 +6,7 @@ objectName interaction;
objectType dicrionary; objectType dicrionary;
fileFormat ASCII; fileFormat ASCII;
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
materials (wallMat lightMat); // a list of materials names materials (wallMat lightMat); // a list of materials names
densities (1000 1000); // density of materials [kg/m3] densities (1000 1000); // density of materials [kg/m3]
@ -14,7 +15,7 @@ contactListType sortedContactList;
contactSearch contactSearch
{ {
method NBS; // method for broad search method NBS;
updateInterval 10; updateInterval 10;

View File

@ -6,9 +6,10 @@ objectName particleInsertion;
objectType dicrionary; objectType dicrionary;
fileFormat ASCII; fileFormat ASCII;
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
active Yes; // is insertion active -> Yes or No active Yes; // is insertion active -> Yes or No
checkForCollision Yes; // is checked -> Yes or No
/* /*
Two layers of particles are packed one-by-one using tho insertion steps Two layers of particles are packed one-by-one using tho insertion steps
@ -69,12 +70,11 @@ leftregion
{ {
/* coordinates of center of both ends of the insertion /* coordinates of center of both ends of the insertion
cylinder on the left side of the V-blender (m,m,m) */ cylinder on the left side of the V-blender (m,m,m) */
p1 ( 0.7562545 0.12 0.50079); p1 ( 0.7562545 0.12 0.50079);
p2 ( 0.7362545 0.12 0.48079); p2 ( 0.7362545 0.12 0.48079);
radius 0.1; // radius of cylinder (m) radius 0.1;
} }
setFields setFields

View File

@ -25,26 +25,26 @@ boundaries
right right
{ {
type exit; // other options: periodict, reflective type exit; // other options: periodic, reflective
} }
bottom bottom
{ {
type exit; // other options: periodict, reflective type exit; // other options: periodic, reflective
} }
top top
{ {
type exit; // other options: periodict, reflective type exit; // other options: periodic, reflective
} }
rear rear
{ {
type exit; // other options: periodict, reflective type exit; // other options: periodic, reflective
} }
front front
{ {
type exit; // other options: periodict, reflective type exit; // other options: periodic, reflective
} }
} }

View File

@ -6,6 +6,7 @@ objectName geometryDict;
objectType dictionary; objectType dictionary;
fileFormat ASCII; fileFormat ASCII;
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
motionModel rotatingAxis; // motion model: rotating object around an axis motionModel rotatingAxis; // motion model: rotating object around an axis
rotatingAxisInfo // information for rotatingAxis motion model rotatingAxisInfo // information for rotatingAxis motion model

Binary file not shown.

After

Width:  |  Height:  |  Size: 158 KiB

View File

@ -47,7 +47,7 @@ positionParticles
method ordered; // other options: random or empty method ordered; // other options: random or empty
orderedInfo orderedInfo
{ {
diameter 0.005; // minimum space between centers of particles distance 0.005; // minimum space between centers of particles
numPoints 30000; // number of particles in the simulation numPoints 30000; // number of particles in the simulation
axisOrder (z x y); // axis order for filling the space with particles axisOrder (z x y); // axis order for filling the space with particles
} }

View File

View File

@ -6,8 +6,8 @@ objectName domainDict;
objectType dictionary; objectType dictionary;
fileFormat ASCII; fileFormat ASCII;
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
// Simulation domain: every particles that goes outside this domain will be deleted
// Simulation domain: every particles that goes outside this domain will be deleted
globalBox globalBox
{ {
min (-0.12 -0.12 0); min (-0.12 -0.12 0);

View File

@ -44,7 +44,6 @@ surfaces
/* /*
This is a plane wall at the rear end of cylinder This is a plane wall at the rear end of cylinder
*/ */
wall1 wall1
{ {
type planeWall; // other options: cuboidWall and cylinderWall type planeWall; // other options: cuboidWall and cylinderWall
@ -65,7 +64,6 @@ surfaces
/* /*
This is a plane wall at the front end of cylinder This is a plane wall at the front end of cylinder
*/ */
wall2 wall2
{ {
type planeWall; // other options: cuboidWall and cylinderWall type planeWall; // other options: cuboidWall and cylinderWall

View File

@ -6,6 +6,7 @@ objectName particlesDict;
objectType dictionary; objectType dictionary;
fileFormat ASCII; fileFormat ASCII;
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
setFields setFields
{ {
/* /*
@ -54,7 +55,7 @@ positionParticles // positions particles
orderedInfo orderedInfo
{ {
diameter 0.005; // diameter of particles distance 0.005; // minimum distance between particles centers
numPoints 30000; // number of particles in the simulation numPoints 30000; // number of particles in the simulation

View File

@ -21,15 +21,15 @@ timePrecision 6; // maximum number of digits for time
g (0 -9.8 0); // gravity vector (m/s2) g (0 -9.8 0); // gravity vector (m/s2)
// save necessary (i.e., required) data on disk // save necessary (i.e., required) data on disk
includeObjects (diameter); includeObjects (diameter);
// exclude unnecessary data from saving on disk // exclude unnecessary data from saving on disk
excludeObjects ();
excludeObjects (rVelocity.dy1 pStructPosition.dy1 pStructVelocity.dy1);
integrationMethod AdamsBashforth2; // integration method integrationMethod AdamsBashforth2; // integration method
integrationHistory off; // do not keep integration history on disk (saves space)
writeFormat ascii; // data writting format (ascii or binary) writeFormat ascii; // data writting format (ascii or binary)
timersReport Yes; // report timers timersReport Yes; // report timers

View File

@ -6,14 +6,14 @@ objectName particleInsertion;
objectType dicrionary; objectType dicrionary;
fileFormat ASCII; fileFormat ASCII;
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
active Yes; // is insertion active -> yes or no active Yes; // is insertion active -> yes or no
checkForCollision No; // is checked -> yes or no checkForCollision No; // is checked -> yes or no
/* /*
one layers of particles are packed one layer of particles are packed
*/ */
layer0 layer0
{ {
timeControl simulationTime; timeControl simulationTime;

View File

@ -6,6 +6,7 @@ objectName sphereDict;
objectType sphereShape; objectType sphereShape;
fileFormat ASCII; fileFormat ASCII;
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
names (lightSphere heavySphere); // names of shapes names (lightSphere heavySphere); // names of shapes
diameters (0.007 0.007); // diameter of shapes diameters (0.007 0.007); // diameter of shapes

View File

@ -6,7 +6,9 @@ objectName domainDict;
objectType dictionary; objectType dictionary;
fileFormat ASCII; fileFormat ASCII;
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
globalBox // Simulation domain: every particles that goes outside this domain will be deleted
// Simulation domain: every particles that goes outside this domain will be deleted
globalBox
{ {
min (-0.11 -0.11 -0.41); min (-0.11 -0.11 -0.41);
@ -16,19 +18,15 @@ globalBox // Simulation domain: every par
boundaries boundaries
{ {
// Determines how often (how many iterations) do you want to // Determines how often (how many iterations) do you want to
// rebuild the list of particles in the neighbor list // rebuild the list of particles in the neighbor list
// of all boundaries in the simulation domain // of all boundaries in the simulation domain
neighborListUpdateInterval 30; neighborListUpdateInterval 30;
// Determines how often do you want to update the new changes in the boundary // Determines how often do you want to update the new changes in the boundary
updateInterval 10; updateInterval 10;
// The distance from the boundary plane within which particles are marked to be in the boundary list // The distance from the boundary plane within which particles are marked to be in the boundary list
neighborLength 0.004; neighborLength 0.004;
left left

View File

@ -6,7 +6,9 @@ objectName geometryDict;
objectType dictionary; objectType dictionary;
fileFormat ASCII; fileFormat ASCII;
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
motionModel conveyorBelt; // motion model can be rotatingAxis or stationary or vibrating
// motion model can be rotatingAxis or stationary or vibrating
motionModel conveyorBelt;
conveyorBeltInfo conveyorBeltInfo
{ {
@ -73,8 +75,3 @@ surfaces
} }
} }

View File

@ -6,16 +6,14 @@ objectName particlesDict;
objectType dictionary; objectType dictionary;
fileFormat ASCII; fileFormat ASCII;
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
setFields setFields
{ {
/* /*
Default value for fields defined for particles Default value for fields defined for particles
These fields should always be defined for simulations with These fields should always be defined for simulations with
spherical particles. spherical particles.
*/ */
defaultValue defaultValue
{ {
velocity realx3 (0 0 0); // linear velocity (m/s) velocity realx3 (0 0 0); // linear velocity (m/s)
@ -31,17 +29,8 @@ setFields
{} {}
} }
positionParticles // positions particles positionParticles
{ {
method empty; // other options: ordered and random method empty; // other options: file, ordered and random
regionType box; // other options: cylinder and sphere
boxInfo // box region 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
}
} }

View File

@ -6,7 +6,8 @@ objectName settingsDict;
objectType dictionary; objectType dictionary;
fileFormat ASCII; fileFormat ASCII;
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
run layerdSiloFilling;
run conveyorBelt;
dt 0.00005; // time step for integration (s) dt 0.00005; // time step for integration (s)
@ -21,13 +22,10 @@ timePrecision 6; // maximum number of digits for ti
g (0 0 -9.8); // gravity vector (m/s2) g (0 0 -9.8); // gravity vector (m/s2)
// save data objects that are not automatically saved on disk. // save data objects that are not automatically saved on disk.
// overrides the default behavior // overrides the default behavior
includeObjects (diameter); includeObjects (diameter);
// exclude unnecessary data from saving on disk // exclude unnecessary data from saving on disk
excludeObjects (rVelocity.dy1 pStructPosition.dy1 pStructVelocity.dy1); excludeObjects (rVelocity.dy1 pStructPosition.dy1 pStructVelocity.dy1);
integrationMethod AdamsBashforth2; // integration method integrationMethod AdamsBashforth2; // integration method

View File

@ -72,7 +72,7 @@ boundaries
## Running the Case ## Running the Case
The solver for this simulation is `sphereGranFlow`. Enter the following commands 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 commands in the terminal. Depending on the computational power, it may take a few minutes to a few hours to complete.
```sh ```
geometryPhasicFlow geometryPhasicFlow
particlesPhasicFlow particlesPhasicFlow
sphereGranFlow sphereGranFlow
@ -81,6 +81,6 @@ 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 convert all the results (particles and geometry) to VTK format and store them in the `VTK/` folder. 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 convert all the results (particles and geometry) to VTK format and store them in the `VTK/` folder.
```sh ```
pFlowToVTK --binary pFlowToVTK --binary
``` ```

View File

@ -24,18 +24,12 @@ g (0 -9.8 0); // gravity vector (m/s2)
includeObjects (diameter); // save necessary (i.e., required) data on disk includeObjects (diameter); // save necessary (i.e., required) data on disk
// exclude unnecessary data from saving on disk // exclude unnecessary data from saving on disk
excludeObjects (rVelocity.dy1 excludeObjects ();
rVelocity.dy2
rVelocity.dy3
pStructPosition.dy1
pStructPosition.dy2
pStructPosition.dy3
pStructVelocity.dy1
pStructVelocity.dy2
pStructVelocity.dy3);
integrationMethod AdamsBashforth4; // integration method integrationMethod AdamsBashforth4; // integration method
integrationHistory off; // to save space on disk
writeFormat ascii; // data writting format (ascii or binary) writeFormat ascii; // data writting format (ascii or binary)
timersReport Yes; // report timers (Yes or No) timersReport Yes; // report timers (Yes or No)

View File

@ -3,7 +3,7 @@
## Problem ## Problem
A homogenization silo is used to mix particles inside a silo using the circulation of particles. A pneumatic conveying system carries particles from the exit and re-enters them from the top. Here, we use a `periodic` boundary to simulate the action of the pneumatic conveyor system for circulating particles. Particles exiting from the bottom are re-entered from the top using this boundary (`periodic`). A homogenization silo is used to mix particles inside a silo using the circulation of particles. A pneumatic conveying system carries particles from the exit and re-enters them from the top. Here, we use a `periodic` boundary to simulate the action of the pneumatic conveyor system for circulating particles. Particles exiting from the bottom are re-entered from the top using this boundary (`periodic`).
The simulation case setup is essentially similar to the [`layeredSiloFilling`](https://github.com/PhasicFlow/phasicFlow/tree/main/tutorials/sphereGranFlow/layeredSiloFilling) tutorial. There is also another change with regard to `layeredSiloFilling`. The exit gate is opened after the filling phase of the silo (see `settings/geometryDict` for more details). The simulation case setup is essentially similar to the [`layeredSiloFilling`](../layeredSiloFilling/) tutorial. There is also another change with regard to `layeredSiloFilling`. The exit gate is opened after the filling phase of the silo (see `settings/geometryDict` for more details).
<div align ="center"> <div align ="center">
<img src="./homoSilo.jpeg" style="width: 400px;"> <img src="./homoSilo.jpeg" style="width: 400px;">

View File

@ -37,7 +37,6 @@ model
heavyMat-heavyMat heavyMat-wallMat heavyMat-heavyMat heavyMat-wallMat
wallMat-wallMat ); wallMat-wallMat );
*/ */
Yeff (1.0e6 1.0e6 1.0e6 // Young modulus [Pa] Yeff (1.0e6 1.0e6 1.0e6 // Young modulus [Pa]
1.0e6 1.0e6 1.0e6 1.0e6
1.0e6); 1.0e6);

View File

@ -109,7 +109,6 @@ layer2
mixture mixture
{ {
parType1 1; // only parType1 parType1 1; // only parType1
} }
} }
@ -143,7 +142,6 @@ layer3
mixture mixture
{ {
parType2 1; parType2 1;
} }
} }
@ -176,7 +174,6 @@ layer4
mixture mixture
{ {
parType1 1; parType1 1;
} }
} }
@ -209,6 +206,5 @@ layer5
mixture mixture
{ {
parType2 1; parType2 1;
} }
} }

View File

@ -38,12 +38,12 @@ boundaries
type exit; type exit;
} }
rear rear // z-
{ {
type periodic; type periodic;
} }
front front // z+
{ {
type periodic; type periodic;
} }

View File

@ -61,7 +61,6 @@ surfaces
/* /*
This is a plane wall at the exit of silo This is a plane wall at the exit of silo
*/ */
exitGate exitGate
{ {
type planeWall; // other options: cuboidWall and cylinderWall type planeWall; // other options: cuboidWall and cylinderWall

View File

@ -13,7 +13,6 @@ setFields
These fields should always be defined for simulations with These fields should always be defined for simulations with
spherical particles. spherical particles.
*/ */
defaultValue defaultValue
{ {
velocity realx3 (0 0 0); // linear velocity (m/s) velocity realx3 (0 0 0); // linear velocity (m/s)

View File

@ -25,12 +25,12 @@ g (0 0 -9.8); // gravity vector (m/s2)
includeObjects (diameter); includeObjects (diameter);
// exclude unnecessary data from saving on disk // exclude unnecessary data from saving on disk
excludeObjects (rVelocity.dy1 rVelocity.dy2 rVelocity.dy3 excludeObjects ();
pStructPosition.dy1 pStructPosition.dy2 pStructPosition.dy3
pStructVelocity.dy1 pStructVelocity.dy2 pStructVelocity.dy3);
integrationMethod AdamsBashforth4; // integration method integrationMethod AdamsBashforth4; // integration method
integrationHistory off; // to save space on disk
writeFormat binary; // data writting format (ascii or binary) writeFormat binary; // data writting format (ascii or binary)
timersReport Yes; // report timers timersReport Yes; // report timers

View File

@ -13,7 +13,6 @@ setFields
These fields should always be defined for simulations with These fields should always be defined for simulations with
spherical particles. spherical particles.
*/ */
defaultValue defaultValue
{ {
velocity realx3 (0 0 0); // linear velocity (m/s) velocity realx3 (0 0 0); // linear velocity (m/s)

View File

@ -25,10 +25,12 @@ g (0 0 -9.8); // gravity vector (m/s^2)
includeObjects (diameter mass); includeObjects (diameter mass);
// exclude unnecessary data from saving on disk // exclude unnecessary data from saving on disk
excludeObjects (rVelocity.dy1 pStructPosition.dy1 pStructVelocity.dy1); excludeObjects ();
integrationMethod AdamsBashforth2; // integration method integrationMethod AdamsBashforth2; // integration method
integrationHistory off;
writeFormat ascii; // data writing format (ascii or binary) writeFormat ascii; // data writing format (ascii or binary)
timersReport Yes; // report timers timersReport Yes; // report timers

View File

@ -0,0 +1,161 @@
# Simulating a Medium-Scale Rotating Drum (v-1.0)
## Problem Definition
This tutorial demonstrates the simulation of a medium-sized rotating drum with a diameter of 0.24 m and a length of 0.36 m. The drum is filled with 250,000 spherical glass beads with a diameter of 3 mm. The drum rotates at a constant speed, and the simulation captures the flow behavior and mixing of the particles.
<div align="center">
<b>
A view of the rotating drum simulation
</b>
</div>
***
## Setting up the Case
PhasicFlow simulation case setup is based on text-based scripts provided in two folders located in the simulation case folder: `settings` and `caseSetup`. All commands should be entered in the terminal while the current working directory is the simulation case folder.
### Creating Particles
In the file `settings/particlesDict`, two dictionaries, `positionParticles` and `setFields`, define how particles are positioned and what field values they have initially.
The `positionParticles` dictionary specifies the ordered positioning method to place 250,000 particles within a cylindrical region:
```C++
positionParticles
{
method ordered; // other options: random and empty
orderedInfo
{
distance 0.003; // minimum distance between particles centers
numPoints 250000; // number of particles in the simulation
axisOrder (z y x); // axis order for filling the space with particles
}
regionType cylinder; // other options: box and sphere
cylinderInfo
{
p1 (0.0 0.0 0.003); // begin point of cylinder axis
p2 (0.0 0.0 0.357); // end point of cylinder axis
radius 0.117; // radius of cylinder
}
}
```
The `setFields` dictionary defines the initial values for particle fields:
```C++
setFields
{
defaultValue
{
velocity realx3 (0 0 0); // linear velocity (m/s)
acceleration realx3 (0 0 0); // linear acceleration (m/s2)
rVelocity realx3 (0 0 0); // rotational velocity (rad/s)
shapeName word glassBead; // name of the particle shape
}
}
```
To create the particles based on these settings, enter the following command in the terminal:
```
> particlesPhasicFlow
```
### Creating Geometry
In the file `settings/geometryDict`, you can find information for creating the rotating drum geometry. The simulation uses the `rotatingAxis` motion model to define rotation around a fixed axis.
The surfaces of the drum are defined in the `surfaces` dictionary, including the cylindrical shell and end walls.
To create the geometry based on these settings, enter the following command in the terminal:
```
> geometryPhasicFlow
```
### Defining Properties and Interactions
In the file `caseSetup/shapes`, the particle shape, diameter, and material are defined:
```C++
names (glassBead); // names of shapes
diameters (0.003); // diameter of shapes
materials (glassMat); // material names for shapes
```
In the file `caseSetup/interaction`, the material properties and interaction models are defined:
```C++
materials (glassMat wallMat); // a list of materials names
densities (2500.0 2500); // density of materials [kg/m3]
model
{
contactForceModel nonLinearLimited;
rollingFrictionModel normal;
/*
Property (glassMat-glassMat glassMat-wallMat
wallMat-wallMat);
*/
Yeff (1.0e6 1.0e6
1.0e6); // Young modulus [Pa]
Geff (0.8e6 0.8e6
0.8e6); // Shear modulus [Pa]
nu (0.25 0.25
0.25); // Poisson's ratio [-]
en (0.97 0.85
1.00); // coefficient of normal restitution
mu (0.65 0.65
0.65); // dynamic friction
mur (0.1 0.1
0.1); // rolling friction
}
```
The contact search settings are also defined in this file, including the method, update interval, and other parameters.
## Running the Simulation
To run the simulation, follow these steps in order:
1. Create the initial particle fields:
```
> particlesPhasicFlow
```
2. Create the geometry:
```
> geometryPhasicFlow
```
3. Start the simulation:
```
> sphereGranFlow
```
The simulation will run according to the settings defined in `settings/settingsDict`, including the time step, start/end times, and gravity vector.
## Post-Processing
After the simulation is complete, you can visualize the results using ParaView. To convert the simulation results to VTK format, use the following command:
```
> pFlowToVTK --binary
```
This will create VTK files in the `VTK/` folder that can be opened in ParaView for visualization and analysis.

View File

@ -6,6 +6,7 @@ objectName interaction;
objectType dicrionary; objectType dicrionary;
fileFormat ASCII; fileFormat ASCII;
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
materials (glassMat wallMat); // a list of materials names materials (glassMat wallMat); // a list of materials names
densities (2500.0 2500); // density of materials [kg/m3] densities (2500.0 2500); // density of materials [kg/m3]

View File

@ -1,10 +0,0 @@
/* -------------------------------*- C++ -*--------------------------------- *\
| phasicFlow File |
| copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */
objectName particleInsertion;
objectType dicrionary;
fileFormat ASCII;
/*---------------------------------------------------------------------------*/
active No; // is checked -> Yes or No

View File

@ -6,7 +6,9 @@ objectName domainDict;
objectType dictionary; objectType dictionary;
fileFormat ASCII; fileFormat ASCII;
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
globalBox // Simulation domain: every particles that goes outside this domain will be deleted
// Simulation domain: every particles that goes outside this domain will be deleted
globalBox
{ {
min (-0.12 -0.12 0); min (-0.12 -0.12 0);

View File

@ -6,6 +6,7 @@ objectName geometryDict;
objectType dictionary; objectType dictionary;
fileFormat ASCII; fileFormat ASCII;
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
motionModel rotatingAxis; // motion model: rotating object around an axis motionModel rotatingAxis; // motion model: rotating object around an axis

View File

@ -36,7 +36,7 @@ positionParticles // positions particles
orderedInfo orderedInfo
{ {
diameter 0.003; // minimum space between centers of particles distance 0.003; // minimum distance between particles centers
numPoints 250000; // number of particles in the simulation numPoints 250000; // number of particles in the simulation

View File

@ -23,7 +23,7 @@ g (0 -9.8 0); // gravity vector (m/s2)
includeObjects (diameter); // save necessary (i.e., required) data on disk includeObjects (diameter); // save necessary (i.e., required) data on disk
// exclude unnecessary data from saving on disk // exclude unnecessary data from saving on disk
excludeObjects (rVelocity.dy1 pStructPosition.dy1 pStructVelocity.dy1); excludeObjects ();
integrationMethod AdamsBashforth2; // integration method integrationMethod AdamsBashforth2; // integration method

View File

@ -1,35 +1,36 @@
# Simularing a rotating drum (v-1.0) # Simulating a Rotating Drum (v-1.0)
## 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. ## Problem Definition
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, each with a diameter of 4 mm. The timestep for integration is 0.00001 s. This tutorial demonstrates the basic setup for creating a rotation-based simulation using built-in geometry in PhasicFlow.
<div align="center"> <div align="center">
<b> <b>
A view of the rotating drum
A view of rotating drum
</b> </b>
<b> <div>
<img src="https://github.com/PhasicFlow/phasicFlow/blob/media/media/rotating-drum-s.png" width="600px">
![](https://github.com/PhasicFlow/phasicFlow/blob/media/media/rotating-drum-s.png) </div>
</div>
</b></div>
*** ***
## 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.
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`).
PhasicFlow simulation case setup is based on text-based scripts provided in two folders located in the simulation case folder: `settings` and `caseSetup`. All commands should be entered in the terminal while the current working directory is the simulation case folder (at the top level of `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. In 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 `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.
The `positionParticles` dictionary uses the `ordered` method to position particles in a space defined by `box`. The box space is defined by two corner points: `min` and `max`. In the `orderedInfo` sub-dictionary, `numPoints` defines the number of particles (30,000), `distance` defines the spacing between adjacent particles (4 mm), and `axisOrder` defines the axis order for filling the space with particles.
<div align="center"> <div align="center">
in <b>settings/particlesDict</b> file in <b>settings/particlesDict</b> file
</div> </div>
```C++ ```C++
positionParticles // positions particles positionParticles
{ {
method ordered; // other options: random and empty method ordered; // other options: random and empty
@ -37,7 +38,7 @@ positionParticles // positions particles
orderedInfo orderedInfo
{ {
diameter 0.004; // minimum space between centers of particles distance 0.004; // minimum space between centers of particles
numPoints 30000; // number of particles in the simulation numPoints 30000; // number of particles in the simulation
@ -54,7 +55,8 @@ positionParticles // positions 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`).
In the `setFields` dictionary, the `defaultValue` sub-dictionary defines the initial values for particle fields (velocity, acceleration, rotational velocity, and shape name). The shape name field should be consistent with the name defined in the shapes file (here, "sphere1").
<div align="center"> <div align="center">
in <b>settings/particlesDict</b> file in <b>settings/particlesDict</b> file
@ -76,17 +78,20 @@ setFields
selectors selectors
{ {
// Selectors can be used to modify properties for specific particle groups
} }
} }
``` ```
Enter the following command in the terminal to create the particles and store them in `0` folder. To create the particles and store them in the `0` folder, enter the following command:
`> 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. `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.
In the file `settings/geometryDict`, you define the motion model and geometry for the simulation. The `rotatingAxis` motion model defines a fixed axis which rotates around itself. The `rotAxis` dictionary specifies the axis endpoints and rotation speed.
<div align="center"> <div align="center">
in <b>settings/geometryDict</b> file in <b>settings/geometryDict</b> file
@ -95,7 +100,7 @@ in <b>settings/geometryDict</b> file
```C++ ```C++
motionModel rotatingAxis; motionModel rotatingAxis;
rotatingAxisInfo // information for rotatingAxisMotion motion model rotatingAxisInfo
{ {
rotAxis rotAxis
{ {
@ -107,7 +112,11 @@ rotatingAxisInfo // information for rotatingAxis
} }
} }
``` ```
In the dictionary `surfaces` you can define all the surfaces (walls) in the simulation. Two main options are available: built-in geometries in PhasicFlow, and providing surfaces with stl file. Here we use built-in geometries. In `cylinder` dictionary, a cylindrical shell with end radii, `radius1` and `radius2`, axis end points `p1` and `p2`, `material` name `prop1`, `motion` component `rotAxis` is defined. `resolution` sets number of division for the cylinder shell. `wall1` and `wall2` define two plane walls at two ends of cylindrical shell with coplanar corner points `p1`, `p2`, `p3`, and `p4`, `material` name `prop1` and `motion` component `rotAxis`.
The `surfaces` dictionary defines all the walls in the simulation. This tutorial uses built-in geometries provided by PhasicFlow. The geometry consists of:
1. A `cylinder` dictionary defining a cylindrical shell with end radii (`radius1` and `radius2`), axis endpoints (`p1` and `p2`), material name (`prop1`), and motion component (`rotAxis`).
2. Two plane walls (`wall1` and `wall2`) at the ends of the cylindrical shell, each defined with four coplanar corner points, the same material name, and the same motion component.
<div align="center"> <div align="center">
in <b>settings/geometryDict</b> file in <b>settings/geometryDict</b> file
@ -119,7 +128,6 @@ surfaces
/* /*
A cylinder with begin and end radii 0.12 m and axis points at (0 0 0) and (0 0 0.1) 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
@ -142,7 +150,6 @@ surfaces
/* /*
This is a plane wall at the rear end of cylinder 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
@ -163,7 +170,6 @@ surfaces
/* /*
This is a plane wall at the front end of cylinder This is a plane wall at the front end of cylinder
*/ */
wall2 wall2
{ {
type planeWall; // type of the wall type planeWall; // type of the wall
@ -182,12 +188,16 @@ surfaces
} }
} }
``` ```
Enter the following command in the terminal to create the geometry and store it in `0/geometry` folder.
`> geometryPhasicFlow` To create the geometry and store it in the `0/geometry` folder, enter:
### 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. geometryPhasicFlow
```
### Defining Properties and Interactions
In the file `caseSetup/interaction`, you define properties of materials and their interactions. The `materials` entry lists material names, and `densities` sets the corresponding densities. The `model` dictionary defines the contact force and rolling friction models, along with other required properties.
<div align="center"> <div align="center">
in <b>caseSetup/interaction</b> file in <b>caseSetup/interaction</b> file
@ -195,37 +205,41 @@ in <b>caseSetup/interaction</b> file
```C++ ```C++
materials (prop1); // a list of materials names materials (prop1); // a list of materials names
densities (1000.0); // density of materials [kg/m3] densities (1000.0); // density of materials [kg/m3]
.
. contactListType sortedContactList;
.
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
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. `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. The `contactSearch` dictionary specifies the algorithm and parameters for finding particle-particle contacts. The `method` determines the broad search algorithm, `updateInterval` sets how often to update the neighbor list, and `sizeRatio` controls the enlarged cell size for finding neighbors.
<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 NBS; // method for broad search
updateInterval 10; updateInterval 10;
@ -235,57 +249,25 @@ contactSearch
adjustableBox Yes; adjustableBox Yes;
} }
``` ```
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. In the file `caseSetup/shapes`, you define particle shapes, including their names, diameters, and material properties:
<div align="center"> <div align="center">
in <b>caseSetup/shape</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`. ### Simulation Domain and Boundaries
<div align="center"> The file `settings/domainDict` defines a rectangular bounding box with boundaries. Particles that exit this box are automatically deleted.
in <b>settings/settingsDict</b> file
</div>
```C++
run rotatingDrumSmall;
dt 0.00001; // time step for integration (s)
startTime 0; // start time for simulation
endTime 10; // end time for simulation
saveInterval 0.1; // time interval for saving the simulation
timePrecision 6; // maximum number of digits for time folder
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"> <div align="center">
in <b>settings/domainDict</b> file in <b>settings/domainDict</b> file
@ -334,13 +316,77 @@ boundaries
} }
``` ```
### Other Settings
## Running the case Additional parameters for the simulation are set in `settings/settingsDict`, including timestep, start and end times, saving intervals, and gravity:
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.
`> sphereGranFlow` <div align="center">
in <b>settings/settingsDict</b> file
</div>
## Post processing ```C++
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/`. dt 0.00001; // time step for integration (s)
`> pFlowToVTK --binary` startTime 0; // start time for simulation
endTime 10; // end time for simulation
saveInterval 0.1; // time interval for saving the simulation
timePrecision 6; // maximum number of digits for time folder
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 ();
integrationMethod AdamsBashforth2; // integration method
integrationHistory off; // to save space on disk
writeFormat ascii; // data writing format (ascii or binary)
timersReport Yes; // report timers (Yes or No)
```
## Running the Case
To execute the simulation, follow these steps in order:
1. Create the geometry:
```
geometryPhasicFlow
```
2. Create the initial particle fields:
```
particlesPhasicFlow
```
3. Run the simulation:
```
sphereGranFlow
```
Depending on your computational resources, the simulation may take from a few minutes to several hours to complete.
## Post Processing
After the simulation completes, you can visualize the results in ParaView by converting them to VTK format:
```
pFlowToVTK --binary
```
This command converts all simulation results (particles and geometry) to VTK format and stores them in a `VTK/` folder. You can then open these files in ParaView for detailed analysis and visualization.
For more specific field output, you can specify fields:
```
pFlowToVTK --binary --fields diameter velocity id
```

View File

@ -6,6 +6,7 @@ objectName interaction;
objectType dicrionary; objectType dicrionary;
fileFormat ASCII; fileFormat ASCII;
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
materials (prop1); // a list of materials names materials (prop1); // a list of materials names
densities (1000.0); // density of materials [kg/m3] densities (1000.0); // density of materials [kg/m3]

View File

@ -1,13 +0,0 @@
/* -------------------------------*- C++ -*--------------------------------- *\
| phasicFlow File |
| copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */
objectName particleInsertion;
objectType dicrionary;
fileFormat ASCII;
/*---------------------------------------------------------------------------*/
active No; // is insertion active -> Yes or No
collisionCheck No; // is checked -> Yes or No

View File

@ -6,7 +6,9 @@ objectName domainDict;
objectType dictionary; objectType dictionary;
fileFormat ASCII; fileFormat ASCII;
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
globalBox // Simulation domain: every particles that goes outside this domain will be deleted
// 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 min (-0.12 -0.12 0.00); // lower corner point of the box
@ -17,31 +19,31 @@ boundaries
{ {
left left
{ {
type exit; // other options: periodict, reflective type exit; // other options: periodic, reflective
} }
right right
{ {
type exit; // other options: periodict, reflective type exit; // other options: periodic, reflective
} }
bottom bottom
{ {
type exit; // other options: periodict, reflective type exit; // other options: periodic, reflective
} }
top top
{ {
type exit; // other options: periodict, reflective type exit; // other options: periodic, reflective
} }
rear rear
{ {
type exit; // other options: periodict, reflective type exit; // other options: periodic, reflective
} }
front front
{ {
type exit; // other options: periodict, reflective type exit; // other options: periodic, reflective
} }
} }

View File

@ -6,6 +6,7 @@ objectName geometryDict;
objectType dictionary; objectType dictionary;
fileFormat ASCII; fileFormat ASCII;
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
motionModel rotatingAxis; motionModel rotatingAxis;
rotatingAxisInfo // information for rotatingAxisMotion motion model rotatingAxisInfo // information for rotatingAxisMotion motion model
@ -25,7 +26,6 @@ surfaces
/* /*
A cylinder with begin and end radii 0.12 m and axis points at (0 0 0) and (0 0 0.1) 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
@ -48,7 +48,6 @@ surfaces
/* /*
This is a plane wall at the rear end of cylinder 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
@ -69,7 +68,6 @@ surfaces
/* /*
This is a plane wall at the front end of cylinder This is a plane wall at the front end of cylinder
*/ */
wall2 wall2
{ {
type planeWall; // type of the wall type planeWall; // type of the wall

View File

@ -10,12 +10,9 @@ setFields
{ {
/* /*
Default value for fields defined for particles Default value for fields defined for particles
These fields should always be defined for simulations with These fields should always be defined for simulations with
spherical particles. spherical particles.
*/ */
defaultValue defaultValue
{ {
velocity realx3 (0 0 0); // linear velocity (m/s) velocity realx3 (0 0 0); // linear velocity (m/s)
@ -41,7 +38,7 @@ positionParticles // positions particles
orderedInfo orderedInfo
{ {
diameter 0.004; // minimum space between centers of particles distance 0.004; // minimum distance between particles centers
numPoints 30000; // number of particles in the simulation numPoints 30000; // number of particles in the simulation

View File

@ -6,6 +6,7 @@ objectName settingsDict;
objectType dictionary; objectType dictionary;
fileFormat ASCII; fileFormat ASCII;
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
run rotatingDrumSmall; run rotatingDrumSmall;
dt 0.00001; // time step for integration (s) dt 0.00001; // time step for integration (s)
@ -27,6 +28,8 @@ excludeObjects (rVelocity.dy1 pStructPosition.dy1 pStructVelocity.dy1);
integrationMethod AdamsBashforth2; // integration method integrationMethod AdamsBashforth2; // integration method
integrationHistory off;
writeFormat ascii; // data writting format (ascii or binary) writeFormat ascii; // data writting format (ascii or binary)
timersReport Yes; // report timers (Yes or No) timersReport Yes; // report timers (Yes or No)

View File

@ -26,7 +26,6 @@ feeder
boxInfo boxInfo
{ {
min ( -0.15 0.34 0.01); // (m,m,m) min ( -0.15 0.34 0.01); // (m,m,m)
max ( 0.15 0.36 0.15); // (m,m,m) max ( 0.15 0.36 0.15); // (m,m,m)
} }

View File

@ -40,7 +40,6 @@ surfaces
material prop1; // material name of this wall material prop1; // material name of this wall
motion none; // this surface is not moving ==> none motion none; // this surface is not moving ==> none
} }
} }

View File

@ -13,8 +13,6 @@ positionParticles
{ {
// A list of options are: ordered, random // A list of options are: ordered, random
method empty; // creates the required fields with zero particles (empty). method empty; // creates the required fields with zero particles (empty).
mortonSorting Yes; // perform initial sorting based on morton
} }
setFields setFields

View File

@ -26,15 +26,13 @@ writeFormat binary; // field files will be saved in binary format
// A list of options: AB2, AB3, AB4, AB5 // A list of options: AB2, AB3, AB4, AB5
integrationMethod AdamsBashforth4; // integration method integrationMethod AdamsBashforth4; // integration method
integrationHistory off;
// overrides the default behavior // overrides the default behavior
includeObjects (diameter); includeObjects (diameter);
// exclude unnecessary data from saving on disk // exclude unnecessary data from saving on disk
excludeObjects (rVelocity.dy1 rVelocity.dy2 rVelocity.dy3 excludeObjects ();
pStructPosition.dy1 pStructPosition.dy2 pStructPosition.dy3
pStructVelocity.dy1 pStructVelocity.dy2 pStructVelocity.dy3);
timersReport Yes; // report timers? timersReport Yes; // report timers?

View File

@ -244,7 +244,7 @@ positionParticles
positionOrderedInfo positionOrderedInfo
{ {
// minimum space between centers of particles // minimum space between centers of particles
diameter 0.005; distance 0.005;
// number of particles in the simulation // number of particles in the simulation
numPoints 24000; numPoints 24000;

View File

@ -38,7 +38,7 @@ positionParticles
orderedInfo orderedInfo
{ {
diameter 0.005; // minimum space between centers of particles distance 0.005; // minimum distance between particles centers
numPoints 24000; // number of particles in the simulation numPoints 24000; // number of particles in the simulation

View File

@ -24,10 +24,12 @@ g (0 0 -9.8); // gravity vector (m/s2)
// include/exclude fields for saving on disk // include/exclude fields for saving on disk
includeObjects (diameter); includeObjects (diameter);
excludeObjects (rVelocity.dy1 pStructPosition.dy1 pStructVelocity.dy1); excludeObjects ();
integrationMethod AdamsBashforth2; integrationMethod AdamsBashforth2;
integrationHistory off;
writeFormat ascii; writeFormat ascii;
timersReport Yes; timersReport Yes;