Lecture 05
Lecture 05
Viewpoint: Part 1
V.Vuorinen
Aalto University School of Engineering
CFD Course, Spring 2017
V.Vuorinen
Aalto University School of Engineering
CFD Course, Spring 2017
dEtot
kin
= tot <0
dt
1 2
E =V
tot
kin u dV
2
tot =V | u |2 dV
dEtot
kin
= tot <0
dt
1 2
E =V
tot
kin u dV
2
tot =V | u |2 dV
/*CodesnapshotfromtheutilitykinEcalculatingtotal
kineticenergy*/
scalarmeshVol=gSum(mesh.V());
scalarkinE=
0.5*(fvc::domainIntegrate(magSqr(U)).value())/meshVol;
Kinetic energy dissipates into heat as seen in this 2d
quasi-turbulent case (periodic boundary conditions)
t=10s t=30s
t=90s
Kinetic energy dissipates into heat as seen in this 2d
quasi-turbulent case (periodic boundary conditions)
t=10s t=30s
Spectral method
HW2: You monitored/controlled the kinetic energy decay by numerics (numerical
diffusion due to diffusive numerical scheme)
Numerics:
dEtot
= tot
kin tot
visc num
dt
num=dispersive + diffusive
Overview of OpenFOAM CFD Code Structure (Source:
OpenFOAM User's Manual)
Overview of OpenFOAM CFD Code Structure (Source:
OpenFOAM User's Manual)
ers ion
n v
your ow n
m and le: e.g. entsOw
o m p d
the c Exam oamStu
u t ility: ico
F
a mple y
Ex icit
t
vor and
c omm
Foam
p le: the er ico
Exam neMesh e solv
i le: th
ref m p
Exa
Essentials of OpenFOAM top-level solverrk4projectionFoam
Vuorinen et al. Computers & Fluids (2014)
Vuorinen et al. Advances in Engineering Software (2015)
Essentials of OpenFOAM top-level solverrk4projectionFoam
Vuorinen et al. Computers & Fluids (2014)
Vuorinen et al. Advances in Engineering Software (2015)
Filename:PressureCorrection.C Filename:CreatePoissonMatrix.C
Essentials of OpenFOAM top-level solverrk4projectionFoam
Vuorinen et al. Computers & Fluids (2014)
Vuorinen et al. Advances in Engineering Software (2015)
phi=fvc::interpolate(U)&mesh.Sf();
dU=dt*(fvc::laplacian(nu,U)fvc::div(phi,U));
phi=fvc::interpolate(U)&mesh.Sf();
dU=dt*(fvc::laplacian(nu,U)fvc::div(phi,U));
Vuorinen et al. Computers & Fluids (2014)
volScalarFieldp volVectorFieldU
( (
IOobject IOobject
( ("U",
"p", runTime.timeName(),
runTime.timeName(), mesh,
mesh, IOobject::MUST_READ,
IOobject::MUST_READ, IOobject::AUTO_WRITE
IOobject::NO_WRITE ),
), mesh
p );
);
Vuorinen et al. Computers & Fluids (2014)
P=rho*R*T;//idealgaslawatcellcenters
P=correctBoundaryConditions();
U=U+dU;//onlyupdatecellcenters
U.correctBoundaryConditions();//readBCfrom/0/U
U==U+dU;//alsocorrectBC's
P.boundaryField()=
rho.boundaryField()*R.boundaryField()*T.boundaryField();
T=fvc::grad(U);//createavolTensorField
dU=dt*(fvc::laplacian(nu,U)fvc::div(phi,U));
phi is a surfaceScalarFieldsurfacebecause it
is defined at cell surfaces
phi=fvc::interpolate(U)&mesh.Sf();
About interpolation and flux limiting
fB
This interpolation This interpolation
can be carried out is very commonly fC
in various ways: carried out by:
linear linear f A
GammaV fC
limitedLinearV
vanLeer FLUX LIMITERS
FLUX LIMITING is useful interpolation
technique close to high oscillating parts: how would you
numerically compute flux/derivative around point B?
BENEFIT: more stable and robust simulation!
Vuorinen et al. Computers & Fluids (2014)
dU=dt*(fvc::laplacian(nu,U)fvc::div(phi,U));
phi is a surfaceScalarFieldsurfacebecause it
is defined at cell surfaces Outer normal vectors multiplied
by surface area of face in the mesh
phi=fvc::interpolate(U)&mesh.Sf();
dot product
Motivation for HW 3: Fluid solid interfaces (boundary layers)
are crucial in heat transfer, flow friction, turbulence
production etc
s Source for pictures from instructor resources: Incropera, de Witt,
Heat and Mass Transfer
Cf = Friction coefficient
2
U /2
(local)
u
Dynamic
viscosity
=
s =
y( ) y=0
Surface
shear stress
''
q s =h(T s T ) Newton's
cooling law
T
''
q s =k T ( ) y y=0
Fourier's
law
https://www.youtube.com/watch?v=HDY-szDEH9s
Thank you for your attention!