70 Commits

Author SHA1 Message Date
e62ba11a8d Merge pull request #238 from wanqing0421/main
fixed the error when insert particles from file with integer number
2025-07-17 20:52:19 +03:30
1b949e9eda Merge pull request #239 from wanqing0421/benchmarks
update results snapshot
2025-07-17 20:51:04 +03:30
9257823b7e Merge branch 'PhasicFlow:main' into benchmarks 2025-07-17 21:26:00 +08:00
35b32db30e Merge branch 'benchmarks' of https://github.com/wanqing0421/phasicFlow-dev into benchmarks 2025-07-17 20:26:40 +08:00
67559d5c6e update results snapshot 2025-07-17 20:25:34 +08:00
3cc3792e08 fixed the error when insert particles from file with integer number 2025-07-17 16:57:05 +08:00
b1ec396a1b updates on benchmarks readme files 2025-07-17 00:15:23 +03:30
a74e38bbec Merge pull request #236 from wanqing0421/benchmarks
update the performance curve figure
2025-07-16 08:44:21 +03:30
26bbdd3dce Merge branch 'PhasicFlow:main' into benchmarks 2025-07-15 22:29:39 +08:00
73ea794687 update the performance curve figure 2025-07-15 22:29:06 +08:00
1b557c8514 Merge pull request #234 from wanqing0421/benchmarks
update helical mixer benchmarks results
2025-07-14 13:31:54 +03:30
b2cfb57c82 update helical mixer benchmarks results 2025-07-13 16:49:57 +08:00
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
0053ef002a CMakeList modified for automatic compile of Zoltan 2025-05-16 18:55:25 +03:30
ad5233bb77 Merge branch 'main' into local-MPI 2025-05-16 10:10:46 +03:30
d7479cf1bd Zoltan is added as thirdParty package 2025-05-15 21:58:43 +03:30
83a6e4baa1 Merge branch 'main' of github.com:PhasicFlow/phasicFlow 2025-05-15 12:01:40 +03:30
bf0197f643 change in the type name of timeValue and sample dictionaries for settingsDict and domain 2025-05-15 12:00:13 +03:30
5a149f3d85 Merge pull request #224 from wanqing0421/postMesh
fixed the cuda bug
2025-05-15 03:35:08 +03:30
80df6bfc9b fixed the cuda bug 2025-05-11 02:29:28 +08:00
14731a6c31 This is the first merge from main into MPI branch
Merge branch 'main' into local-MPI
2025-05-03 16:40:46 +03:30
3d0f31a2b2 Merge pull request #3 from hamidrezanorouzi/MPIdev
Mp idev
2024-11-22 22:40:25 +03:30
HRN
ba8f307c56 Code recovery MPI part 2024-10-18 23:10:42 +03:30
HRN
f317cef0ef Merge branch 'develop' into MPIdev after first commit after code loss 2024-09-21 13:39:17 +03:30
HRN
93617a6ee5 MPI developement zeroTime 2024-08-07 15:13:15 +03:30
HRN
d7e6292e41 Merge branch 'develop' into MPIdev 2024-05-24 20:51:13 +03:30
HRN
5a25556b8a changing blocking-recive to non-blocking (in boundaryProcessor) to improve MPI run 2024-05-24 00:10:15 +03:30
HRN
a0c51e94e1 Merge branch 'develop' into MPIdev 2024-05-23 22:04:47 +03:30
74c281617b Merge pull request #2 from hamidrezanorouzi/MPIdev
Mp idev
2024-05-22 10:08:38 +03:30
d2003b35e6 bug fix to work with CUDA run 2024-05-22 09:52:48 +03:30
e05bd2c350 Merge branch 'develop' into MPIdev 2024-05-18 19:14:01 +03:30
HRN
665879f8ca Data transfer between processors
- Data transfer is done
- contact search at processor boundary is done
- contact force calculation at processor boundary is done
- tests have been done on rotating drum using serial and openMP
2024-05-12 19:06:53 +03:30
HRN
e756d471ba Merge branch 'develop' into MPIdev 2024-05-05 23:07:48 +03:30
30d5349fcf Merge pull request #1 from hamidrezanorouzi/MPIdev
Mp idev
2024-05-05 23:02:16 +03:30
HRN
68b7d141fa boundaryProcessor -> transferData
- point data is being transferred (no notification yet).
- field data should be transferred
2024-05-05 22:54:12 +03:30
HRN
525e972c20 Merge branch 'develop' into MPIdev 2024-05-05 18:46:33 +03:30
HRN
6f48eca95b The problem with memory leak in MPI data transfer fixed and tested. 2024-04-30 00:28:29 +03:30
HRN
b5a81bc0fc Merge branch 'MPI' of github.com:hamidrezanorouzi/phasicFlowMPI into MPIdev 2024-04-28 19:13:54 +03:30
d0798dfc0b clean up of un-used codes 2024-04-27 09:11:09 -07:00
729c088c9f Merge branch 'develop' into MPI 2024-04-27 09:05:49 -07:00
6241fa6dd3 MPI particle id handler 2024-04-27 08:59:13 -07:00
5f90605a41 MPI-boundaries for processor 2024-04-27 08:55:00 -07:00
94fcc3d01b MPI devleopment with boundaries for contact search and data communication, memory leak 2024-04-27 08:44:35 -07:00
1321e6340e Merge branch 'develop' into MPI 2024-04-20 06:16:28 -07:00
5864cea7e8 Merge branch 'develop' into MPI
- This is the merge from develop branch to get latest update from the this branch to start MPI developemet.
- This stage boundaries and data exchange between processors through boundaries are handled.
2024-04-18 10:19:19 -07:00
656e03de36 bug fix for empty domains in partitioning (tested) 2024-01-21 13:23:45 -08:00
41187b0e03 Merge branch 'develop' into MPI 2024-01-20 12:34:26 -08:00
6969b71cc5 MPI code 2024-01-20 11:30:49 -08:00
3594 changed files with 369448 additions and 707 deletions

8
.gitignore vendored
View File

@ -37,11 +37,15 @@
*.out *.out
*.app *.app
# directories # Exclude specific directories wherever they appear
build/** build/**
include/** include/**
bin/** bin/**
lib/** lib/**
**/build/
**/include/
**/bin/
**/lib/
test*/** test*/**
**/**notnow **/**notnow
doc/code-documentation/ doc/code-documentation/
@ -61,3 +65,5 @@ doc/DTAGS
**/[0-9]*.[0-9][0-9][0-9][0-9][0-9][0-9][0-9] **/[0-9]*.[0-9][0-9][0-9][0-9][0-9][0-9][0-9]
**/[0-9]*.[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9] **/[0-9]*.[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]
**/VTK **/VTK

View File

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

View File

@ -71,13 +71,15 @@ public:
word demSystemName, word demSystemName,
const std::vector<box>& domains, const std::vector<box>& domains,
int argc, int argc,
char* argv[] char* argv[],
bool requireRVel
), ),
( (
demSystemName, demSystemName,
domains, domains,
argc, argc,
argv argv,
requireRVel
)); ));
realx3 g()const realx3 g()const
@ -96,7 +98,7 @@ public:
return Control_(); return Control_();
} }
auto inline constexpr usingDoulle()const auto inline constexpr usingDouble()const
{ {
return pFlow::usingDouble__; return pFlow::usingDouble__;
} }
@ -119,7 +121,10 @@ public:
span<const int32> parIndexInDomain(int32 domIndx)const = 0; span<const int32> parIndexInDomain(int32 domIndx)const = 0;
virtual virtual
span<real> diameter() = 0; span<real> diameter() = 0;
virtual
span<uint32> particleId() = 0;
virtual virtual
span<real> courseGrainFactor() = 0; span<real> courseGrainFactor() = 0;
@ -176,7 +181,8 @@ public:
word demSystemName, word demSystemName,
const std::vector<box>& domains, const std::vector<box>& domains,
int argc, 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); 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() pFlow::span<pFlow::real> pFlow::grainDEMSystem::diameter()
{ {
return span<real>(diameterHost_.data(), diameterHost_.size()); return span<real>(diameterHost_.data(), diameterHost_.size());
@ -233,6 +239,7 @@ bool pFlow::grainDEMSystem::beforeIteration()
velocityHost_ = std::as_const(particles_()).velocity().hostView(); velocityHost_ = std::as_const(particles_()).velocity().hostView();
positionHost_ = std::as_const(particles_()).pointPosition().hostView(); positionHost_ = std::as_const(particles_()).pointPosition().hostView();
diameterHost_ = particles_->diameter().hostView(); diameterHost_ = particles_->diameter().hostView();
particleIdHost_ = particles_->particleId().hostView();
if(requireRVel_) if(requireRVel_)
rVelocityHost_ = std::as_const(particles_()).rVelocity().hostView(); rVelocityHost_ = std::as_const(particles_()).rVelocity().hostView();

View File

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

View File

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

View File

@ -63,6 +63,8 @@ protected:
ViewType1D<real, HostSpace> diameterHost_; ViewType1D<real, HostSpace> diameterHost_;
ViewType1D<uint32, HostSpace> particleIdHost_;
bool requireRVel_ = false; bool requireRVel_ = false;
ViewType1D<realx3, HostSpace> rVelocityHost_; ViewType1D<realx3, HostSpace> rVelocityHost_;
@ -122,6 +124,8 @@ public:
span<const int32> parIndexInDomain(int32 di)const override; span<const int32> parIndexInDomain(int32 di)const override;
span<uint32> particleId() override;
span<real> diameter() override; span<real> diameter() override;
span<real> courseGrainFactor() 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 | | phasicFlow File |
| copyright: www.cemf.ir | | copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */ \* ------------------------------------------------------------------------- */
objectName interaction; objectName interaction;
objectType dicrionary; objectType dicrionary;
fileFormat ASCII;
/*---------------------------------------------------------------------------*/
materials (glassMat wallMat); // a list of materials names materials (glassMat wallMat); // a list of materials names
densities (2500.0 2500); // density of materials [kg/m3] densities (2500.0 2500); // density of materials [kg/m3]
contactListType sortedContactList; contactListType sortedContactList;
model model
{ {
contactForceModel nonLinearLimited; contactForceModel nonLinearLimited;
rollingFrictionModel normal; rollingFrictionModel normal;
Yeff (1.0e6 1.0e6 // Young modulus [Pa] Yeff (1.0e6 1.0e6 // Young modulus [Pa]
@ -28,9 +31,6 @@ model
en (0.97 0.85 // coefficient of normal restitution en (0.97 0.85 // coefficient of normal restitution
1.00); 1.00);
et (1.0 1.0 // coefficient of tangential restitution
1.0);
mu (0.65 0.65 // dynamic friction mu (0.65 0.65 // dynamic friction
0.65); 0.65);
@ -41,19 +41,13 @@ model
contactSearch contactSearch
{ {
method NBS; method NBS;
wallMapping cellMapping;
NBSInfo updateInterval 10;
{
updateFrequency 10; // each 20 timesteps, update neighbor list
sizeRatio 1.1; // bounding box size to particle diameter (max)
}
cellMappingInfo sizeRatio 1.1;
{
updateFrequency 10; // each 20 timesteps, update neighbor list
cellExtent 0.6; // bounding box for particle-wall search (> 0.5)
}
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 | | phasicFlow File |
| copyright: www.cemf.ir | | copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */ \* ------------------------------------------------------------------------- */
objectName particleInsertion; objectName shapes;
objectType dicrionary; objectType dictionary;
fileFormat ASCII; fileFormat ASCII;
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
active no; // is insertion active? names (smallParticle largeParticle); // names of shapes
diameters (0.004 0.00401); // diameter of shapes
collisionCheck No; // not implemented for yes 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 ls | grep -P "^(([0-9]+\.?[0-9]*)|(\.[0-9]+))$" | xargs -d"\n" rm -rf
rm -rf VTK 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 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 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 #!/bin/sh
set -e # Exit immediately if a command exits with a non-zero status
cd ${0%/*} || exit 1 # Run from this directory 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 "\n<--------------------------------------------------------------------->"
echo "1) Creating particles" echo "1) Creating particles"
echo "<--------------------------------------------------------------------->\n" echo "<--------------------------------------------------------------------->\n"
@ -18,6 +25,6 @@ sphereGranFlow
echo "\n<--------------------------------------------------------------------->" echo "\n<--------------------------------------------------------------------->"
echo "4) Converting to VtK" echo "4) Converting to VtK"
echo "<--------------------------------------------------------------------->\n" 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 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 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 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 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 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

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 KiB

View File

@ -1 +1,101 @@
# Helical Mixer Benchmark (phasicFlow v-1.0) # Helical Mixer Benchmark (phasicFlow v-1.0)
## Overview
This benchmark compares the performance of phasicFlow with a well-stablished commercial DEM software for simulating a helical mixer with varying particle counts (250k to 4M particles). The benchmark measures both computational efficiency and memory usage across different hardware configurations.
**Summary of Results:**
- phasicFlow achieves similar performance to the commercial DEM software on the same hardware.
- phasicFlow shows a 30% performance improvement when using the NVIDIA RTX A4000 compared to the RTX 4050Ti.
- Memory usage is approximately 50% lower in phasicFlow compared to the commercial software, with phasicFlow using about 0.7 GB of memory per million particles, while the commercial software uses about 1.5 GB per million particles.
## Simulation Setup
<div align="center">
<img src="./images/commericalDEMsnapshot.png"/>
<div align="center">
<p>Figure 1. Commercial DEM simulation snapshot</p>
</div>
</div>
<div align="center">
<img src="./images/phasicFlow_snapshot.png"/>
<div align="center">
<p>Figure 2. phasicFlow simulation snapshot and visualized using Paraview</p>
</div>
</div>
### Hardware Specifications
<div align="center">
Table 1. Hardware specifications used for benchmarking.
</div>
| System | CPU | GPU | Operating System |
| :---------: | :----------------------: | :--------------------------: | :--------------: |
| Laptop | Intel i9-13900HX 2.2 GHz | NVIDIA GeForce RTX 4050Ti 6G | Windows 11 24H2 |
| Workstation | Intel Xeon 4210 2.2 GHz | NVIDIA RTX A4000 16G | Ubuntu 22.04 |
### Simulation Parameters
<div align="center">
Table 2. Parameters for helical mixer simulations.
</div>
| Case | Particle Diameter | Particle Count |
| :-------: | :---------------: | :--------------: |
| 250k | 6 mm | 250,000 |
| 500k | 5 mm | 500,000 |
| 1M | 4 mm | 1,000,000 |
| 2M | 3 mm | 2,000,000 |
| 4M | 2 mm | 4,000,000 |
The time step for all simulations was set to 1.0e-5 seconds and the simulation ran for 7.5 seconds.
## Performance Comparison
### Execution Time
<div align="center">
Table 3. Total calculation time (minutes) for different configurations.
</div>
| Software | 250k | 500k | 1M | 2M | 4M |
| :---------------: | :----: | :-----: | :-----: | :-----: | :-----: |
| phasicFlow-4050Ti | 110 min | 215 min | 413 min | - | - |
| Commercial DEM-4050Ti | 111 min | 210 min | 415 min | - | - |
| phasicFlow-A4000 | 82 min | 150 min | 300 min | 613 min | 1236 min |
The execution time scales linearly with particle count. phasicFlow demonstrates approximately:
- the computing speed is basically the same as well-established commercial DEM software on the same hardware
- 30% performance improvement when using the NVIDIA RTX A4000 compared to the RTX 4050Ti
<div align="center">
<img src="./images/performance.png"/>
<p>Figure 3. Calculation time comparison between phasicFlow and the well-established commercial DEM software.</p>
</div>
### Memory Usage
<div align="center">
Table 4. Memory consumption for different configurations.
</div>
| Software | 250k | 500k | 1M | 2M | 4M |
| :---------------: | :-----: | :-----: | :-----: | :-----: | :-----: |
| phasicFlow-4050Ti | 260 MB | 404 MB | 710 MB | - | - |
| Commercial DEM-4050Ti | 460 MB | 920 MB | 1574 MB | - | - |
| phasicFlow-A4000 | 352 MB | 496 MB | 802 MB | 1376 MB | 2310 MB |
Memory efficiency comparison:
- phasicFlow uses approximately 0.7 GB of memory per million particles
- Commercial DEM software uses approximately 1.5 GB of memory per million particles
- phasicFlow shows ~50% lower memory consumption compared to the commercial alternative
- The memory usage scales linearly with particle count in both software packages. But due to memory limitations on GPUs, it is possible to run larger simulation on GPUs with phasicFlow.
## Run Your Own Benchmarks
The simulation case setup files are available in this folder for users interested in performing similar benchmarks on their own hardware. These files can be used to reproduce the tests and compare performance across different systems.

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,7 +1,9 @@
# Benchmarks # Benchmarks
Benchmakrs has been done on two different simulations: a simulation with simple geometry (rotating drum) and a simulation with complex geometry (helical mixer). Benchmakrs has been done on two different simulations: simulation with simple geometry (rotating drum) and a simulation with complex geometry (helical mixer). These benchmarks are used to show how PhasicFlow performs in different scenarios.
- [rotating drum](./rotatingDrum/readme.md) - [rotating drum](./rotatingDrum/)
- [helical mixer](./helicalMixer/readme.md) - [helical mixer](./helicalMixer/)
**Note:** If you have performed benchmarks with PhasicFlow using other hardware or software other than PhasicFlow, we would be happy to include them in this section. Please open an issue for more arrangements or send a pull request with the benchmarks results.

View File

@ -4,6 +4,12 @@
This benchmark compares the performance of phasicFlow with a well-stablished commercial DEM software for simulating a rotating drum with varying particle counts (250k to 8M particles). The benchmark measures both computational efficiency and memory usage across different hardware configurations. This benchmark compares the performance of phasicFlow with a well-stablished commercial DEM software for simulating a rotating drum with varying particle counts (250k to 8M particles). The benchmark measures both computational efficiency and memory usage across different hardware configurations.
**Summary of Results:**
- phasicFlow achieves approximately 20% faster calculation than the commercial DEM software on the same hardware.
- phasicFlow shows a 30% performance improvement when using the NVIDIA RTX A4000 compared to the RTX 4050Ti.
- Memory usage is approximately 42% lower in phasicFlow compared to the commercial software, with phasicFlow using about 0.7 GB of memory per million particles, while the commercial software uses about 1.2 GB per million particles
## Simulation Setup ## Simulation Setup
<div align="center"> <div align="center">

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -19,7 +19,7 @@ export pFlow_SRC_DIR="$pFlow_PROJECT_DIR/src"
export Kokkos_DIR="$kokkosDir" export Kokkos_DIR="$kokkosDir"
export Zoltan_DIR="$projectDir/Zoltan" #export Zoltan_DIR="$projectDir/Zoltan"
# Cleanup variables (done as final statement for a clean exit code) # Cleanup variables (done as final statement for a clean exit code)
unset projectDir unset projectDir

View File

@ -0,0 +1,44 @@
# Macro to check for Zoltan installation and build it if needed
# Usage: zoltan_find_or_build(ZOLTAN_DIR)
# Returns: ZOLTAN_INCLUDE_DIR, ZOLTAN_LIBRARY
macro(zoltan_find_or_build ZOLTAN_DIR)
# Set the Zoltan directory
set(ZOLTAN_PREFIX "${ZOLTAN_DIR}" CACHE STRING "Zoltan install directory")
message(STATUS "Zoltan install directory is ${ZOLTAN_PREFIX}")
# Check if the Zoltan library is already built
find_path(ZOLTAN_INCLUDE_DIR zoltan.h PATHS "${ZOLTAN_PREFIX}/include")
message(STATUS "Zoltan include path: ${ZOLTAN_INCLUDE_DIR}")
find_library(ZOLTAN_LIBRARY zoltan PATHS "${ZOLTAN_PREFIX}/lib")
message(STATUS "Zoltan lib path: ${ZOLTAN_LIBRARY}")
# Check if Zoltan library exists, if not compile it using buildlib script
if(NOT ZOLTAN_LIBRARY)
message(STATUS "Zoltan library not found. Compiling from source using buildlib script...")
# Execute the buildlib bash script
execute_process(
COMMAND bash ${ZOLTAN_PREFIX}/buildlib
WORKING_DIRECTORY ${ZOLTAN_PREFIX}
RESULT_VARIABLE ZOLTAN_BUILD_RESULT
OUTPUT_VARIABLE ZOLTAN_BUILD_OUTPUT
ERROR_VARIABLE ZOLTAN_BUILD_ERROR
)
if(NOT ZOLTAN_BUILD_RESULT EQUAL 0)
message(FATAL_ERROR "Failed to build Zoltan library using buildlib script. Error: ${ZOLTAN_BUILD_ERROR}")
endif()
# Try to find the library again after building
find_library(ZOLTAN_LIBRARY zoltan PATHS "${ZOLTAN_PREFIX}/lib" NO_DEFAULT_PATH)
find_path(ZOLTAN_INCLUDE_DIR zoltan.h PATHS "${ZOLTAN_PREFIX}/include" NO_DEFAULT_PATH)
if(NOT ZOLTAN_LIBRARY)
message(FATAL_ERROR "Failed to locate Zoltan library after building")
endif()
message(STATUS "Successfully built Zoltan library at ${ZOLTAN_LIBRARY}")
endif()
endmacro()

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,71 @@
#include "processorAB2BoundaryIntegration.hpp"
#include "AdamsBashforth2.hpp"
#include "AB2Kernels.hpp"
#include "boundaryConfigs.hpp"
pFlow::processorAB2BoundaryIntegration::processorAB2BoundaryIntegration(
const boundaryBase &boundary,
const pointStructure &pStruct,
const word &method,
integration& intgrtn
)
:
boundaryIntegration(boundary, pStruct, method, intgrtn)
{}
bool pFlow::processorAB2BoundaryIntegration::correct(
real dt,
const realx3PointField_D& y,
const realx3PointField_D& dy
)
{
#ifndef BoundaryModel1
if(this->isBoundaryMaster())
{
const uint32 thisIndex = thisBoundaryIndex();
const auto& AB2 = static_cast<const AdamsBashforth2&>(Integration());
const auto& dy1View = AB2.BoundaryField(thisIndex).neighborProcField().deviceView();
const auto& dyView = dy.BoundaryField(thisIndex).neighborProcField().deviceView();
const auto& yView = y.BoundaryField(thisIndex).neighborProcField().deviceView();
const rangeU32 aRange(0u, dy1View.size());
return AB2Kernels::intAllActive(
"AB2Integration::correct."+this->boundaryName(),
dt,
aRange,
yView,
dyView,
dy1View
);
}
#endif //BoundaryModel1
return true;
}
bool pFlow::processorAB2BoundaryIntegration::correctPStruct(real dt, const realx3PointField_D &vel)
{
#ifndef BoundaryModel1
if(this->isBoundaryMaster())
{
const uint32 thisIndex = thisBoundaryIndex();
const auto& AB2 = static_cast<const AdamsBashforth2&>(Integration());
const auto& dy1View = AB2.BoundaryField(thisIndex).neighborProcField().deviceView();
const auto& velView = vel.BoundaryField(thisIndex).neighborProcField().deviceView();
const auto& xposView = boundary().neighborProcPoints().deviceView();
const rangeU32 aRange(0u, dy1View.size());
return AB2Kernels::intAllActive(
"AB2Integration::correctPStruct."+this->boundaryName(),
dt,
aRange,
xposView,
velView,
dy1View
);
}
#endif //BoundaryModel1
return true;
}

View File

@ -0,0 +1,51 @@
#ifndef __processorAB2BoundaryIntegration_hpp__
#define __processorAB2BoundaryIntegration_hpp__
#include "boundaryIntegration.hpp"
namespace pFlow
{
class processorAB2BoundaryIntegration
:
public boundaryIntegration
{
public:
TypeInfo("boundaryIntegration<processor,AdamsBashforth2>");
processorAB2BoundaryIntegration(
const boundaryBase& boundary,
const pointStructure& pStruct,
const word& method,
integration& intgrtn
);
~processorAB2BoundaryIntegration()override=default;
bool correct(
real dt,
const realx3PointField_D& y,
const realx3PointField_D& dy)override;
bool correctPStruct(real dt, const realx3PointField_D& vel)override;
add_vCtor(
boundaryIntegration,
processorAB2BoundaryIntegration,
boundaryBase
);
};
}
#endif

View File

@ -0,0 +1,111 @@
/*------------------------------- 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.
-----------------------------------------------------------------------------*/
#include "processorBoundaryContactSearch.hpp"
#include "contactSearch.hpp"
#include "particles.hpp"
//#include "pointStructure.hpp"
//#include "geometry.hpp"
void pFlow::processorBoundaryContactSearch::setSearchBox()
{
auto l = boundary().neighborLength();
auto n = boundary().boundaryPlane().normal();
auto pp1 = boundary().boundaryPlane().parallelPlane(l);
auto pp2 = boundary().boundaryPlane().parallelPlane(-l);
realx3 minP1 = min(min(min(pp1.p1(), pp1.p2()), pp1.p3()), pp1.p4());
realx3 maxP1 = max(max(max(pp1.p1(), pp1.p2()), pp1.p3()), pp1.p4());
realx3 minP2 = min(min(min(pp2.p1(), pp2.p2()), pp2.p3()), pp2.p4());
realx3 maxP2 = max(max(max(pp2.p1(), pp2.p2()), pp2.p3()), pp2.p4());
auto minP = min(minP1, minP2) - l*(realx3(1.0)-abs(n));
auto maxP = max(maxP1, maxP2) + l*(realx3(1.0)-abs(n));
searchBox_={minP, maxP};
}
pFlow::processorBoundaryContactSearch::processorBoundaryContactSearch(
const dictionary &dict,
const boundaryBase &boundary,
const contactSearch &cSearch)
:
boundaryContactSearch(dict, boundary, cSearch),
diameter_(cSearch.Particles().boundingSphere()),
masterSearch_(this->isBoundaryMaster()),
sizeRatio_(dict.getVal<real>("sizeRatio"))
{
if(masterSearch_)
{
setSearchBox();
real minD;
real maxD;
cSearch.Particles().boundingSphereMinMax(minD, maxD);
ppContactSearch_ = makeUnique<twoPartContactSearch>(
searchBox_,
maxD,
sizeRatio_);
}
else
{
searchBox_={{0,0,0},{0,0,0}};
}
}
bool pFlow::processorBoundaryContactSearch::broadSearch
(
uint32 iter,
real t,
real dt,
csPairContainerType &ppPairs,
csPairContainerType &pwPairs,
bool force
)
{
if(masterSearch_)
{
const auto thisPoints = boundary().thisPoints();
const auto& neighborProcPoints = boundary().neighborProcPoints();
const auto& bDiams = diameter_.BoundaryField(thisBoundaryIndex());
const auto thisDiams = bDiams.thisField();
const auto& neighborProcDiams = bDiams.neighborProcField();
ppContactSearch_().broadSearchPP(
ppPairs,
thisPoints,
thisDiams,
neighborProcPoints,
neighborProcDiams,
boundaryName()
);
//pOutput<<"ppSize "<< ppPairs.size()<<endl;
return true;
}else
{
return true;
}
}

View File

@ -0,0 +1,76 @@
/*------------------------------- 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.
-----------------------------------------------------------------------------*/
#ifndef __processorBoundaryContactSearch_hpp__
#define __processorBoundaryContactSearch_hpp__
#include "boundaryContactSearch.hpp"
#include "pointFields.hpp"
#include "twoPartContactSearch.hpp"
namespace pFlow
{
class processorBoundaryContactSearch : public boundaryContactSearch
{
private:
box searchBox_;
uniquePtr<twoPartContactSearch> ppContactSearch_ = nullptr;
const realPointField_D& diameter_;
bool masterSearch_;
real sizeRatio_;
void setSearchBox();
public:
TypeInfo("boundaryContactSearch<MPI,processor>")
processorBoundaryContactSearch(
const dictionary& dict,
const boundaryBase& boundary,
const contactSearch& cSearch
);
~processorBoundaryContactSearch() override = default;
add_vCtor(
boundaryContactSearch,
processorBoundaryContactSearch,
boundaryBase
);
bool broadSearch(
uint32 iter,
real t,
real dt,
csPairContainerType& ppPairs,
csPairContainerType& pwPairs,
bool force = false
) override;
};
}
#endif //__processorBoundaryContactSearch_hpp__

View File

@ -0,0 +1,163 @@
#include "twoPartContactSearch.hpp"
#include "twoPartContactSearchKernels.hpp"
#include "phasicFlowKokkos.hpp"
#include "streams.hpp"
void pFlow::twoPartContactSearch::checkAllocateNext(uint32 n)
{
if( nextCapacity_ < n)
{
nextCapacity_ = n;
reallocNoInit(next_, n);
}
}
void pFlow::twoPartContactSearch::nullifyHead()
{
fill(head_, static_cast<uint32>(-1));
}
void pFlow::twoPartContactSearch::nullifyNext(uint32 n)
{
fill(next_, 0u, n, static_cast<uint32>(-1));
}
void pFlow::twoPartContactSearch::buildList(
const deviceScatteredFieldAccess<realx3> &points)
{
if(points.empty())return;
uint32 n = points.size();
checkAllocateNext(n);
nullifyNext(n);
nullifyHead();
pFlow::twoPartContactSearchKernels::buildNextHead(
points,
searchCells_,
head_,
next_
);
}
pFlow::twoPartContactSearch::twoPartContactSearch
(
const box &domain,
real cellSize,
real sizeRatio
)
:
searchCells_(domain, cellSize),
head_("periodic:head",searchCells_.nx(), searchCells_.ny(), searchCells_.nz()),
sizeRatio_(sizeRatio)
{
}
bool pFlow::twoPartContactSearch::broadSearchPP
(
csPairContainerType &ppPairs,
const deviceScatteredFieldAccess<realx3> &points1,
const deviceScatteredFieldAccess<real>& diams1,
const deviceScatteredFieldAccess<realx3> &points2,
const deviceScatteredFieldAccess<real>& diams2,
const realx3& transferVec
)
{
if(points1.empty())return true;
if(points2.empty()) return true;
buildList(points1);
uint32 nNotInserted = 1;
// loop until the container size fits the numebr of contact pairs
while (nNotInserted > 0)
{
nNotInserted = pFlow::twoPartContactSearchKernels::broadSearchPP
(
ppPairs,
points1,
diams1,
points2,
diams2,
transferVec,
head_,
next_,
searchCells_,
sizeRatio_
);
if(nNotInserted)
{
// - resize the container
// note that getFull now shows the number of failed insertions.
uint32 len = max(nNotInserted,100u) ;
auto oldCap = ppPairs.capacity();
ppPairs.increaseCapacityBy(len);
INFORMATION<< "Particle-particle contact pair container capacity increased from "<<
oldCap << " to "<<ppPairs.capacity()<<" in contact search in boundary region."<<END_INFO;
}
}
return true;
}
bool pFlow::twoPartContactSearch::broadSearchPP
(
csPairContainerType &ppPairs,
const deviceScatteredFieldAccess<realx3> &points1,
const deviceScatteredFieldAccess<real> &diams1,
const realx3Vector_D& points2,
const realVector_D& diams2,
const word& name
)
{
buildList(points1);
uint32 nNotInserted = 1;
// loop until the container size fits the numebr of contact pairs
while (nNotInserted > 0)
{
nNotInserted = pFlow::twoPartContactSearchKernels::broadSearchPP
(
ppPairs,
points1,
diams1,
points2,
diams2,
head_,
next_,
searchCells_,
sizeRatio_
);
if(nNotInserted)
{
// - resize the container
// note that getFull now shows the number of failed insertions.
uint32 len = max(nNotInserted,100u) ;
auto oldCap = ppPairs.capacity();
ppPairs.increaseCapacityBy(len);
INFORMATION<< "Particle-particle contact pair container capacity increased from "<<
oldCap << " to "<<ppPairs.capacity()<<" in boundary contact search in "<< name <<END_INFO;
}
}
return true;
}

View File

@ -0,0 +1,104 @@
/*------------------------------- 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.
-----------------------------------------------------------------------------*/
#ifndef __twoPartContactSearch_hpp__
#define __twoPartContactSearch_hpp__
#include "contactSearchGlobals.hpp"
#include "scatteredFieldAccess.hpp"
#include "cells.hpp"
#include "VectorSingles.hpp"
namespace pFlow
{
class twoPartContactSearch
{
public:
using HeadType = deviceViewType3D<uint32>;
using NextType = deviceViewType1D<uint32>;
private:
cells searchCells_;
HeadType head_{ "periodic::head", 1, 1, 1 };
NextType next_{ "periodic::next", 1 };
real sizeRatio_ = 1.0;
uint32 nextCapacity_ = 0;
void checkAllocateNext(uint32 n);
void nullifyHead();
void nullifyNext(uint32 n);
void buildList(
const deviceScatteredFieldAccess<realx3> &points);
public:
twoPartContactSearch(
const box &domain,
real cellSize,
real sizeRatio = 1.0);
/// @brief Perform a broad-search for spheres in two adjacent regions.
/// Region 1 is considered as the master (primary) region and region 2 as slave
/// @param ppPairs pairs container which holds i and j
/// @param points1 point positions in region 1
/// @param diams1 diameter of spheres in region 1
/// @param points2 point positions in region 2
/// @param diams2 diameter of spheres in region 2
/// @param transferVec a vector to transfer points from region 2 to region 1
/// @return true if it is successful
bool broadSearchPP(
csPairContainerType &ppPairs,
const deviceScatteredFieldAccess<realx3> &points1,
const deviceScatteredFieldAccess<real> &diams1,
const deviceScatteredFieldAccess<realx3> &points2,
const deviceScatteredFieldAccess<real> &diams2,
const realx3 &transferVec);
bool broadSearchPP(
csPairContainerType &ppPairs,
const deviceScatteredFieldAccess<realx3> &points1,
const deviceScatteredFieldAccess<real> &diams1,
const realx3Vector_D& points2,
const realVector_D& diams2,
const word& name);
const auto& searchCells()const
{
return searchCells_;
}
real sizeRatio()const
{
return sizeRatio_;
}
};
}
#endif //__twoPartContactSearch_hpp__

View File

@ -0,0 +1,186 @@
#include "twoPartContactSearchKernels.hpp"
INLINE_FUNCTION_HD
bool
sphereSphereCheckB(
const pFlow::realx3& p1,
const pFlow::realx3 p2,
pFlow::real d1,
pFlow::real d2
)
{
return pFlow::length(p2 - p1) < 0.5 * (d2 + d1);
}
void
pFlow::twoPartContactSearchKernels::buildNextHead(
const deviceScatteredFieldAccess<realx3>& points,
const cells& searchCells,
deviceViewType3D<uint32>& head,
deviceViewType1D<uint32>& next
)
{
uint32 n = points.size();
Kokkos::parallel_for(
"pFlow::ppwBndryContactSearch::buildList",
deviceRPolicyStatic(0, n),
LAMBDA_HD(uint32 i) {
int32x3 ind;
if (searchCells.pointIndexInDomain(points[i], ind))
{
// discards points out of searchCell
uint32 old =
Kokkos::atomic_exchange(&head(ind.x(), ind.y(), ind.z()), i);
next[i] = old;
}
}
);
Kokkos::fence();
}
pFlow::uint32
pFlow::twoPartContactSearchKernels::broadSearchPP(
csPairContainerType& ppPairs,
const deviceScatteredFieldAccess<realx3>& points,
const deviceScatteredFieldAccess<real>& diams,
const deviceScatteredFieldAccess<realx3>& mirrorPoints,
const deviceScatteredFieldAccess<real>& mirrorDiams,
const realx3& transferVec,
const deviceViewType3D<uint32>& head,
const deviceViewType1D<uint32>& next,
const cells& searchCells,
const real sizeRatio
)
{
if (points.empty())
return 0;
if (mirrorPoints.empty())
return 0;
auto nMirror = mirrorPoints.size();
uint32 getFull = 0;
Kokkos::parallel_reduce(
"pFlow::twoPartContactSearchKernels::broadSearchPP",
deviceRPolicyStatic(0, nMirror),
LAMBDA_HD(const uint32 mrrI, uint32& getFullUpdate) {
realx3 p_m = mirrorPoints(mrrI) + transferVec;
int32x3 ind_m;
if (!searchCells.pointIndexInDomain(p_m, ind_m))
return;
real d_m = sizeRatio * mirrorDiams[mrrI];
for (int ii = -1; ii < 2; ii++)
{
for (int jj = -1; jj < 2; jj++)
{
for (int kk = -1; kk < 2; kk++)
{
auto ind = ind_m + int32x3{ ii, jj, kk };
if (!searchCells.inCellRange(ind))
continue;
uint32 thisI = head(ind.x(), ind.y(), ind.z());
while (thisI != static_cast<uint32>(-1))
{
auto d_n = sizeRatio * diams[thisI];
// first item is for this boundary and second itme,
// for mirror
if(sphereSphereCheckB(p_m, points[thisI], d_m, d_n)&&
ppPairs.insert(thisI,mrrI) == static_cast<uint32>(-1))
{
getFullUpdate++;
}
thisI = next(thisI);
}
}
}
}
},
getFull
);
return getFull;
}
pFlow::uint32
pFlow::twoPartContactSearchKernels::broadSearchPP(
csPairContainerType& ppPairs,
const deviceScatteredFieldAccess<realx3>& points1,
const deviceScatteredFieldAccess<real>& diams1,
const realx3Vector_D& points2,
const realVector_D& diams2,
const deviceViewType3D<uint32>& head,
const deviceViewType1D<uint32>& next,
const cells& searchCells,
real sizeRatio
)
{
if (points1.empty())
return 0;
if (points2.empty())
return 0;
auto nP2 = points2.size();
auto points2View = points2.deviceView();
auto diams2View = diams2.deviceView();
uint32 getFull = 0;
Kokkos::parallel_reduce(
"pFlow::twoPartContactSearchKernels::broadSearchPP",
deviceRPolicyStatic(0, nP2),
LAMBDA_HD(const uint32 i2, uint32& getFullUpdate) {
realx3 p_m = points2View(i2);
int32x3 ind_m;
if (!searchCells.pointIndexInDomain(p_m, ind_m))
return;
real d_m = sizeRatio * diams2View[i2];
for (int ii = -1; ii < 2; ii++)
{
for (int jj = -1; jj < 2; jj++)
{
for (int kk = -1; kk < 2; kk++)
{
auto ind = ind_m + int32x3{ ii, jj, kk };
if (!searchCells.inCellRange(ind))
{
continue;
}
uint32 i1 = head(ind.x(), ind.y(), ind.z());
while (i1 != static_cast<uint32>(-1))
{
auto d_n = sizeRatio * diams1[i1];
// first item is for this boundary and second itme,
// for mirror
if(sphereSphereCheckB(p_m, points1[i1], d_m, d_n)&&
ppPairs.insert(i1,i2) == static_cast<uint32>(-1))
{
getFullUpdate++;
}
i1 = next(i1);
}
}
}
}
},
getFull
);
return getFull;
}

View File

@ -0,0 +1,49 @@
#ifndef __twoPartContactSearchKernels_hpp__
#define __twoPartContactSearchKernels_hpp__
#include "contactSearchGlobals.hpp"
#include "cells.hpp"
#include "contactSearchFunctions.hpp"
#include "scatteredFieldAccess.hpp"
#include "VectorSingles.hpp"
namespace pFlow::twoPartContactSearchKernels
{
void buildNextHead(
const deviceScatteredFieldAccess<realx3> &points,
const cells &searchCells,
deviceViewType3D<uint32> &head,
deviceViewType1D<uint32> &next );
uint32 broadSearchPP
(
csPairContainerType &ppPairs,
const deviceScatteredFieldAccess<realx3> &points,
const deviceScatteredFieldAccess<real> &diams,
const deviceScatteredFieldAccess<realx3> &mirrorPoints,
const deviceScatteredFieldAccess<real> &mirrorDiams,
const realx3 &transferVec,
const deviceViewType3D<uint32> &head,
const deviceViewType1D<uint32> &next,
const cells &searchCells,
real sizeRatio
);
uint32
broadSearchPP(
csPairContainerType& ppPairs,
const deviceScatteredFieldAccess<realx3>& points1,
const deviceScatteredFieldAccess<real>& diams1,
const realx3Vector_D& points2,
const realVector_D& diams2,
const deviceViewType3D<uint32>& head,
const deviceViewType1D<uint32>& next,
const cells& searchCells,
real sizeRatio
);
}
#endif //__twoPartContactSearchKernels_hpp__

View File

@ -0,0 +1,132 @@
#ifndef __processorBoundarySIKernels_hpp__
#define __processorBoundarySIKernels_hpp__
namespace pFlow::MPI::processorBoundarySIKernels
{
template<typename ContactListType, typename ContactForceModel>
inline
void sphereSphereInteraction
(
const word& kernalName,
real dt,
const ContactListType& cntctList,
const ContactForceModel& forceModel,
const deviceScatteredFieldAccess<realx3>& thisPoints,
const deviceViewType1D<real>& thisDiam,
const deviceViewType1D<uint32>& thisPropId,
const deviceViewType1D<realx3>& thisVel,
const deviceViewType1D<realx3>& thisRVel,
const deviceViewType1D<realx3>& thisCForce,
const deviceViewType1D<realx3>& thisCTorque,
const deviceViewType1D<realx3>& neighborPoints,
const deviceViewType1D<real>& neighborDiam,
const deviceViewType1D<uint32>& neighborPropId,
const deviceViewType1D<realx3>& neighborVel,
const deviceViewType1D<realx3>& neighborRVel,
const deviceViewType1D<realx3>& neighborCForce,
const deviceViewType1D<realx3>& neighborCTorque
)
{
using ValueType = typename ContactListType::ValueType;
uint32 ss = cntctList.size();
if(ss == 0u)return;
uint32 lastItem = cntctList.loopCount();
Kokkos::parallel_for(
kernalName,
deviceRPolicyDynamic(0,lastItem),
LAMBDA_HD(uint32 n)
{
if(!cntctList.isValid(n))return;
auto [i,j] = cntctList.getPair(n);
uint32 ind_i = thisPoints.index(i);
uint32 ind_j = j;
real Ri = 0.5*thisDiam[ind_i];
real Rj = 0.5*neighborDiam[ind_j];
realx3 xi = thisPoints.field()[ind_i];
realx3 xj = neighborPoints[ind_j];
real dist = length(xj-xi);
real ovrlp = (Ri+Rj) - dist;
if( ovrlp >0.0 )
{
auto Nij = (xj-xi)/max(dist,smallValue);
auto wi = thisRVel[ind_i];
auto wj = neighborRVel[ind_j];
auto Vr = thisVel[ind_i] - neighborVel[ind_j] + cross((Ri*wi+Rj*wj), Nij);
auto history = cntctList.getValue(n);
int32 propId_i = thisPropId[ind_i];
int32 propId_j = neighborPropId[ind_j];
realx3 FCn, FCt, Mri, Mrj, Mij, Mji;
// calculates contact force
forceModel.contactForce(
dt, i, j,
propId_i, propId_j,
Ri, Rj,
ovrlp,
Vr, Nij,
history,
FCn, FCt);
forceModel.rollingFriction(
dt, i, j,
propId_i, propId_j,
Ri, Rj,
wi, wj,
Nij,
FCn,
Mri, Mrj);
auto M = cross(Nij,FCt);
Mij = Ri*M+Mri;
Mji = Rj*M+Mrj;
auto FC = FCn + FCt;
Kokkos::atomic_add(&thisCForce[ind_i].x_,FC.x_);
Kokkos::atomic_add(&thisCForce[ind_i].y_,FC.y_);
Kokkos::atomic_add(&thisCForce[ind_i].z_,FC.z_);
Kokkos::atomic_add(&neighborCForce[ind_j].x_,-FC.x_);
Kokkos::atomic_add(&neighborCForce[ind_j].y_,-FC.y_);
Kokkos::atomic_add(&neighborCForce[ind_j].z_,-FC.z_);
Kokkos::atomic_add(&thisCTorque[ind_i].x_, Mij.x_);
Kokkos::atomic_add(&thisCTorque[ind_i].y_, Mij.y_);
Kokkos::atomic_add(&thisCTorque[ind_i].z_, Mij.z_);
Kokkos::atomic_add(&neighborCTorque[ind_j].x_, Mji.x_);
Kokkos::atomic_add(&neighborCTorque[ind_j].y_, Mji.y_);
Kokkos::atomic_add(&neighborCTorque[ind_j].z_, Mji.z_);
cntctList.setValue(n,history);
}
else
{
cntctList.setValue(n, ValueType());
}
});
Kokkos::fence();
}
} //pFlow::MPI::processorBoundarySIKernels
#endif //__processorBoundarySIKernels_hpp__

View File

@ -0,0 +1,256 @@
/*------------------------------- 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.
-----------------------------------------------------------------------------*/
#include "processorBoundarySIKernels.hpp"
template <typename cFM, typename gMM>
pFlow::MPI::processorBoundarySphereInteraction<cFM, gMM>::processorBoundarySphereInteraction(
const boundaryBase &boundary,
const sphereParticles &sphPrtcls,
const GeometryMotionModel &geomMotion)
:
boundarySphereInteraction<cFM,gMM>(
boundary,
sphPrtcls,
geomMotion
),
masterInteraction_(boundary.isBoundaryMaster())
{
if(masterInteraction_)
{
this->allocatePPPairs();
this->allocatePWPairs();
}
}
#ifdef BoundaryModel1
template <typename cFM, typename gMM>
bool pFlow::MPI::processorBoundarySphereInteraction<cFM, gMM>::sphereSphereInteraction
(
real dt,
const ContactForceModel &cfModel,
uint32 step
)
{
// master processor calculates the contact force/torque and sends data back to the
// neighbor processor (slave processor).
// slave processor recieves the data and adds the data to the internalField
if(masterInteraction_)
{
if(step==1)return true;
const auto & sphPar = this->sphParticles();
uint32 thisIndex = this->boundary().thisBoundaryIndex();
const auto& cfBndry = static_cast<const processorBoundaryField<realx3>&> (
sphPar.contactForce().BoundaryField(thisIndex));
const auto& ctBndry = static_cast<const processorBoundaryField<realx3>&> (
sphPar.contactTorque().BoundaryField(thisIndex));
if(step == 2 )
{
iter++;
pFlow::MPI::processorBoundarySIKernels::sphereSphereInteraction(
"ppBoundaryInteraction."+this->boundaryName(),
dt,
this->ppPairs(),
cfModel,
this->boundary().thisPoints(),
sphPar.diameter().deviceViewAll(),
sphPar.propertyId().deviceViewAll(),
sphPar.velocity().deviceViewAll(),
sphPar.rVelocity().deviceViewAll(),
sphPar.contactForce().deviceViewAll(),
sphPar.contactTorque().deviceViewAll(),
this->boundary().neighborProcPoints().deviceViewAll(),
sphPar.diameter().BoundaryField(thisIndex).neighborProcField().deviceViewAll(),
sphPar.propertyId().BoundaryField(thisIndex).neighborProcField().deviceViewAll(),
sphPar.velocity().BoundaryField(thisIndex).neighborProcField().deviceViewAll(),
sphPar.rVelocity().BoundaryField(thisIndex).neighborProcField().deviceViewAll(),
cfBndry.neighborProcField().deviceViewAll(),
ctBndry.neighborProcField().deviceViewAll()
);
return true;
}
else if(step == 3 )
{
cfBndry.sendBackData();
ctBndry.sendBackData();
return true;
}
return false;
}
else
{
if(step == 1 )
{
const auto & sphPar = this->sphParticles();
uint32 thisIndex = this->boundary().thisBoundaryIndex();
const auto& cfBndry = static_cast<const processorBoundaryField<realx3>&>(
sphPar.contactForce().BoundaryField(thisIndex));
const auto& ctBndry = static_cast<const processorBoundaryField<realx3>&> (
sphPar.contactTorque().BoundaryField(thisIndex));
cfBndry.recieveBackData();
ctBndry.recieveBackData();
return false;
}
else if(step == 11)
{
const auto & sphPar = this->sphParticles();
uint32 thisIndex = this->boundary().thisBoundaryIndex();
const auto& cfBndry = static_cast<const processorBoundaryField<realx3>&>(
sphPar.contactForce().BoundaryField(thisIndex));
const auto& ctBndry = static_cast<const processorBoundaryField<realx3>&> (
sphPar.contactTorque().BoundaryField(thisIndex));
cfBndry.addBufferToInternalField();
ctBndry.addBufferToInternalField();
return true;
}
return false;
}
return false;
}
#else
template <typename cFM, typename gMM>
bool pFlow::MPI::processorBoundarySphereInteraction<cFM, gMM>::sphereSphereInteraction
(
real dt,
const ContactForceModel &cfModel,
uint32 step
)
{
// master processor calculates the contact force/torque and sends data back to the
// neighbor processor (slave processor).
// slave processor recieves the data and adds the data to the internalField
if(masterInteraction_)
{
if(step==1)return true;
const auto & sphPar = this->sphParticles();
uint32 thisIndex = this->boundary().thisBoundaryIndex();
const auto& cfBndry = static_cast<const processorBoundaryField<realx3>&> (
sphPar.contactForce().BoundaryField(thisIndex));
const auto& ctBndry = static_cast<const processorBoundaryField<realx3>&> (
sphPar.contactTorque().BoundaryField(thisIndex));
if(step == 2 )
{
pFlow::MPI::processorBoundarySIKernels::sphereSphereInteraction(
"ppBoundaryInteraction."+this->boundaryName(),
dt,
this->ppPairs(),
cfModel,
this->boundary().thisPoints(),
sphPar.diameter().deviceViewAll(),
sphPar.propertyId().deviceViewAll(),
sphPar.velocity().deviceViewAll(),
sphPar.rVelocity().deviceViewAll(),
sphPar.contactForce().deviceViewAll(),
sphPar.contactTorque().deviceViewAll(),
this->boundary().neighborProcPoints().deviceViewAll(),
sphPar.diameter().BoundaryField(thisIndex).neighborProcField().deviceViewAll(),
sphPar.propertyId().BoundaryField(thisIndex).neighborProcField().deviceViewAll(),
sphPar.velocity().BoundaryField(thisIndex).neighborProcField().deviceViewAll(),
sphPar.rVelocity().BoundaryField(thisIndex).neighborProcField().deviceViewAll(),
cfBndry.neighborProcField().deviceViewAll(),
ctBndry.neighborProcField().deviceViewAll()
);
return true;
}
else if(step == 3 )
{
cfBndry.sendBackData();
ctBndry.sendBackData();
return true;
}
else if(step == 11 )
{
cfBndry.updateBoundaryFromSlave();
ctBndry.updateBoundaryFromSlave();
return true;
}
return false;
}
else
{
if(step == 1 )
{
const auto & sphPar = this->sphParticles();
uint32 thisIndex = this->boundary().thisBoundaryIndex();
const auto& cfBndry = static_cast<const processorBoundaryField<realx3>&>(
sphPar.contactForce().BoundaryField(thisIndex));
const auto& ctBndry = static_cast<const processorBoundaryField<realx3>&> (
sphPar.contactTorque().BoundaryField(thisIndex));
cfBndry.recieveBackData();
ctBndry.recieveBackData();
return false;
}
else if(step == 11)
{
const auto & sphPar = this->sphParticles();
uint32 thisIndex = this->boundary().thisBoundaryIndex();
const auto& cfBndry = static_cast<const processorBoundaryField<realx3>&>(
sphPar.contactForce().BoundaryField(thisIndex));
const auto& ctBndry = static_cast<const processorBoundaryField<realx3>&> (
sphPar.contactTorque().BoundaryField(thisIndex));
cfBndry.addBufferToInternalField();
cfBndry.updateBoundaryToMaster();
ctBndry.addBufferToInternalField();
ctBndry.updateBoundaryToMaster();
return true;
}
return false;
}
return false;
}
#endif

View File

@ -0,0 +1,93 @@
/*------------------------------- 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.
-----------------------------------------------------------------------------*/
#ifndef __processorBoundarySphereInteraction_hpp__
#define __processorBoundarySphereInteraction_hpp__
#include "boundarySphereInteraction.hpp"
#include "processorBoundaryField.hpp"
#include "boundaryProcessor.hpp"
namespace pFlow::MPI
{
template<typename contactForceModel,typename geometryMotionModel>
class processorBoundarySphereInteraction
:
public boundarySphereInteraction<contactForceModel, geometryMotionModel>
{
public:
using PBSInteractionType =
processorBoundarySphereInteraction<contactForceModel,geometryMotionModel>;
using BSInteractionType =
boundarySphereInteraction<contactForceModel, geometryMotionModel>;
using GeometryMotionModel = typename BSInteractionType::GeometryMotionModel;
using ContactForceModel = typename BSInteractionType::ContactForceModel;
using MotionModel = typename geometryMotionModel::MotionModel;
using ModelStorage = typename ContactForceModel::contactForceStorage;
using IdType = typename BSInteractionType::IdType;
using IndexType = typename BSInteractionType::IndexType;
using ContactListType = typename BSInteractionType::ContactListType;
private:
bool masterInteraction_;
public:
TypeInfoTemplate22("boundarySphereInteraction", "processor",ContactForceModel, MotionModel);
processorBoundarySphereInteraction(
const boundaryBase& boundary,
const sphereParticles& sphPrtcls,
const GeometryMotionModel& geomMotion
);
add_vCtor
(
BSInteractionType,
PBSInteractionType,
boundaryBase
);
~processorBoundarySphereInteraction()override = default;
bool sphereSphereInteraction(
real dt,
const ContactForceModel& cfModel,
uint32 step)override;
};
}
#include "processorBoundarySphereInteraction.cpp"
#endif //__processorBoundarySphereInteraction_hpp__

View File

@ -0,0 +1,17 @@
#include "processorBoundarySphereInteraction.hpp"
#include "geometryMotions.hpp"
#include "contactForceModels.hpp"
template class pFlow::MPI::processorBoundarySphereInteraction
<
pFlow::cfModels::limitedNonLinearNormalRolling,
pFlow::rotationAxisMotionGeometry
>;
template class pFlow::MPI::processorBoundarySphereInteraction
<
pFlow::cfModels::nonLimitedNonLinearNormalRolling,
pFlow::rotationAxisMotionGeometry
>;

View File

@ -359,7 +359,7 @@ bool pFlow::sphereInteraction<cFM,gMM, cLT>::hearChanges
if(msg.equivalentTo(message::ITEMS_REARRANGE)) if(msg.equivalentTo(message::ITEMS_REARRANGE))
{ {
notImplementedFunction; notImplementedFunction;
return false; return true;
} }
fatalErrorInFunction<<"Event "<< msg.eventNames()<< fatalErrorInFunction<<"Event "<< msg.eventNames()<<

View File

@ -0,0 +1,46 @@
#include "processorBoundarySphereParticles.hpp"
#include "sphereParticles.hpp"
#include "boundaryProcessor.hpp"
pFlow::processorBoundarySphereParticles::processorBoundarySphereParticles(
const boundaryBase &boundary,
sphereParticles &prtcls
)
:
boundarySphereParticles(boundary, prtcls)
{
}
bool pFlow::processorBoundarySphereParticles::acceleration(const timeInfo &ti, const realx3& g)
{
#ifndef BoundaryModel1
if(isBoundaryMaster())
{
auto thisIndex = thisBoundaryIndex();
auto mass = Particles().mass().BoundaryField(thisIndex).neighborProcField().deviceView();
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().acceleration().BoundaryField(thisIndex).neighborProcField().deviceView();
auto rAcc = Particles().rAcceleration().BoundaryField(thisIndex).neighborProcField().deviceView();
Kokkos::parallel_for(
"processorBoundary::acceleration."+this->boundaryName(),
deviceRPolicyStatic(0,mass.size()),
LAMBDA_HD(uint32 i){
acc[i] = cf[i]/mass[i] + g;
rAcc[i] = ct[i]/I[i];
});
Kokkos::fence();
}
#endif
return true;
}

View File

@ -0,0 +1,38 @@
#ifndef __processorBoundarySphereParticles_hpp__
#define __processorBoundarySphereParticles_hpp__
#include "boundarySphereParticles.hpp"
namespace pFlow
{
class processorBoundarySphereParticles
:
public boundarySphereParticles
{
public:
/// type info
TypeInfo("boundarySphereParticles<MPI,processor>");
processorBoundarySphereParticles(
const boundaryBase &boundary,
sphereParticles& prtcls
);
add_vCtor(
boundarySphereParticles,
processorBoundarySphereParticles,
boundaryBase
);
bool acceleration(const timeInfo& ti, const realx3& g)override;
};
}
#endif

View File

@ -0,0 +1,70 @@
#include "MPIParticleIdHandler.hpp"
#include "procCommunication.hpp"
pFlow::MPI::MPIParticleIdHandler::MPIParticleIdHandler
(
pointStructure& pStruct
)
:
particleIdHandler(pStruct)
{
initialIdCheck();
}
pFlow::Pair<pFlow::uint32, pFlow::uint32>
pFlow::MPI::MPIParticleIdHandler::getIdRange(uint32 nNewParticles)
{
uint32 startId;
if(maxId_==-1)
{
startId = 0;
}
else
{
startId = maxId_+1;
}
uint32 endId = startId+nNewParticles-1;
maxId_ = endId;
return {startId, endId};
}
bool pFlow::MPI::MPIParticleIdHandler::initialIdCheck()
{
/// empty point structure / no particles in simulation
uint32 maxId = -1;
if( !pStruct().empty() )
{
maxId = max( *this );
}
auto maxIdAll = procVector<uint32>(pFlowProcessors());
auto numAll = procVector<uint32>(pFlowProcessors());
auto comm = procCommunication(pFlowProcessors());
comm.collectAllToAll(maxId, maxIdAll);
comm.collectAllToAll(size(),numAll);
uint32 n = 0;
for(uint32 i=0; i<maxIdAll.size(); i++)
{
if( maxIdAll[i]==-1 && numAll[i]!= 0)
{
if(comm.localRank() == i)
{
fillSequence(*this, n);
maxId_ = size()-1 + n;
}
}
else
{
if(comm.localRank() == i)
{
maxId_ = maxIdAll[i];
}
}
n += numAll[i];
}
return true;
}

View File

@ -0,0 +1,60 @@
/*------------------------------- 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.
-----------------------------------------------------------------------------*/
#ifndef __MPIParticleIdHandler_hpp__
#define __MPIParticleIdHandler_hpp__
#include "particleIdHandler.hpp"
namespace pFlow::MPI
{
class MPIParticleIdHandler : public particleIdHandler
{
private:
uint32 maxId_ = -1;
bool initialIdCheck() override;
public:
ClassInfo("particleIdHandler<MPI>");
explicit MPIParticleIdHandler(pointStructure& pStruct);
~MPIParticleIdHandler() override = default;
add_vCtor(
particleIdHandler,
MPIParticleIdHandler,
pointStructure
);
Pair<uint32, uint32> getIdRange(uint32 nNewParticles) override;
uint32 maxId() const override
{
return maxId_;
}
};
}
#endif //__MPIParticleIdHandler_hpp__

View File

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

View File

@ -9,9 +9,11 @@ set(SourceFiles
# Regions # Regions
region/regionPoints/regionPoints/regionPoints.cpp region/regionPoints/regionPoints/regionPoints.cpp
region/regionPoints/sphereRegionPoints/sphereRegionPoints.cpp region/regionPoints/sphereRegionPoints/sphereRegionPoints.cpp
region/regionPoints/boxRegionPoints/boxRegionPoints.cpp
region/regionPoints/lineRegionPoints/lineRegionPoints.cpp region/regionPoints/lineRegionPoints/lineRegionPoints.cpp
region/regionPoints/centerPointsRegionPoints/centerPointsRegionPoints.cpp region/regionPoints/centerPointsRegionPoints/centerPointsRegionPoints.cpp
region/regionPoints/multipleSpheresRegionPoints/multipleSpheresRegionPoints.cpp region/regionPoints/multipleSpheresRegionPoints/multipleSpheresRegionPoints.cpp
region/regionPoints/rectMeshRegionPoints/rectMeshRegionPoints.cpp
# Postprocess components # Postprocess components
postprocessComponent/postprocessComponent/postprocessComponent.cpp postprocessComponent/postprocessComponent/postprocessComponent.cpp

View File

@ -467,7 +467,7 @@ pFlow::postprocessData::fieldsDataBase::fieldsDataBase
systemControl& control, systemControl& control,
const dictionary& postDict, const dictionary& postDict,
bool inSimulation, bool inSimulation,
timeValue startTime TimeValueType startTime
) )
: :
time_(control.time()), time_(control.time()),
@ -492,7 +492,7 @@ pFlow::postprocessData::fieldsDataBase::fieldsDataBase
} }
} }
pFlow::timeValue pFlow::postprocessData::fieldsDataBase::currentTime() const pFlow::TimeValueType pFlow::postprocessData::fieldsDataBase::currentTime() const
{ {
return time_.currentTime(); return time_.currentTime();
} }
@ -914,7 +914,7 @@ pFlow::uniquePtr<pFlow::postprocessData::fieldsDataBase>
systemControl& control, systemControl& control,
const dictionary& postDict, const dictionary& postDict,
bool inSimulation, bool inSimulation,
timeValue startTime TimeValueType startTime
) )
{ {
word dbType; word dbType;

View File

@ -78,7 +78,7 @@ private:
anyList allFields_; anyList allFields_;
/// Map to store the last capture time of each field /// Map to store the last capture time of each field
wordMap<timeValue> captureTime_; wordMap<TimeValueType> captureTime_;
/// Reference to the Time object /// Reference to the Time object
Time& time_; Time& time_;
@ -178,7 +178,7 @@ public:
systemControl& control, systemControl& control,
const dictionary& postDict, const dictionary& postDict,
bool inSimulation, bool inSimulation,
timeValue startTime); TimeValueType startTime);
/// no copy constructor /// no copy constructor
fieldsDataBase(const fieldsDataBase&) = delete; fieldsDataBase(const fieldsDataBase&) = delete;
@ -203,7 +203,7 @@ public:
systemControl& control, systemControl& control,
const dictionary& postDict, const dictionary& postDict,
bool inSimulation, bool inSimulation,
timeValue startTime TimeValueType startTime
), ),
(control, postDict, inSimulation, startTime) (control, postDict, inSimulation, startTime)
); );
@ -211,7 +211,7 @@ public:
// - Public Access Functions // - Public Access Functions
/// returns the current time /// returns the current time
timeValue currentTime()const; TimeValueType currentTime()const;
/// const ref to object Time /// const ref to object Time
const Time& time()const const Time& time()const
@ -282,7 +282,7 @@ public:
/// Get the next avaiable time folder after the current time folder /// Get the next avaiable time folder after the current time folder
/// This is only used for post-simulation processing /// This is only used for post-simulation processing
virtual virtual
timeValue getNextTimeFolder()const TimeValueType getNextTimeFolder()const
{ {
return -1.0; return -1.0;
} }
@ -291,7 +291,7 @@ public:
/// This is used only for post-simulation processing /// This is used only for post-simulation processing
/// @returns the time value of the next folder. /// @returns the time value of the next folder.
virtual virtual
timeValue setToNextTimeFolder() TimeValueType setToNextTimeFolder()
{ {
return -1.0; return -1.0;
} }
@ -300,7 +300,7 @@ public:
/// This is used only for post-simulation processing /// This is used only for post-simulation processing
/// @returns the time value of the skipped folder /// @returns the time value of the skipped folder
virtual virtual
timeValue skipNextTimeFolder() TimeValueType skipNextTimeFolder()
{ {
return -1.0; return -1.0;
} }
@ -316,7 +316,7 @@ public:
systemControl& control, systemControl& control,
const dictionary& postDict, const dictionary& postDict,
bool inSimulation, bool inSimulation,
timeValue startTime); TimeValueType startTime);
}; };
} // namespace pFlow::postprocessData } // namespace pFlow::postprocessData

View File

@ -49,7 +49,7 @@ pFlow::postprocessData::simulationFieldsDataBase::simulationFieldsDataBase
systemControl &control, systemControl &control,
const dictionary& postDict, const dictionary& postDict,
bool inSimulation, bool inSimulation,
timeValue startTime TimeValueType startTime
) )
: :
fieldsDataBase(control, postDict, inSimulation, startTime), fieldsDataBase(control, postDict, inSimulation, startTime),

View File

@ -60,7 +60,7 @@ public:
systemControl& control, systemControl& control,
const dictionary& postDict, const dictionary& postDict,
bool inSimulation, bool inSimulation,
timeValue startTime); TimeValueType startTime);
~simulationFieldsDataBase() override = default; ~simulationFieldsDataBase() override = default;

View File

@ -178,4 +178,26 @@ bool PostprocessOperationAverage::write(const fileSystem &parDir) const
return true; 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 } // namespace pFlow::postprocessData

View File

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

View File

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

View File

@ -86,12 +86,12 @@ private:
word fieldName_; word fieldName_;
/// Timestamp when mask was last updated (-1 indicates never updated) /// Timestamp when mask was last updated (-1 indicates never updated)
timeValue lastUpdated_ = -1; TimeValueType lastUpdated_ = -1;
/// Updates the mask based on current field values if needed, returns true if successful /// Updates the mask based on current field values if needed, returns true if successful
bool updateMask() bool updateMask()
{ {
timeValue t = database().currentTime(); TimeValueType t = database().currentTime();
if( equal( t, lastUpdated_)) return true; if( equal( t, lastUpdated_)) return true;
@ -206,11 +206,11 @@ private:
std::vector<bool> mask_; std::vector<bool> mask_;
timeValue lastUpdated_ = -1; TimeValueType lastUpdated_ = -1;
bool updateMask() bool updateMask()
{ {
timeValue t = database().currentTime(); TimeValueType t = database().currentTime();
if( equal( t, lastUpdated_)) return true; if( equal( t, lastUpdated_)) return true;

View File

@ -124,6 +124,25 @@ bool postprocessOperation::write(const fileSystem &parDir) const
return true; 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 uniquePtr<postprocessOperation> postprocessOperation::create
( (
const dictionary &opDict, const dictionary &opDict,

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