Professional Documents
Culture Documents
Prepared by
Dr. Md. Shahjada Tarafder
References:
a) Klaus A Hoffman and Steve T. Chiang (2000): Computational Fluid Dynamics, Volume I, Fourth
Edition, A publication of Engineering Education System, Wichita, USA.
b) John D. Anderson Jr. (2021): Fundamentals of Aerodynamics, Fifth Edition, The McGraw-Hill
Companies, Inc., USA
c) Versteeg, H. K. and Malalasekera, W. (2007): An introduction to computational fluid dynamics:
The finite volume method, 2nd Edition, Pearson Education Limited, India.
Course Objective:
• To introduce the student to widely used techniques in the numerical solution of fluid dynamics
equations
• To develop a clear understanding of how computational methods, algorithms and boundary
condition chosen affect the approximate solution
• To place CFD in the context of a useful design tool for shipbuilding industry and a vital research
tool for fluid-structure interaction of ships
• To develop practical expertise in solving CFD problems with a commercial CFD code, ANSYS
CFX and
• To develop an awareness of the power and limitations of CFD.
Course Outcomes: After completion of this course the student should be able:
• To be familiar with the differential equations for flow phenomena and numerical methods for their
solution
• To use and develop flow simulation software for the most important classes of flows in
engineering and science
• To analyze different mathematical models and computational methods for flow simulations
critically
• To undertake flow computations using current best practice for model and method selection, and
assessment of the quality of results obtained.
Course Outcomes: After successfully completing this course, the students should be able to:
• To understand the theoretical basis of CFD
• To develop a CFD model for “real world” engineering problems
• To address complex problems using CFD with the specific focus on developing practical skills in
using a commercial CFD package, ANSYS CFX
• To interpret computational results and to write a report conveying the result of the computational
analysis.
(a) Computational Fluid dynamics (CFD): Fluid flows are governed by the partial differential equations
(PDE) based on the conservation laws of mass, momentum and energy. Computational Fluid Dynamics
(CFD) is the art of replacing such PDE systems by a set of algebraic equations which can be solved
using digital computers.
Source: Lecture note-Kuzmin
(b) Computational Fluid dynamics (CFD): CFD is a science that with the help of digital computers
produces quantitative predictions of fluid flows based on the conservation laws (conservation of mass,
momentum and energy) of governing equation of fluid motion. These predictions normally occur under
those conditions defined in terms of flow geometry, the physical properties of a fluid and the boundary
and initial condition of a flow field. The prediction generally concerns sets of valves of the flow variable
such as velocity. Pressure or temperature at selected locations in the domain and for selected times. It
may also evaluate the overall behavior of the flow. Such as the flow rate or the hydrodynamic force
acting on an object in the flow. During the post four decades, different types of numerical methods have
been developed to simulate the fluid flows involving a wide range of applications. The numerical
methods include
The CFD predictions are never completed exact. Because many sources of error are involved in the
predictions, one has to be very careful in interpreting the results produced by CFD techniques. The
most common sources of error are:
• Discretization error
• Input data error and
• Modeling error.
Source: Fluid Mechanics by Kundu
(c) Computational fluid dynamics (CFD): CFD is a branch of fluid mechanics that uses numerical
analysis and data structures to analyze and solve problems that involve fluid flows. Computers are used
to perform the calculations required to simulate the free-stream flow of the fluid, and the interaction of
the fluid (liquids and gases) with surfaces defined by boundary conditions. With high-
CFD is applied to a wide range of research and engineering problems in many fields of study and
industries, including aerodynamics and aerospace analysis, weather simulation, natural science
and environmental engineering, industrial system design and analysis, biological engineering, fluid
flows and heat transfer, and engine and combustion analysis.
Source: Wikipedia
Conservation form
Equation of continuity
+ div ( u ) = 0
t
x-momentum equation ( u) p
+ div ( uu ) = − + div ( grad u ) + S Mx
t x
y-momentum equation ( v) p
+ div ( vu ) = − + div ( grad v) + S My
t x
z-momentum equation ( w) p
+ div( wu ) = − + div( grad w) + S Mz
t z
Energy equation ( i)
+ div( iu ) = − p div u + div (k grad T ) + + Si
t
( ) 𝜕(𝜌𝜙)
+ div ( u ) = div (grad ) + S + ∇ ∙ (𝜌𝜙𝒖) = ∇ ∙ (Γ∇𝜙) + 𝑆𝛷 (1)
t 𝜕𝑡
In words
Eq. (1) is the so-called transport equation for property . The rate of change term and the rate of convective
term on the left-hand side and the diffusive term and the source term respectively on the right-hand side.
Eq. (1) is used as the starting point for computational procedures in finite volume method. By setting
equal to 1, u, v, w and i and selecting appropriate values for the diffusion coefficient and source terms we
obtain each of the five partial differential equations for mass momentum, and energy conservation.
The key step of the finite volume method which is to be developed, is the integration of over a three-
dimensional control volume CV yielding
( )
CV
t
dV + div( u ) dV = div(grad ) dV + S dV
CV CV CV
Gauss-divergence theorem
a dV = n a dA
CV A
( )
CV t dV + A n ( u) dA = A n (grad ) dA + CV S dV
The product n(u) expresses the flux component of property due to fluid flow along the outward normal
vector n so the second term on the left-hand side of Eq. (2), the convective term is the net rate of decrease
of the fluid property of the fluid element due to convection.
In steady state problem
n ( u) dA = n (grad ) dA + S dV
A A CV
In time-dependent problem, it is necessary to integrate with respect time t over a small interval t, this
yields the most general integrated form of the transport equation:
t CV
t
( ) dV dt + n ( u ) dAdt = n (grad ) dAdt + S dVdt
t A t A t CV
(2)
div(grad ) + S = 0 (1)
( ) + S = 0
i + j + k i +j +k + S = 0
x y z x y z
+ + + S = 0
x x y y z z
Fig. 1 Fig. 2
Step 2: Discretization
The key step of the finite volume method is the integration of the governing equation over a control volume
to yield a discretized equation at it nodal point P.
d d
dx ( dx ) dV + S dV = 0
V V
d d
( dx ) A − ( dx )
V
e
V
w A+ S dV = 0
V
d d
( A ) e − (A ) w + S V = 0
dx dx
The source term S may be a function of the dependent variable and the finite volume method approximates
the source term by means of a linear form as:
S V = SU + SPP
− −
e Ae E P − w Aw P W + SU + S PP = 0
xPE xWP
This can be re-arranged as
e Ae w Aw A A
+ − S P P = w w W + e e E + SU
xPE xWP xWP xPE
The above equation can be written as
aP P = aW W + aE E + SU (3)
Where
aW aE ap
w Aw e Ae
aW + aE − S P
xWP xPE
Eq. (3) is the discretized form of the governing equation for the boundary value problem as defined in Eq.
Prob. 4.1
Consider the problem of source-free heat conduction in an insulated rod of 0.5 m in length and ends are
maintained at constant temperatures of 100 0C and 500 0C respectively. The dimensional problem is
𝑑 𝑑𝑇
governed by 𝑑𝑥 (𝑘 𝑑𝑥) = 0. Calculate the steady state temperature distribution in the rod by dividing the
Solution:
d dT
= 0 with TA = 100 C and TB = 500 C
0 0
k
dx dx
Let us divide the length of the rod into five equal control volumes as shown in Fig. below giving x = 0.1
m.
The discretized equation for the governing equation of steady state heat flow can be expressed as
aP TP = aW TW + aE TE
The thermal conductivity k, node spacing x and cross-sectional area A are constants and thus results
At node 1:
𝑑 𝑑𝑇 𝑑𝑇 𝑑𝑇
(𝑘 ) = 0 (𝑘 𝐴 ) − (𝑘 𝐴 ) = 0
𝑑𝑥 𝑑𝑥 𝑑𝑥 𝑒 𝑑𝑥 𝑤
𝑑 𝑑𝑇 𝑘𝐴 𝑘𝐴
∫ (𝑘 ) 𝛿𝑥 𝛿𝐴 = 0 (𝑇2 − 𝑇1 ) − (𝑇 − 𝑇𝐴 ) = 0
𝑑𝑥 𝑑𝑥 𝛿𝑥 𝛿𝑥/2 1
𝐶𝑉
At node 5:
d dT dT dT
(k )+S = 0 (kA ) e − (kA )w = 0
dx dx dx dx
d dT kA kA
dx (k dx ) x A = 0
CV
(TB − T5 ) −
x/ 2 x
(T5 − T4 ) = 0
dT dT
(k )e − (k ) w
dx dx x A = 0 300 𝑇5 = 100𝑇4 + 200𝑇𝐵
CV
x
T1 140
T 220
2
T3 = 300
T4 380
T5 460
Analytical solution:
d
(k
dT
)=0 T = TA at x = 0, B = 100k
Applying boundary conditions
dx dx T = TB at x = 0.5, A = 800k
Integrating Now
d dT
dx (k dx ) dx = 0 kT = 800k x+100k
Prob. 4.2
Consider a large plate of thickness L = 2 cm with constant thermal conductivity k = 0.5 W/m/K and uniform
heat generation q = 1000 KW/m3. The faces A and B are at temperatures of 100 0C and 200 0C respectively.
Assume that the dimensions in the y- and z-directions are so large that temperature gradients are significant
in the x-direction only and the area in they-z plane A is 1.00 m2. Calculate the steady state temperature
distribution by dividing the domain into five control volumes. The governing equation for the steady state
𝑑 𝑑𝑇
temperature distribution is given by (𝑘 ) + 𝑞 = 0.
𝑑𝑥 𝑑𝑥
d dT (1)
(k )+q =0
dx dx
Integrating over a control volume dV
d dT
dx (k dx ) dV + q dV = 0
CV CV
The second integral is computed by using Mid-point integration formula and above equation can be written
as
dT dT
(kA )e − (kA ) w + q V = 0
dx dx
ke A k A
(TE − TP ) − w (TP − TW ) + qA x = 0
x x
The above equation can be re-arranged as
ke A kw A kw A ke A
x + x − 0 TP = x TW + x TE + qA x
Since kw = ke = k , this equation is written in the general form as
aPTP = aW TW + aETE + Su (2)
where
aW aE aP SP Su
kA kA aW + aE − S P 0 qA x
x x
At node 1:
where
aW aE aP SP Su
kA 2 kA 2kA
0 aW + aE − S P − qA x + T
x x x A
At node 5:
dT dT
(kA )e − (kA ) w + q V = 0
dx dx
ke A k A
(TB − TP ) − w (TP − TW ) + qA x = 0
x/2 x
k w A ke A kw A ke A
x + x / 2 TP = x TW + 0 TE + qA x + x / 2 TB
The above equation can be re-arranged as
aPTP = aW TW + aETE + Su (4)
aPT5 = 125 T4 + Su
where
aW aE aP SP Su
kA 2kA 2kA
0 aW + aE − S P − qA x + T
x x x B
Now
K = 0.5 W K/m q = 1000103 W/m3 A = 1 m2 x = 0.004 m
kA 0.5 1
= = 125 and q A x = 1000 103 1 0.004 = 4000 W
x 0.004
Analytical solution:
T − T q
T = B A + ( L − x) x + TA
L 2k
Solution:
d dT
kA − hP(T − T ) = 0 with TB = 100 C and T = 20 C
0 0
dx dx
We use a uniform grid and divide the length into five control volumes so that x = 0.2 m. The grid is
shown in below:
d dT
dx dx dV − n (T− T ) dV = 0
2
CV CV
dT dT
− A − n (TP − T ) A x = 0
2
A
dx e dx w
TE − TP TP − TW
− − n 2 (TP − T ) x = 0
x x
This can be re-arranged as
1 1 1 1
x + x TP = x TW + x TE + n T x − n x TP
2 2
1 1 1 1
x + x + n x TP = x TW + x TE + n T x
2 2
Where
aW aE aP SP Su
1 1
aW + aE − S P −n2 x n2 x T
x x
At node 5:
dT dT
− − n (TP − T ) x = 0
2
dx e dx w
TP − TW
0 − x − n (TP − T ) x = 0
2
1 1
x + n x TP = x TW + 0 TE + n x T
2 2
aPTP = aW TW + aETE + Su
Where
aW aE aP SP Su
1
0 aW + aE − S P −n2 x n2 x T
x
At node 1:
Where
aW aE aP SP Su
1 2 2 TB
0 aW + aE − S P −n2 x − n 2 x T +
x x x
Now
20 −5 0 0 0 T1 1100
−5 15 −5 0
0 T2 100
0 −5 15 −5 0 T3 = 100
0 0 −5 15 −5 T4 100
0 0 0 −5 10 T5 100
T1 64.22
T 36.91
2
T3 = 26.50
T4 22.60
T5 21.30
e Ae A A A
(E − P ) − w w (P − W ) + n n (N − P ) − s s (P − S ) + Su + SPP = 0
xPE xWP yPN ySP
w Aw e Ae n An s As A A A A
+ + + − S P P = w w W + e e E + n n N + s s S + Su
xWP xPE yPN ySP xWP xPE yPN ySP
This can be written in the general form as
aPP = aW W + aEE + aNN + aSS + Su
aPP = anb nb + Su
Where
aW aE aN aS aP
w Aw e Ae n An s As
aW + aE + aN + aS − S P
xWP xPE yPN ySP
A − A + A − A + A − A + S V = 0
x e x w y n y s z t z b
The discretized equation for interior nodes can finally be written as:
Where
aW aE aN aS aT aB aP
w Aw e Ae n An s As t At b Ab
aW + aE + aN + aS + aB + aT − S P
xWP xPE yPN ySP z PT z BP
d d
( uA )e − ( uA )w = A − A
dx e dx w
A A
( uA )e − ( uA )w = (E − P ) − (P − W )
xPE e xWP w
( u)e − ( u) w
CV
x
dA dx = 0
( uA )e − ( uA )w = 0
Fe − Fw = 0
In order to solve above equation we need to calculate the transported property at e and w faces. Schemes
for this purpose are assessed in the following sections.
P + E + P
e = and w = W
2 2
Substitution of the above expressions into the convection terms of momentum equation yields
Where
aW aE ap
Fw Fe
Dw + 2 De − 2 aW + aE + ( Fe − Fw )
Solution:
d
( u ) = with = 1 at x = 0 and = 0 at x = 1
d d
dx dx dx
Node 2, 3, and 4:
Using central differencing scheme, the discretization of governing equation can be expressed
aP P = aW W + aE E
Where
aW aE ap
Fw Fe
Dw + 2 De − 2 aW + aE + ( Fe − Fw )
Node 1:
d
( u ) =
d d
dx dx dx
d d d
dx ( u ) dAdx = dx dx dAdx
CV CV
d d
( uA )e − ( uA )w = A − A
dx e dx w
A A
( uA )e − ( uA )w = (E − P ) − (P − A )
x e x / 2 A
Fe
(P + E ) − FA A = De (E − P ) − DA (P − A )
2
Node 5:
d d
( uA )e − ( uA )w = A − A
dx e dx w
A A
( uA )e − ( uA )w = (B − P ) − (P − W )
x / 2 e x w
Fw
FB B − (P + W ) = DB (B − P ) − Dw (P − W )
2
d
( u ) =
d d
dx dx dx
The discretization of governing equations is
Fee − Fww = De (E − P ) − Dw (P − W )
( uA )e − ( uA )w = 0
When the flow is in the positive direction, uw>0, ue >0 (Fw>0, Fe >0), the upwind scheme sets
w = W and e = P
and the discretized equation becomes
FeP − FwW = De (E − P ) − Dw (P − W )
This can be rearranged as
( Dw + De + Fe )P = ( Dw + Fw )W + DeE
( Dw + Fw ) + De + (Fe − Fw )P = (Dw + Fw )W + DeE
When the flow is in the negative direction, uw <0, ue<0 (Fw<0, Fe<0), the scheme takes
w = P and e = E
With
aW aE ap
Fw 0, Fe 0 ( Dw + Fw ) De
aW + aE + ( Fe − Fw )
Fw 0, Fe 0 Dw ( De − Fe )
A form of notation for aW and aE coefficients of the upwind differencing method that covers both flow
directions is given below:
aW aE
Dw + max ( Fw ,0 ) De + max(0, − Fe )
Solution:
d
( u ) = with = 1 at x = 0 and = 0 at x = 1
d d
dx dx dx
The steady one-dimensional convection and diffusion problem is governed by
Node 5:
FBB − FW W = DB (B − P ) − Dw (P − W )
FA = FB = F and DA = DB = 2
x
The hybrid differencing scheme uses piecewise formulae based on the local Peclet number to evaluate the
net flux through each control volume face. The Peclet number is evaluated at the face of the control volume.
For a west face,
Fw ( u)w
Pew = =
D w w / xWP
The steady one-dimensional convection and diffusion problem is governed by
d d d
( u ) = ( )
dx dx dx
The discretized equation for one-dimensional convection and diffusion problem becomes
Fee − Fww = De (E − P ) − Dw (P − W )
Fee + De (P − E ) = Fww + Dw (W − P )
1 1
qw = Fw (W + P ) + (W − P )
2 Pew
for −2 Pew 2
1 2 1 2
= Fw 1 + W + 1 − P
2 Pew 2 Pew
Flux through the area Aw
aW aE
F F
max Fw , Dw + w ,0 max − Fe , De − e ,0
2 2
Solution:
d
( u ) = with = 1 at x = 0 and = 0 at x = 1
d d
dx dx dx
Node 1:
d d
( uA )e − ( uA )w = A − A
dx e dx A
FeP − FAA = 0 − DA (P − A )
Node 5:
d d
( uA )e − ( uA )w = A − A
dx B dx w
FBP − FwW = DB (B − P ) − 0
It can be seen that the diffusive flux at the boundary is entered on the right-hand side and the convective
fluxes are given by means of the upwind method. We note that FA = FB = F and DB = 2Γ/δx = 2D so the
discretized equation can be written as
aP P = aW W + aE E + Su
aP = aW + aE + ( Fe − Fw ) − S P
aP P = aW W + aE E + aWW WW
With
aW aE aWW ap
6 1 3 1
Dw + Fw + Fe De − Fe Fw aW + aE + aWW + ( Fe − Fw )
8 8 8 8
aW aE aWW ap
3 6 1 1
Dw + Fw De − Fe − Fw Fe aW + aE + aEE + ( Fe − Fw )
8 8 8 8
Solution:
The steady one-dimensional convection and diffusion problem is governed by
Quadratic interpolation
( x) = k0 + k1 x + k2 x 2
U at x = xU
= C at x = xC
at x = x
D D
= k1 + 2k2 x
x
( x − xC )( x − xD ) ( x − xU )( x − xD ) ( x − xU )( x − xC )
( x) = U + C + D
( xU − xC )( xU − xD ) ( xC − xU )( xC − xD ) ( xD − xU )( xD − xC )
Solution:
The linearly extrapolated value at the mirror node is given by
0 = 2 A − P
Node 1:
The discretized equation at node 1 is
d d
( uA )e − ( uA ) A = A − A
dx e dx A
7 3 2 D
Fe P + E − A − FAA = De (E − P ) − A ( 9P − 8A − E )
8 8 8 3
7 3 2 D
Fe 1 + 2 − A − FAA = De (2 − 1 ) − A ( 91 − 8A − 2 )
8 8 8 3
Node 5:
Now the diffusive flux through the west boundary is given by
DB
= (8B − 9P + W )
x B 3
The discretized equation at node 1 is
d d
( uA )B − ( uA )w = A − A
dx B dx w
Node 2:
6 3 1 7 3 2
Fe P + E − W − Fw W + P − A = De (E − P ) − Dw (P − W )
8 8 8 8 8 8
Node 3-4:
u u p
( uu ) + ( vu ) = + − + Su
x-momentum equation (1)
x y x x y y x
v v p
( uv ) + ( vv ) = + − + Sv
y-momentum equation (2)
x y x x y y y
continuity equation
( u ) + ( v ) = 0 (3)
x y
• The convective terms of the momentum equations contain non-linear quantities: for example, the
• All three equations are intricately coupled because every velocity component appears in each
momentum equation and in the continuity equation. The most complex issue to resolve is the role
played by the pressure. It appears in both momentum equations, but there is evidently no (transport
or other) equation for the pressure.
If the pressure gradient is known, the process of obtaining discretized equations for velocities from the
momentum equations is exactly the same as that for any other scalar, and the schemes explained before are
applicable.
In general-purpose flow computations we also wish to calculate the pressure field as part of the solution, so
its gradient is not normally known beforehand. If the flow is compressible the continuity equation may be
used as the transport equation for density and, in addition to Eq. 1-3, the energy equation is the transport
equation for temperature.
Both the problems associated with the non-linearities in the equation set and the pressure–velocity linkage
can be resolved by adopting an iterative solution strategy such as the SIMPLE algorithm of Patankar and
Spalding (1972).
aP vP = anbvnb + x ( ps − pn ) + bv (5)
If the pressures are e and w are obtained by linear interpolation the pressure gradient term p / x in the u-
momentum equation is given by
p p − p
= e w
=
( pE + pP ) / 2 − ( pP + pW ) / 2 p − p
= E W
(6)
x x x 2 x
p pn − ps pN − pS (7)
= =
y y 2 y
The pressure at the central node (P) does not appear in Eq. (6) and (7). Substituting the appropriate values
from the ‘checker-board’ pressure field in Fig. 1 into Eq. (4)–(5) we find that all the discretized gradients
are zero at all the nodal points even though the pressure field exhibits spatial oscillations in both directions.
As a result, this pressure field would give the same (zero) momentum source in the discretized equations
as a uniform pressure field. This behaviour is obviously non-physical.
A remedy for this problem is to use a staggered grid for velocity components. The idea is to evaluate scalar
variables, such as pressure, density, temperature etc. at ordinary nodal points but to calculate velocity
components on staggered grids centred around the cell faces.
Similarly,
𝑎𝑤 𝑢𝑤 = ∑ 𝑎𝑛𝑏 𝑢𝑛𝑏 + 𝛥𝑦(𝑝𝑊 − 𝑝𝑃 ) + 𝑏𝑤
( u )e y − ( u )w y + ( v )n x − ( u )s x = 0 (10)
e e
a u* = a u + y p − p + b
nb nb ( P E ) e
(11)
ae vn* = a
v
nb nb + x ( p
P − pN )+b
n
(12)
Scheme aw ae
Central differencing DW + FW / 2 DE − FE / 2
Upwind differencing DW + max ( FW ,0 ) DE + max ( 0, − FE )
Hybrid differencing max FW , ( DW + FW / 2 ) ,0 max − FE , ( DE − FE / 2 ) ,0
A
A
DW = , FW = u
*
( )W D = , FN = v
*
( )
y N
N
x W ’
N
Similarly, we define velocity corrections u′ and v′ to relate the correct velocities u and v to the guessed
velocities u* and v*:
Subtraction of Eq. (11) and (12) from Eq. (8) and (9) respectively gives
ae (ue − ue* ) = anb (unb − u nb ) + y ( pP − pP ) − ( pE − pE )
(16)
Using correction formulae (13)–(15) Eq. (16) and (17) can be rewritten as follows:
aeue = anbunb
+ y( pP − pE ) (18)
y x
Where d e = and dn =
ae an
Eq. (14) and (15) gives
ue = ue + de ( pP − pE ) (20)
Similarly,
′
𝑢𝑤 = 𝑢𝑤 ∗
+ 𝑑𝑤 (𝑝𝑊 − 𝑝𝑃′ )
𝑣𝑠 = 𝑣𝑠∗ + 𝑑𝑠 (𝑝𝑆′ − 𝑝𝑃′ )
Where
aW aE aN aS ap b
The discretization of the u-momentum equation for the cell P follows the principles outlined in previous
chapters and yields the following discrete equation:
aPuP = anbunb + bPu + ( pw − pe )
Here, a unit area of cross section y = 1 has been assumed. The neighbors nb for this co-located
arrangement include the velocities at the points E and W. The pressure at the faces e and w are not known
since the pressure is stored at the cell centroid.
Dividing above two equations by their respective center coefficients aP and aE, we have
uP =
a u + bPu
nb nb
+
1 pW − pE
aP aP 2
1 pW − pE
= uˆP +
aP 2
Similarly, for uE
p − pEE
aE uE = anbunb + bEu + P
2
=
a u + bEu
nb nb
+
1 pP − pEE
uE
aE aE 2
1 pP − pEE
= uˆE +
aE 2
Where
uˆP =
a u + bPu
nb nb
aP
uˆE =
a u + bEu
nb nb
aE
Co-located formulations prevent checker boarding by devising interpolation procedures which express the
face velocities ue and uw in terms of adjacent pressure values rather than alternate pressure values.
Furthermore, the face velocity ue is not defined purely as a linear interpolation of the two adjacent cell
values; an additional term, called the added dissipation prevents velocity checker-boarding. The discrete
one-dimensional momentum equations for cells P and E yield
1 pW − pE
uP = uˆP +
aP 2
p − pE
= uˆP + d P W
2
Similarly, for uE
Prob. 6.1
Consider the steady, one-dimensional frictionless and incompressible fluid flow through a duct with
constant cross-sectional area. Referring to the staggered grid as shown in Fig. below calculate the pressure
p at nodes A, B , C and the velocities u at the backward staggered nodes at 2, 3 and 4. Density = 1.0 kg/m3
and multiplier d = 1.0, duct area A = constant, u1 = 10 m/s and pressure pD = 0 pa. Assume guess values
𝑢2∗ = 8.0 𝑚/𝑠, 𝑢3∗ = 11.0 𝑚/𝑠 and 𝑢4∗ = 7.0 𝑚/𝑠
p d2y
( uu ) = − + Su =2
x x dx 2
( u ) = 0 dy
= 2x + A
x dx
with u1 = 10 m / s at inlet y = x 2 + Ax + B
and pD = 0 at outlet y = 0 at x = 0 B = 0
The discretization of u-momentum and continuity equations at node P of original cell can be expressed as
aPuP = anbunb + y ( pw − pe ) + bu
where
aW aE aP b
( dA)w ( dA)e aW + aE ( u A) − ( u A)
w
e
Given data:
Density = 1 kg/m3, Duct area A = constant, d = 1.0
Boundary conditions: u1 = 10 m/s and PD = 0 pa
Initial guess velocity: u2*= 8 m/s, u3*= 11 m/s, u4*= 7 m/s
(
( dA)w + ( dA)e pP = ( dA)w pW + ( dA )e pE + u * A ) − ( u A)
w
*
e
We cut the link to the west boundary side by setting the relevant coefficient, aW to zero and introduce the
appropriate flux, in this case the mass flow rate into the control volume through the boundary side, as a
source term b.
aW = ( dA)w = 0.0
aE = ( dA)e = ( dA)2 = 11 A = 1.0 A
aP = aW + aE = 1.0 A
(
b = u* A ) − ( u A) + ( uA)
w
*
e bundary
Note that the given velocity at node 1 has been used in the calculation of the additional source contribution
to b. Using above we obtain the discretized pressure correction equation at node A
1.0 A pA = 0 + 1.0 A pB + 2.0 A
pA = pB + 2.0
Velocity at node 2: u2 = u2 + d2 ( pA − pB ) = 8.0 + 1.0 4.0 − 2.0 = 10.0 m/s
Velocity at node 3: u3 = u3 + d3 ( pB − pC ) = 11.0 + 1.0 2.0 − 3.0 = 10.0 m/s
Velocity at node 4: u4 = u4 + d4 ( pC − pD ) = 7.0 + 1.0 3.0 − 0 = 10.0 m/s
Prob. 6.2
Consider the steady, one-dimensional flow of a frictionless and constant density fluid through a two-
dimensional nozzle as shown in Fig. (a). Calculate the pressures at the nodes B, C and D and velocities at
nodes at 1, 2, 3 and 4 using SIMPLE algorithm of forward staggered grid arrangement given in Fig. (b).
The stagnation point is given in the inlet and the static pressure is specified at the exit.
Given data:
The density of the fluid = 1 kg/m3
Nozzle length L = 2.0 m and grid spacing x = L / 4 = 0.5 m
Cross-sectional area at the inlet AA = 0.5 m2 and at the exit AE = 0.1m2
Boundary conditions: At the inlet, the flow entering the nozzle is drawn from a large plenum chamber
and the fluid has zero momentum and the stagnation pressure at inlet p0 = 10 Pa. The static pressure
at exit is pE = 0 Pa.
Initial velocity field: To generate the initial velocity fields guess a mass flow rate m = 1.0 kg / s and
u = m / A m/s.
du dp
uA = −A
dx dx
d
( uA) = 0
dx
SIMPLE Algorithm:
In standard notation the discretized momentum equation for this one-dimensional problem can be written
as
aPuP = aW uW + aEuE + Su
If we use the upwind differencing scheme the coefficients may be obtained as
Solution:
Mass flow rate at inlet, 𝑚̇ = 𝜌𝐴𝑢 = 1.0 𝑘𝑔/𝑠 and
the initial guess velocities at node 1, 2, 3, and 4 are
u1 = m / ( A1 ) = 1.0 / (1 0.45) = 2.22222 m / s
Velocity at node 2:
aPuP = aW uW + aE uE + Su
A W = Fw = ( uA) w = 1 [(u1 + u 2 ) / 2] 0.4
= 1 [(2.2222 + 2.8571) / 2] 0.4 = 1.01587
aW = Fw
aE = 0
aP = aW + aE + Fe − Fw = 1.01587 + 0 + (1.02857 − 1.01587)
= 1.02857
Su = p A2 = ( pB − pC ) A2 = (7.5 − 5.0) 0.35 = 0.875
The discretized momentum equation at node 2 is
1.02857u2 = 1.01587u1 + 0.875
We also calculate the parameter d at node 2 for later use in the pressure correction equation
d = A2 / aP = 0.35 /1.02857 = 0.34027
Velocity at node 3:
aPuP = aW uW + aE uE + Su
The discretized momentum equation at node 3 is
1.06666u3 = 1.02857u2 + 0.625 and
Velocity at node 1:
aPuP = aW uW + aE uE + Su
The stagnation pressure p0 = 10 pa is given in a plenum chamber upstream from the inlet where the fluid
is at rest. Denote the velocity at A by uA and use Bernoulli’s equation to express the static pressure at A,
which is needed in the source term Su, in terms of p0 and uA:
1
p A = p0 − ( u A2 )
2
From the equation of continuity
u A = u1 A1 / AA
Combining above two equations
2
1 A
p A = p0 − u12 1
2 AA
The discretized u-momentum equation for control volume 1 using upwind scheme can be expressed as
Feu1 − Fwu A = ( p A − pB ) A1
Fw = u A AA = u1 A1
Substituting
1
Feu1 − Fw (u1 A1 / AA ) = p0 − u12 ( A1 / AA )2 − pB A1
2
1
Fe − Fw ( A1 / AA ) + Fw ( A1 / AA )2 u1 = p0 − pB A1
2
1
AP = Fe − Fw ( A1 / AA ) + Fw ( A1 / AA ) 2
2
The third term is an extra contribution arising from our choice to specify the stagnation pressure at inlet. In
this calculation we have chosen to place the negative contribution to coefficient a1 on the right-hand side.
Hence
1
[𝐹𝑒 + 𝐹𝑤 (𝐴1 /𝐴𝐴 )2 ] 𝑢1 = [𝑝0 − 𝑝𝐵 ]𝐴1 + 𝐹𝑤 (𝐴1 /𝐴𝐴 )𝑢1𝑜𝑙𝑑
2
This is termed the deferred correction approach and can be effective in stabilizing the iterative process if
the initial velocity field is based on a very poor guess.
Now we calculate
Velocity at node 4:
aPuP = aW uW + aE uE + Su
Fw = ( uA)w = 1.0 (u3 + u4 ) / 2 0.2 = 1.06666
At the east boundary of momentum control volume 4 we have a fixed pressure, but we do not have two
velocities that straddle the east boundary. To compute the mass flux across this boundary we impose
Continuity:
Fe = ( uA)4
At the first iteration we can use the assumed mass flow rate, so we set Fe=1.0 kg/s. Thus,
aW = Fw = 1.06666
aE = 0
aP = aW + aE + Fe − Fw = 1.06666 + 0 + (1.0 − 1.06666) = 1.0
Su = p Aav = ( pD − pB ) A4 = (2.5 − 0.0) 0.15 = 0.375
Substitution of p′A = 0.0 and p′E = 0.0 into the pressure correction equations for internal nodes B, C and D
yields the following system of equations:
0.26161 pB = 0.11909 pC − 0.06830
0.17769 pC = 0.11909 pB + 0.058593 pD + 0.18279
0.081093 pD = 0.058593 pC + 0.25882
pA = 0.0 pB = 1.63935 pC = 4.17461 pD = 6.20805 pE = 0.0
Corrected nodal pressures are now calculated using these pressure corrections:
pB = pC + pB = 7.5 + 1.63935 = 9.13935
pC = pC + pC = 5.0 + 4.17461 = 9.17461
pD = pD + pD = 2.5 + 6.20805 = 8.70805 Corrected velocities at the end of the first iteration are
u1 = u1 + d1 ( pA − pB ) = 2.19935 + 0.31670 0.0 − 1.63935 = 1.68015
u2 = u2 + d2 ( pB − pC ) = 3.02289 + 0.34027 1.6395 − 4.17461 = 2.16020
u3 = u3 + d3 ( pC − pD ) = 3.5087 + 0.23437 4.17461 − 6.20805 = 3.02428
u4 = u4 + d4 ( pD − pE ) = 4.10926 + 0.15 6.20805 − 0.0 = 5.04047
First, we check whether the velocity field satisfies continuity. The mass flow rates uA calculated at u-
nodes are
The exact mass flow rate from Bernoulli’s equation is 0.44721 kg/s, so the error in the computed mass flow
rate is +69%. This is not a problem, because we would not expect the solution after one iteration to be
accurate.
Solution:
where
k k k k
aW = Aw aE = Ae aS = As aN = An aP = aW + aE + aS + aN
x x y y
All nodes except 6 and 7 are adjacent to boundaries. At a boundary node the discretized equation takes
the form
The boundary conditions are incorporated into the discretized equations by setting the relevant coefficient
to zero and by the inclusion of source terms through Su and Sp.
At node 6:
40T6 = 10T2 + 10T5 + 10T7 + 10T10
At node 7:
40T7 = 10T3 + 10T6 + 10T8 + 10T11
At node 1:
T T
kA + qw Aw + k + qs As = 0
x e y n
KA KA
(TE − TP ) + bw + (TN − TP ) + bs = 0
x e x n
KA KA KA KA
+ TP = TE + TN + bw + bs
x e x n x e x n
( aE + aN ) TP = 0 TW + aETE + aN TN + 0 TS + bw + bs
aW = 0
bW = qw Aw = 500 103 (0.1 0.01) = 500
South is an insulated boundary; no flux enters the control volume through the south boundary:
aS = 0
bS = 0
Total source
Su = bW + bS = 500
SP = 0
Total source
Su = bW + bN = 500 + 2000 = 2500
SP = −20
Now we have
aP = aS + aE − S P = 10 + 10 + 20 = 40
Su = 2500
The coefficients and the source term of the discretization equation for all points are summarized in Table
below:
One-dimensional unsteady heat conduction: One dimensional unsteady heat conduction problem is
governed by the equation
T T
c = k +S
t x x
Analyticals solution from Separation of variable method
T = T ( x, t ) = ax + bt + c
c t
dVdt = k dVdt + S dVdt
t CV t CV x x t CV
c P
dV dt = dAdx dt + S V dt
t CV t t CV x t
T T
k −k
t +t
TP − TP0 t +t
x e x w t +t
c dV dt = dAdx dt + S V dt
t CV t t CV x t
t +t
T −T T T
0
c P P V t = kA − kA dt + S V t
t t x e x w
t +t k A
c (TP − TP0 ) V = e (TE − TP ) − w (TP − TW ) dt + S V t
k A
t xPE xWP
In order to evaluate the integration, we need to assume about the variation of TP, TE and TW. We may
generalize the approach by means of weighting parameter between 0 and 1.
=
1
2
(
TP + TP0 if =
1
2
) Crank − Nicolson method
= TP if = 1 Im plicit method
Now
t +t t +t
I P = TP dt = TP + (1 − )TP0 dt
t t
0 1/2 1
IP TP0 t 1
(
TP + TP0 t ) TP t
2
Using above formula and dividing by A t throughout we have
TP − TP0 k k
c x = e (TE − TP ) − w (TP − TW ) +
t xPE xWP
k k
+ (1 − ) e (TE0 − TP0 ) − w (TP0 − TW0 ) + S x
xPE xWP
x ke kw kw k
c + + TP = TW + (1 − ) TW0 + e TE + (1 − ) TE0
t xPE xWP xWP xPE
x k k
+ c − (1 − ) e − (1 − ) w TP0 + S x
t xPE xWP
aP TP = aW TW + (1 − )TW0 + aE TE + (1 − )TE0
+ aP0 − (1 − )aW − (1 − )aE TP0 + b
where
aW aE aP b
kw ke x
c + ( aW + aE ) S x
xWP xPE t
T T
c = k +S
t x x
c t
dVdt = k dVdt + S dVdt
t CV t CV x x t CV
T T
k −k
t +t
TP − T 0
x e x w
t +t t +t
c t dV dt = dAdx dt + S V dt
P
t CV t CV x t
t +t
TP − TP0 T T
c V t = kA − kA dt + S V t
t t x e x w
t +t k A
c (TP − TP0 ) V = e (TE − TP ) − w (TP − TW ) dt + S V t
k A
t xPE xWP
In order to evaluate the integration an assumption is required for the variation of T P, TE and TW inside the
integral. This approach can be generalized by means of weighting parameter between 0 and 1.
T = TP + (1 − )TP0
= TP0 if = 0 Explicit method
TE = TE + (1 − )TE0
= TE0 if = 0
TW = TW + (1 − )TW0
= TW0 if = 0
Explicit scheme
kA k A
c(TP − TP0 )V = e (TE0 − TP0 ) − w (TP0 − TW0 ) t + S A x t
xPE xWP
TE = TE + (1 − )TE0
= TE if = 1
TW = TW + (1 − )TW0
= TW if = 1
aP TP = aW TW + aE TE + aP0 TP0 + Su
Cranck-Nicolson Scheme
TP = TP + (1 − )TP0
=
1
2
(TP + TP0 ) if =
1
2
TE = TE + (1 − )TE0
=
1
2
(TE + TE0 ) if =
1
2
TW = TW + (1 − )TW0
=
1
2
(TW + TW0 ) if =
1
2
T + T0 TE + TE0 0 (aE + aW ) 0
aP TP = aW W W +
Ea + aP − (aW − TP + Su
2 2 2
The thin plate is initially at uniform temperature of 2000C and at a certain time t = 0, the temperature of the
east side of the plate is suddenly reduced to 00C. The other surface is insulated. Calculate the transient
(unsteady) temperature distribution of the slab using Explicit or Fully Implicit Scheme of Finite Volume
Method with a time step size t = 40s. Given: plate thickness L = 3 cm, thermal conductivity k = 10 W/m-K
and c = 10 10-6 J/m3/K. To generate the grid divide the domain width L into five equal control volumes
with x = 1 cm.
The numerical solution with the explicit method is generated by dividing the domain width L into five
equal control volumes with x =0.004 m. The resulting one-dimensional grid is shown in Fig. below:
T
= 0 at x = 0, t 0
x
T = 0 at x = L, t 0
At node 1:
T T
c = k
t x x
t +t
T t +t
T
c dVdt = k dVdt
t CV t t CV x x
x k
c ( )
TP − TP0 = (TE − TP ) − 0
0 0
t x e
x k 0 x k 0
c TP = TE + c − TP
t x e t x e
aPTP = aE TE0 + aP − aE ) TP0
At node 2-4:
TP − TP0 t +t
T T
c t V = (kA )e − (kA ) w dt
t t x x
x k 0 k 0
c
t
( )
TP − TP0 = (TE − TP ) −
0
(TP − TW )
0
x e x w
x k 0 k 0 x k k 0
c TP = TW + TE + c − − TP
t x w x e t x w x e
aPTP = aW TW0 + aE TE0 + aP − (aW + aE ) TP0
At node 5:
x / 2 e x w
x k 0 x k k 0 k
c TP = TW + c − − TP + TB
t x w t x w x / 2 e x / 2 e
aPTP = aW TW0 + aP − (aW + 2aE ) TP0 + Su
x 0.004
c = 10 106 = 20000
t 2
After substitution of numerical values and some simplification the discretization equations for the
various nodes are
Solution
For t = 2sec : T11 = 200, T21 = 200, T31 = 200, T41 = 200, T51 = 200
Node 1:
x k
c ( TP − TP0 ) = (TE − TP ) − 0
t x e
x k k x 0
c + TP = TE + c TP
t x e x e t
aP TP = aE TE + Su
Node 2-4:
x k k
c
t
( )
TP − TP0 = (TE − TP ) − (TP − TW )
x e x w
x k k k k x 0
c + + TP = TW + TE + c TP
t x w x e x w x e t
aP TP = aW TW + aE TE + aP0 TP0
aP TP = aW TW + aE TE + Su
At node 5:
TP − TP0 t +t
T T
c V = (kA )e − (kA ) w dt
t t x x
x k k
c
t
( )
TP − TP0 = (TB − TP ) − (TP − TW )
x / 2 e x w
x k k k x 0 k
c + + TP = TW + c TP + TB
t x w x / 2 e x w t x / 2 e
aP TP = aW TW + Su
where
aW aE aP b
kw ke x
c + aW + aE S x
xWP xPE t
After substitution of numerical values and some simplification the discretization equations for the
various nodes are
Solution
For t = 40sec : T1 = 187.38, T2 = 176.28, T3 = 150.04, T4 = 103.69, T5 = 37.51
+ ( u ) + ( v ) = 0
t x y
The equation of continuity is applied at the centre of the cell, P
t +t
t +t
t +t
t dVdt + x ( )
u dVdt + y ( v ) dVdt = 0
t CV t CV t CV
t +t t +t
( P − P0 ) V = t ( uA)e − ( uA)w dt + t ( uA)n − ( uA)s dt
Fully implicit scheme
uP = uP + (1 − )u0P = uP if = 1
( P )
− P0 V = ( uA)e − ( uA)w t + ( uA)n − ( uA)s t
In an orthogonal mesh the grid lines are perpendicular at intersections. Fig. (a) shows an example of an
orthogonal curvilinear mesh for the calculation of flow around an aerofoil and Fig. (b) presents a non-
orthogonal body-fitted grid for the half-cylinder problem.
In both types of body-fitted grid all the domain boundaries coincide with co-ordinate lines, so geometrical
details can be incorporated accurately without the need for stepwise approximations.
Unstructured grids
The advantage of unstructured grid arrangement is that no implicit structure of co-ordinate lines is imposed
by the grid – hence the name unstructured – and the mesh can be easily concentrated where necessary
without wasting computer storage. Moreover, control volumes may have any shape, and there are no
restrictions on the number of adjacent cells meeting at a point (2D) or along a line (3D). In practical,
triangles or quadrilaterals are most often used for 2D problems and tetrahedral or hexahedral elements in
3D ones.
In the cell-centred method the nodes are placed at the centroid of the control volume, as shown in Fig. (a).
In the vertex-vertex method the nodes are placed on the vertices of the grid.
(2)
( dV ) + A n ( u) dA = A n (grad ) dA + CV S dV
t CV
The surface integration must be carried out over the bounding surface A of the control volume CV. The
physical interpretation of n u is the component of the vector u in the direction of the outward unit vector
n normal to infinitesimal surface element dA. Some simple 2D examples of different shapes of control
volumes are shown in Fig. below:
Fig. (a) Cell-centred control volume arrangement Fig. (b) A face of a control volume and the
normal unit vector
The area integration for each of the elements is approximated by using the central differencing method
along line PA.
A − P
n (grad ) dA = n (grad ) A = n A
Ai
i i i
Ai (4)
is the distance between the centroid A and P and the approximation is only correct if the mesh is fully
orthogonal. Generally, in unstructured meshes the lines connecting centroid P and A are not parallel to the
unit normal vector ni as shown in Fig. (a). This is known as mesh skewness or non-orthogonality.
The flux calculation Eq. (4) has to be corrected by adding a contribution arising from non-orthogonality.
There are different ways to correct the flux but the most common form is to introduce a term known as
cross-diffusion, which is treated as a source term when the discretized equation is assembled.
Now an expression for the cross-diffusion term is developed by introducing co-ordinates along the line
joining P and A, and along the face of the control volume. Thus, the term can be expressed in terms
of (x, y) coordinates or (n, ) coordinates as follows:
= i+ j = n + e (5)
x y n
The normal unit vector n and the two other unit vectors e and e in the directions of and respectively
can be calculated from stored x- and y-co-ordinates of control volume nodes and vertices as follows
y x y −y x −x
n= i− j = b a i− b a j
Ai Ai
Thus, the normal component of the diffusive flux required in equation Eq. (4):
1
n = = + tan (9)
n cos
The two gradients of the transported quantity on the right-hand side of expression (11.16) may both be
approximated using central differencing:
A − P
= (10)
b − a
= (11)
In the literature and are called the direct gradient and cross-diffusion respectively. Substitution
of central difference approximations (10) and (11) into equation (9) yields
A n. ( grad ) dA =
A
A − P Ai b − a
n Ai = + Ai tan
cos
It is straightforward from the figure to see that
1 1 n. n
= = and
cos n. e n. e
sin e . e
tan = =
cos n. e
A − P n n − e e
n Ai = Ai − b a n Ai (12)
n e n e
The factors n.n Ai/n and ee Ai/n.e can be calculated from the grid geometry. In summary, for
unstructured grids the diffusion flux through each control volume face is evaluated as follows:
The convective flux parameter Fi which is equal to the mass flow rate normal to the surface element:
Fi = n ( u ) dA = n u A
Ai
i
The convective flux of transported quantity across the control surface in terms of the product as Fi i:
n ( u ) dA = F
A Ai A
i i
S dV =S V
CV
F
A
i U + (r )(D − U ) / 2 = Di ( A − P ) + S D −cross ,i + ( Su + S PP )
A
The thermal conductivity of the material is k = 50 W / m − K . Determine the discretized equation for
nodes 1, 2, 3, 5 and 6.
Solution:
To demonstrate the method a triangular mesh is chosen with equilateral triangle, which has the advantage
that it is an orthogonal unstructured grid. Since the normal vector to any face lies exactly along the lines
joining centroid, we do not need to calculate the cross-diffusion term arising from non-orthogonality.
Due to the symmetry of the problem domain and the boundary conditions only a quarter of the problem is
required in the calculation.
However, we would not be able to use equilateral triangles everywhere, so it is more convenient to consider
one half of the geometry and used symmetry boundary conditions across line HI and KJ.
div(k grad T ) = 0
(k T) dV = 0
Applying Gauss-divergence formula, we obtain
k T n dA = 0
T
k n dA = 0
k
n (TP − TN ) dA = 0
The discretized equation for each triangular control volume can be written as:
k Ai
A n
(Tnb − TP ) = 0
k Ai k Ai
Let Di = =
n
DT = D T
A
i P
A
i nb
Where aP = a nb − SP
The area of all control volume faces is
Ai = = 2 10−2 m2
and the distance between two nodes (0, 23/3) and (1, 13/3) is
2
= 10−2 m
3
Node 1:
Flux through any face is
k Ai
Di (TN − TP ) = (TN − TP )
Flux through face AB is
(T2 − TP )
k −2
2 10−2 = k 3(T2 − TP )
2 / 3 10
Face AC is a boundary, so the flux through this face is introduced as a source term using the unstructured
mesh equivalent of the half-cell approximation first introduced in section 4.3:
Flux through AC is
(TAC − TP )
k −2
2 10−2 = 2k 3(TAC − TP )
(1/ 3) 10
Node 2:
a1 = k 3 , a3 = k 3 and the face AD is an insulated boundary. Flux through the boundary AD is zero
(insulated boundary), so
Su = 0
SP = 0
aP = a1 + a3 − S P
After simplification the discretized equation for node 2 is
2T2 = T1 + T3
Node 3:
TBE = 4000 C and a2 = k 3, a4 = k 3 . Flux through BE is
Node 4:
The discretized equation for node 4 is
2T4 = T5 + T3
Node 5:
Flux through FG is
(TFG − TP )
k −2
2 10−2 = 2k 3(TFG − TP )
(1/ 3) 10
Su = 2k 3 TFG
SP = −2k 3
a P = a4 + a 6 − SP = (1 + 1 + 2)k 3
Node 6 and 8:
The discretized equation for node 6 is
4T6 = T5 + T7 + 400
Node 7:
Flux through GI is
Node 9:
The discretized equation for node 7 is
3T9 = T8 + 1000
For the discretization employ a grid with only two control volumes (CVs) as illustrated in Fig. 2. The
required coordinates for the distinguished points for both Cvs are indicated in Table 1 below:
→ →
cd = (6 − 5)i + (0 − 4) j = i − 4 j da = (0 − 6)i + (0 − 0) j = −6i + 0 j
→ i j → i j
en = − = 4i + j sn = − = 0i + 6 j
1 −4 −6 0
4 1 nˆs = 0i + j
nˆe = i+ j
17 17
(c) Discretization of governing differential equation
2T 2T
−k 2 − k 2 = q
x y
2T 2T
− k 2 + k 2 dV = q dV
x y
− kT dV = q dV
Denoting the unit normal vector nˆe = ne i + ne j and then applying Gauss divergence theorem in the left
x y
V V S
Applying the midpoint rule we get
Fe + Fw + Fn + Fs = q V
East face:
4 T 1 T 4 TE − TP 1 Tne − Tse
Fe = −k + e
dS = − k + Se
S 17 x
e 17 y 17 x 17 y
South face:
T T TP − TS
Fs = −k 0 − 1 = ( xse − xsw )
y
dS k
x yP − yS
s
S
s
T −0
= 2 P (6 − 0)
2−0
= 6TP
North face:
T T −T
Fn = −k dSn = −k N P ( xne − xnw )
S y
s y N − yP
Fe + Fw + Fn + Fs = q V
17
− (T2 − T1 ) − 10 + 6T1 + 3T1 − 60 = 8 18
9
98 17
T1 − T2 = 154
9 9
For CV 2
Fe + Fw + Fn + Fs = q V
17
0+ (T2 − T1 ) − 10 + 6T2 + 3T2 − 60 = 8 18
9
98 17
T2 − T1 = 194
9 9
After solving we get
T1 = 17.77
T2 = 20.90
The direction is determined by the connecting line between points P and E, and the direction is
determined by the direction of the CV face. Note that and , because of a distortion of the grid, can
deviate from the directions and which are defined by the connecting lines of P with the CV face
centers e and n.
=
(x E
− xP )( yne − yse ) − ( yE − yP )( xne − xse )
( E
− P ) Se
1
=
( E − P ) Se
J ( xE − xP )( yne − yse ) − ( yE − yP )( xne − xse )
The derivatives of T with respect to and can be approximated as
T TE − TP T Tne − Tse
= and =
E − P Se
dSe = ( xne − xse ) i + ( yne − yse ) j
^
^
The vector normal to dSe is
i j
dSn = − = − ( yne − yse ) i + ( xne − xse ) j
xne − xse yne − yse
^
The unit vectors tangential and normal to dSe are
tˆe =
(xne − xse ) ( yne − yse )
i+ j
Se Se
( y − y ) (x − x )
nˆe = − ne se i + ne se j = ne i + ne j
Se Se x y
Where
(y − yse ) (x − x )
ne = − ; ne = ne se and Se = (x − xse ) + ( yne − yse )
ne 2 2
x
Se Se y ne
Now
T T
k ne +
y
ne
x
x y
k y x T x y T
= ne − ne + ne − ne
J
x
y y x
+
(
k E − P Se )
xE − xP y − yP Tne − Tse
ne − E
n
( xE − xP )( yne − yse ) − ( yE − yP )( xne − xse ) E − P E − P e Se y x
T T
k ne + ne = De (TE − TP ) + Ne (Tne − Tse )
x y x y
Where
(x − x ) + ( y − y )
2 2
De = −k ne se ne se
(x ne
− xse )( y − y ) − ( y − y
E P ne se )( x E
− xP )
(x − x ) + ( y − y )
2 2
= −k ne se ne se
(x ne
− xse )( y − y ) − ( y − y
E P ne se )( x E
− xP )
(5 − 6) + ( 4 − 0)
2 2
= −2.0
( 5 − 6 )( 2 − 2 ) − ( 4 − 0 )
31 13
−
4 4
17
9
And
Ne = k
( y − y )( x − x ) + ( x − x )( y − y )
ne se E P ne se E P
( y − y )( x − x ) − ( x − x )( y − y )
ne se E P ne se E P
=k
( y − y )( x − x ) + ( x − x )( x − x )
ne se E P ne se E P
( y − y )( x − x ) − ( x − x )( y − y )
ne se E P ne se E P
= 2.0
( 4 − 0 )( 2 − 2 ) + ( 5 − 6 )( 31 / 4 − 13 / 4 )
( 4 − 0 )( 31 / 4 − 13 / 4 ) − ( 5 − 6 )( 2 − 2 )
1
=−
2
In order to numerically solve the governing partial differential equations (PDEs) of fluid mechanics,
approximations to the partial differentials are introduced. These approximations convert the partial
derivatives to finite difference expressions, which are used to rewrite the PDEs as algebraic equations. The
approximate algebraic equations, referred to as finite difference equations (FDEs), are subsequently solved
at discrete points within the domain of interest. Therefore, as set of grid points within the domain, as well
as the boundaries, of the domain, must be specified.
Typically, the computation domain is selected to be rectangular in shape where the interior grid points are
distributed along grid lines. Therefore, the grid points can be identified easily with reference to the
appropriate grid lines. This type grid is known as the structured grid. A second category of grid system may
be constructed where the grids points can be associated with orderly defined grid lines. This type of grid
systems is known as the unstructured gird.
The majority of the physical domains of interest are nonrectangular. Therefore, imposing a rectangular
computational domain on such a physical domain will require some sort of interpolation for the
implementation of the boundary conditions. Since the boundary conditions have a dominant influence on
the solutions of the equation, such an interpolation causes inaccuracies at the place of the greatest
sensitivity. In addition, unequal grid spacing near the boundaries creates further complications with the
FDEs since approximations with unequal step sizes must be used. This form of the FDE changes from node
to node, creating cumbersome programming details.
To overcome these difficulties, a transformation from physical pace to computation space is introduced.
This transformation is accomplished by specifying a generalized coordinate system which will map the
nonrectangular grid system in the physical space to a rectangular uniform grid spacing in the computation
space.
Fig. A typical 2D domain for the symmetric Fig. Computational domain with constant step sizes
blunt body problem.
And
Similarly,
= y + y
y
Now
u u
+ =0
x y
u u u u
x + x + y + y = 0
( x + y ) u + ( x + y )
u
=0
This is the equation which will be solved in the computational domain. Also note that the transformation
derivatives 𝜉𝑥 , 𝜉𝑦 , 𝜂𝑥 𝑎𝑛𝑑 𝜂𝑦 must be obtained from the functional relations.
d = x dx + y dy
d x y dx
d = y dy
x
dy = y d + yd
dx x x d
dy = y y d
𝑎 𝑎12
−1
[𝐴] = [𝑎11 𝑎22 ]
x y x x 21
=
x y y y 𝐴𝑑𝑗 𝐴 1 𝐴11 𝐴21
𝐴−1 = = [ ]
|𝐴| |𝐴| 𝐴12 𝐴22
From which
x = − J y x y 1 y − x
=
y = J x x y A − y x
J=
1 x y y − x
=J
x y − y x y
x − y x
The following algebraic relations will transform this physical domain into a rectangular domain:
=x
y
=
yt
H 2 − H1
yt = H1 + x
L
Thus, the algebraic relations can finally be written as
L
=
IM − 1
1
=
JM − 1
A computation domain is constructed for a 1713 grid system. The values of and are known at each
grid within this domain. The grid system generated for a physical domain defined by
L = 4, H1 = 2 and H2 = 4.
IM JM = 17 13
L 4
= = = 0.25
IM − 1 17 − 1
1 1
= = = 0.083
JM − 1 13 − 1
x = 1.0
y = 0
x =
( H 2 − H1 ) y / L
H1 + ( H 2 − H1 ) x / L
2
H 2 − H1
=−
L H1 + ( H 2 − H1 ) / L
1
y =
H1 + ( H 2 − H1 ) x / L
1
=
H1 + ( H 2 − H1 ) / L
1
J=
x y − y x
xi , j +1 − xi , j −1
x =
2
Three point forward second order approximations
−3xi ,1 + 4 xi ,2 − xi ,3
x =
2
A comparison of the metric evaluated numerically and analytically and the error introduced in the
numerical computations is shown in below:
Matrix Inversion
𝐴𝑋 = 𝐵
𝑋 = 𝐴−1 𝐵
Solution:
( k T ) = 0
T T
k + k =0
x x y y
T T T T
kA − kA + kA − kA =0
x e x w y n y s
T T T T
kA − kA + kA − kA =0
x e x w y n y s
kA kA kA
(T2 − T1 ) − (T1 − Tbw ) + (T4 − T1 ) − 0 = 0
x 1− 2 x 21−1 y 1− 4
kA kA kA kA kA kA
+ + T1 = T2 + T4 + Tbw
x 1− 2 x 21−1 y 1− 4 x 1−2 y 1− 4 x 21−1
0.667 3 10−3 + 2 10−3 + 110−3 T1 = 2 10 −3 T2 + 110 −3 T4 + 2 10 −3 320
0.005 T1 = 0.002 T2 + 0.001 T4 + 0.64
f = g F F + g C C
Where g F and gC could be the basis of weighting factor in the respective volumes such that
VC VF
gF = , gC = = 1 − gF
VC + VF VC + VF
V1 0.01
g e1 = = = 0.333
V1 + V2 0.01 + 0.02
V2 0.02
ge 2 = = = 0.40
V1 + V2 0.01 + 0.02
The values of thermal conductivity (k) at the element faces
k1 k2 10−3 102
k1−2 = = 3 10−3
(1 − ge1 ) k1 + ge 2k2 (1 − 0.333) 10 + 0.333 10
−3 2
T T T T
kA − kA + kA − kA =0
x e x w y n y s
kA kA kA
(T3 − T2 ) − (T2 − T1 ) + (T5 − T2 ) + qs As = 0
x 2 −3 x 1− 2 y 2 −5
kA kA kA kA kA kA
+ + T2 = T1 + T3 + T5 + bs
x 2−3 x 1− 2 y 2−5 x 1− 2 x 2 −3 y 2 −5
0.4 102 + 0.667 3 10−3 + 2 102 T2 = 0.667 3 10 −3 T1 + 0.4 10 2 T3 + 2 10 2 T5 + 100 0.2
240.002 T2 = 0.002 T1 + 40 T3 + 200 T5 + 20
Element 7: Mixed boundary condition
T Tb − TP
kA = ( kA ) b = h (T − Tb ) A b
y n yb
From which an equation of Tb can be obtained as
ℎ∞ 𝑇∞ + (𝑘/𝛿𝑦)𝑏 𝑇𝑃
𝑇𝑏 =
ℎ∞ + (𝑘/𝛿𝑦)𝑏
Substituting the value of Tb the flux equation is transformed to
T
kA = h (T − Tb ) A b
y n
h T + ( k / y )b
= h T − ( T − TP ) A b
h + (k / y )b
h T + T (k / y )b − h T − ( k / y)b
= h ( T − TP ) A b
h + (k / y )b
T ( k / y )b − ( k / y )b
= h ( T − TP ) A b
h + (k / y )b
= − R e q TP + R e q T
kA kA kA
(T8 − T7 ) − (T7 − T19 ) − R e q T7 + R e q T − (T7 − T4 ) = 0
x 7 −8 x 7 −19 y 4−7
kA kA kA kA kA kA
+ + + R e q T7 = T4 + T8 + T19 − R e q T
x 7−19 x 7−8 y 4−7 y 4 −7 x 7 −8 x 7−19
2 10−3 + 0.667 3 10−3 + 0.001998 + 110−3 T7 = 0.001 T4 + 0.002T8 + 2 10−3 320 − 0.001998 300