1484 Curso CFD de Standford Me469a Numerical Methods For Fluids Mechancis Capitulo 4 Finite Volume Discretization
1484 Curso CFD de Standford Me469a Numerical Methods For Fluids Mechancis Capitulo 4 Finite Volume Discretization
1484 Curso CFD de Standford Me469a Numerical Methods For Fluids Mechancis Capitulo 4 Finite Volume Discretization
ME469A
Numerical Methods for
Fluid Mechanics
Handout #4
Gianluca Iaccarino
1
1/22/09
FV Domain Discretization
Divide Ω in subdomains and apply
the same governing equation Sf
Ωi
! "! "! !
d
ρφdV + ρφ#v · nˆf dS = Γ∇φ · nˆf dS + Qφ dV
dt Ωi Sf Sf Ωi
f f
FV Time Term
! Sf
d "! Ω "! !
ρφdV + ρφ#v · nˆi dS =
f Γ∇φ · nˆf dS + Qφ dV
dt Ωi Sf Sf Ωi
f f
2
1/22/09
FV Domain Discretization
The unknowns are connected to volumes
NodesVolumesCenters CentersVolumesNodes
FV Domain Discretization
The difference between the two constructions is more
clear if we consider irregular (unstructured) grids
Primal Grid
Solid line (triangles)
Dual Grid
Dotted line (polygons)
3
1/22/09
FV Surface Integrals
The computation of the fluxes requires the
determination of surface integrals, for example the
convective fluxes are:
! "! "! !
d
ρφdV + ρφ#v · nˆf dS = Γ∇φ · nˆf dS + Qφ dV
dt Ωi Sf Sf Ωi
f f
Nomenclature
Refer to a 2D Cartesian (structured, equally spaced)
grid.
It is common to refer
to the cells as (i,j)
y
or (P) ne
j
The neighbors are e E
P
(i+1,j)-(i-1,j), etc or
(E), (W), etc. se
4
1/22/09
Surface integrals
Refer to the “east” face of cell P
Trapezoidal
! Rule: se
Se
Fe = f dS ≈ (fne + fse )
Se 2
Interpolation Practices
Step 2: compute the function values at the face
φe
φE
where e
P E
xe − xP
λe =
xE − xP
5
1/22/09
Interpolation Practices
An alternative widely used approach is to consider the
direction of propagation of the information:
interpolated
φ(x)
The convective flux is associated to value
P e E
φe = φP if ("v · n̂)e > 0
Interpolation Practices
The “going-with-the-wind” idea can be extended to high
order easily…
φW
φ(x) interpolated
value
φe = φP λw + φW λe φP
φe
φe = φP if ("v · n̂)e > 0
φE
P e E
W
Etc.
Flow direction
6
1/22/09
Interpolation Practices
Another common used interpolation extends the idea of
upwinding further by considering a parabola (QUICK:
quadratic upwind interpolation for convective kinematics)
φe = g1 φE − g2 φW + (1 − g1 + g2 )φP
φW
φe = g1 φE − g2 φW + (1 − g1 + g2 )φP φ(x) interpolated
value
P e E
W
Diffusive Fluxes
Diffusive fluxes are NOT associated to an underlying
velocity (no basis for upwinding) and involve gradients
(Fick’s law)
7
1/22/09
Diffusive Fluxes
By using Taylor series expansions around φe we can
derive
! "
(xe − xP )2 − (xE − xe )2 ∂ 2 φ
!τ =
2(xE − xP ) ∂x2 e
! "
(xe − xP )3 + (xE − xe )3 ∂3φ
+ + H.O.T.
6(xE − xP ) ∂x3 e
φ(x)
we obtain a second order approximation φP
1. If the grid is uniform
2. If the face center is at φE
xE + xP P e E
xe =
2
Volume integrals
Similar logic as the surface integrals
Second order:
!
QP = qdV ≈ qP ∆V
ΩP
8
1/22/09
FV Domain Discretization
Discretized Equations
Recall the original equation
! "! "! !
d
ρφdV + ρφ#v · nˆf dS = Γ∇φ · nˆf dS + Qφ dV
dt Ωi Sf Sf Ωi
f f
9
1/22/09
Discretized Equations
1D grid
W w e E
P
! "
∂φ φE − φP
Γ∇φ · n̂e = Γ ≈Γ
∂x e xE − xP
! "
∂φ φP − φW
Γ∇φ · n̂w = Γ ≈Γ
∂x e xP − xW
w
Discretized Equations
1D grid
W w e E
P
10
1/22/09
Discretized Equations
Integrating using the midpoint rule, the face area cancels out
(it’s 1D – no need to integrate)
W w e E
P
AP φP + AE φE + AW φW = 0
where Γ Etc.
AE = λ e −
xE − xP
Discretized Equations
Resulting discrete problem is a tridiagonal linear system
AP φP + AE φE + AW φW = 0
W w e E
P
· ·
· · · ·
AW AP AE
· · ·
· ·
11
1/22/09
Discretized Equations
If the discretization was based on the QUICK scheme
(assuming v>0) we would obtain
W w e E
WW P
AW W φW W + AW φW + AP φP + AE φE = 0
· ·
· · ·
· · · ·
AW W AW AP AE
· · · ·
· · ·
Deferred Correction
High order discretization methods naturally introduce
larger stencils (more neighbors) more complex filling
patterns and reduced sparsity
12
1/22/09
Exact Solution
This (atypical) problem has an exact solution is Dirichlet
conditions are applied to x=0 (φ0) and x=L (φL)
Power-Law Scheme
The exact solution can be used in an unusual way to
develop an interpolation scheme
interpolated
φ(x) value
φP
φE
P e E
13