Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
yotakagi77
Open
CAE
Local
User
Groups
in
Japan
@Kansai
June
13,
2015,
Osaka
University
Agenda
Basic
informa*on
on
turbulence
model
Tensor
mathema*cs
Exercise
1:
Compiling
and
execu*on
of
WALE
model
Exercise
2:
Implementa*on
of
coherent
structure
Smagorisky
model
Addi*onal
works
Basic
informa*on
on
turbulence
model
Turbulent
ow
simula*on
DNS
LES
RANS
Modeling
No
Subgrid
scale
Reynolds
average
Accuracy
Cost
Spalart (2001)
Super-Region
Region
Euler
(ER)
RANS
(RR)
Viscous
(VR)
Outer
(OR)
LES
(LR)
Viscous
(VR)
Focus
(FR)
Departure
(DR)
8
Detached-eddy
simula*on
(DES)
P.
R.
Spalart
(1997):
We
name
the
new
approach
Detached-Eddy
Simula8on
(DES)
to
emphasize
its
dis8nct
treatments
of
a?ached
and
separated
regions.
Spalart (2001)
Super-Region
Region
Euler
(ER)
RANS
(RR)
Viscous
(VR)
Outer
(OR)
LES
(LR)
Viscous
(VR)
Focus
(FR)
Departure
(DR)
9
Coupling
with
momentum
equa*on
through
viscosity
RANS
U
t ( (
+ (UU) ( + t ) U + (U)T )) = p
Turbulent viscosity
LES
U
t ( (
+ (UU) ( + SGS ) U + (U)T )) = p
Sub-grid scale viscosity
Spa*al Temporal
Dij = Sij + ij
1 T 1 T
T = (T + T ) + (T T ) = symm T + skewT,
2 2
tr T = T11 + T22 + T33,
diag T = (T11,T22 ,T33 ),
1 1
T = T (tr T)I + (tr T)I = dev T + hyd T,
3 3
T11 T12 T13
det T = T21 T22 T23
T31 T32 T33
OpenFOAM
tensor
classes
Opera2on
Mathema2cal
Class
Addi*on
a
+
b
a
+
b
Subtrac*on
a
b
a
b
Scalar
mul*plica*on
sa
s
*
a
Scalar
division
a
/
s
a
/
s
Outer
product
a
b
a
*
b
Inner
product
a
b
a
&
b
Double
inner
product
a
:
b
a
&&
b
Cross
product
a
b
a
^
b
Square
a2
sqr(a)
Magnitude
squared
|a|2
magSqr(a)
Magnitude
|a|
mag(a)
Power
an
pow(a,
n)
OpenFOAM
tensor
classes
Opera2on
Mathema2cal
Class
Transpose
TT
T.T()
Diagonal
diag
T
diag(T)
Trace
tr
T
tr(T)
Deviatoric
component
dev
T
dev(T)
Symmetric
component
symm
T
symm(T)
Skew-symmetric
skew
T
skew(T)
component
Determinant
det
T
det(T)
Cofactors
cof
T
cof(T)
Inverse
inv
T
inv(T)
Exercise
1:
Compiling
and
execu*on
of
WALE
model
Governing
equa*on
for
incompressible
LES
LESModel
WALE;
printCoeffs
on;
delta
cubeRootVol;
...
Simula*on
of
channel
ow
$ gedit
system/controlDict
...
libs
("libincompressibleWALE.so");
controlDict
{
deltaT
0.002;
endTime
0.022;
libs
"libincompressibleWALE.so";
}
Simula*on
of
channel
ow
at
Re
=
110
turbulenceProperties
{
simulationType
LESModel;
}
LESProperties
{
LESModel
WALE;
delta
cubeRootVol;
}
In
dynLagrangian.C
void
dynLagrangian::updateSubGridScaleFields
(const
tmp<volTensorField>&
gradU)
{
nuSgs_
=
(flm_/fmm_)*sqr(delta())*mag(dev(symm(gradU)));
nuSgs_.correctBoundaryConditions();
}
In
dynOneEqEddy.C
void
dynOneEqEddy::updateSubGridScaleFields
(
const
volSymmTensorField&
D,
const
volScalarField&
KK
)
{
nuSgs_
=
ck(D,
KK)*sqrt(k_)*delta();
nuSgs_.correctBoundaryConditions();
}
Understanding
formula*on
with
codes
where
1 # ui u j & 1 # ui u j &
Sij = %% + ((, ij = %% ((
2 $ x j x i ' 2 $ x j x i '
Coherent
structure
Smagorinsky
model
for
non-
rota*ng
ow
(NRCSM)
Smagorinsky
model
(SM)
based
on
an
eddy-viscosity,
aij = 2C2 | S | Sij
(aij = 2t Sij , t = C2 | S |)
The
model
parameter
C
is
determined
as
follows:
C = C1 | FCS |3 / 2
with
1 Q
C1 = , FCS =
20 E
where
2
1 $
1 ui '
E = ( ij ij + Sij Sij )
= && ))
2 2 % x j (
with
1 Q
C2 = , FCS = , F = 1 FCS
22 E
where
2
1 $
1 ui '
(
E = ij ij + Sij Sij ) = && ))
2 2 % x j (
Improved
CSM
model
is
valid
for
rota*ng
ow.
Seung
for
making
new
library
1. Copy
the
source
code
of
WALE
model.
Compile
them.
$ run
$ cd
../src/libraries
$ cp
-r
incompressibleWALE/WALE/
./NRCSM
$ cp
r
incompressibleWALE/Make
./NRCSM
$ cd
NRCSM
$ rename
WALE
NRCSM
*
$ rm
r
NRCSM.dep
$ rm
rf
Make/linux64Gcc47DPOpt
$ gedit
Make/files
NRCSM.C
LIB
=
$(FOAM_USER_LIBBIN)/libNRCSM
$ wmake
libso
Q
and
E
calcula*ons
4. In
NRCSM.C,
insert
the
calcula*on
of
Q
and
E.
Copy&Paste
the
corresponding
sec*on
from
Q.C.
Save
and
Compile
them.
$ gedit
NRCSM.C
NRCSM.C
volScalarField
Q
(
0.5*(sqr(tr(gradU))
-
tr(((gradU)&(gradU))))
);
volScalarField
E
(
0.5*(gradU
&&
gradU)
);
$ wmake
libso
FCS
and
C
calcula*ons
5. In
NRCSM.C,
insert
the
calcula*on
of
FCS
and
C
(coecient
of
eddy
viscosity
model).
Save
and
Compile
them.
$ gedit
NRCSM.C
NRCSM.C
volScalarField
Fcs
(
Q/
max(E,dimensionedScalar("SMALL",E.dimensions(),SMALL))
);
volScalarField
ccsm_
(
c1_*pow(mag(Fcs),1.5)
);
$ wmake
libso
SGS
calcula*on
6. In
NRCSM.C,
modify
the
nuSGS_
calcula*on.
Look
the
other
updateSubGridScaleFields
func*ons
in
the
dynamic
models.
$ gedit
NRCSM.C
NRCSM.C
nuSgs_
=
ccsm_*sqr(delta())*mag(dev(symm(gradU)));
LESModel
NRCSM;
printCoeffs
on;
delta
cubeRootVol;
...
Valida*on
with
channel
ow
$ gedit
system/controlDict
...
libs
("libNRCSM.so");