interphaschangefoam and pans
TRANSCRIPT
-
8/10/2019 InterPhasChangeFoam and PANS
1/40
Abolfazl Asnaghi
Dec 2013
interPhaseChangeFoam PANS Turbulence Models
-
8/10/2019 InterPhasChangeFoam and PANS
2/40
Cavitation
A BC
D E F
Flow Direction
Pressure
A
B
CE
F
Liq.
Vap
D
Liq-Vap
Liq : Liquid
Vap: Vapor
-
8/10/2019 InterPhasChangeFoam and PANS
3/40
Cavitation
-
8/10/2019 InterPhasChangeFoam and PANS
4/40
Cavitation & OpenFoam
Available solvers in OF for multiphase simulations:
o cavitatingFoam
o compressibleInterFoam
o compessibleTwoPhaseEulerFoam
o interFoam
o
interPhaseChangeFoam
Find more information here:
http://www.openfoam.org/docs/user/standard-solvers.php
o multiphaseEulerFoam
o multiphaseInterFoam
o settlingFoam
o twoLiquidMixingFoam
o
twoPhaseEulerFoam
-
8/10/2019 InterPhasChangeFoam and PANS
5/40
interPhaseChangeFoam Solver
interPhaseChangeFoam
Solver for 2 incompressible, isothermal immiscible
fluids with phase-change (e.g. cavitation). Uses a VOF
(volume of fluid) phase-fraction based interface
capturing approach
interPhaseChangeDyFoam
Added in OF2.2.2 (since after will be called OF)
Providing optional mesh motion and mesh topology
changes including adaptive re-meshing
-
8/10/2019 InterPhasChangeFoam and PANS
6/40
-
8/10/2019 InterPhasChangeFoam and PANS
7/40
interPhaseChangeFoam Structureo alphaEqn.H
o alphaEqnSubCycle.H
o createFields.Ho interPhaseChangeFoam.C
o pEqn.H
o UEqn.H
o phaseChangeTwoPhaseMixtures Folder
o Kunz Folder
Kunz.C
Kunz.H
o Merkle Folder
Merkle.C
Merkle.H
o phaseChangeTwoPhaseMixture Folder
phaseChangeTwoPhaseMixture.C
phaseChangeTwoPhaseMixture.HnewPhaseChangeTwoPhaseMixture.C
newPhaseChangeTwoPhaseMixture.H
o SchnerrSauer Folder
SchnerrSauer.C
SchnerrSauer.H
o Make Folder
files
o tions
-
8/10/2019 InterPhasChangeFoam and PANS
8/40
interPhaseChangeFoam Structure
o alphaEqn.H
o alphaEqnSubCycle.H
o interPhaseChangeFoam.C
o pEqn.H
o
UEqn.Ho phaseChangeTwoPhaseMixtures Folder
o phaseChangeTwoPhaseMixture Folder
phaseChangeTwoPhaseMixture.C
phaseChangeTwoPhaseMixture.H
o SchnerrSauer Folder
SchnerrSauer.C
SchnerrSauer.H
-
8/10/2019 InterPhasChangeFoam and PANS
9/40
User Input
o Initial time folder (usually zero folder)
U: velocity (m/s)
alpha1: liquid volume fraction (must be between zero & one
p_rgh = p-rho.g.h where p here is the thermodynamic pressure which comes
from intermolecular forces and you see it in the N.S. equations (pa)
-
8/10/2019 InterPhasChangeFoam and PANS
10/40
User Input
o constant folder: transportProperties file
Select the phase change model
Define the saturation pressure
Define the surface tension
Define the phases propertiesRemember for cavitation, the first phase is liquid
Define the phases change model propertiesn: number of nuclei
dNuc: average diameter of nuclei
Cc: condensation rate coefficient
Cv: vaporization rate coefficient
-
8/10/2019 InterPhasChangeFoam and PANS
11/40
Solver Flowchart
Reading maxCo, and maxDeltaT from controlDict
Calculates and outputs the mean and
maximum Courant Numbers
Calculates deltaT based on the
maximum Courant Number in the
flow, maximum allowed CourantNumber and maximum allowed deltaT
Calculates viscosity of mean flow
based on the each phase properties,
specified viscosity models for each
phase and alpha distribution. For
homogenous assumption:
lvvvm
lvvvm
)1(
)1(
In C file: #include "phaseChangeTwoPhaseMixture.H
And then in the above H file:#include "incompressibleTwoPhaseMixture.H"
-
8/10/2019 InterPhasChangeFoam and PANS
12/40
Solver Flowchart
Solves alpha1 transport equation, and
obtains new distribution
Correct the alpha boundary condition,
and also interface curvature.
PIMPLE loop to solve momentum, pressure
correction, and turbulence equations.
-
8/10/2019 InterPhasChangeFoam and PANS
13/40
UEqn
Keeping this term (which is the
continuity equation, and in converged
solution is equal to zero ) would increase
the stability of the solution considerably
gx
p
xgxg
x
gx
.
x
gxp
xgxg
x
p
.
This trick has simplified the boundary condition
implementation, and also increased the stability
when the gravity should be considered
-
8/10/2019 InterPhasChangeFoam and PANS
14/40
pEqn(just intrested parts)
Calling the source terms of pressure
correction equation, vDotP
C: stands for construction of liquid
V: stands for vaporization of liquid
Splitting the source terms in two termsSp as diagonal, and the other as Su
ghpSatVVpVV
pSatghghpVVpSatpVVU
vpcprghvpcp
vpcpvpcpf
..
...
* Look at the Jassak PhD thesis for further information about pressure correction equations
-
8/10/2019 InterPhasChangeFoam and PANS
15/40
alphaEqnSubCycle
Calling nAlphaSubCycles and
nAlphaCorr frompimpleDic
in system/fvSolution file
cAlpha(): two phase interface compression(relative velocity) coefficient, defined by
user at system/fvSolution:alpha Dictionary
Ref. Henrik PhD Thesis, Eq:3-58
rhoPhi is
set to zero
-
8/10/2019 InterPhasChangeFoam and PANS
16/40
alphaEqnSubCycle
Maximum allowed time step for alpha equation is much lower than the one that we can use for
solving momentum or turbulence equations.
Therefore, we consider deltaT as the main time step for momentum or turbulence equations,
and use deltaT/nAlphaSubCycle as the time step for alpha equation.
rhoPhiSum is set equal to rhoPhi equal to zero
Main time step used in other equations
subCycle.H is added to main .C file which
itself contains subCycleTime.H
In subCycle.H, runTime.deltaT() has been changed to
deltaT/nAlphaSubCycle or equivalently totalDeltaT/nAlphaSubCycle
-
8/10/2019 InterPhasChangeFoam and PANS
17/40
alphaEqn
l
i
rvl
i
illS
x
u
x
u
t
vvlli UUU
vl UUUr
-
8/10/2019 InterPhasChangeFoam and PANS
18/40
Importance of Turbulence Model
Twist11 HydroFoil - k Omega SST
A.Asnaghi, 16thNumerical Towing Tank Symposium, 2013
-
8/10/2019 InterPhasChangeFoam and PANS
19/40
PANS
PANS = Partially Averaged Navier Stokeso If all of the velocity disturbance specturm be solved that would be DNS:
very high precision but huge amount of computational cost
o If we use vaerage of all of the velocity disturbance specturm that would be
RANS: fair precision with acceptable computational cost
o In PANS, we are aiming to calculate some parts of unresolved velocity
disturbance specturm.
PANS
RANS DNS
PANS = Partially Averaged Navier Stokeso The main advantage of PANS (and other scale adaptive methods) is that it
switches depending on resolution, and can converges to DNS in the
resolution limit.
o Where can one use this in its work?
It is an attractive feature since it means that one could have primarily
RANS for the most parts of the computation domain and spend the
resources on the more importance parts where he/she needs the structures
and more detailed simulation.
-
8/10/2019 InterPhasChangeFoam and PANS
20/40
PANS
Starting point: defining the mapping functions:
o Where u stands for unresolved
o Unresolved means those parts of fluctuation spectrum band that instead of solvinghave been averaged
o This mapping functions have been proposed for k-epsilon model. However, they
can be extended to other RANS models, e.g. K-Omega
-
8/10/2019 InterPhasChangeFoam and PANS
21/40
PANS
k
ik
t
ii
immP
x
k
xx
ku
t
k
Transport Equations for standard k-Epsilon model
uu
i
u
ku
u
ii
uimumP
x
k
xx
ku
t
k
Transport Equations for PANS k-Epsilon model
Sk
Ck
PCf
xxx
u
tu
u
u
uu
k
i
u
u
u
ii
uimum
2
*
21
Sk
CPCPk
Cxxx
u
t bki
t
ii
imm
2
231
-
8/10/2019 InterPhasChangeFoam and PANS
22/40
-
8/10/2019 InterPhasChangeFoam and PANS
23/40
Turbulence model Cd Cd Error (%) Strouhal number St. Error (%)
kEpsilon 1.67 -20.5 0.1348 2.12
OEEVM (LES) 2.05 -2.4 0.1333 1
PANS 2.139 1.8 0.1293 -2.04
Reference Value (Exp.) 2.1 ----- 0.132 -----
Flow Over a Square Cylinder
U = 0.54 m/s with 2% turbulence
Re = 22 000
Size of the square cylinder is 0.04 m wide and 0.392 m high.
Its situated in a tunnel with a width of 14D = 0.56 m
Primitive Results
-
8/10/2019 InterPhasChangeFoam and PANS
24/40
Thank you
-
8/10/2019 InterPhasChangeFoam and PANS
25/40
Backup Slides
-
8/10/2019 InterPhasChangeFoam and PANS
26/40
Turbulence Models
kEpsilon
-
8/10/2019 InterPhasChangeFoam and PANS
27/40
Turbulence Models
kEpsilon
-
8/10/2019 InterPhasChangeFoam and PANS
28/40
Turbulence Models
PANS
based on kEpsilon RANS Model
By defining the mapping functions:
-
8/10/2019 InterPhasChangeFoam and PANS
29/40
-
8/10/2019 InterPhasChangeFoam and PANS
30/40
General Governing Equations
1
1
n
i
i
0
i
imm
x
u
t
g
x
u
x
u
xx
P
x
uu
t
u
m
i
j
j
i
m
jij
jimim
lvvvmvvvm )1(,)1(
SSDt
D
x
uS
x
u
tl
vl
m
m
mi
i
i
ivv
1,
To simulate phase change rate, few models are available: Sauer, Kunz, Singhal, ...
-
8/10/2019 InterPhasChangeFoam and PANS
31/40
PANS Implementation in OpenFoam
Create the initial files from original kEpsilon turbulence model
o Open a new terminal
o Load openfoam
o Copy kEpsilon turbulence model to your directory
o Rename the folder and its files (kEpsilon.C and kEpsilon.H) to kEpsilonPANS
o Replace all of the kEpsilon words with kEpsilonPANS in .C and .H files
o Go to Make folder, and then into the files
Replace kEpsilon with kEpsilonPANS, and also libkEpsilon with
libkEpsilonPANS
Debug the model (wmake libso)
-
8/10/2019 InterPhasChangeFoam and PANS
32/40
PANS Implementation in kEpsilonPANS.C
In the Constructors part of kEpsilonPANS.C, and between definitions ofsigmaEps_ and k_, define the following parameters: fEpsilon, and fK
fEpsilon_
(
dimensioned::lookupOrAddToDict
("fEpsilon",
coeffDict_,
1.0
)
),
fK_
( dimensioned::lookupOrAddToDict
(
"fK",
coeffDict_,
0.2
)
),
-
8/10/2019 InterPhasChangeFoam and PANS
33/40
eBtween definitions of epsilon_ and nut_, define the fields of kU_ andepsilonU_
kU_
(IOobject
(
"kU",
runTime_.timeName(),
mesh_,
IOobject::NO_READ,
IOobject::AUTO_WRITE),
autoCreateK("kU", mesh_)
),
epsilonU_
(IOobject
(
"epsilonU",
runTime_.timeName(),
mesh_,
IOobject::NO_READ,
IOobject::AUTO_WRITE),
autoCreateEpsilon("epsilonU", mesh_)
),
PANS Implementation in kEpsilonPANS.C
-
8/10/2019 InterPhasChangeFoam and PANS
34/40
After printCoeffs() add the following command. So you can be sure duringsimulation that an appropriate turbulence model has been called
Info
-
8/10/2019 InterPhasChangeFoam and PANS
35/40
In the kEpsilonPANS::correct section, do the following
1- Add definitions of C2U parameters
2- replace epsilon and k with epsilonU and kU in the section related to
creating equations
const dimensionedScalar C2U = C1_ + (fK_/fEpsilon_) * (C2_ - C1_);
// Unresolved Turbulent kinetic energy equation
tmp kUEqn
(
fvm::ddt(kU_)
+ fvm::div(phi_, kU_)
- fvm::laplacian(DkUEff(), kU_)==
G
- fvm::Sp(epsilonU_*fK_/kU_, kU_)
);
kUEqn().relax();
solve(kUEqn);bound(kU_, fK_ * kMin_);
PANS Implementation in kEpsilonPANS.C
-
8/10/2019 InterPhasChangeFoam and PANS
36/40
// Update unresolved epsilon and G at the wall
epsilonU_.boundaryField().updateCoeffs();
// Unresolved Dissipation equation
tmp epsUEqn
(
fvm::ddt(epsilonU_)+ fvm::div(phi_, epsilonU_)
- fvm::laplacian(DepsilonUEff(), epsilonU_)
==
C1_*G*(epsilonU_)/(kU_)
+ fvm::Sp(C1_*(1-fK_)*(epsilonU_)/(kU_), epsilonU_)
- fvm::Sp(C2U*(epsilonU_)/(kU_), epsilonU_)
);
epsUEqn().relax();
epsUEqn().boundaryManipulate(epsilonU_.boundaryField());
solve(epsUEqn);
bound(epsilonU_, fEpsilon_ * epsilonMin_);
PANS Implementation in kEpsilonPANS.C
-
8/10/2019 InterPhasChangeFoam and PANS
37/40
Calculate k, and epsilon based on the kU, and epsilon
// Calculation of Turbulent kinetic energy and Dissipation rate
k_ = kU_/fK_;
epsilon_ = (epsilonU_)/(fEpsilon_);
// Re-calculate viscosity
nut_ = Cmu_*sqr(kU_)/epsilonU_;
PANS Implementation in kEpsilonPANS.C
-
8/10/2019 InterPhasChangeFoam and PANS
38/40
Calculate k, and epsilon based on the kU, and epsilon
// Calculation of Turbulent kinetic energy and Dissipation rate
k_ = kU_/fK_;
epsilon_ = (epsilonU_)/(fEpsilon_);
// Re-calculate viscosity
nut_ = Cmu_*sqr(kU_)/epsilonU_;
PANS Implementation in kEpsilonPANS.C
-
8/10/2019 InterPhasChangeFoam and PANS
39/40
Add definition of fEpsilon, and fK to protected data:model coefficients
Add definition of kU, and epsilonU to protected data:Fields
In the Member Function, add definition of kU and epsilonU fields
Define DkUEff, and DepsilonUEff fields
PANS Implementation in kEpsilonPANS.H
dimensionedScalar fEpsilon_;
dimensionedScalar fK_;
volScalarField kU_;volScalarField epsilonU_;
//- Return the unresolved turbulence kinetic energy
virtual tmp kU() const
{return kU_;
}
//- Return the unresolved turbulence kinetic energy
dissipation rate
virtual tmp epsilonU() const
{
return epsilonU_;}
-
8/10/2019 InterPhasChangeFoam and PANS
40/40