GOFUN2017 ParticleSimulations Slides
GOFUN2017 ParticleSimulations Slides
R OBER T K ASPER
Chair of Modeling and Simulation,
University of Rostock
March 21, 2017 © 2017 UNIVERSITY OF ROSTOCK | CHAIR OF MODELING AND SIMULATION 1 / 44
LeMoS
Outline
Introduction
Motivation
Lagrangian-Particle-Tracking in OpenFOAM
Fundamentals of Lagrangian-Particle-Tracking
Governing Equations
Particle Forces
Particle Response Time
Phase-Coupling Mechanisms
Particle-Particle Interaction
Application
How to build your own Eulerian-Lagrangian Solver in OpenFOAM
How to use your own Eulerian-Lagrangian Solver in OpenFOAM
Post-Processing with OpenFOAM/Paraview
March 21, 2017 © 2017 UNIVERSITY OF ROSTOCK | CHAIR OF MODELING AND SIMULATION 2 / 44
LeMoS
Outline
Introduction
Motivation
Lagrangian-Particle-Tracking in OpenFOAM
Fundamentals of Lagrangian-Particle-Tracking
Governing Equations
Particle Forces
Particle Response Time
Phase-Coupling Mechanisms
Particle-Particle Interaction
Application
How to build your own Eulerian-Lagrangian Solver in OpenFOAM
How to use your own Eulerian-Lagrangian Solver in OpenFOAM
Post-Processing with OpenFOAM/Paraview
March 21, 2017 © 2017 UNIVERSITY OF ROSTOCK | CHAIR OF MODELING AND SIMULATION 3 / 44
LeMoS
March 21, 2017 © 2017 UNIVERSITY OF ROSTOCK | CHAIR OF MODELING AND SIMULATION 4 / 44
LeMoS
Lagrangian-Particle-Tracking in OpenFOAM
• Solvers for any kind of particle-laden flow are already implemented1 :
• DPMFoam/MPPICFoam: Transient solver for the coupled transport of a single
kinematic particle cloud including the effect of the volume fraction of particles on the
continuous phase (Multi-Phase Particle In Cell modeling is used to represent collisions
without resolving particle-particle interactions)
• sprayFoam: Transient solver for compressible, turbulent flow with a spray particle cloud
• ...
March 21, 2017 © 2017 UNIVERSITY OF ROSTOCK | CHAIR OF MODELING AND SIMULATION 5 / 44
LeMoS
Outline
Introduction
Motivation
Lagrangian-Particle-Tracking in OpenFOAM
Fundamentals of Lagrangian-Particle-Tracking
Governing Equations
Particle Forces
Particle Response Time
Phase-Coupling Mechanisms
Particle-Particle Interaction
Application
How to build your own Eulerian-Lagrangian Solver in OpenFOAM
How to use your own Eulerian-Lagrangian Solver in OpenFOAM
Post-Processing with OpenFOAM/Paraview
March 21, 2017 © 2017 UNIVERSITY OF ROSTOCK | CHAIR OF MODELING AND SIMULATION 6 / 44
LeMoS
• Calculation of isothermal particle motions requires the solution of the following set of
ordinary differential equations:
• Newton’s second law of motion presupposes the consideration of all relevant forces
acting on the particle, e.g., drag, gravitational and buoyancy forces, pressure forces:
dup X
mp = Fi = FD + FG + FP + ... (2)
dt
March 21, 2017 © 2017 UNIVERSITY OF ROSTOCK | CHAIR OF MODELING AND SIMULATION 7 / 44
LeMoS
Drag Force
• Drag is the most important force (approx. 80 % of the total force) and is expressed in
terms of the drag coefficient CD :
πDp2
FD = CD ρf (uf − up ) |uf − up | (3)
8
• Putnam (1961):
(
24 2/3
1 + 16 Rep if Rep ≤ 1000
CD = Rep (5)
0.424 if Rep > 1000
March 21, 2017 © 2017 UNIVERSITY OF ROSTOCK | CHAIR OF MODELING AND SIMULATION 8 / 44
LeMoS
Drag Force
Measurement
Stokes regime
2
10 Newton regime
Schiller-Naumann
Putnam
101
CD [-]
100
10−1
Figure: Drag coefficient as a function of particle Reynolds number, comparison of experimental data with
correlations of Schiller-Naumann (1935) and Putnam (1961)
March 21, 2017 © 2017 UNIVERSITY OF ROSTOCK | CHAIR OF MODELING AND SIMULATION 9 / 44
LeMoS
ρf
FG = mp g 1 − (6)
ρp
• The force due to a local pressure gradient can be expressed for a spherical particle
simply as:
πDp3
FP = − ∇p (7)
6
• Expressing the local pressure gradient ∇p in terms of the momentum equation leads
to the final pressure gradient force:
πDp3
Duf
F p = ρf − ∇ · ν ∇uf + ∇uTf (8)
6 Dt
March 21, 2017 © 2017 UNIVERSITY OF ROSTOCK | CHAIR OF MODELING AND SIMULATION 10 / 44
LeMoS
Other Forces
• Slip-shear lift force: particles moving in a shear layer experience a transverse lift
force due to the nonuniform relative velocity over the particle and the resulting
nonuniform pressure distribution
• Slip-rotation lift force: particles, which are freely rotating in a flow, may also
experience a lift force due to their rotation (Magnus force)
• ...
March 21, 2017 © 2017 UNIVERSITY OF ROSTOCK | CHAIR OF MODELING AND SIMULATION 11 / 44
LeMoS
ρp Dp2
τp = , St = τp /τf (10)
18µf fD
Phase-Coupling Mechanisms
• Phase-coupling mechanisms strongly influences the behavior of the continous and
dispersed phase:
• One-way coupling: fluid → particles
• Two-way coupling: fluid particles
• Four-way coupling: fluid particles + particle collisions
5 103
10
two-way
coupling
104 102
τp /τe
coupling
2 100
10 (negligible
effect on
two-way
101 turbulence) 10−1
coupling
March 21, 2017 © 2017 UNIVERSITY OF ROSTOCK | CHAIR OF MODELING AND SIMULATION 13 / 44
LeMoS
Particle-Particle Interaction
• OpenFOAM uses the soft-sphere-model (DSEM)
• Particle-particle collisions are considered using a
spring, friction slider and dash-pot
March 21, 2017 © 2017 UNIVERSITY OF ROSTOCK | CHAIR OF MODELING AND SIMULATION 14 / 44
LeMoS
Outline
Introduction
Motivation
Lagrangian-Particle-Tracking in OpenFOAM
Fundamentals of Lagrangian-Particle-Tracking
Governing Equations
Particle Forces
Particle Response Time
Phase-Coupling Mechanisms
Particle-Particle Interaction
Application
How to build your own Eulerian-Lagrangian Solver in OpenFOAM
How to use your own Eulerian-Lagrangian Solver in OpenFOAM
Post-Processing with OpenFOAM/Paraview
March 21, 2017 © 2017 UNIVERSITY OF ROSTOCK | CHAIR OF MODELING AND SIMULATION 15 / 44
LeMoS
How to build your own Eulerian-Lagrangian Solver in
OpenFOAM
• Problem: no proper solver is available for your requirements? /
• Solution: customize an existing solver for your own purposes! ,
Figure: Particle-laden backward-facing step flow according to Fessler & Eaton (1999)
March 21, 2017 © 2017 UNIVERSITY OF ROSTOCK | CHAIR OF MODELING AND SIMULATION 16 / 44
LeMoS
How to build your own Eulerian-Lagrangian Solver in
OpenFOAM
1. Open a terminal and source OpenFOAM-4.x (if not already done)
2. Create a working directory for our Eulerian-Lagrangian solver and move into it:
mkdir solver/
cd solver/
3. Copy the original pimpleFoam solver (Large time-step transient solver for
incompressible, turbulent flow, using the PIMPLE (merged PISO-SIMPLE) algorithm)
from OpenFOAM-4.x and rename it:
cp -r $FOAM_SOLVERS/incompressible/pimpleFoam/ .
mv pimpleFoam pimpleLPTFoam/
cd pimpleLPTFoam/
March 21, 2017 © 2017 UNIVERSITY OF ROSTOCK | CHAIR OF MODELING AND SIMULATION 17 / 44
LeMoS
How to build your own Eulerian-Lagrangian Solver in
OpenFOAM
4. After moving into the pimpleLPTFoam directory, change the name of the pimpleFoam.C
file, remove the pimpleDyMFoam and SRFPimpleFoam sub-solver directories:
mv pimpleFoam.C pimpleLPTFoam.C
rm -r pimpleDyMFoam/ SRFPimpleFoam/
mkdir lagrangian
5. Copy the lagrangian library intermediate (includes submodels for particle forces,
particle collisions, injection and dispersion models,...) from OpenFOAM-4.x:
cp -r $FOAM_SRC/lagrangian/intermediate/ lagrangian/
6. Open the createFields.H file with a text editor for some customizations:
vi createFields.H
March 21, 2017 © 2017 UNIVERSITY OF ROSTOCK | CHAIR OF MODELING AND SIMULATION 18 / 44
LeMoS
How to build your own Eulerian-Lagrangian Solver in
OpenFOAM
7. Add the following code lines after #include "createMRF.H" to create and read
the fluid density from the transportProperties and calculate the inverse fluid density:
createFields.H
Info« "Reading transportProperties\n" « endl;
IOdictionary transportProperties
(
IOobject
(
"transportProperties",
runTime.constant(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
dimensionedScalar rhoInfValue
(
transportProperties.lookup("rhoInf")
);
dimensionedScalar invrhoInf("invrhoInf",(1.0/rhoInfValue));
March 21, 2017 © 2017 UNIVERSITY OF ROSTOCK | CHAIR OF MODELING AND SIMULATION 19 / 44
LeMoS
How to build your own Eulerian-Lagrangian Solver in
OpenFOAM
8. Create a volScalarField for the fluid density and the dynamic fluid viscosity:
createFields.H createFields.H
volScalarField rhoInf volScalarField mu
( (
IOobject IOobject
( (
"rho", "mu",
runTime.timeName(), runTime.timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh, laminarTransport.nu()
rhoInfValue *rhoInfValue
); );
March 21, 2017 © 2017 UNIVERSITY OF ROSTOCK | CHAIR OF MODELING AND SIMULATION 20 / 44
LeMoS
How to build your own Eulerian-Lagrangian Solver in
OpenFOAM
9. Initialize the basicKinematicCollidingCloud (includes particle-particle interactions):
createFields.H
const word kinematicCloudName
(
args.optionLookupOrDefault<word>("cloudName", "kinematicCloud")
);
Info« "Constructing kinematicCloud " « kinematicCloudName « endl;
basicKinematicCollidingCloud kinematicCloud
(
kinematicCloudName,
rhoInf,
U,
mu,
g
);
vi pimpleLPTFoam.C
March 21, 2017 © 2017 UNIVERSITY OF ROSTOCK | CHAIR OF MODELING AND SIMULATION 21 / 44
LeMoS
How to build your own Eulerian-Lagrangian Solver in
OpenFOAM
11. Add the basicKinematicCollidingCloud.H and readGravitationalAcceleration.H to the
existing header files:
pimpleLPTFoam.C
...
#include "turbulentTransportModel.H"
#include "pimpleControl.H"
#include "fvOptions.H"
#include "basicKinematicCollidingCloud.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "readGravitationalAcceleration.H"
#include "createControl.H"
#include "createTimeControls.H"
#include "createFields.H"
...
March 21, 2017 © 2017 UNIVERSITY OF ROSTOCK | CHAIR OF MODELING AND SIMULATION 22 / 44
LeMoS
How to build your own Eulerian-Lagrangian Solver in
OpenFOAM
12. Add the kinematicCloud.evolve() function after the PIMPLE corrector loop:
pimpleLPTFoam.C
// –- Pressure-velocity PIMPLE corrector loop
while (pimple.loop())
{
#include "UEqn.H"
// –- Pressure corrector loop
while (pimple.correct())
{
#include "pEqn.H"
}
if (pimple.turbCorr())
{
laminarTransport.correct();
turbulence->correct();
}
}
Info« "\nEvolving " « kinematicCloud.name() « endl;
kinematicCloud.evolve();
runTime.write();
March 21, 2017 © 2017 UNIVERSITY OF ROSTOCK | CHAIR OF MODELING AND SIMULATION 23 / 44
LeMoS
How to build your own Eulerian-Lagrangian Solver in
OpenFOAM
13. Open the UEqn.H file for some customizations:
vi UEqn.H
UEqn.H
tmp<fvVectorMatrix> tUEqn
(
fvm::ddt(U) + fvm::div(phi, U)
+ MRF.DDt(U)
+ turbulence->divDevReff(U)
==
fvOptions(U)
+ invrhoInf*kinematicCloud.SU(U)
);
fvVectorMatrix& UEqn = tUEqn.ref();
UEqn.relax();
March 21, 2017 © 2017 UNIVERSITY OF ROSTOCK | CHAIR OF MODELING AND SIMULATION 24 / 44
LeMoS
How to build your own Eulerian-Lagrangian Solver in
OpenFOAM
15. The implementation is (almost) done, but we need some customizations within the
Make directory of the intermediate library in order to compile everything correctly:
vi intermediate/Make/options
16. We want our own customized intermediate library (maybe to implement a own particle
force model or similar), so replace the last code line of the files file by:
files
LIB = $(FOAM_USER_LIBBIN)/libPimpleLPTLagrangianIntermediate
17. Tell the solver where he can find our intermediate library (and some additional too):
vi Make/options
March 21, 2017 © 2017 UNIVERSITY OF ROSTOCK | CHAIR OF MODELING AND SIMULATION 25 / 44
LeMoS
How to build your own Eulerian-Lagrangian Solver in
OpenFOAM
options
EXE_INC =
-Ilagrangian/intermediate/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
-I$(LIB_SRC)/regionModels/regionModel/lnInclude
EXE_LIBS = \
-L$(FOAM_USER_LIBBIN) \
-lPimpleLPTLagrangianIntermediate \
-llagrangian\
-lturbulenceModels \
-lincompressibleTurbulenceModels \
-lincompressibleTransportModels \
-lfiniteVolume \
...
March 21, 2017 © 2017 UNIVERSITY OF ROSTOCK | CHAIR OF MODELING AND SIMULATION 26 / 44
LeMoS
How to build your own Eulerian-Lagrangian Solver in
OpenFOAM
18. Tell the compiler the name of our new Eulerian-Lagrangian solver:
vi Make/files
files
pimpleLPTFoam.C
EXE = $(FOAM_USER_APPBIN)/pimpleLPTFoam
19. Finally, we can compile the intermediate library and the solver:
wmake all
March 21, 2017 © 2017 UNIVERSITY OF ROSTOCK | CHAIR OF MODELING AND SIMULATION 27 / 44
LeMoS
How to use your own Eulerian-Lagrangian Solver in
OpenFOAM
Particle-laden backward-facing step flow (Fessler & Eaton, 1999)
• Geometry:
• Step height: H = 26.7 mm
• Channel height/width: h = 40 mm, B = 457 mm
• Length inlet and expansion channel: LU = 5h, LD = 35h
Figure: Snapshot of the instantaneous velocity field |U| obtained from Large Eddy Simulation (sub-grid
scale turbulence model: Dynamic Smagorinsky (DSM)) for Re0 = 18.600
March 21, 2017 © 2017 UNIVERSITY OF ROSTOCK | CHAIR OF MODELING AND SIMULATION 29 / 44
LeMoS
How to use your own Eulerian-Lagrangian Solver in
OpenFOAM
• Basic folder structure of any OpenFOAM case:
0: includes the initial boundary conditions
constant: includes the mesh (polyMesh folder), physical properties of the fluid
(transportProperties), particle properties and settings (kinematicCloudProperties),...
system: includes the simulation settings (controlDict), settings for numerical schemes
(fvSchemes) and solver for the algebraic equations systems (fvSolution), decomposition
methods (decomposeParDict), ...
• Download the current tutorial case setup using the git clone command:
Git repository on Bitbucket
$ git clone https://slint@bitbucket.org/slint/gofun2017_particletut.git
March 21, 2017 © 2017 UNIVERSITY OF ROSTOCK | CHAIR OF MODELING AND SIMULATION 30 / 44
LeMoS
How to use your own Eulerian-Lagrangian Solver in
OpenFOAM
1. We start with the mesh generation → move into the tutorial directory and build the 2D
mesh using OpenFOAM’s blockMesh utility and check the mesh quality:
cd gofun2017_particletutorial/tutorial/BFS/
blockMesh
checkMesh
Figure: Two-dimensional block-structured mesh for the particle-laden backward-facing step flow
March 21, 2017 © 2017 UNIVERSITY OF ROSTOCK | CHAIR OF MODELING AND SIMULATION 31 / 44
LeMoS
How to use your own Eulerian-Lagrangian Solver in
OpenFOAM
2. Let’s see how to define initial boundary conditions (at the example of the velocity field):
}
value uniform (9.39 0 0); • Each patch needs an initial boundary
outlet condition
{
type zeroGradient;
}
walls
• Boundary conditions in OpenFOAM:
{
type noSlip; • Dirichlet (fixedValue)
}
sides • Neumann (fixedGradient/zeroGradient)
{
type empty;
} • Special types: cyclic, symmetry, empty
}
(for 2D caes), ...
March 21, 2017 © 2017 UNIVERSITY OF ROSTOCK | CHAIR OF MODELING AND SIMULATION 32 / 44
LeMoS
How to use your own Eulerian-Lagrangian Solver in
OpenFOAM
3. Let’s see how to set up the particle cloud:
kinematicCloudProperties
solution
{
• Activate/de-activate the particle cloud
active true;
coupled true;
transient yes; • Enable/disable phase coupling
cellValueSourceCorrection off;
maxCo 0.3;
interpolationSchemes • Transient/steady-state solution (max.
{
rho cell; Courant number)
U cell;
mu cell;
} • Enable/disable correction of momentum
integrationSchemes
{ transferred to the Eulerian phase
U Euler;
}
sourceTerms • Choose interpolation/integration
{
schemes schemes for the LPT and treatment of
{
U semiImplicit 1; source terms
}
March 21, 2017 © 2017 UNIVERSITY OF ROSTOCK | CHAIR OF MODELING AND SIMULATION 33 / 44
LeMoS
How to use your own Eulerian-Lagrangian Solver in
OpenFOAM
March 21, 2017 © 2017 UNIVERSITY OF ROSTOCK | CHAIR OF MODELING AND SIMULATION 34 / 44
LeMoS
How to use your own Eulerian-Lagrangian Solver in
OpenFOAM
kinematicCloudProperties
injectionModels
{ • Setup of the particle injection:
model1
{
type patchInjection;
• Injection model + injection patch name
patchName inlet;
duration 1; • Total duration of particle injection
parcelsPerSecond 33261;
massTotal 0; • Injected parcels/particles per second
parcelBasisType fixed;
flowRateProfile constant 1;
nParticle 1;
• Number of particles per parcel
SOI 0.4;
U0 (9.39 0 0); • Start-of-injection time (SOI)
sizeDistribution
{ • Initial parcel/particle velocity (U0 )
type fixedValue;
fixedValueDistribution
{
• Size distribution model (normal size
value 0.00007; distribution, ...)
}
}
}
}
March 21, 2017 © 2017 UNIVERSITY OF ROSTOCK | CHAIR OF MODELING AND SIMULATION 35 / 44
LeMoS
How to use your own Eulerian-Lagrangian Solver in
OpenFOAM
March 21, 2017 © 2017 UNIVERSITY OF ROSTOCK | CHAIR OF MODELING AND SIMULATION 36 / 44
LeMoS
How to use your own Eulerian-Lagrangian Solver in
OpenFOAM
• Adjust the particle-particle and
kinematicCloudProperties particle-wall interaction model
pairCollisionCoeffs coefficients:
{
maxInteractionDistance 0.00007; • α: coefficient related to the coefficient
writeReferredParticleCloud no; of restitution e (see diagram)
pairModel pairSpringSliderDashpot;
pairSpringSliderDashpotCoeffs • b: Spring power → b = 1 (linear) or
{
useEquivalentSize no; b = 3/2 (Hertzian theory)
alpha 0.12;
b 1.5; • µ: friction coefficient
mu 0.52;
cohesionEnergyDensity 0; 1
collisionResolutionSteps 12;
}; 0.8
wallModel wallSpringSliderDashpot;
0.6
wallSpringSliderDashpotCoeffs
e [-]
{
0.4
useEquivalentSize no;
collisionResolutionSteps 12;
0.2
youngsModulus 1e10;
poissonsRatio 0.23;
alpha 0.12; 0
0.01 0.05 0.1 0.5 1 5
b 1.5; α [-]
mu 0.43;
cohesionEnergyDensity 0;
}; Figure: Relationship between α and the coefficient
}
of restitution e (Tsuji et al., 1992)
March 21, 2017 © 2017 UNIVERSITY OF ROSTOCK | CHAIR OF MODELING AND SIMULATION 37 / 44
LeMoS
How to use your own Eulerian-Lagrangian Solver in
OpenFOAM
kinematicCloudProperties
cloudFunctions
{ • Use cloudFunctions to record particle
voidFraction1
{ tracks, calculate particle erosion, ...
type voidFraction;
}
value ( 0 -9.81 0 );
March 21, 2017 © 2017 UNIVERSITY OF ROSTOCK | CHAIR OF MODELING AND SIMULATION 38 / 44
LeMoS
How to use your own Eulerian-Lagrangian Solver in
OpenFOAM
6. Use OpenFOAM’s foamMonitor utility to check the convergence:
foamMonitor -l postProcessing/residuals/0/residuals.dat
March 21, 2017 © 2017 UNIVERSITY OF ROSTOCK | CHAIR OF MODELING AND SIMULATION 39 / 44
LeMoS
paraFoam
2. Load the last time step and check the velocity and pressure field:
March 21, 2017 © 2017 UNIVERSITY OF ROSTOCK | CHAIR OF MODELING AND SIMULATION 40 / 44
LeMoS
3. Let’s check how much volume of each grid cell is occupied by particles (void fraction
α = Vp /Vc ):
March 21, 2017 © 2017 UNIVERSITY OF ROSTOCK | CHAIR OF MODELING AND SIMULATION 41 / 44
LeMoS
4. Sample the flow and particle velocity using OpenFOAM’s sample utility (see
OpenFOAM user guide) and plot the velocity profiles:
2.5 EFD: LDA (Fessler et al.)
2 CFD Simulation
1.5
y /H
1
0.5
0
−2 0 2 4 6 8 10 12 14
2 · hUp,x i/U0 + x/H
March 21, 2017 © 2017 UNIVERSITY OF ROSTOCK | CHAIR OF MODELING AND SIMULATION 42 / 44
LeMoS
Crow, T. C., Schwarzkopf, J. D., Sommerfeld, M. and Tsuji, Y., 2011, Multiphase flows
with droplets and particles, 2nd ed., CRC Press, Taylor & Francis.
Sommerfeld, M., 2010, Particle Motion in Fluids, VDI Heat Atlas, Springer.
Tsuji, Y., Tanaka, T. and Ishida, T., 1992, Lagrangian numerical simulation of plug flow
of collisionless particles in a horizontal pipe, Powder Tech., Vol. 71, 239.
March 21, 2017 © 2017 UNIVERSITY OF ROSTOCK | CHAIR OF MODELING AND SIMULATION 43 / 44
LeMoS
Any questions?
March 21, 2017 © 2017 UNIVERSITY OF ROSTOCK | CHAIR OF MODELING AND SIMULATION 44 / 44