-
Notifications
You must be signed in to change notification settings - Fork 19
Tutorial: incompressible‐‐pimpleHFDIBFoam‐‐fallingParticleDistribution
This tutorial represents a situation where a number of non-spherical particles of different sizes is sedimenting in a rectangular domain.
Note that in order for the tutorial to be fast to evaluate even on personal computers, it is constructed as two-dimensional. However, the DEM part of the code is suitable only for three-dimensional simulations and the particles properties were adjusted in such a way that the tutorial gives plausible results.
The test case is built with dimensions (120mm,0.1mm,6mm) defined as a single block, as the figure below depicts. The front and back in Y directions are prescribed as type empty
, and the active boundaries prescribed as type wall
are highlighted in green. These boundaries are prescribed with zeroGradient
boundary condition for pressure and noSlip
for fluid velocity. Remaining type patch
boundary, highlighted in blue, is prescribed with fixedValue
set to uniform 0
boundary condition for pressure and zeroGradient
for fluid velocity. For details see files
"tutorialDirectory"/system/blockMeshDict
for details regarding mesh construction and
"tutorialDirectory"/0.org/U
"tutorialDirectory"/0.org/p
for details regarding boundary and initial condition settings
please note that the dimensions depicted are in millimeters
To configure the DEM solver you must open the HFDIBDEMDict found at path
"tutorialDirectory"/constant/HFDIBDEMDict
Right below the openFOAM head of the file is located bodyNames()
list option. Here, you define particle names that you wish to include in your simulation; if the particle is based on STL surface mesh, please insert the file with the matching in name into the directory. In our case, we are working with a particle named "icoSphere". Therefore, we will modify the list as bodyNames("icoSphere")
, which is linked to the file located here:
"tutorialDirectory"/constant/triSurface/icoSphere.stl
next we enter global solver configurations,
-
interpolationSchemes
setting for immersed boundary method -
surfaceThreshold
threshold for particle projection and interpolation schemes, -
stepDEM
integration step for DEM solver working splitting global CFD integration step the inverse value is amount of DEM steps per one CFD iteration -
geometricD
active considered active directions(1) for active (-1) for inactive -
recordSimulation
boolean option to separately record the position of particles at a given time -
recordFirstTimeStep
boolean option to record initial position of particles added to domain -
nSolidsInDomain
upper limit of particle which can be active within domain, when not entered the default value is 1000
next is the control of the outputs, while the solver runs are outupts may be required for debugging purpose otherwise they tend to slow down simulation time or even overload memory and lead to the crash of simulation. For these purposes solver enables outputSetup
dict where following outputs may be enabled
-
basic
simulation time info and body velocities and location per CFD step -
iB
detailed info regarding particle properties per DEM step -
DEM
detailed info regarding particle contact treatment -
addModel
detailed info regarding particle addition into the computational domain -
parallelDEM
detailed info regarding particle contact treatment from all subdomains for parallel computations
next is the DEM
dictionary to set material and properties. The materials
is the sub-dictionary where multiple materials might be defined using
-
Y
- Young Modulus (material stiffness), -
nu
- Poisson ratio, -
mu
- static friction coefficient, -
adhN
- normal adhesion coefficient, -
eps
- coefficient of restitution (dissipation). Next the curvature coefficientLcCoeff
represents the local curvature of the considered solids.collisionPatches
is sub-dictionary for a definition of collision boundaries which may or may not correspond with system boundaries eachwall
is defined as a dictionary consisting of -
material
enter the above defined material, -
nVec
normal vector of the boundary which points out from the domain and -
planePoint
arbitrary point located at the desired patch. Which concludes present DEM options.
The virtualMesh
dictionary is a setting of the contact treatment algorithm for STL mesh-based solids. It is described by level
- a decomposition level similar to snappyHexMesh settings declaring how much the contact area will be refined—and by charCellSize
—the size of the characteristic computational cell for initial refinement of the contact area.
These settings conclude that the general setting of the HFDIBDEMDict does not directly concern particle properties. To prescribe particle properties, the dictionary must be defined with the given name of the particle, in our case, icoSphere{}
Within this dictionary, you must define particle motion for freely moving enter
-
fullyCoupledBody;
if you wish to determine initial velocity you may enterfullyCoupledBody{velocit (0 1 0);}
. - To prescribe particle material, define
material *name*
and state the name of the defined material also define particle density asrho rho [1 -3 0 0 0 0 0] *value*;
. - To prescribe boundary condition for fluid interaction, define dictionary
U{BC noSlip;}
, which is the only value presently implemented. - For body geometry,
bodyGeom
, which is in this caseconvex
- to enable particle rotation, define
updateTorque
and set ittrue
- for particle to start synchronised with fluid velocity and rotation, set
startSynced true
in this case we assume no initial velocity for particle - to freeze the simulated particle at a place after prolonged contact with a static object, other particle, or boundary use
timesToSetStatic
and enter the number of time steps after which the particle will be stoped at place in this case this counter is set for 80.
For the given tutorial we wish to add size distribution of the given particle. Therefore, we shall define bodyAddition
sub-dictionary and set it to addModel distribution
. This is configured as
bodyAddition
{
addModel distribution;
distributionCoeffs
{
stlBaseSize 0.005; //stating referential size of the STL file
addMode fieldBased; //selecting mode to condition particle addition
fieldBasedCoeffs
{
fieldName lambda; //name of the indicator field
fieldValue 0.05; //minimal field value before addition
}
addDomain boundBox; //choosing to create new particles within the bounding box
boundBoxCoeffs
{
minBound (0 -0.001 -0.03);
maxBound (0.04 0.001 0.03);
}
scalingMode noScaling; //aded particles wont be additionally rescaled
noScalingCoeffs{};
rotationMode noRotation; /added particles wont be additionally rotated
noRotationCoeffs{};
}
}
This addModel in particular requires additional data in file
"tutorialDirectory"/constant/distributionDict
in which particle size distribution is defined in two dictionaries distribution
and particleSize
for the former state percentage of given particle size you wish to include, this is defined in former as scale factor to STL size stated as convertToMeters
. Further more arbitry rotates particles as well.
each particle dict should also include refineBuffers 1;
,sdBasedLambda false;
the first is for adaptive mesh refinement which can be enabled in dynamicMeshDict, the second is old option which will be removed in next major update.
The case setting is then concluded with prescription of gravity in
"tutorialDirectory"/constant/g
with value (9.81 0 0 );
as this tutorial is for CFD-DEM simulation we must include gravity for fluid flow as well with the use of the fvOptions see
"tutorialDirectory"/system/fvOptions
With this, the solver's configuration should be concluded, and you may proceed to run the simulation. You may also inspect other settings. However, these are common for all OpenFOAM pimpleFOAM-based cases.
The case is run using ./Allrun &
or bash Allrun &
script:
`#!/bin/sh
. $WM_PROJECT_DIR/bin/tools/RunFunctions
rm -rf 0
cp -r 0.org 0
runApplication blockMesh # mesh generation, see system/blockMeshDict
application=`getApplication` # selects application (pimpleHFDIBFoam) from system/controlDict
runApplication $application # run the simulation itself
paraFOAM -touch # to create .OpenFOAM file for visualisation in paraview
after the simulation ends, you may proceed to visualization and optional post-processing.
Several approaches might be used to visualize the results of the CFD-DEM simulation depending on the level of detail you wish to achieve. Let's stared with the minimalistic approach using only the paraview, Let enter following command in terminal opened in tutorial directory
paraFOAM
openHFDIB-DEM wiki, pose questions in Discussions or via email.