23 Commits

Author SHA1 Message Date
a3c3ca1b84 postprocess for segregation 2025-07-08 01:06:25 +03:30
94f892f06f runThiscase modified 2025-07-04 22:42:56 +03:30
e900128ee7 Merge branch 'main' of github.com:PhasicFlow/phasicFlow 2025-07-04 22:39:13 +03:30
75a0f311eb resources folder is created, runThisCase files have been updated 2025-07-04 22:38:15 +03:30
890dee4021 benchmarks for helical mixers
Update helicalMixer benchmarks
2025-07-04 08:24:04 +03:30
4ba301f9d0 Update helicalMixer benchmarks 2025-07-03 20:11:40 +08:00
d0c76e2fc4 updates for rectMesh in postprocess 2025-07-03 01:22:55 +03:30
c90f775156 rectMesh postProcess revisited 2025-07-01 18:18:53 +03:30
b7f051e099 Merge branch 'main' of github.com:PhasicFlow/phasicFlow 2025-06-29 23:21:35 +03:30
ae8ca0d41b benchmark helical mixer is added 2025-06-29 23:18:15 +03:30
9f17a79fbc Merge pull request #228 from wanqing0421/rectMesh
update rect mesh region for postprocess
2025-06-29 21:29:44 +03:30
be086ffb67 some modification for write rectMesh results in vtk format 2025-06-26 13:21:28 +08:00
a18936c8ec update rect mesh region for postprocess 2025-06-03 10:55:47 +08:00
21a7d0ab4d minor changes in readmd.md of postProcessing 2025-05-22 12:46:11 +03:30
c89a297e6f centerPoint enhanced & DEMsystem modified for id
- center points enhanced to select particle ids based on the particles located in box, sphere and cylinder
- readme.md modified
- DEMsystem is modified to pass id
2025-05-22 09:37:07 +03:30
832d1fb16b Merge branch 'main' of github.com:PhasicFlow/phasicFlow 2025-05-19 13:54:03 +03:30
e8ee35791f minor changes after MPI merge 2025-05-19 13:53:34 +03:30
a570432f84 Merge pull request #227 from wanqing0421/boxMesh
add box region for postprocess
2025-05-19 11:23:53 +03:30
0e4a041ffb Update volume boxRegionPoints.cpp 2025-05-19 11:21:26 +03:30
51c6f925d8 add box region 2025-05-18 21:50:37 +08:00
9fb8abb166 Merge branch 'main' of github.com:PhasicFlow/phasicFlow 2025-05-16 19:18:31 +03:30
90a8fff673 Merge pull request #226 from PhasicFlow/local-MPI
Local mpi
2025-05-16 19:17:24 +03:30
a05225ce53 Merge branch 'main' of github.com:PhasicFlow/phasicFlow 2025-05-16 19:15:17 +03:30
128 changed files with 44907 additions and 564 deletions

View File

@ -66,12 +66,13 @@ pFlow::uniquePtr<pFlow::DEMSystem>
word demSystemName,
const std::vector<box>& domains,
int argc,
char* argv[]
char* argv[],
bool requireRVel
)
{
if( wordvCtorSelector_.search(demSystemName) )
{
return wordvCtorSelector_[demSystemName] (demSystemName, domains, argc, argv);
return wordvCtorSelector_[demSystemName] (demSystemName, domains, argc, argv, requireRVel);
}
else
{

View File

@ -71,13 +71,15 @@ public:
word demSystemName,
const std::vector<box>& domains,
int argc,
char* argv[]
char* argv[],
bool requireRVel
),
(
demSystemName,
domains,
argc,
argv
argv,
requireRVel
));
realx3 g()const
@ -119,7 +121,10 @@ public:
span<const int32> parIndexInDomain(int32 domIndx)const = 0;
virtual
span<real> diameter() = 0;
span<real> diameter() = 0;
virtual
span<uint32> particleId() = 0;
virtual
span<real> courseGrainFactor() = 0;
@ -176,7 +181,8 @@ public:
word demSystemName,
const std::vector<box>& domains,
int argc,
char* argv[]);
char* argv[],
bool requireRVel=false);
};

View File

@ -163,6 +163,12 @@ pFlow::grainDEMSystem::parIndexInDomain(int32 di)const
return particleDistribution_->particlesInDomain(di);
}
pFlow::span<pFlow::uint32> pFlow::grainDEMSystem::particleId()
{
return span<uint32>(particleIdHost_.data(), particleIdHost_.size());
}
pFlow::span<pFlow::real> pFlow::grainDEMSystem::diameter()
{
return span<real>(diameterHost_.data(), diameterHost_.size());
@ -233,6 +239,7 @@ bool pFlow::grainDEMSystem::beforeIteration()
velocityHost_ = std::as_const(particles_()).velocity().hostView();
positionHost_ = std::as_const(particles_()).pointPosition().hostView();
diameterHost_ = particles_->diameter().hostView();
particleIdHost_ = particles_->particleId().hostView();
if(requireRVel_)
rVelocityHost_ = std::as_const(particles_()).rVelocity().hostView();

View File

@ -63,6 +63,8 @@ protected:
ViewType1D<real, HostSpace> diameterHost_;
ViewType1D<uint32, HostSpace> particleIdHost_;
bool requireRVel_ = false;
ViewType1D<realx3, HostSpace> rVelocityHost_;
@ -122,6 +124,8 @@ public:
span<const int32> parIndexInDomain(int32 di)const override;
span<uint32> particleId() override;
span<real> diameter() override;
span<real> courseGrainFactor() override;

View File

@ -165,6 +165,11 @@ pFlow::sphereDEMSystem::parIndexInDomain(int32 di)const
return particleDistribution_->particlesInDomain(di);
}
pFlow::span<pFlow::uint32> pFlow::sphereDEMSystem::particleId()
{
return span<uint32>();
}
pFlow::span<pFlow::real> pFlow::sphereDEMSystem::diameter()
{
return span<real>(diameterHost_.data(), diameterHost_.size());
@ -235,6 +240,7 @@ bool pFlow::sphereDEMSystem::beforeIteration()
velocityHost_ = std::as_const(particles_()).velocity().hostView();
positionHost_ = std::as_const(particles_()).pointPosition().hostView();
diameterHost_ = particles_->diameter().hostView();
particleIdHost_ = particles_->particleId().hostView();
if(requireRVel_)
rVelocityHost_ = std::as_const(particles_()).rVelocity().hostView();

View File

@ -63,6 +63,8 @@ protected:
ViewType1D<real, HostSpace> diameterHost_;
ViewType1D<uint32, HostSpace> particleIdHost_;
bool requireRVel_ = false;
ViewType1D<realx3, HostSpace> rVelocityHost_;
@ -122,6 +124,8 @@ public:
span<const int32> parIndexInDomain(int32 di)const override;
span<uint32> particleId() override;
span<real> diameter() override;
span<real> courseGrainFactor() override;

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

@ -26,7 +26,7 @@ bool pFlow::processorBoundarySphereParticles::acceleration(const timeInfo &ti, c
auto I = Particles().I().BoundaryField(thisIndex).neighborProcField().deviceView();
auto cf = Particles().contactForce().BoundaryField(thisIndex).neighborProcField().deviceView();
auto ct = Particles().contactTorque().BoundaryField(thisIndex).neighborProcField().deviceView();
auto acc = Particles().accelertion().BoundaryField(thisIndex).neighborProcField().deviceView();
auto acc = Particles().acceleration().BoundaryField(thisIndex).neighborProcField().deviceView();
auto rAcc = Particles().rAcceleration().BoundaryField(thisIndex).neighborProcField().deviceView();
Kokkos::parallel_for(

View File

@ -185,6 +185,18 @@ public:
return contactTorque_;
}
inline
uint32PointField_D& particleId()
{
return idHandler_();
}
inline
const uint32PointField_D& particleId() const
{
return idHandler_();
}
inline
uint32 maxId()const
{

View File

@ -9,9 +9,11 @@ set(SourceFiles
# Regions
region/regionPoints/regionPoints/regionPoints.cpp
region/regionPoints/sphereRegionPoints/sphereRegionPoints.cpp
region/regionPoints/boxRegionPoints/boxRegionPoints.cpp
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,18 +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.
## 1. Overview
### Important Notes
Postprocessing in phasicFlow allows you to:
* **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.
- 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
- Perform postprocessing at specific time intervals
* **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
@ -33,16 +31,28 @@ Postprocessing in phasicFlow allows you to:
- [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
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 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
@ -51,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
@ -61,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
@ -74,7 +83,6 @@ components
);
```
If you want to activate in-simulation postprocessing, you need to add these lines to the `settings/settingsDict` file:
```cpp
@ -83,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
@ -93,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.
@ -102,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
@ -118,12 +126,19 @@ Regions define where in the domain the postprocessing operations are applied:
| Region Type | Description | Required Parameters | Compatible with |
|-------------|-------------|---------------------|-----------------|
| `sphere` | A spherical region | `radius`, `center` | bulk |
| `multipleSpheres` | Multiple spherical regions | `centers`, `radii` | bulk |
| `line` | Spheres along a line with specified radius | `p1`, `p2`, `nSpheres`, `radius` | bulk |
| `centerPoints` | Specific particles selected by ID | `ids` | individual |
| `sphere` | A spherical region | `radius`, `center` defined in `sphereInfo` dict| bulk |
| `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 |
| `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
## 6. Processing Operations for Bulk Properties
Within each processing region of type `bulk`, you can define multiple operations to be performed:
@ -152,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}$$
@ -335,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
@ -447,15 +546,87 @@ components
processMethod particleProbe;
processRegion centerPoints;
selector id;
field component(position,y);
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).
// default behavior: if you do not specify it, parameters in defaultTimeControl is used.
}
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 10 s
endTime 10;
// execution interval of this compoenent
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
{
@ -565,5 +736,4 @@ components
}
);
```

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,52 @@
#include "boxRegionPoints.hpp"
#include "fieldsDataBase.hpp"
#include "numericConstants.hpp"
namespace pFlow::postprocessData
{
boxRegionPoints::boxRegionPoints
(
const dictionary &dict,
fieldsDataBase &fieldsDataBase
)
:
regionPoints(dict, fieldsDataBase),
boxRegion_(dict.subDict("boxInfo")),
volume_
(
(boxRegion_.maxPoint().x() - boxRegion_.minPoint().x()) *
(boxRegion_.maxPoint().y() - boxRegion_.minPoint().y()) *
(boxRegion_.maxPoint().z() - boxRegion_.minPoint().z())
),
diameter_(2 * pow(3 * volume_ / 4.0 / Pi, 1.0 / 3.0)),
selectedPoints_("selectedPoints")
{
}
bool boxRegionPoints::update()
{
const auto points = database().updatePoints();
selectedPoints_.clear();
for(uint32 i = 0; i < points.size(); ++i)
{
if( boxRegion_.isInside(points[i]))
{
selectedPoints_.push_back(i);
}
}
return true;
}
bool boxRegionPoints::write(iOstream &os) const
{
os <<"# Single box\n";
os <<"# min point: "<< boxRegion_.minPoint() <<endl;
os <<"# max point: "<< boxRegion_.maxPoint() << endl;
os <<"time"<< tab <<"value"<<endl;
return true;
}
} // End namespace pFlow::postprocessData

View File

@ -0,0 +1,171 @@
/*------------------------------- 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 boxRegionPoints.hpp
* @brief A class representing a box region for point selection
*
* This class provides functionality to select points within a box 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 box
* @see fieldsDataBase
*/
#ifndef __boxRegionPoints_hpp__
#define __boxRegionPoints_hpp__
#include "regionPoints.hpp"
#include "box.hpp"
#include "Vectors.hpp"
namespace pFlow::postprocessData
{
class boxRegionPoints
:
public regionPoints
{
private:
/// box object defining the region for point selection
box boxRegion_;
/// Volume of the box region
real volume_;
/// Diameter of the box region
real diameter_;
/// Indices of points that are selected by this region
uint32Vector selectedPoints_;
public:
TypeInfo(box::TYPENAME());
/**
* @brief Construct a box region for point selection
*
* @param dict Dictionary containing boxInfo dictionary
* @param fieldsDataBase Database containing fields data
*/
boxRegionPoints(
const dictionary& dict,
fieldsDataBase& fieldsDataBase);
/// Destructor
~boxRegionPoints() override = default;
/**
* @brief Get the number of regions (always 1 for box)
* @return Always returns 1
*/
uint32 size()const override
{
return 1;
}
/**
* @brief Check if the region is empty
* @return Always returns false
*/
bool empty()const override
{
return false;
}
/**
* @brief Get the volume of the box region
* @return A span containing the volume of the region
*/
span<const real> volumes()const override
{
return span<const real>(&volume_, 1);
}
/**
* @brief Get the equivalent diameter of the box region
* @return A span containing the diameter of the region
*/
span<const real> eqDiameters()const override
{
return span<const real>(&diameter_, 1);
}
/**
* @brief Get the center of the box region
* @return A span containing the center point of the region
*/
span<const realx3> centers()const override
{
realx3 center = 0.5 * (boxRegion_.minPoint() + boxRegion_.maxPoint());
return span<const realx3>(&center, 1);
}
/**
* @brief Get the indices of points within the region (const version)
* @param elem Element index (ignored as there's only one box)
* @return A span containing indices of points within the region
*/
span<const uint32> indices(uint32 elem)const override
{
return span<const uint32>(selectedPoints_.data(), selectedPoints_.size());
}
/**
* @brief Get the indices of points within the region (non-const version)
* @param elem Element index (ignored as there's only one box)
* @return A span containing indices of points within the region
*/
span<uint32> indices(uint32 elem) override
{
return span<uint32>(selectedPoints_.data(), selectedPoints_.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
* @return Always returns true
*/
bool writeToSameTimeFile()const override
{
return true;
}
/**
* @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 // __boxRegionPoints_hpp__

View File

@ -8,6 +8,8 @@ namespace pFlow::postprocessData
bool centerPointsRegionPoints::selectIds()
{
// check if it is already found the ids of particles
// if not, then find the ids of particles
if(!firstTimeUpdate_) return true;
firstTimeUpdate_ = false;
@ -26,16 +28,20 @@ bool centerPointsRegionPoints::selectIds()
}
}
else
// TODO: this should be corrected to select ids of particles
// that are selected based on the selector (this is visa versa)
{
auto selectorPtr = pStructSelector::create(
selector,
database().pStruct(),
probDict_.subDict(selector+"Info"));
auto selectedPoints = selectorPtr->selectedPoints();
ids_.resize(selectedPoints.size());
ids_.assign(selectedPoints.begin(), selectedPoints.end());
const auto& idField = database().updateFieldUint32(idName_);
ids_.clear();
ids_.reserve(selectedPoints.size());
for( auto& pntIndex: selectedPoints)
{
ids_.push_back(idField[pntIndex]);
}
}
volume_.resize(ids_.size(),1.0);
@ -62,11 +68,12 @@ bool centerPointsRegionPoints::update()
const auto& idField = database().updateFieldUint32(idName_);
selectedPoints_.fill(-1);
for(uint32 i = 0; i < idField.size(); ++i)
for( uint32 j=0; j< ids_.size(); ++j)
{
for( uint32 j=0; j< ids_.size(); ++j)
auto id = ids_[j];
for( uint32 i=0; i< idField.size(); i++)
{
if(idField[i] == ids_[j])
if(idField[i] == id)
{
selectedPoints_[j] = i;
break;

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

@ -36,15 +36,87 @@ components
processMethod particleProbe;
processRegion centerPoints;
selector id;
field component(position,y);
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).
// default behavior: if you do not specify it, parameters in defaultTimeControl is used.
}
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 10 s
endTime 10;
// execution interval of this compoenent
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
{
@ -105,7 +177,7 @@ components
{
function sum;
field one;
phi one;
phi one;
divideByVolume yes;
}
@ -124,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

@ -16,7 +16,7 @@ template class pFlow::MPI::dataIOMPI<pFlow::uint32x3>;
template class pFlow::MPI::dataIOMPI<pFlow::uint64>;
template class pFlow::MPI::dataIOMPI<pFlow::size_t>;
//template class pFlow::MPI::dataIOMPI<pFlow::size_t>;
template class pFlow::MPI::dataIOMPI<pFlow::real>;

View File

@ -24,9 +24,9 @@ Licence:
#include "scatteredMasterDistribute.hpp"
#include "scatteredMasterDistributeChar.hpp"
pFlow::MPI::MPISimulationDomain::MPISimulationDomain(systemControl& control)
pFlow::MPI::MPISimulationDomain::MPISimulationDomain(systemControl& control, real maxBSphere)
:
simulationDomain(control),
simulationDomain(control, maxBSphere),
communication_(pFlowProcessors()),
subDomainsAll_(pFlowProcessors()),
numPointsAll_(pFlowProcessors()),

View File

@ -61,7 +61,7 @@ public:
TypeInfo("simulationDomain<MPI>");
explicit MPISimulationDomain(systemControl& control);
explicit MPISimulationDomain(systemControl& control, real maxBSphere);
~MPISimulationDomain() final = default;

View File

@ -47,7 +47,7 @@ pFlow::MPI::processorBoundaryField<T, MemorySpace>::updateBoundary(
)
{
#ifndef BoundaryModel1
if(!this->boundary().performBoundarytUpdate())
if(!this->boundary().performBoundaryUpdate())
return true;
#endif
@ -128,21 +128,19 @@ const typename pFlow::MPI::processorBoundaryField<T, MemorySpace>::
template<class T, class MemorySpace>
bool pFlow::MPI::processorBoundaryField<T, MemorySpace>::hearChanges(
real t,
real dt,
uint32 iter,
const timeInfo & ti,
const message& msg,
const anyList& varList
)
{
BoundaryFieldType::hearChanges(t,dt,iter, msg,varList);
if(msg.equivalentTo(message::BNDR_PROC_SIZE_CHANGED))
{
auto newProcSize = varList.getObject<uint32>("size");
auto newProcSize = varList.getObject<uint32>(
message::eventName(message::BNDR_PROC_SIZE_CHANGED));
neighborProcField_.resize(newProcSize);
}
if(msg.equivalentTo(message::BNDR_PROCTRANSFER_SEND))
else if(msg.equivalentTo(message::BNDR_PROCTRANSFER_SEND))
{
const auto& indices = varList.getObject<uint32Vector_D>(
message::eventName(message::BNDR_PROCTRANSFER_SEND)
@ -169,7 +167,6 @@ bool pFlow::MPI::processorBoundaryField<T, MemorySpace>::hearChanges(
thisFieldInNeighbor_.sendData(pFlowProcessors(),transferData);
}
}
else if(msg.equivalentTo(message::BNDR_PROCTRANSFER_RECIEVE))
{
@ -182,30 +179,38 @@ bool pFlow::MPI::processorBoundaryField<T, MemorySpace>::hearChanges(
{
uint32 numRecieved = neighborProcField_.waitBufferForUse();
if(msg.equivalentTo(message::CAP_CHANGED))
if(numRecieved == 0u)
{
auto newCap = varList.getObject<uint32>(
message::eventName(message::CAP_CHANGED));
this->internal().field().reserve(newCap);
return true;
}
if(msg.equivalentTo(message::SIZE_CHANGED))
if(msg.equivalentTo(message::RANGE_CHANGED))
{
auto newSize = varList.getObject<uint32>(
message::eventName(message::SIZE_CHANGED));
this->internal().field().resize(newSize);
auto newRange = varList.getObject<rangeU32>(
message::eventName(message::RANGE_CHANGED));
this->internal().field().resize(newRange.end());
}
const auto& indices = varList.getObject<uint32IndexContainer>(
message::eventName(message::ITEM_INSERT));
this->internal().field().insertSetElement(indices, neighborProcField_.buffer().deviceView());
return true;
if(msg.equivalentTo(message::ITEMS_INSERT))
{
const auto& indices = varList.getObject<uint32IndexContainer>(
message::eventName(message::ITEMS_INSERT));
this->internal().field().insertSetElement(
indices,
neighborProcField_.buffer().deviceView());
}
}
else
{
if(!BoundaryFieldType::hearChanges(ti, msg,varList) )
{
return false;
}
}
return true;
}
template <class T, class MemorySpace>
void pFlow::MPI::processorBoundaryField<T, MemorySpace>::sendBackData() const

View File

@ -91,9 +91,7 @@ public:
}
bool hearChanges(
real t,
real dt,
uint32 iter,
const timeInfo & ti,
const message& msg,
const anyList& varList
) override;

View File

@ -83,15 +83,15 @@ pFlow::MPI::boundaryProcessor::beforeIteration(
else if(step == 2 )
{
#ifdef BoundaryModel1
callAgain = true;
#else
if(!performBoundarytUpdate())
{
callAgain = false;
return true;
}
#endif
#ifdef BoundaryModel1
callAgain = true;
#else
if(!performBoundaryUpdate())
{
callAgain = false;
return true;
}
#endif
thisNumPoints_ = size();
@ -136,7 +136,7 @@ pFlow::MPI::boundaryProcessor::beforeIteration(
varList.emplaceBack(msg.addAndName(message::BNDR_PROC_SIZE_CHANGED), neighborProcNumPoints_);
if( !notify(ti.iter(), ti.t(), ti.dt(), msg, varList) )
if( !notify(ti, msg, varList) )
{
fatalErrorInFunction;
callAgain = false;
@ -343,8 +343,9 @@ bool pFlow::MPI::boundaryProcessor::transferData(
neighborProcPoints_.waitBufferForUse();
internal().insertPointsOnly(neighborProcPoints_.buffer(), msg, varList);
const auto& indices = varList.getObject<uint32IndexContainer>(message::eventName(message::ITEM_INSERT));
const auto& indices = varList.getObject<uint32IndexContainer>(message::eventName(message::ITEMS_INSERT));
// creates a view (does not copy data)
auto indView = deviceViewType1D<uint32>(indices.deviceView().data(), indices.deviceView().size());
uint32Vector_D newIndices("newIndices", indView);
@ -356,7 +357,7 @@ bool pFlow::MPI::boundaryProcessor::transferData(
return false;
}
const auto ti = internal().time().TimeInfo();
const auto& ti = internal().time().TimeInfo();
if(!notify(ti, msg, varList))
{
fatalErrorInFunction;

View File

@ -114,8 +114,8 @@ public:
return true;
}
fatalErrorInFunction<<"Event"<< msg.eventNames()<<"with code "<< msg <<
" is not handled in boundaryField."<<endl;
fatalErrorInFunction<<"Event "<< msg.eventNames()<<" with code "<< msg <<
" is not handled in boundaryField "<< name()<<endl;
return false;
}

View File

@ -223,7 +223,7 @@ bool pFlow::internalField<T, MemorySpace>:: hearChanges
else
{
fatalErrorInFunction<<"hear changes in internal field is not processing "<<
message::eventName(message::RANGE_CHANGED)<<
msg.eventNames()<<
" event with message code "<< msg<<endl;
return false;
}

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

@ -25,8 +25,8 @@ template class pFlow::dataIORegular<pFlow::uint32x3>;
template class pFlow::dataIO<pFlow::uint64>;
template class pFlow::dataIORegular<pFlow::uint64>;
template class pFlow::dataIO<size_t>;
template class pFlow::dataIORegular<size_t>;
//template class pFlow::dataIO<size_t>;
//template class pFlow::dataIORegular<size_t>;
template class pFlow::dataIO<pFlow::real>;
template class pFlow::dataIORegular<pFlow::real>;

View File

@ -246,7 +246,7 @@ public:
/// Is this iter the right time for updating bounday list
inline
bool performBoundarytUpdate()const
bool performBoundaryUpdate()const
{
return updateTime_;
}

View File

@ -60,7 +60,7 @@ bool pFlow::boundaryExit::beforeIteration
{
callAgain = false;
if( !performBoundarytUpdate())
if( !performBoundaryUpdate())
{
return true;
}

View File

@ -60,7 +60,7 @@ bool pFlow::boundaryPeriodic::beforeIteration(
return true;
}
//output<<this->thisBoundaryIndex()<<" ->"<<ti.iter()<<" update called\n";
if(!performBoundarytUpdate())
if(!performBoundaryUpdate())
{
return true;
}

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