13 Commits

104 changed files with 44466 additions and 484 deletions

View File

@ -1,67 +0,0 @@
/* -------------------------------*- C++ -*--------------------------------- *\
| phasicFlow File |
| copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */
objectName particleInsertion;
objectType dicrionary;
active yes; // is insertion active?
collisionCheck No; // not implemented for yes
particleInlet1
{
type boxRegion; // type of insertion region
rate 1000000; // insertion rate (particles/s)
startTime 0; // (s)
endTime 2.0; // (s)
interval 0.05; //s
boxRegionInfo
{
min ( -0.17 0.23 0.46); // (m,m,m)
max ( 0.17 0.24 0.88); // (m,m,m)
}
setFields
{
velocity realx3 (0.0 -0.3 0.0); // initial velocity of inserted particles
}
mixture
{
smallParticle 1; // mixture composition of inserted particles
}
}
particleInlet2
{
type boxRegion; // type of insertion region
rate 1000000; // insertion rate (particles/s)
startTime 0; // (s)
endTime 2.0; // (s)
interval 0.05; //s
boxRegionInfo
{
min ( -0.17 0.23 0.02); // (m,m,m)
max ( 0.17 0.24 0.44); // (m,m,m)
}
setFields
{
velocity realx3 (0.0 -0.3 0.0); // initial velocity of inserted particles
}
mixture
{
largeParticle 1; // mixture composition of inserted particles
}
}

View File

@ -1,11 +0,0 @@
/* -------------------------------*- C++ -*--------------------------------- *\
| phasicFlow File |
| copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */
objectName sphereDict;
objectType sphereShape;
names (smallParticle largeParticle); // names of shapes
diameters (0.002 0.00201); // diameter of shapes
materials (glassMat glassMat); // material names for shapes

View File

@ -2,18 +2,21 @@
| phasicFlow File |
| copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */
objectName interaction;
objectType dicrionary;
fileFormat ASCII;
/*---------------------------------------------------------------------------*/
materials (glassMat wallMat); // a list of materials names
densities (2500.0 2500); // density of materials [kg/m3]
contactListType sortedContactList;
model
{
contactForceModel nonLinearLimited;
contactForceModel nonLinearLimited;
rollingFrictionModel normal;
Yeff (1.0e6 1.0e6 // Young modulus [Pa]
@ -28,9 +31,6 @@ model
en (0.97 0.85 // coefficient of normal restitution
1.00);
et (1.0 1.0 // coefficient of tangential restitution
1.0);
mu (0.65 0.65 // dynamic friction
0.65);
@ -41,19 +41,13 @@ model
contactSearch
{
method NBS;
wallMapping cellMapping;
method NBS;
NBSInfo
{
updateFrequency 10; // each 20 timesteps, update neighbor list
sizeRatio 1.1; // bounding box size to particle diameter (max)
}
updateInterval 10;
cellMappingInfo
{
updateFrequency 10; // each 20 timesteps, update neighbor list
cellExtent 0.6; // bounding box for particle-wall search (> 0.5)
}
sizeRatio 1.1;
cellExtent 0.55;
adjustableBox Yes;
}

View File

@ -0,0 +1,72 @@
/* -------------------------------*- C++ -*--------------------------------- *\
| phasicFlow File |
| copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */
objectName particleInsertion;
objectType dictionary;
fileFormat ASCII;
/*---------------------------------------------------------------------------*/
active yes; // is insertion active?
particleInlet1
{
regionType box; // type of insertion region
rate 250000; // insertion rate (particles/s)
timeControl simulationTime;
startTime 0; // (s)
endTime 2.0; // (s)
insertionInterval 0.05; //s
boxInfo
{
min (-0.17 0.23 0.46); // (m,m,m)
max ( 0.17 0.24 0.88); // (m,m,m)
}
setFields
{
velocity realx3 (0.0 -0.3 0.0); // initial velocity of inserted particles
}
mixture
{
smallParticle 1; // mixture composition of inserted particles
}
}
particleInlet2
{
regionType box; // type of insertion region
rate 250000; // insertion rate (particles/s)
timeControl simulationTime;
startTime 0; // (s)
endTime 2.0; // (s)
insertionInterval 0.05; //s
boxInfo
{
min ( -0.17 0.23 0.02); // (m,m,m)
max ( 0.17 0.24 0.44); // (m,m,m)
}
setFields
{
velocity realx3 (0.0 -0.3 0.0); // initial velocity of inserted particles
}
mixture
{
largeParticle 1; // mixture composition of inserted particles
}
}

View File

@ -2,13 +2,11 @@
| phasicFlow File |
| copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */
objectName particleInsertion;
objectType dicrionary;
objectName shapes;
objectType dictionary;
fileFormat ASCII;
/*---------------------------------------------------------------------------*/
active no; // is insertion active?
collisionCheck No; // not implemented for yes
names (smallParticle largeParticle); // names of shapes
diameters (0.004 0.00401); // diameter of shapes
materials (glassMat glassMat); // material names for shapes

View File

@ -3,5 +3,5 @@ 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
rm -rf stl
#------------------------------------------------------------------------------

View File

@ -0,0 +1,32 @@
#!/bin/sh
set -e # Exit immediately if a command exits with a non-zero status
cd ${0%/*} || exit 1 # Run from this directory
echo "\n<--------------------------------------------------------------------->"
echo "0) Copying stl files"
echo "\n<--------------------------------------------------------------------->"
mkdir -p stl
cp -rfv $pFlow_PROJECT_DIR/resources/stls/helicalMixer/* ./stl/
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
echo "\n<--------------------------------------------------------------------->"
echo "4) Converting to VtK"
echo "<--------------------------------------------------------------------->\n"
pFlowToVTK -f diameter id velocity --binary
#------------------------------------------------------------------------------

View File

@ -0,0 +1,49 @@
/* -------------------------------*- C++ -*--------------------------------- *\
| phasicFlow File |
| copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */
objectName domainDict;
objectType dictionary;
fileFormat ASCII;
/*---------------------------------------------------------------------------*/
// Simulation domain
globalBox
{
min (-0.19 -0.19 -0.02);
max ( 0.19 0.26 0.92);
}
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
}
}

View File

@ -0,0 +1,60 @@
/* -------------------------------*- C++ -*--------------------------------- *\
| phasicFlow File |
| copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */
objectName geometryDict;
objectType dictionary;
fileFormat ASCII;
/*---------------------------------------------------------------------------*/
// motion model: rotating object around an axis
motionModel rotatingAxis;
rotatingAxisInfo
{
rotAxis
{
// end points of axis
p1 (0 0 0);
p2 (0 0 1);
// rotation speed (rad/s) => 30 rpm
omega 3.1428;
// interval for rotation of axis
startTime 2.5;
endTime 100;
}
}
surfaces
{
helix
{
type stlWall; // type of the wall
file helix2.stl; // file name in stl folder
material wallMat; // material name of this wall
motion rotAxis; // motion component name
}
shell
{
type stlWall; // type of the wall
file shell2.stl; // file name in stl folder
material wallMat; // material name of this wall
motion none; // motion component name
}
plug
{
type planeWall;
p1 (-0.075 -0.185 0.375);
p2 ( 0.075 -0.185 0.375);
p3 ( 0.075 -0.185 0.525);
p4 (-0.075 -0.185 0.525);
material wallMat;
motion none;
}
}

View File

@ -0,0 +1,27 @@
/* -------------------------------*- C++ -*--------------------------------- *\
| phasicFlow File |
| copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */
objectName particlesDict;
objectType dictionary;
fileFormat ASCII;
/*---------------------------------------------------------------------------*/
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 smallParticle; // name of the particle shape
}
selectors
{}
}
positionParticles
{
method empty; // creates the required fields with zero particles (empty).
}

View File

@ -0,0 +1,37 @@
/* -------------------------------*- C++ -*--------------------------------- *\
| phasicFlow File |
| copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */
objectName settingsDict;
objectType dictionary;
fileFormat ASCII;
/*---------------------------------------------------------------------------*/
run helicalMixer;
dt 0.00001; // time step for integration (s)
startTime 0; // start time for simulation
endTime 2; // end time for simulation
saveInterval 0.05; // time interval for saving the simulation
timePrecision 4; // maximum number of digits for time folder
g (0 -9.8 0); // gravity vector (m/s2)
// save necessary (i.e., required) data on disk
includeObjects (diameter);
// exclude unnecessary data from saving on disk
excludeObjects ();
integrationMethod AdamsBashforth2; // integration method
integrationHistory off; // Do not save integration history on the disk
writeFormat binary; // data writting format (ascii or binary)
timersReport Yes; // report timers (Yes or No)
timersReportInterval 0.05; // time interval for reporting timers

View File

@ -0,0 +1,53 @@
/* -------------------------------*- C++ -*--------------------------------- *\
| phasicFlow File |
| copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */
objectName interaction;
objectType dicrionary;
fileFormat ASCII;
/*---------------------------------------------------------------------------*/
materials (glassMat wallMat); // a list of materials names
densities (2500.0 2500); // density of materials [kg/m3]
contactListType sortedContactList;
model
{
contactForceModel nonLinearLimited;
rollingFrictionModel normal;
Yeff (1.0e6 1.0e6 // Young modulus [Pa]
1.0e6);
Geff (0.8e6 0.8e6 // Shear modulus [Pa]
0.8e6);
nu (0.25 0.25 // Poisson's ratio [-]
0.25);
en (0.97 0.85 // coefficient of normal restitution
1.00);
mu (0.65 0.65 // dynamic friction
0.65);
mur (0.1 0.1 // rolling friction
0.1);
}
contactSearch
{
method NBS;
updateInterval 10;
sizeRatio 1.1;
cellExtent 0.55;
adjustableBox Yes;
}

View File

@ -0,0 +1,72 @@
/* -------------------------------*- C++ -*--------------------------------- *\
| phasicFlow File |
| copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */
objectName particleInsertion;
objectType dictionary;
fileFormat ASCII;
/*---------------------------------------------------------------------------*/
active yes; // is insertion active?
particleInlet1
{
regionType box; // type of insertion region
rate 62500; // insertion rate (particles/s)
timeControl simulationTime;
startTime 0; // (s)
endTime 2.0; // (s)
insertionInterval 0.05; //s
boxInfo
{
min (-0.17 0.23 0.46); // (m,m,m)
max ( 0.17 0.24 0.88); // (m,m,m)
}
setFields
{
velocity realx3 (0.0 -0.3 0.0); // initial velocity of inserted particles
}
mixture
{
smallParticle 1; // mixture composition of inserted particles
}
}
particleInlet2
{
regionType box; // type of insertion region
rate 62500; // insertion rate (particles/s)
timeControl simulationTime;
startTime 0; // (s)
endTime 2.0; // (s)
insertionInterval 0.05; //s
boxInfo
{
min ( -0.17 0.23 0.02); // (m,m,m)
max ( 0.17 0.24 0.44); // (m,m,m)
}
setFields
{
velocity realx3 (0.0 -0.3 0.0); // initial velocity of inserted particles
}
mixture
{
largeParticle 1; // mixture composition of inserted particles
}
}

View File

@ -0,0 +1,12 @@
/* -------------------------------*- C++ -*--------------------------------- *\
| phasicFlow File |
| copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */
objectName shapes;
objectType dictionary;
fileFormat ASCII;
/*---------------------------------------------------------------------------*/
names (smallParticle largeParticle); // names of shapes
diameters (0.006 0.00601); // diameter of shapes
materials (glassMat glassMat); // material names for shapes

View File

@ -0,0 +1,8 @@
#!/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
rm -rf stl
#------------------------------------------------------------------------------

View File

@ -1,5 +1,12 @@
#!/bin/sh
set -e # Exit immediately if a command exits with a non-zero status
cd ${0%/*} || exit 1 # Run from this directory
echo "\n<--------------------------------------------------------------------->"
echo "0) Copying stl files"
echo "\n<--------------------------------------------------------------------->"
mkdir -p stl
cp -rfv $pFlow_PROJECT_DIR/resources/stls/helicalMixer/* ./stl/
echo "\n<--------------------------------------------------------------------->"
echo "1) Creating particles"
echo "<--------------------------------------------------------------------->\n"
@ -18,6 +25,6 @@ sphereGranFlow
echo "\n<--------------------------------------------------------------------->"
echo "4) Converting to VtK"
echo "<--------------------------------------------------------------------->\n"
pFlowToVTK -f diameter id velocity
pFlowToVTK -f diameter id velocity --binary
#------------------------------------------------------------------------------

View File

@ -0,0 +1,49 @@
/* -------------------------------*- C++ -*--------------------------------- *\
| phasicFlow File |
| copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */
objectName domainDict;
objectType dictionary;
fileFormat ASCII;
/*---------------------------------------------------------------------------*/
// Simulation domain
globalBox
{
min (-0.19 -0.19 -0.02);
max ( 0.19 0.26 0.92);
}
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
}
}

View File

@ -0,0 +1,60 @@
/* -------------------------------*- C++ -*--------------------------------- *\
| phasicFlow File |
| copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */
objectName geometryDict;
objectType dictionary;
fileFormat ASCII;
/*---------------------------------------------------------------------------*/
// motion model: rotating object around an axis
motionModel rotatingAxis;
rotatingAxisInfo
{
rotAxis
{
// end points of axis
p1 (0 0 0);
p2 (0 0 1);
// rotation speed (rad/s) => 30 rpm
omega 3.1428;
// interval for rotation of axis
startTime 2.5;
endTime 100;
}
}
surfaces
{
helix
{
type stlWall; // type of the wall
file helix2.stl; // file name in stl folder
material wallMat; // material name of this wall
motion rotAxis; // motion component name
}
shell
{
type stlWall; // type of the wall
file shell2.stl; // file name in stl folder
material wallMat; // material name of this wall
motion none; // motion component name
}
plug
{
type planeWall;
p1 (-0.075 -0.185 0.375);
p2 ( 0.075 -0.185 0.375);
p3 ( 0.075 -0.185 0.525);
p4 (-0.075 -0.185 0.525);
material wallMat;
motion none;
}
}

View File

@ -0,0 +1,27 @@
/* -------------------------------*- C++ -*--------------------------------- *\
| phasicFlow File |
| copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */
objectName particlesDict;
objectType dictionary;
fileFormat ASCII;
/*---------------------------------------------------------------------------*/
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 smallParticle; // name of the particle shape
}
selectors
{}
}
positionParticles
{
method empty; // creates the required fields with zero particles (empty).
}

View File

@ -0,0 +1,37 @@
/* -------------------------------*- C++ -*--------------------------------- *\
| phasicFlow File |
| copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */
objectName settingsDict;
objectType dictionary;
fileFormat ASCII;
/*---------------------------------------------------------------------------*/
run helicalMixer;
dt 0.00001; // time step for integration (s)
startTime 0; // start time for simulation
endTime 7.5; // end time for simulation
saveInterval 0.05; // time interval for saving the simulation
timePrecision 4; // maximum number of digits for time folder
g (0 -9.8 0); // gravity vector (m/s2)
// save necessary (i.e., required) data on disk
includeObjects (diameter);
// exclude unnecessary data from saving on disk
excludeObjects ();
integrationMethod AdamsBashforth2; // integration method
integrationHistory off; // Do not save integration history on the disk
writeFormat binary; // data writting format (ascii or binary)
timersReport Yes; // report timers (Yes or No)
timersReportInterval 0.05; // time interval for reporting timers

View File

@ -0,0 +1,53 @@
/* -------------------------------*- C++ -*--------------------------------- *\
| phasicFlow File |
| copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */
objectName interaction;
objectType dicrionary;
fileFormat ASCII;
/*---------------------------------------------------------------------------*/
materials (glassMat wallMat); // a list of materials names
densities (2500.0 2500); // density of materials [kg/m3]
contactListType sortedContactList;
model
{
contactForceModel nonLinearLimited;
rollingFrictionModel normal;
Yeff (1.0e6 1.0e6 // Young modulus [Pa]
1.0e6);
Geff (0.8e6 0.8e6 // Shear modulus [Pa]
0.8e6);
nu (0.25 0.25 // Poisson's ratio [-]
0.25);
en (0.97 0.85 // coefficient of normal restitution
1.00);
mu (0.65 0.65 // dynamic friction
0.65);
mur (0.1 0.1 // rolling friction
0.1);
}
contactSearch
{
method NBS;
updateInterval 10;
sizeRatio 1.1;
cellExtent 0.55;
adjustableBox Yes;
}

View File

@ -0,0 +1,72 @@
/* -------------------------------*- C++ -*--------------------------------- *\
| phasicFlow File |
| copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */
objectName particleInsertion;
objectType dictionary;
fileFormat ASCII;
/*---------------------------------------------------------------------------*/
active yes; // is insertion active?
particleInlet1
{
regionType box; // type of insertion region
rate 500000; // insertion rate (particles/s)
timeControl simulationTime;
startTime 0; // (s)
endTime 2.0; // (s)
insertionInterval 0.05; //s
boxInfo
{
min (-0.17 0.23 0.46); // (m,m,m)
max ( 0.17 0.24 0.88); // (m,m,m)
}
setFields
{
velocity realx3 (0.0 -0.3 0.0); // initial velocity of inserted particles
}
mixture
{
smallParticle 1; // mixture composition of inserted particles
}
}
particleInlet2
{
regionType box; // type of insertion region
rate 500000; // insertion rate (particles/s)
timeControl simulationTime;
startTime 0; // (s)
endTime 2.0; // (s)
insertionInterval 0.05; //s
boxInfo
{
min ( -0.17 0.23 0.02); // (m,m,m)
max ( 0.17 0.24 0.44); // (m,m,m)
}
setFields
{
velocity realx3 (0.0 -0.3 0.0); // initial velocity of inserted particles
}
mixture
{
largeParticle 1; // mixture composition of inserted particles
}
}

View File

@ -0,0 +1,12 @@
/* -------------------------------*- C++ -*--------------------------------- *\
| phasicFlow File |
| copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */
objectName shapes;
objectType dictionary;
fileFormat ASCII;
/*---------------------------------------------------------------------------*/
names (smallParticle largeParticle); // names of shapes
diameters (0.003 0.00301); // diameter of shapes
materials (glassMat glassMat); // material names for shapes

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
rm -rf stl
#------------------------------------------------------------------------------

View File

@ -0,0 +1,32 @@
#!/bin/sh
set -e # Exit immediately if a command exits with a non-zero status
cd ${0%/*} || exit 1 # Run from this directory
echo "\n<--------------------------------------------------------------------->"
echo "0) Copying stl files"
echo "\n<--------------------------------------------------------------------->"
mkdir -p stl
cp -rfv $pFlow_PROJECT_DIR/resources/stls/helicalMixer/* ./stl/
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
echo "\n<--------------------------------------------------------------------->"
echo "4) Converting to VtK"
echo "<--------------------------------------------------------------------->\n"
pFlowToVTK -f diameter id velocity --binary
#------------------------------------------------------------------------------

View File

@ -0,0 +1,49 @@
/* -------------------------------*- C++ -*--------------------------------- *\
| phasicFlow File |
| copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */
objectName domainDict;
objectType dictionary;
fileFormat ASCII;
/*---------------------------------------------------------------------------*/
// Simulation domain
globalBox
{
min (-0.19 -0.19 -0.02);
max ( 0.19 0.26 0.92);
}
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
}
}

View File

@ -0,0 +1,60 @@
/* -------------------------------*- C++ -*--------------------------------- *\
| phasicFlow File |
| copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */
objectName geometryDict;
objectType dictionary;
fileFormat ASCII;
/*---------------------------------------------------------------------------*/
// motion model: rotating object around an axis
motionModel rotatingAxis;
rotatingAxisInfo
{
rotAxis
{
// end points of axis
p1 (0 0 0);
p2 (0 0 1);
// rotation speed (rad/s) => 30 rpm
omega 3.1428;
// interval for rotation of axis
startTime 2.5;
endTime 100;
}
}
surfaces
{
helix
{
type stlWall; // type of the wall
file helix2.stl; // file name in stl folder
material wallMat; // material name of this wall
motion rotAxis; // motion component name
}
shell
{
type stlWall; // type of the wall
file shell2.stl; // file name in stl folder
material wallMat; // material name of this wall
motion none; // motion component name
}
plug
{
type planeWall;
p1 (-0.075 -0.185 0.375);
p2 ( 0.075 -0.185 0.375);
p3 ( 0.075 -0.185 0.525);
p4 (-0.075 -0.185 0.525);
material wallMat;
motion none;
}
}

View File

@ -0,0 +1,27 @@
/* -------------------------------*- C++ -*--------------------------------- *\
| phasicFlow File |
| copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */
objectName particlesDict;
objectType dictionary;
fileFormat ASCII;
/*---------------------------------------------------------------------------*/
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 smallParticle; // name of the particle shape
}
selectors
{}
}
positionParticles
{
method empty; // creates the required fields with zero particles (empty).
}

View File

@ -0,0 +1,37 @@
/* -------------------------------*- C++ -*--------------------------------- *\
| phasicFlow File |
| copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */
objectName settingsDict;
objectType dictionary;
fileFormat ASCII;
/*---------------------------------------------------------------------------*/
run helicalMixer;
dt 0.00001; // time step for integration (s)
startTime 0; // start time for simulation
endTime 2; // end time for simulation
saveInterval 0.05; // time interval for saving the simulation
timePrecision 4; // maximum number of digits for time folder
g (0 -9.8 0); // gravity vector (m/s2)
// save necessary (i.e., required) data on disk
includeObjects (diameter);
// exclude unnecessary data from saving on disk
excludeObjects ();
integrationMethod AdamsBashforth2; // integration method
integrationHistory off; // Do not save integration history on the disk
writeFormat binary; // data writting format (ascii or binary)
timersReport Yes; // report timers (Yes or No)
timersReportInterval 0.05; // time interval for reporting timers

View File

@ -0,0 +1,53 @@
/* -------------------------------*- C++ -*--------------------------------- *\
| phasicFlow File |
| copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */
objectName interaction;
objectType dicrionary;
fileFormat ASCII;
/*---------------------------------------------------------------------------*/
materials (glassMat wallMat); // a list of materials names
densities (2500.0 2500); // density of materials [kg/m3]
contactListType sortedContactList;
model
{
contactForceModel nonLinearLimited;
rollingFrictionModel normal;
Yeff (1.0e6 1.0e6 // Young modulus [Pa]
1.0e6);
Geff (0.8e6 0.8e6 // Shear modulus [Pa]
0.8e6);
nu (0.25 0.25 // Poisson's ratio [-]
0.25);
en (0.97 0.85 // coefficient of normal restitution
1.00);
mu (0.65 0.65 // dynamic friction
0.65);
mur (0.1 0.1 // rolling friction
0.1);
}
contactSearch
{
method NBS;
updateInterval 10;
sizeRatio 1.1;
cellExtent 0.55;
adjustableBox Yes;
}

View File

@ -0,0 +1,72 @@
/* -------------------------------*- C++ -*--------------------------------- *\
| phasicFlow File |
| copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */
objectName particleInsertion;
objectType dictionary;
fileFormat ASCII;
/*---------------------------------------------------------------------------*/
active yes; // is insertion active?
particleInlet1
{
regionType box; // type of insertion region
rate 1000000; // insertion rate (particles/s)
timeControl simulationTime;
startTime 0; // (s)
endTime 2.0; // (s)
insertionInterval 0.05; //s
boxInfo
{
min (-0.17 0.23 0.46); // (m,m,m)
max ( 0.17 0.24 0.88); // (m,m,m)
}
setFields
{
velocity realx3 (0.0 -0.3 0.0); // initial velocity of inserted particles
}
mixture
{
smallParticle 1; // mixture composition of inserted particles
}
}
particleInlet2
{
regionType box; // type of insertion region
rate 1000000; // insertion rate (particles/s)
timeControl simulationTime;
startTime 0; // (s)
endTime 2.0; // (s)
insertionInterval 0.05; //s
boxInfo
{
min ( -0.17 0.23 0.02); // (m,m,m)
max ( 0.17 0.24 0.44); // (m,m,m)
}
setFields
{
velocity realx3 (0.0 -0.3 0.0); // initial velocity of inserted particles
}
mixture
{
largeParticle 1; // mixture composition of inserted particles
}
}

View File

@ -0,0 +1,12 @@
/* -------------------------------*- C++ -*--------------------------------- *\
| phasicFlow File |
| copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */
objectName shapes;
objectType dictionary;
fileFormat ASCII;
/*---------------------------------------------------------------------------*/
names (smallParticle largeParticle); // names of shapes
diameters (0.002 0.00201); // diameter of shapes
materials (glassMat glassMat); // material names for shapes

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
rm -rf stl
#------------------------------------------------------------------------------

View File

@ -0,0 +1,32 @@
#!/bin/sh
set -e # Exit immediately if a command exits with a non-zero status
cd ${0%/*} || exit 1 # Run from this directory
echo "\n<--------------------------------------------------------------------->"
echo "0) Copying stl files"
echo "\n<--------------------------------------------------------------------->"
mkdir -p stl
cp -rfv $pFlow_PROJECT_DIR/resources/stls/helicalMixer/* ./stl/
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
echo "\n<--------------------------------------------------------------------->"
echo "4) Converting to VtK"
echo "<--------------------------------------------------------------------->\n"
pFlowToVTK -f diameter id velocity --binary
#------------------------------------------------------------------------------

View File

@ -0,0 +1,49 @@
/* -------------------------------*- C++ -*--------------------------------- *\
| phasicFlow File |
| copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */
objectName domainDict;
objectType dictionary;
fileFormat ASCII;
/*---------------------------------------------------------------------------*/
// Simulation domain
globalBox
{
min (-0.19 -0.19 -0.02);
max ( 0.19 0.26 0.92);
}
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
}
}

View File

@ -0,0 +1,60 @@
/* -------------------------------*- C++ -*--------------------------------- *\
| phasicFlow File |
| copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */
objectName geometryDict;
objectType dictionary;
fileFormat ASCII;
/*---------------------------------------------------------------------------*/
// motion model: rotating object around an axis
motionModel rotatingAxis;
rotatingAxisInfo
{
rotAxis
{
// end points of axis
p1 (0 0 0);
p2 (0 0 1);
// rotation speed (rad/s) => 30 rpm
omega 3.1428;
// interval for rotation of axis
startTime 2.5;
endTime 100;
}
}
surfaces
{
helix
{
type stlWall; // type of the wall
file helix2.stl; // file name in stl folder
material wallMat; // material name of this wall
motion rotAxis; // motion component name
}
shell
{
type stlWall; // type of the wall
file shell2.stl; // file name in stl folder
material wallMat; // material name of this wall
motion none; // motion component name
}
plug
{
type planeWall;
p1 (-0.075 -0.185 0.375);
p2 ( 0.075 -0.185 0.375);
p3 ( 0.075 -0.185 0.525);
p4 (-0.075 -0.185 0.525);
material wallMat;
motion none;
}
}

View File

@ -0,0 +1,27 @@
/* -------------------------------*- C++ -*--------------------------------- *\
| phasicFlow File |
| copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */
objectName particlesDict;
objectType dictionary;
fileFormat ASCII;
/*---------------------------------------------------------------------------*/
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 smallParticle; // name of the particle shape
}
selectors
{}
}
positionParticles
{
method empty; // creates the required fields with zero particles (empty).
}

View File

@ -0,0 +1,37 @@
/* -------------------------------*- C++ -*--------------------------------- *\
| phasicFlow File |
| copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */
objectName settingsDict;
objectType dictionary;
fileFormat ASCII;
/*---------------------------------------------------------------------------*/
run helicalMixer;
dt 0.00001; // time step for integration (s)
startTime 0; // start time for simulation
endTime 2; // end time for simulation
saveInterval 0.05; // time interval for saving the simulation
timePrecision 4; // maximum number of digits for time folder
g (0 -9.8 0); // gravity vector (m/s2)
// save necessary (i.e., required) data on disk
includeObjects (diameter);
// exclude unnecessary data from saving on disk
excludeObjects ();
integrationMethod AdamsBashforth2; // integration method
integrationHistory off; // Do not save integration history on the disk
writeFormat binary; // data writting format (ascii or binary)
timersReport Yes; // report timers (Yes or No)
timersReportInterval 0.05; // time interval for reporting timers

View File

@ -0,0 +1,53 @@
/* -------------------------------*- C++ -*--------------------------------- *\
| phasicFlow File |
| copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */
objectName interaction;
objectType dicrionary;
fileFormat ASCII;
/*---------------------------------------------------------------------------*/
materials (glassMat wallMat); // a list of materials names
densities (2500.0 2500); // density of materials [kg/m3]
contactListType sortedContactList;
model
{
contactForceModel nonLinearLimited;
rollingFrictionModel normal;
Yeff (1.0e6 1.0e6 // Young modulus [Pa]
1.0e6);
Geff (0.8e6 0.8e6 // Shear modulus [Pa]
0.8e6);
nu (0.25 0.25 // Poisson's ratio [-]
0.25);
en (0.97 0.85 // coefficient of normal restitution
1.00);
mu (0.65 0.65 // dynamic friction
0.65);
mur (0.1 0.1 // rolling friction
0.1);
}
contactSearch
{
method NBS;
updateInterval 10;
sizeRatio 1.1;
cellExtent 0.55;
adjustableBox Yes;
}

View File

@ -0,0 +1,72 @@
/* -------------------------------*- C++ -*--------------------------------- *\
| phasicFlow File |
| copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */
objectName particleInsertion;
objectType dictionary;
fileFormat ASCII;
/*---------------------------------------------------------------------------*/
active yes; // is insertion active?
particleInlet1
{
regionType box; // type of insertion region
rate 125000; // insertion rate (particles/s)
timeControl simulationTime;
startTime 0; // (s)
endTime 2.0; // (s)
insertionInterval 0.05; //s
boxInfo
{
min (-0.17 0.23 0.46); // (m,m,m)
max ( 0.17 0.24 0.88); // (m,m,m)
}
setFields
{
velocity realx3 (0.0 -0.3 0.0); // initial velocity of inserted particles
}
mixture
{
smallParticle 1; // mixture composition of inserted particles
}
}
particleInlet2
{
regionType box; // type of insertion region
rate 125000; // insertion rate (particles/s)
timeControl simulationTime;
startTime 0; // (s)
endTime 2.0; // (s)
insertionInterval 0.05; //s
boxInfo
{
min ( -0.17 0.23 0.02); // (m,m,m)
max ( 0.17 0.24 0.44); // (m,m,m)
}
setFields
{
velocity realx3 (0.0 -0.3 0.0); // initial velocity of inserted particles
}
mixture
{
largeParticle 1; // mixture composition of inserted particles
}
}

View File

@ -0,0 +1,12 @@
/* -------------------------------*- C++ -*--------------------------------- *\
| phasicFlow File |
| copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */
objectName shapes;
objectType dictionary;
fileFormat ASCII;
/*---------------------------------------------------------------------------*/
names (smallParticle largeParticle); // names of shapes
diameters (0.005 0.00501); // diameter of shapes
materials (glassMat glassMat); // material names for shapes

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
rm -rf stl
#------------------------------------------------------------------------------

View File

@ -0,0 +1,32 @@
#!/bin/sh
set -e # Exit immediately if a command exits with a non-zero status
cd ${0%/*} || exit 1 # Run from this directory
echo "\n<--------------------------------------------------------------------->"
echo "0) Copying stl files"
echo "\n<--------------------------------------------------------------------->"
mkdir -p stl
cp -rfv $pFlow_PROJECT_DIR/resources/stls/helicalMixer/* ./stl/
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
echo "\n<--------------------------------------------------------------------->"
echo "4) Converting to VtK"
echo "<--------------------------------------------------------------------->\n"
pFlowToVTK -f diameter id velocity --binary
#------------------------------------------------------------------------------

View File

@ -0,0 +1,49 @@
/* -------------------------------*- C++ -*--------------------------------- *\
| phasicFlow File |
| copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */
objectName domainDict;
objectType dictionary;
fileFormat ASCII;
/*---------------------------------------------------------------------------*/
// Simulation domain
globalBox
{
min (-0.19 -0.19 -0.02);
max ( 0.19 0.26 0.92);
}
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
}
}

View File

@ -0,0 +1,60 @@
/* -------------------------------*- C++ -*--------------------------------- *\
| phasicFlow File |
| copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */
objectName geometryDict;
objectType dictionary;
fileFormat ASCII;
/*---------------------------------------------------------------------------*/
// motion model: rotating object around an axis
motionModel rotatingAxis;
rotatingAxisInfo
{
rotAxis
{
// end points of axis
p1 (0 0 0);
p2 (0 0 1);
// rotation speed (rad/s) => 30 rpm
omega 3.1428;
// interval for rotation of axis
startTime 2.5;
endTime 100;
}
}
surfaces
{
helix
{
type stlWall; // type of the wall
file helix2.stl; // file name in stl folder
material wallMat; // material name of this wall
motion rotAxis; // motion component name
}
shell
{
type stlWall; // type of the wall
file shell2.stl; // file name in stl folder
material wallMat; // material name of this wall
motion none; // motion component name
}
plug
{
type planeWall;
p1 (-0.075 -0.185 0.375);
p2 ( 0.075 -0.185 0.375);
p3 ( 0.075 -0.185 0.525);
p4 (-0.075 -0.185 0.525);
material wallMat;
motion none;
}
}

View File

@ -0,0 +1,27 @@
/* -------------------------------*- C++ -*--------------------------------- *\
| phasicFlow File |
| copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */
objectName particlesDict;
objectType dictionary;
fileFormat ASCII;
/*---------------------------------------------------------------------------*/
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 smallParticle; // name of the particle shape
}
selectors
{}
}
positionParticles
{
method empty; // creates the required fields with zero particles (empty).
}

View File

@ -0,0 +1,37 @@
/* -------------------------------*- C++ -*--------------------------------- *\
| phasicFlow File |
| copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */
objectName settingsDict;
objectType dictionary;
fileFormat ASCII;
/*---------------------------------------------------------------------------*/
run helicalMixer;
dt 0.00001; // time step for integration (s)
startTime 0; // start time for simulation
endTime 2; // end time for simulation
saveInterval 0.05; // time interval for saving the simulation
timePrecision 4; // maximum number of digits for time folder
g (0 -9.8 0); // gravity vector (m/s2)
// save necessary (i.e., required) data on disk
includeObjects (diameter);
// exclude unnecessary data from saving on disk
excludeObjects ();
integrationMethod AdamsBashforth2; // integration method
integrationHistory off; // Do not save integration history on the disk
writeFormat binary; // data writting format (ascii or binary)
timersReport Yes; // report timers (Yes or No)
timersReportInterval 0.05; // time interval for reporting timers

View File

@ -1,56 +0,0 @@
/* -------------------------------*- C++ -*--------------------------------- *\
| phasicFlow File |
| copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */
objectName geometryDict;
objectType dictionary;
// motion model: rotating object around an axis
motionModel rotatingAxisMotion;
surfaces
{
helix
{
type stlWall; // type of the wall
file helix2.stl; // file name in stl folder
material wallMat; // material name of this wall
motion rotAxis; // motion component name
}
shell
{
type stlWall; // type of the wall
file shell2.stl; // file name in stl folder
material wallMat; // material name of this wall
motion none; // motion component name
}
plug
{
type planeWall;
p1 (-0.075 -0.185 0.375);
p2 ( 0.075 -0.185 0.375);
p3 ( 0.075 -0.185 0.525);
p4 (-0.075 -0.185 0.525);
material wallMat; // material name of this wall
motion none; // motion component name
}
}
// information for rotatingAxisMotion motion model
rotatingAxisMotionInfo
{
rotAxis
{
p1 ( 0 0 0);
p2 ( 0 0 1);
omega 0; //3.1428; // rotation speed (rad/s) => 30 rpm
}
}

View File

@ -1,31 +0,0 @@
/* -------------------------------*- C++ -*--------------------------------- *\
| phasicFlow File |
| copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */
objectName particlesDict;
objectType dictionary;
setFields
{
defaultValue
{
velocity realx3 (0 0 0); // linear velocity (m/s)
acceleration realx3 (0 0 0); // linear acceleration (m/s2)
rotVelocity realx3 (0 0 0); // rotational velocity (rad/s)
shapeName word smallParticle; // name of the particle shape
}
selectors
{}
}
// positions particles
positionParticles
{
method empty; // creates the required fields with zero particles (empty).
maxNumberOfParticles 4100000; // maximum number of particles in the simulation
mortonSorting Yes; // perform initial sorting based on morton code?
}

View File

@ -1,36 +0,0 @@
/* -------------------------------*- C++ -*--------------------------------- *\
| phasicFlow File |
| copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */
objectName settingsDict;
objectType dictionary;;
run inclinedScrewConveyor;
dt 0.00001; // time step for integration (s)
startTime 2.9; // start time for simulation
endTime 7; // end time for simulation
saveInterval 0.05; // time interval for saving the simulation
timePrecision 3; // maximum number of digits for time folder
g (0 -9.8 0); // gravity vector (m/s2)
/*
Simulation domain
every particles that goes outside this domain is deleted.
*/
domain
{
min (-0.19 -0.19 -0.02);
max ( 0.19 0.26 0.92);
}
integrationMethod AdamsBashforth2; // integration method
timersReport Yes; // report timers?
timersReportInterval 0.01; // time interval for reporting timers

View File

@ -1,4 +1,5 @@
#!/bin/sh
set -e # Exit immediately if a command exits with a non-zero status
cd ${0%/*} || exit 1 # Run from this directory
echo "\n<--------------------------------------------------------------------->"
echo "1) Creating particles"

View File

@ -1,4 +1,5 @@
#!/bin/sh
set -e # Exit immediately if a command exits with a non-zero status
cd ${0%/*} || exit 1 # Run from this directory
echo "\n<--------------------------------------------------------------------->"
echo "1) Creating particles"

View File

@ -1,4 +1,5 @@
#!/bin/sh
set -e # Exit immediately if a command exits with a non-zero status
cd ${0%/*} || exit 1 # Run from this directory
echo "\n<--------------------------------------------------------------------->"
echo "1) Creating particles"

View File

@ -1,4 +1,5 @@
#!/bin/sh
set -e # Exit immediately if a command exits with a non-zero status
cd ${0%/*} || exit 1 # Run from this directory
echo "\n<--------------------------------------------------------------------->"
echo "1) Creating particles"

View File

@ -1,4 +1,5 @@
#!/bin/sh
set -e # Exit immediately if a command exits with a non-zero status
cd ${0%/*} || exit 1 # Run from this directory
echo "\n<--------------------------------------------------------------------->"
echo "1) Creating particles"

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -13,6 +13,7 @@ set(SourceFiles
region/regionPoints/lineRegionPoints/lineRegionPoints.cpp
region/regionPoints/centerPointsRegionPoints/centerPointsRegionPoints.cpp
region/regionPoints/multipleSpheresRegionPoints/multipleSpheresRegionPoints.cpp
region/regionPoints/rectMeshRegionPoints/rectMeshRegionPoints.cpp
# Postprocess components
postprocessComponent/postprocessComponent/postprocessComponent.cpp

View File

@ -178,4 +178,26 @@ bool PostprocessOperationAverage::write(const fileSystem &parDir) const
return true;
}
bool PostprocessOperationAverage::write(iOstream &os) const
{
if(! postprocessOperation::write(os))
{
return false;
}
if(!calculateFluctuation2_())
{
return true;
}
return
std::visit
(
[&](auto&& arg)->bool
{
return arg.writeFieldToVtk(os);
},
fluctuation2FieldPtr_()
);
}
} // namespace pFlow::postprocessData

View File

@ -195,6 +195,8 @@ public:
/// write to os stream
bool write(const fileSystem &parDir)const override;
bool write(iOstream& os)const override;
/// @brief Execute average operation on field values
/// @param weights Weight factors for particles

View File

@ -142,7 +142,7 @@ regionField<T> executeFluctuation2Operation
)
{
const auto& regPoints = fieldAvg.regPoints();
regionField<T> processedField(regFieldName, regPoints, T{});
regionField<T> processedField(regFieldName+"_fluctuation2", regPoints, T{});
auto vols = regPoints.volumes();
for(uint32 reg =0; reg<regPoints.size(); reg++)

View File

@ -124,6 +124,25 @@ bool postprocessOperation::write(const fileSystem &parDir) const
return true;
}
bool postprocessOperation::write(iOstream& os)const
{
if(!regPoints().writeToSameTimeFile())
{
const auto& field = processedField();
return
std::visit
(
[&](auto&& arg)->bool
{
return arg.writeFieldToVtk(os);
},
field
);
}
return false;
}
uniquePtr<postprocessOperation> postprocessOperation::create
(
const dictionary &opDict,

View File

@ -99,7 +99,7 @@ public:
private:
/// Dictionary containing operation-specific parameters.
pFlow::dictionary operationDict_;
pFlow::dictionary operationDict_;
/// This Threshold is used to exclude the regions which contain
/// fewer than this value.
@ -255,7 +255,7 @@ public:
/// write the result to output stream (possibly a file)
/// @param os Output stream to write the result.
virtual
bool write(iOstream& os)const {return true;}
bool write(iOstream& os)const;
/// Create the polymorphic object using the virtual constructor.
/// @param opDict Dictionary containing operation-specific parameters.

View File

@ -152,11 +152,25 @@ bool pFlow::postprocessData::PostprocessComponent<RegionType, ProcessMethodType>
}
else
{
notImplementedFunction;
return false;
}
word chNum = real2FixedStripZeros(database().time().currentTime() *1000000, 0);
fileSystem file = parDir + (name() +"-"+chNum+".vtk");
auto osPtr = makeUnique<oFstream>(file);
regPoints().write(osPtr());
for(auto& operation:operatios_)
{
if(!operation->write(osPtr()))
{
fatalErrorInFunction
<<"Error occurred in writing operation defined in dict "
<< operation->operationDict()
<<endl;
return false;
}
}
}
return true;
}

View File

@ -53,7 +53,7 @@ private:
regionField<real> volumeFactor_;
bool executed_{false};
bool executed_{false};
dictionaryList operationDicts_;
@ -122,8 +122,6 @@ public:
};
}
#include "PostprocessComponent.cpp"

View File

@ -47,8 +47,8 @@ public:
:
PostprocessComponent<RegionType,GaussianDistribution>(dict, fieldsDB, defaultTimeControl)
{
/// initializes the Gaussian distribution for all elements of region
//const uint32 n = this->regPoints().size();
this->regPoints().applyRegionExtension();
auto d = this->regPoints().eqDiameters();
auto c = this->regPoints().centers();
auto& regs = this->regionProecessMethod();

View File

@ -26,6 +26,7 @@ Licence:
#include "sphereRegionPoints.hpp"
#include "lineRegionPoints.hpp"
#include "multipleSpheresRegionPoints.hpp"
#include "rectMeshRegionPoints.hpp"
namespace pFlow::postprocessData
{
@ -37,6 +38,10 @@ template class PostprocessComponentGaussian<multipleSpheresRegionPoints>;
template class PostprocessComponentUniform<multipleSpheresRegionPoints>;
template class PostprocessComponentArithmetic<multipleSpheresRegionPoints>;
template class PostprocessComponentGaussian<rectMeshRegionPoints>;
template class PostprocessComponentUniform<rectMeshRegionPoints>;
template class PostprocessComponentArithmetic<rectMeshRegionPoints>;
template class PostprocessComponentGaussian<lineRegionPoints>;
template class PostprocessComponentUniform<lineRegionPoints>;
template class PostprocessComponentArithmetic<lineRegionPoints>;

View File

@ -2,17 +2,16 @@
The `PostprocessData` module in phasicFlow provides powerful tools for analyzing particle-based simulations both during runtime (in-simulation) and after simulation completion (post-simulation). This document explains how to configure and use the postprocessing features through the dictionary-based input system.
- in-simulation: this is postprocessing that is active during simulation. When running a solver, it allows for real-time data analysis and adjustments based on the simulation's current state. See below to see how you can activate in-simulation postprocessing.
- post-simulation: this is postprocessing that is done after the simulation is completed. It allows for detailed analysis of the simulation results, including data extraction and visualization based on the results that are stored in time-folders. If you want to use post-simulation, you need to run utility `postprocessPhasicFlow` in terminal (in the simulation case setup folder) to run the postprocessing. This utility reads the `postprocessDataDict` file and performs the specified operations on the simulation data.
- **In-simulation**: This is postprocessing that is active during simulation. When running a solver, it allows for real-time data analysis and adjustments based on the simulation's current state. See below to learn how you can activate in-simulation postprocessing.
- **Post-simulation**: This is postprocessing that is done after the simulation is completed. It allows for detailed analysis of the simulation results, including data extraction and visualization based on the results stored in time folders. If you want to use post-simulation, you need to run the utility `postprocessPhasicFlow` in the terminal (in the simulation case setup folder) to execute the postprocessing. This utility reads the `postprocessDataDict` file and performs the specified operations on the simulation data.
### Important Notes
* **NOTE 1:**
postprocessing for in-simulation, is not implemented for MPI execution. So, do not use it when using MPI execution. For post-simulation postprocessing, you can use the `postprocessPhasicFlow` utility without MPI, even though the actual simulation has been done using MPI.
* **NOTE 1:**
Postprocessing for in-simulation is not implemented for MPI execution. So, do not use it when using MPI execution. For post-simulation postprocessing, you can use the `postprocessPhasicFlow` utility without MPI, even though the actual simulation has been done using MPI.
* **NOTE 2:**
In post-simulation mode, all timeControl settings are ignored. The postprocessing will be done for all the time folders that are available in the case directory or if you specify the time range in the command line, the postprocessing will be done for the time folders that are in the specified range of command line.
* **NOTE 2:**
In post-simulation mode, all `timeControl` settings are ignored. The postprocessing will be done for all the time folders that are available in the case directory, or if you specify the time range in the command line, the postprocessing will be done for the time folders within the specified range.
## Table of Contents
@ -32,12 +31,14 @@ In post-simulation mode, all timeControl settings are ignored. The postprocessin
- [7.1. Example 1: Probing Individual Particles](#71-example-1-probing-individual-particles)
- [7.2. Example 2: Processing in a Spherical Region](#72-example-2-processing-in-a-spherical-region)
- [7.3. Example 3: Processing Along a Line](#73-example-3-processing-along-a-line)
- [7.4. Example 4: Processing in a Rectangular Mesh](#74-example-4-processing-in-a-rectangular-mesh)
- [7.5. Example 5: Tracking particles](#75-example-5-tracking-particles)
- [8. Advanced Features](#8-advanced-features)
- [8.1. Special functions applied on fields](#81-special-functions-applied-on-fields)
- [8.2. Particle Filtering with includeMask](#82-particle-filtering-with-includemask)
- [8.1. Special Functions Applied on Fields](#81-special-functions-applied-on-fields)
- [8.2. Particle Filtering with IncludeMask](#82-particle-filtering-with-includemask)
- [8.3. Implementation Notes](#83-implementation-notes)
- [9. Mathematical Formulations](#9-mathematical-formulations)
- [10. A complete dictionary file (postprocessDataDict)](#10-a-complete-dictionary-file-postprocessdatadict)
- [10. A Complete Dictionary File (postprocessDataDict)](#10-a-complete-dictionary-file-postprocessdatadict)
## 1. Overview
@ -46,12 +47,12 @@ Postprocessing in phasicFlow allows you to:
- Extract information about particles in specific regions of the domain
- Calculate statistical properties such as averages and sums of particle attributes
- Track specific particles throughout the simulation
- Apply different weighing methods when calculating statistics
- Apply different weighting methods when calculating statistics
- Perform postprocessing at specific time intervals
## 2. Setting Up Postprocessing
Postprocessing is configured through a dictionary file named `postprocessDataDict` which should be placed in the `settings` directory. Below is a detailed explanation of the configuration options.
Postprocessing is configured through a dictionary file named `postprocessDataDict`, which should be placed in the `settings` directory. Below is a detailed explanation of the configuration options.
### 2.1. Basic Configuration
@ -60,7 +61,6 @@ The input dictionary, **settings/postprocessDataDict**, may look like this:
```cpp
// PostprocessData dictionary
// Enable/disable postprocessing during simulation
runTimeActive yes; // Options: yes, no
@ -70,7 +70,7 @@ shapeType sphere; // Options depend on the simulation type: sphere, grain, etc
// Default time control for postprocessing components
defaultTimeControl
{
timeControl timeStep; // Options: timeStep, simulationTime, settings
timeControl timeStep; // Options: timeStep, simulationTime, settingsDict
startTime 0; // Start time for postprocessing
endTime 1000; // End time for postprocessing
executionInterval 150; // How frequently to run postprocessing
@ -83,7 +83,6 @@ components
);
```
If you want to activate in-simulation postprocessing, you need to add these lines to the `settings/settingsDict` file:
```cpp
@ -92,7 +91,7 @@ libs ("libPostprocessData.so");
auxFunctions postprocessData;
```
This will link the postprocessing library to your simulation, allowing you to use its features. Note that, anytime you want to deactivate the in-simulation postprocessing, you can simply change the `runTimeActive` option to `no` in `postprocessDataDict` file.
This will link the postprocessing library to your simulation, allowing you to use its features. Note that anytime you want to deactivate the in-simulation postprocessing, you can simply change the `runTimeActive` option to `no` in the `postprocessDataDict` file.
## 3. Time Control Options
@ -102,8 +101,8 @@ Each postprocessing component can either use the default time control settings o
|--------|-------------|---------------------|
| `timeStep` | Controls execution based on simulation time steps | `startTime`, `endTime`, `executionInterval` |
| `simulationTime` | Controls execution based on simulation time | `startTime`, `endTime`, `executionInterval` |
| `settings` | Uses parameters from settingsDict file | None (defined elsewhere) |
| `default` | Uses the default time control settings (uses `defaultTimeControl` settings)| None (uses default) |
| `settingsDict` | Uses parameters from settingsDict file | None (defined elsewhere) |
| `default` | Uses the default time control settings (uses `defaultTimeControl` settings) | None (uses default) |
If no time control is specified, the `default` option is used automatically.
@ -111,14 +110,14 @@ If no time control is specified, the `default` option is used automatically.
The postprocessing module provides several methods for processing particle data. They are categorized into two main groups: bulk and individual methods.
- **Bulk Methods**: Operate on all particles that are located in a specified locations/regions (cells, spheres, etc.).
- **Bulk Methods**: Operate on all particles that are located in specified locations/regions (cells, spheres, etc.).
- **Individual Methods**: Operate on specific particles, allowing for targeted particle property extraction.
| Method | Property type | Description | Formula |
|--------|------------------|-------------|---------|
| Method | Property Type | Description | Formula |
|--------|---------------|-------------|---------|
| `arithmetic` | bulk | Simple arithmetic mean/sum with equal weights | Each particle contributes equally |
| `uniformDistribution` | bulk | Each particle contributes inversely proportional to the total number of particles | $w_i = 1/n$ where $n$ is the number of particles |
| `GaussianDistribution` | bulk | Weight contribution based on distance from center with Gaussian falloff | $w_i = \exp(-\|x_i - c\|^2/(2\sigma^2))/\sqrt{2\pi\sigma^2}$ |
| `GaussianDistribution` | bulk | Weight contribution based on distance from the center with Gaussian falloff | $w_i = \exp(-\|x_i - c\|^2/(2\sigma^2))/\sqrt{2\pi\sigma^2}$ |
| `particleProbe` | individual | Extracts values from specific particles | Direct access to particle properties |
## 5. Region Types
@ -131,11 +130,13 @@ Regions define where in the domain the postprocessing operations are applied:
| `multipleSpheres` | Multiple spherical regions | `centers`, `radii` defined in `multiplSpheresInfo` dict | bulk |
| `line` | Spheres along a line with specified radius | `p1`, `p2`, `nSpheres`, `radius` defined in `lineInfo` dict| bulk |
| `box`| A cuboid region | `min`, `max` defined in `boxInfo` dict | bulk |
| `centerPoints`* | Specific particles selected by ID | `ids` | individual |
| `centerPoints`* | Specific particles selected by center points located in a box | `boxInfo` | individual |
| `centerPoints`* | Specific particles selected by center points located in a sphere | `sphereInfo` | individual |
| `centerPoints`* | Specific particles selected by center points located in a cylinder | `cylinderInfo` | individual |
| <td colspan="4">\* Particles selection is done when simulation reaches the time that is specified by `startTime` of the post-process component and this selection remains intact up to the end of simulation. This is very good for particle tracking purposes or when you want to analyze specific particles behavior over time.</td> |
| `rectMesh`** | creates a rectangular mesh and each direction is divided into equal spaces| corner points of mesh, and `nx`, `ny`, `nz`: number of divisions in each direction | bulk |
| `centerPoints`* | if `selector` is set to `id`, particles selected by ID list | `ids`: a list of particle ids | individual |
| `centerPoints`* | if `selector` is set to `box`, particles are selected by center points located in a box | corner points of the box are given in `boxInfo` sub-dict | individual |
| `centerPoints`* | if `selector` is set to `sphere`, particles are selected by center points located in a sphere | center and radius of a sphere given in `sphereInfo` sub-dict | individual |
| `centerPoints`* | if `selector` is set to `cylinder`, particles are selected by center points located in a cylinder | axis info and radius of cylinder at end points that are given in `cylinderInfo` sub-dict | individual |
| <td colspan="3">\* Particles selection is done when simulation reaches the time that is specified by `startTime` of the post-process component and this selection remains intact up to the end of simulation. This is very good for particle tracking purposes or when you want to analyze specific particles behavior over time.</td> |
| <td colspan="3">\** This region creates a rectangular mesh and particles are located into cells according to their center points. When using `GaussianDistribution` as `processMethod`, a larger neighbor radius is considered for each cell and particles inside this neighbor radius are included in the calculations.</td> |
## 6. Processing Operations for Bulk Properties
@ -166,7 +167,7 @@ where:
### 6.2. About fluctuation2 in average function
Fluctuation2 is an optional parameter that can be used to account for fluctuations in the particle field values with respect to mean value of the field.
`fluctuation2` is an optional parameter that can be used to account for fluctuations in the particle field values with respect to mean value of the field.
It is used in the `average` function to calculate the fluctuation of the field values around the mean. The formula for fluctuation2 is:
$$\text{fluctuation}^2 = \frac{\sum_j w_j \cdot \phi_j \cdot (\text{field}_j - \text{mean})^2}{\sum_i w_i \cdot \phi_i}$$
@ -349,6 +350,90 @@ along_a_line
This example creates 10 spherical regions along a line from (0,0,0) to (0,0.15,0.15) and calculates the bulk density and volume density in each region.
### 7.4 Example 4: Processing in a Rectangular Mesh
In this example, a rectangular mesh is defined. The `rectMeshInfo` section specifies the minimum and maximum corner points of the box, the number of divisions in each direction, and an optional cell extension factor which is effective for GaussianDistribution only. In the `operations` section, two operations are defined: one for calculating the average velocity and another for calculating the solid volume fraction.
```cpp
on_a_rectMesh
{
processMethod GaussianDistribution;
processRegion rectMesh;
timeControl settingsDict; // uses settings from settingsDict file
rectMeshInfo
{
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
nx 30; // number of divisions in x direction
ny 30; // number of divisions in y direction
nz 15; // number of divisions in z direction
// optional (default is 2.0)
// for each cell, a neighbor radius is considered. This neighbor radius is equal to
// cellExtension * equivalent diameter of the cell.
// cell extension is only effective when using GaussianDistribution as processMethod.
cellExtension 3;
}
operations
(
avVelocity
{
function average;
field velocity;
fluctuation2 yes;
threshold 4;
phi mass;
}
solidVolumeFraction
{
function sum;
field volume;
divideByVolume yes;
}
);
}
```
### 7.5 Example 5: Tracking particles
Suppose we want to mark and track the position of particles that are located inside a box region at t = 1 s. All particles that are inside the box at t = 1 s will be marked/selected and then the position of them are recorded along the simulation time. The following example shows how to do this. Note that marking/selecting of particles is done at the instance that is defined by `startTime`.
```C++
particlesTrack
{
processMethod particleProbe;
processRegion centerPoints;
// all particles whose ceters are located inside this box
// are selected. Selection occurs at startTime: particles
// that are inside the box at t = startTime.
selector box;
boxInfo
{
min (0 0 0);
max (0.1 0.05 0.05);
}
// center position of selected particles are processed
field position;
timeControl simulationTime;
// execution starts at 1.0 s
startTime 1.0;
// execution ends at 100 s
endTime 100;
// execution interval of this compoenent
executionInterval 0.02;
}
```
## 8. Advanced Features
### 8.1. Special functions applied on fields
@ -464,7 +549,7 @@ components
field component(velocity,y);
ids (0 10 100);
timeControl default; // other options are settings, timeStep, simulationTime
// settings: uses parameters from settingsDict file
// settingsDict: uses parameters from settingsDict file
// timeStep: uses the time step of the simulation controlling the execution of postprocessing
// simulationTime: uses the simulation time of the simulation controlling the execution of postprocessing
// default: uses the default time control (defined in defaultTimeControl).
@ -499,6 +584,49 @@ components
executionInterval 0.02;
}
on_a_rectMesh
{
processMethod GaussianDistribution;
processRegion rectMesh;
timeControl settingsDict; // uses settings from settingsDict file
rectMeshInfo
{
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
nx 30; // number of divisions in x direction
ny 30; // number of divisions in y direction
nz 15; // number of divisions in z direction
// optional (default is 2.0)
// for each cell, a neighbor radius is considered. This neighbor radius is equal to
// cellExtension * equivalent diameter of the cell.
// cell extension is only effective when using GaussianDistribution as processMethod.
cellExtension 3;
}
operations
(
avVelocity
{
function average;
field velocity;
fluctuation2 yes;
threshold 4;
phi mass;
}
solidVolumeFraction
{
function sum;
field volume;
divideByVolume yes;
}
);
}
on_single_sphere
{

View File

@ -24,6 +24,7 @@ Licence:
#include "types.hpp"
#include "regionPoints.hpp"
#include "Field.hpp"
#include "cellMapper.hpp"
namespace pFlow::postprocessData
{
@ -101,6 +102,11 @@ public:
return field_.size();
}
uint32x3 shape()const
{
return regionPoints_.shape();
}
bool empty()const
{
return field_.empty();

View File

@ -1,3 +1,6 @@
namespace pFlow::postprocessData
{
@ -9,6 +12,86 @@ regionField<T>::regionField(
:
field_(name, "regionFieldValue", rPoints.size(), rPoints.size(), defaultVal),
regionPoints_(rPoints)
{}
template<typename T>
inline
bool regionField<T>::writeFieldToVtk(iOstream& os)const
{
fatalErrorInFunction<< "This type is not supported for vtk conversion:"<<
field_.typeName()<<endl;
fatalExit;
return false;
}
template<>
inline
bool regionField<real>::writeFieldToVtk(iOstream& os)const
{
os<<"FIELD FieldData 1 " << field_.name() << " 1 "<< field_.size() << " float\n";
const auto mapper = cellMapper{shape()};
for(uint32 k=0; k<mapper.nz(); k++)
{
for(uint32 j=0; j<mapper.ny(); j++)
{
for(uint32 i=0; i<mapper.nx(); i++)
{
os<< field_[ mapper(i,j,k) ]<<'\n';
}
}
}
os<<endl;
return true;
}
template<>
inline
bool regionField<realx3>::writeFieldToVtk(iOstream& os)const
{
os<<"FIELD FieldData 1 " << field_.name() << " 3 "<< field_.size() << " float\n";
const auto mapper = cellMapper{shape()};
for(uint32 k=0; k<mapper.nz(); k++)
{
for(uint32 j=0; j<mapper.ny(); j++)
{
for(uint32 i=0; i<mapper.nx(); i++)
{
os<<field_[mapper(i,j,k)].x()<<' '<<field_[mapper(i,j,k)].y()<<' '<<field_[mapper(i,j,k)].z()<<'\n';
}
}
}
os<<endl;
return true;
}
template<>
inline
bool regionField<uint32>::writeFieldToVtk(iOstream& os)const
{
os<<"FIELD FieldData 1 " << field_.name() << " 1 "<< field_.size() << " int\n";
const auto mapper = cellMapper{shape()} ;
for(uint32 k=0; k<mapper.nz(); k++)
{
for(uint32 j=0; j<mapper.ny(); j++)
{
for(uint32 i=0; i<mapper.nx(); i++)
{
os<< field_[ mapper(i,j,k) ]<<'\n';
}
}
}
os<<endl;
return true;
}
} // End namespace pFlow::postprocessData

View File

@ -0,0 +1,56 @@
#ifndef __cellMapper_hpp__
#define __cellMapper_hpp__
#include "types.hpp"
namespace pFlow::postprocessData
{
struct cellMapper
{
uint32x3 cells_;
cellMapper()
:
cells_()
{}
explicit cellMapper(uint32x3 cells)
:
cells_(cells)
{}
cellMapper(const cellMapper&) = default;
cellMapper(cellMapper&&) = default;
cellMapper& operator=(const cellMapper&) = default;
cellMapper& operator=(cellMapper&&) = default;
~cellMapper() = default;
inline
uint32 operator()(uint32 i, uint32 j, uint32 k)const
{
return (k*(cells_.y()*cells_.x()))+j*cells_.x() + i;
}
uint32 nx()const
{
return cells_.x();
}
uint32 ny()const
{
return cells_.y();
}
uint32 nz()const
{
return cells_.z();
}
};
} //pFlow::postprocessData
#endif //__cellMapper_hpp__

View File

@ -0,0 +1,224 @@
#include "rectMeshRegionPoints.hpp"
#include "fieldsDataBase.hpp"
#include "numericConstants.hpp"
void pFlow::postprocessData::rectMeshRegionPoints::findPointsBeyoundCells()
{
// check if pointsBeyoundCells_ is initialized
if(!pointsBeyoundCells_)
{
pointsBeyoundCells_ = makeUnique<decltype(pointsOnCells_)>
(
"selectedPoints2",
this->size()
);
}
// get the reference to pointsBeyoundCells_ and clear it
auto& selectedPoints = pointsBeyoundCells_();
// point positions are obtained from the database
const auto points = database().updatePoints();
// iterate through all cells to find points that are within the search radius
for(int32 i=0; i<mapper_.nx(); i++)
{
for(int32 j=0; j<mapper_.ny(); j++)
{
for(int32 k=0; k<mapper_.nz(); k++)
{
uint32 cellIndex = mapper_(i,j,k);
// copy the points in the center cell
auto& cellIndices = selectedPoints[cellIndex];
cellIndices.clear();
if(pointsOnCells_[cellIndex].empty())
continue;
const auto cellCenter = centerPoints_[cellIndex];
const auto rad = 0.5*diameter_[cellIndex];
for(int32 ii=-2; ii <= 2; ++ii)
{
for(int32 jj=-2; jj <= 2; ++jj)
{
for(int32 kk=-2; kk <= 2; ++kk)
{
int32 ni = i + ii;
int32 nj = j + jj;
int32 nk = k + kk;
if(ni < 0 || nj < 0 || nk < 0)
continue;
if(ni >= mapper_.nx() || nj >= mapper_.ny() || nk >= mapper_.nz())
continue;
uint32 neighborIndex = mapper_(ni, nj, nk);
const auto& neighborPoints = pointsOnCells_[neighborIndex];
for(auto nIndx : neighborPoints)
{
if( (points[nIndx]-cellCenter).length() < rad )
{
cellIndices.push_back(nIndx);
}
}
}
}
}
}
}
}
}
pFlow::postprocessData::rectMeshRegionPoints::rectMeshRegionPoints
(
const dictionary &dict,
fieldsDataBase &fieldsDataBase
)
:
regionPoints(dict, fieldsDataBase),
boxRegion_(dict.subDict("rectMeshInfo")),
cellExtension_(dict.subDict("rectMeshInfo").getValOrSet<real>("cellExtension", 2.0)),
pointsOnCells_("selectedPoints"),
selectedPoints_(pointsOnCells_)
{
cellExtension_ = max(cellExtension_, one);
const auto& rectMeshInfo = dict.subDict("rectMeshInfo");
auto nx = rectMeshInfo.getValMax<uint32>("nx", 1);
auto ny = rectMeshInfo.getValMax<uint32>("ny", 1);
auto nz = rectMeshInfo.getValMax<uint32>("nz", 1);
mapper_ = cellMapper(uint32x3(nx, ny, nz));
uint32 nCells = mapper_.nx() * mapper_.ny() * mapper_.nz();
real vol = boxRegion_.volume() / nCells;
volumes_.resize(nCells, vol);
diameter_.resize(nCells, 2 * pow(3 * vol / 4.0 / Pi, 0.3333333));
pointsOnCells_.resize(nCells);
centerPoints_.resize(nCells);
real dx = (boxRegion_.maxPoint().x() - boxRegion_.minPoint().x()) / mapper_.nx();
real dy = (boxRegion_.maxPoint().y() - boxRegion_.minPoint().y()) / mapper_.ny();
real dz = (boxRegion_.maxPoint().z() - boxRegion_.minPoint().z()) / mapper_.nz();
for(uint32 i = 0; i < nx; ++i)
{
for(uint32 j = 0; j < ny; ++j)
{
for(uint32 k = 0; k < nz; ++k)
{
realx3 center = boxRegion_.minPoint() +
realx3(
( static_cast<real>(i) + 0.5) * dx,
( static_cast<real>(j) + 0.5) * dy,
( static_cast<real>(k) + 0.5) * dz
);
centerPoints_[mapper_(i, j, k)] = center;
}
}
}
}
void pFlow::postprocessData::rectMeshRegionPoints::applyRegionExtension()
{
// it cannot be lower than 1
cellExtension_ = max(one, cellExtension_);
real vf = pow(cellExtension_, 3);
for(auto& v:volumes_)
{
v *= vf;
}
for(auto& d:diameter_)
{
d *= cellExtension_;
}
}
bool pFlow::postprocessData::rectMeshRegionPoints::update()
{
const auto points = database().updatePoints();
for (auto& elem : pointsOnCells_)
{
elem.clear();
}
real dx = (boxRegion_.maxPoint().x() - boxRegion_.minPoint().x()) / mapper_.nx();
real dy = (boxRegion_.maxPoint().y() - boxRegion_.minPoint().y()) / mapper_.ny();
real dz = (boxRegion_.maxPoint().z() - boxRegion_.minPoint().z()) / mapper_.nz();
for (uint32 i = 0; i < points.size(); ++i)
{
if(boxRegion_.isInside(points[i]))
{
uint32 indexX = (points[i] - boxRegion_.minPoint()).x() / dx;
uint32 indexY = (points[i] - boxRegion_.minPoint()).y() / dy;
uint32 indexZ = (points[i] - boxRegion_.minPoint()).z() / dz;
pointsOnCells_[mapper_(indexX, indexY, indexZ)].push_back(i);
}
}
// search beyound cells is not required
if( equal(cellExtension_,one))
{
selectedPoints_ = pointsOnCells_;
return true;
}
// search beyound cells is required
findPointsBeyoundCells();
selectedPoints_ = pointsBeyoundCells_();
return true;
}
bool pFlow::postprocessData::rectMeshRegionPoints::write(iOstream &os) const
{
auto [x, y , z] = boxRegion_.minPoint();
auto [nx, ny, nz] = mapper_.cells_;
real dx = (boxRegion_.maxPoint().x() - boxRegion_.minPoint().x()) / mapper_.nx();
real dy = (boxRegion_.maxPoint().y() - boxRegion_.minPoint().y()) / mapper_.ny();
real dz = (boxRegion_.maxPoint().z() - boxRegion_.minPoint().z()) / mapper_.nz();
os << "# vtk DataFile Version 3.0" << endl;
os << "postProcessData" << endl;
os << "ASCII" << endl;
os << "DATASET RECTILINEAR_GRID" << endl;
os << "DIMENSIONS " << nx + 1 << " " << ny + 1 << " " << nz + 1 << endl;
os << "X_COORDINATES " << nx + 1 << " float\n";
for(int32 i = 0; i < nx + 1; i++)
{
os << x << "\n";
x += dx;
}
os << "Y_COORDINATES " << ny + 1 << " float\n";
for(int32 j = 0; j < ny + 1; j++)
{
os << y << "\n";
y += dy;
}
os << "Z_COORDINATES " << nz + 1 << " float\n";
for(int32 j = 0; j < nz + 1; j++)
{
os << z << "\n";
z += dz;
}
os << "CELL_DATA " << nx * ny * nz << endl;
return true;
}

View File

@ -0,0 +1,222 @@
/*------------------------------- phasicFlow ---------------------------------
O C enter of
O O E ngineering and
O O M ultiscale modeling of
OOOOOOO F luid flow
------------------------------------------------------------------------------
Copyright (C): www.cemf.ir
email: hamid.r.norouzi AT gmail.com
------------------------------------------------------------------------------
Licence:
This file is part of phasicFlow code. It is a free software for simulating
granular and multiphase flows. You can redistribute it and/or modify it under
the terms of GNU General Public License v3 or any other later versions.
phasicFlow is distributed to help others in their research in the field of
granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-----------------------------------------------------------------------------*/
/**
* @file rectMeshRegionPoints.hpp
* @brief A class representing a rectMesh region for point selection
*
* This class provides functionality to select points within a rectMesh region
* and to compute related properties such as volume and equivalent diameter.
* It inherits from regionPoints and implements all required virtual methods.
*
* @see regionPoints
* @see fieldsDataBase
*/
#ifndef __rectMeshRegionPoints_hpp__
#define __rectMeshRegionPoints_hpp__
#include "regionPoints.hpp"
#include "box.hpp"
#include "Vectors.hpp"
#include "cellMapper.hpp"
namespace pFlow::postprocessData
{
class rectMeshRegionPoints
:
public regionPoints
{
private:
/// box object defining the region for point selection
box boxRegion_;
/// store the cells that are inside the box region
cellMapper mapper_;
/// Center points of each cell in the rectMesh region
realx3Vector centerPoints_;
/// Volume of each cell in the rectMesh region
realVector volumes_;
/// Diameter of each cell in the rectMesh region
realVector diameter_;
real cellExtension_;
Vector<uint32Vector> pointsOnCells_;
uniquePtr<Vector<uint32Vector>> pointsBeyoundCells_;
/// Indices of points that are selected by this region
Vector<uint32Vector>& selectedPoints_;
void findPointsBeyoundCells();
public:
TypeInfo("rectMesh");
/**
* @brief Construct a rectMesh region for point selection
*
* @param dict Dictionary containing sphereInfo dictionary
* @param fieldsDataBase Database containing fields data
*/
rectMeshRegionPoints(
const dictionary& dict,
fieldsDataBase& fieldsDataBase);
/// Destructor
~rectMeshRegionPoints() override = default;
/**
* @brief Get the number of regions
*/
uint32 size()const override
{
return volumes_.size();
}
/**
* return the shape of the field
*/
uint32x3 shape()const override
{
return mapper_.cells_;
}
const cellMapper& mapper()const
{
return mapper_;
}
/**
* @brief Update the points selected by this region
* @return True if update was successful
*/
bool empty()const override
{
return volumes_.empty();
}
void applyRegionExtension() override;
real regionExtensionRatio()const override
{
return cellExtension_;
}
/**
* @brief Get the volume of the rectMesh region
* @return A span containing the volume of the region
*/
span<const real> volumes()const override
{
return span<const real>(volumes_.data(), volumes_.size());
}
/**
* @brief Get the equivalent diameter of the rectMesh region
* @return A span containing the diameter of the region
*/
span<const real> eqDiameters()const override
{
return span<const real>(diameter_.data(), diameter_.size());
}
/**
* @brief Get the center of the rectMesh region
* @return A span containing the center point of the region
*/
span<const realx3> centers()const override
{
return span<const realx3>(centerPoints_.data(), centerPoints_.size());
}
/**
* @brief Get the indices of points within the region (const version)
* @param elem Element index (ignored as there's only one sphere)
* @return A span containing indices of points within the region
*/
span<const uint32> indices(uint32 elem)const override
{
if (elem >= size())
{
fatalErrorInFunction
<< "The element index is out of range. elem: " << elem
<< " size: " << size() << endl;
fatalExit;
}
return span<const uint32>(selectedPoints_[elem].data(), selectedPoints_[elem].size());
}
/**
* @brief Get the indices of points within the region (non-const version)
* @param elem Element index (ignored as there's only one sphere)
* @return A span containing indices of points within the region
*/
span<uint32> indices(uint32 elem) override
{
if (elem >= size())
{
fatalErrorInFunction
<< "The element index is out of range. elem: " << elem
<< " size: " << size() << endl;
fatalExit;
}
return span<uint32>(selectedPoints_[elem].data(), selectedPoints_[elem].size());
}
/**
* @brief Update the points selected by this region
* @return True if update was successful
*/
bool update()override;
/**
* @brief Determine if data should be written to the same time file
*/
bool writeToSameTimeFile()const override
{
return false;
}
/**
* @brief Write region data to output stream
* @param os Output stream to write to
* @return True if write was successful
*/
bool write(iOstream& os)const override;
};
}
#endif // __sphereRegionPoints_hpp__

View File

@ -49,10 +49,10 @@ class fieldsDataBase;
*/
class regionPoints
{
using PointsTypeHost = typename pointStructure::PointsTypeHost;
using PointsTypeHost = typename pointStructure::PointsTypeHost;
/// Reference to the fields database containing simulation data
fieldsDataBase& fieldsDataBase_;
fieldsDataBase& fieldsDataBase_;
public:
@ -78,11 +78,29 @@ public:
/// @brief size of elements
virtual
uint32 size()const = 0;
virtual
uint32x3 shape()const
{
return uint32x3(size(), 1u, 1u);
}
/// @brief check if the region is empty
virtual
bool empty()const = 0;
/// by default it does nothing
/// But, it can be used for the methods that needs to search for
/// particles which are beyound the region
virtual void applyRegionExtension()
{}
virtual
real regionExtensionRatio()const
{
return 1.0;
}
/// @brief volume of elements
/// @return sapn for accessing the volume of elements
virtual

View File

@ -39,7 +39,7 @@ components
field component(velocity,y);
ids (0 10 100);
timeControl default; // other options are settings, timeStep, simulationTime
// settings: uses parameters from settingsDict file
// settingsDict: uses parameters from settingsDict file
// timeStep: uses the time step of the simulation controlling the execution of postprocessing
// simulationTime: uses the simulation time of the simulation controlling the execution of postprocessing
// default: uses the default time control (defined in defaultTimeControl).
@ -74,6 +74,49 @@ components
executionInterval 0.02;
}
on_a_rectMesh
{
processMethod GaussianDistribution;
processRegion rectMesh;
timeControl settingsDict; // uses settings from settingsDict file
rectMeshInfo
{
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
nx 30; // number of divisions in x direction
ny 30; // number of divisions in y direction
nz 15; // number of divisions in z direction
// optional (default is 2.0)
// for each cell, a neighbor radius is considered. This neighbor radius is equal to
// cellExtension * equivalent diameter of the cell.
// cell extension is only effective when using GaussianDistribution as processMethod.
cellExtension 3;
}
operations
(
avVelocity
{
function average;
field velocity;
fluctuation2 yes;
threshold 4;
phi mass;
}
solidVolumeFraction
{
function sum;
field volume;
divideByVolume yes;
}
);
}
on_single_sphere
{
@ -134,7 +177,7 @@ components
{
function sum;
field one;
phi one;
phi one;
divideByVolume yes;
}
@ -153,15 +196,14 @@ components
startTime 1.0;
endTime 3.0;
executionInterval 0.1;
// 10 spheres with radius 0.01 along the straight line defined by p1 and p2
lineInfo
{
p1 (0 0 0);
p2 (0 0.15 0.15);
nSpheres 10;
radius 0.01;
p1 (0 0 0);
p2 (0 0.15 0.15);
nSpheres 10;
radius 0.01;
}
operations

View File

@ -181,4 +181,4 @@ public:
}
#endif //__IOPattern_hpp__
#endif //__IOPattern_hpp__

View File

@ -62,4 +62,5 @@ public:
} // namespace pFlow
#endif
#endif

View File

@ -111,6 +111,14 @@ public:
return max_;
}
INLINE_FUNCTION_HD
real volume()const
{
return (max_.x() - min_.x()) *
(max_.y() - min_.y()) *
(max_.z() - min_.z());
}
//// - IO operation
FUNCTION_H
bool read(iIstream & is);

View File

@ -1,4 +1,5 @@
#!/bin/sh
set -e # Exit immediately if a command exits with a non-zero status
cd ${0%/*} || exit 1 # Run from this directory
echo "\n<--------------------------------------------------------------------->"
echo "1) Creating particles"

View File

@ -1,4 +1,5 @@
#!/bin/sh
set -e # Exit immediately if a command exits with a non-zero status
cd ${0%/*} || exit 1 # Run from this directory
echo "\n<--------------------------------------------------------------------->"

View File

@ -0,0 +1,184 @@
# Post-processing for Evaluating Segregation of Particles
- Compatibility: phasicFlow-v-1.0
- Solvers and tools: sphereGranFlow, postprocessPhasicFlow
## Background
In particle-based simulations, it's often necessary to perform operations on particle fields to obtain bulk properties of the powder system (such as sums or averages). For example, we may need to calculate the mass-averaged velocity of particles in a granular flow. For bulk-processing of particle fields, we can use a mesh structure to obtain bulk properties of the powder in each cell. In this tutorial, we use a rectangular mesh in which a cuboid is divided into equal sub-spaces (cells).
This tutorial demonstrates how to obtain three important bulk properties:
- Mass-averaged solid velocity (and its fluctuations)
- Solid volume fraction
- Volume fraction of small particles (segregation measurement)
## Problem Definition
We will post-process the simulation results from the case [rotating drum with binary particles](../sphereGranFlow/binarySystemOfParticles/). The goal is to create a rectangular mesh with cuboid cells and calculate bulk properties on this mesh to analyze particle segregation patterns.
***
## Case Setup
This tutorial focuses solely on the post-processing aspect of the simulation. It assumes you have already executed the simulation and the results are available for post-processing.
**Important Note:** Postprocessing in phasicFlow can be performed in two modes:
1. **In-simulation postprocessing**: Activated during simulation runtime, allowing calculations on live simulation data
2. **Post-simulation postprocessing**: Performed after the simulation has completed
For more detailed information about different modes of postprocessing, please refer to the [official documentation page](../../../src/PostprocessData/readme.md).
### Configuration File
In `settings/postprocessDataDict`, you configure the post-processing parameters:
```C++
// file: settings/postprocessDataDict
// Enable in-simulation postprocessing (set to "no" for post-simulation only)
runTimeActive yes;
// Shape type used in the simulation
shapeType sphere;
components
(
on_rectMesh
{
// Use Gaussian distribution for sampling and distributing
// particle properties over cells
processMethod GaussianDistribution;
processRegion rectMesh;
// Use time control in settingsDict file
timeControl settingsDict;
// A rectangular mesh is constructed using corner points of the
// mesh region and number of divisions in each direction
rectMeshInfo
{
min (-0.12 -0.12 0.00);
max (0.12 0.12 0.1);
nx 36;
ny 36;
nz 15;
}
operations
(
// Calculate mass-averaged particle velocity
avVelocity
{
function average;
field velocity;
fluctuation2 yes;
threshold 4;
phi mass;
}
// Calculate solid volume fraction
solidVolFraction
{
function sum;
field volume;
divideByVolume yes;
threshold 4;
}
// Calculate volume fraction of small particles
smallSphereVolFraction
{
function average;
field one;
phi volume;
divideByVolume no;
threshold 4;
includeMask lessThan;
lessThanInfo
{
field diameter;
value 0.0031;
}
}
);
}
);
```
### Understanding the Configuration
#### Mesh Configuration
In the `rectMeshInfo` dictionary:
- `min` and `max` define the corner points of the entire domain
- `nx`, `ny`, and `nz` define the number of divisions in each direction
#### Operations
We define three operations to extract bulk properties:
1. **avVelocity**: Calculates mass-averaged particle velocity
The `average` function is defined mathematically as:
$$\text{average} = \frac{\sum_j w_j \cdot \phi_j \cdot \text{field}_j}{\sum_i w_i \cdot \phi_i}$$
When `field` is set to velocity and `phi` is set to mass, we calculate the mass-averaged velocity of particles in each cell. With `fluctuation2` set to yes, we also calculate velocity fluctuations around the mean value.
Note that:
- Cells with fewer than 4 particles are excluded (via the `threshold` parameter)
- $w_j$ is the weight factor determined by the Gaussian distribution function
2. **solidVolFraction**: Calculates solid volume fraction in each cell
The `sum` function is defined as:
$$\text{sum} = \sum_j w_j \cdot \phi_j \cdot \text{field}_j$$
By setting `field` to volume and `divideByVolume` to yes, we sum the volumes of all particles in each cell and divide by the cell volume, giving us the solid volume fraction.
3. **smallSphereVolFraction**: Calculates volume fraction of small particles in each cell
This operation measures the volume fraction of small particles relative to total particle volume. The `includeMask` parameter filters particles by diameter, selecting only those smaller than 0.0031 units.
The numerator of the `average` function calculates the sum of small particle volumes, while the denominator calculates the total volume of all particles.
### Particle Filtering with includeMask
The `includeMask` parameter allows filtering particles based on field values. Available options include:
* `all`: Include all particles (default)
* `lessThan`: Include particles where field < value
* `lessThanEq`: Include particles where field ≤ value
* `greaterThan`: Include particles where field > value
* `greaterThanEq`: Include particles where field ≥ value
* `equal`: Include particles where field = value
* `between`: Include particles where value1 < field < value2
* `betweenEq`: Include particles where value1 ≤ field ≤ value2
## Running the Post-processing Tool
After completing the simulation, execute the post-processing tool with:
```bash
postprocessPhasicFlow
```
The results will be stored in the `./postprocessData` folder.
**Tip:** Run `postprocessPhasicFlow -h` to see all available command-line options, including time range selection for post-processing.

View File

@ -7,47 +7,42 @@ objectType dicrionary;
fileFormat ASCII;
/*---------------------------------------------------------------------------*/
materials (prop1); // a list of materials names
densities (1000.0); // density of materials [kg/m3]
materials (prop1); // a list of materials names
densities (1000.0); // density of materials [kg/m3]
contactListType sortedContactList;
model
{
contactForceModel nonLinearNonLimited;
rollingFrictionModel normal;
Yeff (1.0e6); // Young modulus [Pa]
Geff (0.8e6); // Shear modulus [Pa]
nu (0.25); // Poisson's ratio [-]
en (0.7); // coefficient of normal restitution
et (1.0); // coefficient of tangential restitution
mu (0.3); // dynamic friction
mur (0.1); // rolling friction
}
contactSearch
{
method multiGridNBS; // method for broad search particle-particle
wallMapping multiGridMapping; // method for broad search particle-wall
method NBS;
multiGridNBSInfo
{
updateFrequency 10; // each 10 timesteps, update neighbor list
sizeRatio 1.1; // bounding box size to particle diameter (max)
}
updateInterval 10;
multiGridMappingInfo
{
updateFrequency 10; // each 10 timesteps, update neighbor list
cellExtent 0.6; // bounding box for particle-wall search (> 0.5)
}
sizeRatio 1.1;
cellExtent 0.55;
adjustableBox Yes;
}
model
{
contactForceModel nonLinearNonLimited;
rollingFrictionModel normal;
Yeff (1.0e6); // Young modulus [Pa]
Geff (0.8e6); // Shear modulus [Pa]
nu (0.25); // Poisson's ratio [-]
en (0.7); // coefficient of normal restitution
mu (0.3); // dynamic friction
mur (0.1); // rolling friction
}

View File

@ -7,6 +7,8 @@ objectType sphereShape;
fileFormat ASCII;
/*---------------------------------------------------------------------------*/
names (smallSphere largeSphere); // names of shapes
names (smallSphere largeSphere); // names of shapes
diameters (0.003 0.005); // diameter of shapes
materials (prop1 prop1); // material names for shapes

View File

@ -3,5 +3,5 @@ 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
rm -rf postprocessData
#------------------------------------------------------------------------------

View File

@ -1,4 +1,5 @@
#!/bin/sh
set -e # Exit immediately if a command exits with a non-zero status
cd ${0%/*} || exit 1 # Run from this directory
echo "\n<--------------------------------------------------------------------->"
echo "1) Creating particles"

View File

@ -0,0 +1,49 @@
/* -------------------------------*- C++ -*--------------------------------- *\
| phasicFlow File |
| copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */
objectName domainDict;
objectType dictionary;
fileFormat ASCII;
/*---------------------------------------------------------------------------*/
// 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
}
}

View File

@ -2,70 +2,89 @@
| phasicFlow File |
| copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */
objectName geometryDict;
objectType dictionary;
objectName geometryDict;
objectType dictionary;
fileFormat ASCII;
/*---------------------------------------------------------------------------*/
// motion model: rotating object around an axis
motionModel rotatingAxisMotion;
motionModel rotatingAxis;
rotatingAxisInfo // information for rotatingAxisMotion motion model
{
rotAxis
{
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)
startTime 0.5;
}
}
surfaces
{
/*
A cylinder with begin and end radii 0.12 m and axis points at (0 0 0)
and (0 0 0.1)
*/
cylinder
{
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
radius1 0.12; // radius at p1
radius2 0.12; // radius at p2
resolution 24; // number of divisions
material prop1; // material name of this wall
motion rotAxis; // motion component name
}
/*
A cylinder with begin and end radii 0.12 m and axis points at (0 0 0) and (0 0 0.1)
*/
cylinder
{
type cylinderWall; // type of the wall
/*
This is a plane wall at the rear end of cylinder
*/
wall1
{
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
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
}
p1 (0.0 0.0 0.0); // begin point of cylinder axis
/*
This is a plane wall at the front end of cylinder
*/
wall2
{
type planeWall;
p1 (-0.12 -0.12 0.1);
p2 ( 0.12 -0.12 0.1);
p3 ( 0.12 0.12 0.1);
p4 (-0.12 0.12 0.1);
material prop1;
motion rotAxis;
}
p2 (0.0 0.0 0.1); // end point of cylinder axis
radius1 0.12; // radius at p1
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
{
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
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
{
type planeWall; // type of the wall
p1 (-0.12 -0.12 0.1); // first point of the wall
p2 ( 0.12 -0.12 0.1); // second point
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
}
}
// information for rotatingAxisMotion motion model
rotatingAxisMotionInfo
{
rotAxis
{
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)
}
}

View File

@ -10,21 +10,20 @@ fileFormat ASCII;
// positions particles
positionParticles
{
method positionOrdered; // ordered positioning
method ordered;
maxNumberOfParticles 30001; // maximum number of particles in the simulation
mortonSorting Yes; // perform initial sorting based on morton code?
cylinder // cylinder region for positioning particles
regionType cylinder;
cylinderInfo
{
p1 (0.0 0.0 0.003); // begin point of cylinder axis
p2 (0.0 0.0 0.097); // end point of cylinder axis
radius 0.117; // radius of cylinder
}
positionOrderedInfo
orderedInfo
{
distance 0.005; // minimum distance between particles centers
distance 0.005; // minimum space between centers of particles
numPoints 30000; // number of particles in the simulation
axisOrder (z x y); // axis order for filling the space with particles
}
@ -35,8 +34,8 @@ setFields
/*
Default value for fields defined for particles
These fields should always be defined for simulations with
spherical particles.*/
spherical particles.
*/
defaultValue
{
velocity realx3 (0 0 0); // linear velocity (m/s)
@ -49,17 +48,17 @@ setFields
{
shapeAssigne
{
selector selectRandom; // type of point selector
selectRandomInfo
selector randomPoints; // type of point selector
randomPointsInfo
{
begin 0; // begin index of points
end 29999; // end index of points
number 10000; // number of points to be selected
end 29999; // end index of points
number 10000;
}
fieldValue // fields that the selector is applied to
{
/*
sets shapeName of the selected points to largeSphere*/
shapeName word largeSphere;
}
}

View File

@ -0,0 +1,82 @@
/* -------------------------------*- C++ -*--------------------------------- *\
| phasicFlow File |
| copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */
objectName processDataDict;
objectType dictionary;;
fileFormat ASCII;
/*---------------------------------------------------------------------------*/
runTimeActive yes;
shapeType sphere;
components
(
on_rectMesh
{
processMethod GaussianDistribution;
processRegion rectMesh;
timeControl settingsDict;
rectMeshInfo
{
min (-0.12 -0.12 0.00);
max (0.12 0.12 0.1);
nx 36;
ny 36;
nz 15;
}
operations
(
avVelocity
{
function average;
field velocity;
fluctuation2 yes;
threshold 4;
phi mass;
}
solidVolFraction
{
function sum;
field volume;
divideByVolume yes;
threshold 4;
}
smallSphereVolFraction
{
function average;
field one;
phi volume;
divideByVolume no;
threshold 4;
includeMask lessThan;
lessThanInfo
{
field diameter;
value 0.0031;
}
}
);
}
);

View File

@ -1,54 +0,0 @@
/* -------------------------------*- C++ -*--------------------------------- *\
| phasicFlow File |
| copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */
objectName postprocessDict;
objectType dictionary;;
fileFormat ASCII;
/*---------------------------------------------------------------------------*/
rectMesh
{
min (-0.12 -0.12 0.0); //minimum corner point
max (0.12 0.12 0.1); //maximum corner point
nx 24; // number of divisions in x direction
ny 24; // number of divisions in y direction
nz 10; // number of divisions in z direction
}
numberBased
{
// num particles in a cell
numParticles
{
field real 1.0; // uniform field with value 1
operation sum; // sum over all particles in a cell
includeMask all; // select all
}
// concentration of small particles (number based)
smallConc
{
field real 1.0; // uniform field with value 1
operation average; // average over all particles in a cell
threshold 1; // exclude cells with number of particles less than 1
includeMask lessThan; // include mask
lessThanInfo
{
field diameter; // include particles with diameter less than 0.004
value 0.004;
}
}
// average velocity of particles
avVelocity
{
field velocity; // read velocity field from time folder
operation average; // average over all particles in the cell
threshold 3; // exclude cells with number of particles less than 3
includeMask all; // select all
}
}

View File

@ -2,39 +2,37 @@
| phasicFlow File |
| copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */
objectName settingsDict;
objectType dictionary;;
objectName settingsDict;
objectType dictionary;
fileFormat ASCII;
/*---------------------------------------------------------------------------*/
run rotatingDrumSmall;
run rotatingDrumSmall;
dt 0.00001; // time step for integration (s)
libs ("libPostprocessData.so");
startTime 0; // start time for simulation
auxFunctions postprocessData;
endTime 10; // end time for simulation
dt 0.00001; // time step for integration (s)
saveInterval 0.1; // time interval for saving the simulation
startTime 0; // start time for simulation
timePrecision 6; // maximum number of digits for time folder
endTime 10; // end time for simulation
g (0 -9.8 0); // gravity vector (m/s2)
saveInterval 0.1; // time interval for saving the simulation
/*
Simulation domain
every particles that goes outside this domain is deleted.
*/
domain
{
min (-0.12 -0.12 0);
max (0.12 0.12 0.1);
}
timePrecision 6; // maximum number of digits for time folder
integrationMethod AdamsBashforth2; // integration method
g (0 -9.8 0); // gravity vector (m/s2)
writeFormat ascii;
includeObjects (diameter); // save necessary (i.e., required) data on disk
timersReport Yes; // report timers?
integrationMethod AdamsBashforth2; // integration method
timersReportInterval 0.01; // time interval for reporting timers
integrationHistory off;
writeFormat ascii; // data writting format (ascii or binary)
timersReport Yes; // report timers (Yes or No)
timersReportInterval 0.01; // time interval for reporting timers

View File

@ -1,4 +1,5 @@
#!/bin/sh
set -e # Exit immediately if a command exits with a non-zero status
cd ${0%/*} || exit 1 # Run from this directory
echo "\n<--------------------------------------------------------------------->"
echo "1) Creating particles"

View File

@ -1,4 +1,5 @@
#!/bin/sh
set -e # Exit immediately if a command exits with a non-zero status
cd ${0%/*} || exit 1 # Run from this directory
echo "\n<--------------------------------------------------------------------->"
echo "1) Creating particles"

View File

@ -1,4 +1,5 @@
#!/bin/sh
set -e # Exit immediately if a command exits with a non-zero status
cd ${0%/*} || exit 1 # Run from this directory
echo "\n<--------------------------------------------------------------------->"
echo "1) Creating particles"

View File

@ -1,4 +1,5 @@
#!/bin/sh
set -e # Exit immediately if a command exits with a non-zero status
cd ${0%/*} || exit 1 # Run from this directory
echo "\n<--------------------------------------------------------------------->"
echo "1) Creating particles"

View File

@ -1,4 +1,5 @@
#!/bin/sh
set -e # Exit immediately if a command exits with a non-zero status
cd ${0%/*} || exit 1 # Run from this directory
echo "\n<--------------------------------------------------------------------->"
echo "1) Creating particles"

View File

@ -1,4 +1,5 @@
#!/bin/sh
set -e # Exit immediately if a command exits with a non-zero status
cd ${0%/*} || exit 1 # Run from this directory
echo "\n<--------------------------------------------------------------------->"
echo "1) Creating particles"

View File

@ -1,4 +1,5 @@
#!/bin/sh
set -e # Exit immediately if a command exits with a non-zero status
cd ${0%/*} || exit 1 # Run from this directory
echo "\n<--------------------------------------------------------------------->"
echo "1) Creating particles"

View File

@ -1,4 +1,5 @@
#!/bin/sh
set -e # Exit immediately if a command exits with a non-zero status
cd ${0%/*} || exit 1 # Run from this directory
echo "\n<--------------------------------------------------------------------->"
echo "1) Creating particles"

View File

@ -1,4 +1,5 @@
#!/bin/sh
set -e # Exit immediately if a command exits with a non-zero status
cd ${0%/*} || exit 1 # Run from this directory
echo "\n<--------------------------------------------------------------------->"
echo "1) Creating particles"

Some files were not shown because too many files have changed in this diff Show More