240 111 5MB
English Pages 240 Year 2012
Gautam Biswas Somenath Mukherjee
α Alpha Science International Ltd. Oxford, U.K.
Computational Fluid Dynamics 242 pgs. | 70 figs. | 06 tbls.
Gautam Biswas JC Bose National Fellow and Director CSIR-Central Mechanical Engineering Research Institute Durgapur Professor Department of Mechanical Engineering Indian Institute of Technology Kanpur Kanpur Somenath Mukherjee Senior Principal Scientist CSIR-Central Mechanical Engineering Research Institute Durgapur Copyright © 2014 ALPHA SCIENCE INTERNATIONAL LTD. 7200 The Quorum, Oxford Business Park North Garsington Road, Oxford OX4 2JZ, U.K.
www.alphasci.com All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording or otherwise, without prior written permission of the publisher. Printed from the camera-ready copy provided by the Authors. ISBN 978-1-84265-738-6 E-ISBN 978-1-78332-038-7 Printed in India
vi
Preface
Contents
Preface................................................................................................................... v
1. Method of Weighted Residuals.............................................. 1.1 1.1 Statement of a Typical Boundary Value Problem(BVP)........................... 1.1 1.2 The Weighted Residual Method (WRM).................................................... 1.2 1.3 The Galerkin’s Method.......................................................................... ...1.14 1.4 Other Variants of the Weighted Residual Method.................................. 1.23 1.4.1 The Collocation Method....................................................................... 1.23 1.4.2 The Sub-Domain Method.................................................................... 1.24 1.4.3 The Least Squares Method................................................................. 1.25 References........................................................................................................ 1.28 Problems........................................................................................................... 1.29
2. Finite Difference Method....................................................... 2.1 2.1 Classification of Partial Differential Equations........................................ 2.1 2.1.1 Boundary and Initial Conditions.......................................................... 2.3
2.2 Finite Differences........................................................................................ 2.4 2.2.1 Elementary Finite Difference Quotients.............................................. 2.5
2.3 Basic Aspects of Finite-Difference Equations........................................... 2.9 2.3.1 Consistency............................................................................................ 2.9 2.3.2 Convergence......................................................................................... 2.11 2.3.3 Explicit and Implicit Methods............................................................. 2.11 2.3.4 Explicit and Implicit Methods for Two-Dimensional
Heat Conduction Equation.................................................................. 2.14
2.3.5 ADI Method.......................................................................................... 2.16
2.4 Errors and Stability Analysis................................................................... 2.18 2.4.1 Introduction......................................................................................... 2.18 2.4.2 First-Order Wave Equation................................................................ 2.22 2.4.3 Stability of Hyperbolic and Elliptic Equations.................................. 2.22
viii Contents 2.5 Fundamentals of Fluid Flow Modeling.................................................... 2.27 2.5.1 Conservative Property......................................................................... 2.27 2.5.2 The Upwind Scheme............................................................................ 2.31 2.5.3 Transportive Property......................................................................... 2.31 2.5.4 Upwind Differencing and Artificial Viscosity..................................... 2.33 2.5.5 Second Upwind Differencing or Hybrid Scheme................................ 2.35 2.5.6 Some More Suggestions for Improvements........................................ 2.36
2.6 Some Non-Trivial Problems with Discretized Equations....................... 2.38 References........................................................................................................ 2.39 Problems........................................................................................................... 2.41
3. Introduction to Finite Volume Method............................... 3.1 3.1 The Basic Technique................................................................................... 3.1 3.2 A Generalized Approach............................................................................. 3.6 3.2.1 Equations with First Derivatives......................................................... 3.7 3.2.2 Equations with Second Derivatives...................................................... 3.9 References........................................................................................................ 3.13 Problems........................................................................................................... 3.14
4. Introduction to the Finite Element Method...................... 4.1 4.1 Introduction................................................................................................. 4.1 4.2 Galerkin’s Weak Formulations for the Two Dimensional Steady Heat
Conduction Equation.................................................................................. 4.3 4.2.1 Weighted Residual with the Analytical Solution as the Trial Function at the Element Level............................................................. 4.4 4.2.2 Galerkin’s Weighted Residual Form at the Element Level................. 4.5
4.3 Element Formulation for the 2-D Steady State Heat Transfer Problem... 4.6 4.3.1 Approximation for the Thermal Profile................................................ 4.6 4.3.2 Determination of Element Equations................................................... 4.9 4.3.3 Assembly of Elements and Solutions of the Global System Equation.4.11 References........................................................................................................ 4.16 Problems........................................................................................................... 4.17
5. Vorticity-Stream Function Approach.................................. 5.1 5.1 Introduction................................................................................................. 5.1 5.2 Numerical Methodology.............................................................................. 5.2 5.3 The Algorithm............................................................................................. 5.3 5.3.1 Bottom Wall Boundary.......................................................................... 5.4 5.3.2 Upper Boundary.................................................................................... 5.5
Contents ix 5.3.3 Inlet Boundary....................................................................................... 5.5 5.3.4 Outflow Boundary.................................................................................. 5.6
5.4 Application to Curvilinear Geometries...................................................... 5.8 References........................................................................................................ 5.10 Problems........................................................................................................... 5.11
6. Solution of Navier-Stokes Equations for Incompressible Flows Using SIMPLE and MAC Algorithms....................... 6.1 6.1 Introduction................................................................................................. 6.1 6.2 Staggered Grid............................................................................................ 6.2 6.3 Semi Implicit Method for Pressure Linked Equations (SIMPLE)............ 6.3 6.3.1 x - Momentum Equation........................................................................ 6.3 6.3.2 y - Momentum Equation........................................................................ 6.7 6.3.3 Solution Procedure................................................................................. 6.9 6.3.4 Two-Dimensional System of Equations and Line-by-line TDMA..... 6.10
6.4 Solution of the Unsteady Navier-Stokes Equations.................................. 6.12 6.4.1 Introduction to the MAC Method........................................................ 6.12 6.4.2 MAC Formulation................................................................................ 6.14 6.4.3 Boundary Conditions........................................................................... 6.19 6.4.4 Numerical Stability Considerations................................................... 6.21 6.4.5 Higher-Order Upwind Differencing.................................................... 6.21 6.4.6 Sample Results.................................................................................... 6.23
6.5 Solution of Energy Equation.................................................................... 6.25 6.5.1 Retention of Dissipation...................................................................... 6.27
6.6 Solution Procedure.................................................................................... 6.27 References........................................................................................................ 6.29 Problems........................................................................................................... 6.30
7. Solution of Navier-Stokes Equations in Curvilinear Coordinates................................................................................. 7.1 7.1 Introduction................................................................................................. 7.1 7.1.1 Continuity and Momentum Equations................................................. 7.2
7.2 Discretization of the Fluid Domain for Continuity and Momentum Equations................................................................................ 7.4 7.3 Scalar Transport....................................................................................... 7.12 7.4 The Discretised System of Equations...................................................... 7.14 7.5 Discretization of Equations...................................................................... 7.15 7.6 Time Discretization................................................................................... 7.19 7.7 Calculation of Pressure............................................................................. 7.20
x Contents 7.8 Boundary Conditions................................................................................ 7.27 References........................................................................................................ 7.28 Problem............................................................................................................ 7.29
8. Volume-of-Fluid Methods for Surface Tension Dominant Two-Phase Flows.................................................. 8.1 8.1 Introduction................................................................................................. 8.1 8.2 Numerical Methodology.............................................................................. 8.4 8.2.1 Advection Algorithm.............................................................................. 8.5 8.2.2 Interface Reconstruction....................................................................... 8.7 8.2.2.1 LVIRA...................................................................................... 8.8 8.2.2.2 CLSVOF................................................................................... 8.8 8.2.3 Surface Tension Model........................................................................ 8.10
8.2.3.1 K8 Kernel............................................................................... 8.10
8.2.3.2 CLSVOF................................................................................. 8.11 8.2.4 Outline of the Numerical Solution Procedure.................................... 8.12
8.3 Formulation of the Problems Involving Liquid and its Own Vapor....... 8.13 8.3.1 Jump Conditions at Liquid Vapor Interface...................................... 8.13 8.3.2 Numerical Procedure for Handling Problems with Liquid-Vapor Interface........................................................................ 8.14
8.3.2.1 The CLSVOF Advection Algorithm...................................... 8.15
8.4 Validation of the Interface Tracking Algorithms.................................... 8.15 8.4.1 Advection of a Hollow Square............................................................. 8.16 8.4.2 Circle in Shear Flow............................................................................ 8.17
8.5 Results and Discussion............................................................................. 8.19 8.5.1 Capillary Wave.................................................................................... 8.19 8.5.2 Rayleigh-Taylor Instability................................................................. 8.19
8.6 Bubble Formation at an Underwater Orifice.......................................... 8.22 8.7 Simulations for Vapor Bubbles at Near Critical Pressure..................... 8.26 8.8 Conclusions................................................................................................ 8.26 8.9 Acknowledgment....................................................................................... 8.28 References........................................................................................................ 8.29 Nomenclature................................................................................................... 8.33
Index.............................................................................................................. I.1
Chapter 1
Method of Weighted Residuals The methods of weighted residuals are techniques used in solving boundary value problems to determine approximate solutions to ordinary differential equations (ODEs) or partial differential equations (PDEs) defined on a given domain with specified kinematic (geometric) and kinetic (natural, or force) boundary conditions [Brebbia(1978), Dym et al.(1993), Finlayson(1972), Reddy (1993)]. These methods are based on setting up appropriate residual functions (which result from the residues of the pertinent differential equations due to approximations of the solutions) that are minimized with respect to some weighting functions in an integral sense over the whole solution domain.
1.1
Statement of a typical Boundary Value Problem(BVP)
Consider a domain Ω over which the following differential equation applies D(u) − f = 0
(1.1)
where D is some differential operator, with a source f distributed in the domain. The analytical solution for the field variable u of this differential equation satisfies the following domain boundary conditions u = uB G(u) = qB
in ΓD in Γq
(1.2a,b)
with ΓD ∪ Γq = Γ, ΓD ∩ Γq = 0 where Γ is the total boundary of the domain. Here ΓD , known as the Dirichlet boundary, denotes the set of domain boundaries with specified kinematic (or geometric) conditions and Γq , known as the
1.2 Computational Fluid Dynamics flux boundary, denotes the set of domain boundaries with specified natural, (or force) boundary conditions, that give the forces or fluxes across the boundary. The expression G(u) denotes the result of a differential operator G (of order lower than that of D ) upon the variable u to give the net flux qB across the Γq boundary. A typical boundary value problem consists of finding a solution to equation (1.1) satisfying the boundary conditions (1.2a,b). An applied mathematician often seeks an approximate solution uh for the differential equation. Such an approximate solution is obtainable using various numerical techniques, one of which is known as the weighted residual method. This approach is particularly useful for determining solutions to differential equations for many physical problems that do not admit exact solutions.
1.2
The Weighted Residual Method (WRM)
An approximate solution uh automatically generates a non-vanishing residual function from the differential equation, given by D(uh ) − f = ε
(1.3)
The approximate solution uh satisfies exactly the Dirichlet boundary conditions (1.2a), in ΓD uh = uB (1.4) Any admissible function uh , that essentially satisfies the kinematic boundary conditions (1.4), but does not necessarily satisfy the force boundary conditions exactly can be used as a trial function. For the purpose of determining the final form of the trial function, we invoke another kinematically admissible function, called the weighting function, denoted by W, such that it vanishes at the Dirichlet boundary, W = 0 in ΓD (1.5) However, the weighting function W should not vanish in the flux boundary Γq , if any. Equation (1.5) represents the homogeneous form of the kinematic boundary conditions imposed upon the weighting function. This restriction, however, will be relaxed in another variant of the weighted residual method, called the Galerkin’s Method, where the forms of the test function and the weighted function are identical. The weighted residual method effectively attempts to determine an approximate solution uh through a global integral that tends to vanish over the entire domain Ω of the non-vanishing residual function e, weighted with W Z W ε.dΩ ⇒ 0 Ω
or
Method of Weighted Residuals 1.3
Z
Ω
W D(uh ) − f dΩ ⇒ 0
(1.6)
where the sign “⇒” denotes ‘weakly equal to’ signifying the fact that the weighted integral residual usually approximates to zero value and under certain special circumstances can be exactly equal to zero. Expression (1.6) mathematically delineates the method of weighted residuals to determine an approximate function uh satisfying the Dirichlet boundary condition (1.4) and weighted with an admissible weighting function W, satisfying (1.5). Interestingly, equation (1.6) can also be interpreted as a statement of the celebrated principle of virtual work with a kinematically admissible ‘virtual displacement’ W=δuh , over the ‘equilibrium’ field distribution uh in the domain Ω. These kinematically admissible virtual displacements vanish at the Dirichlet boundary. As an illustrative example, the one dimensional Poisson’s equation can be used to demonstrate the applicability of the method of weighted residuals. d2 u = −p (1.7) dx2 with p as a source term within the one-dimensional domain Ω bounded by x=0 and x=a. Two possible combinations of the boundary conditions of the problem are shown below. Case (i) u = uL u = uR
at at
x=0 x=a
in ΓD in ΓD
(kinematic) (kinematic)
(1.8)
Case (ii) u=0 du = qR dx
at
x=0
in
ΓD
(kinematic) (1.9)
at
x=a
in Γq
(natural)
Weighted residual with the analytical solution as the trial function With the analytical solution u as the trial function for the differential equation (1.7), and a weighting function W of continuous non-vanishing first order derivative in the domain, the trivial case of vanishing of the weighted residual is given by Z a 2 d u W + p dx = 0 (1.10) dx2 0
1.4 Computational Fluid Dynamics Expanding (1.10) by performing the integration by parts, one gets
−
a
Z
0
dW dx
du dx
dx +
a
Z
0
du du W pdx + −W + W =0 dx x=0 dx x=a
which, after rearrangement, can also be expressed as Z
a
0
dW dx
du dx
dx =
Z
a
du du W pdx + −W + W dx x=0 dx x=a
0
(1.11)
or Z
0
a
dW dx
du dx
dx =
Z
a
W pdx + (Wx=0 ) .qL + (Wx=a ) .qR
(1.12)
0
where the analytical fluxes at the boundaries are du du qL = − qR = dx x=0 dx
(1.13) x=a
For the present purpose boundary fluxes qL and qR are conventionally taken to be positive provided they are directed along the positive x axis, as shown in Fig 1.1
Figure 1.1: Fluxes qL and qR at the domain boundaries. They are conventionally positive if directed along the positive x axis Equation (1.12) is valid for any admissible function that can be interpreted as a variation of the field variable, i.e. W=δu. Thus the equation can also be expressed as
Method of Weighted Residuals 1.5
a
Z
0
dδu dx
du dx
Z
dx =
0
a
δu.pdx + (δu.qL )x=0 + (δu.qR )x=a
(1.14)
At the boundaries, the following combinations of boundary conditions can be imposed. At x=0, either δu =0 (at ΓD boundary) or qL = (-du/dx )x=0 is specified (at Γq boundary). At x=a, either δu =0 (at ΓD boundary) or qR = (du/dx )x=a is specified (at Γq boundary). One can observe that the two cases of boundary conditions (1.8) and (1.9) are actually consumed in the above combinations. Thus equation (1.14) reduces to Z a Z a dδu du dx = δu.pdx f or Case (i) (1.15) dx dx 0 0 and Z
a
0
dδu dx
du dx
dx =
Z
a
δu.pdx + (δu.qR )x=a
0
f or Case (ii)
(1.16)
Weak form with the an approximate function as the trial function If an admissible function uh satisfying the kinematic boundary conditions is employed as the trial function and a weighing function W of continuous nonvanishing first order derivative in the domain is used, the weighted residual is given by Z a 2 h d u W + p dx ⇒ 0 (1.17) dx2 0 Expanding (1.17) thorough integration by parts, one gets Z
a
Z
a
0
dW dx
dW dx
duh dx
a
duh duh W pdx + −W + W ⇒0 dx x=0 dx x=a 0 0 (1.18) which, after rearrangement, can also be expressed as −
duh dx
dx +
dx ⇒
Z
Z
a 0
duh duh W pdx + −W + W (1.19) dx x=0 dx x=a
1.6 Computational Fluid Dynamics Expression (1.19) can now be compared with its analogue (1.11). Due to the approximate nature of the field variable uh , its gradient duh /dx (which is also an approximation to the analytical gradient du/dx ) cannot be equated to the flux at the domain boundaries. With proper values of the boundary fluxes, the inequality of expression (1.19) actually reduces to an equality, so that the expression reduces to an equation that is an analogue of (1.12),
Z
a 0
dW dx
duh dx
dx =
Z
a h h W pdx + (Wx=0 ) .qL + (Wx=a ) .qR
(1.20)
0
where the boundary fluxes satisfy the following inequalities
h qL
duh 6= − dx x=0
h qR 6=
duh dx
(1.21) x=a
Equation (1.20) is called the weak form of the differential equation (1.7), since it employs lower (first) order derivatives of the field variable and the weighting function while the actual differential equation involves a higher (second) order derivative of the field variable. While equation (1.20) can be interpreted as an analog of equation (1.12), inequality (1.21) stands against equation (1.13), showing the penalty that creeps into the system due to approximations of the field variable u. Equation (1.20) can now cater to the following boundary conditions h At x=0, either W =0 (at ΓD boundary) or qL is specified (at Γq boundary). h is specified (at Γq boundary). At x=a, either W =0 (at ΓD boundary) or qR
Thus we finally get the weak forms for Cases (i) and (ii).
Z
a
0
dW dx
duh dx
dx =
Z
a
W.pdx
f or Case (i)
(1.22)
0
and
Z
0
a
dW dx
duh dx
dx =
Z
0
a
W.pdx + (Wx=a ) qR
f or Case (ii)
(1.23)
Method of Weighted Residuals 1.7
In view of the inequality (1.21), an important corollary follows for the weak form of the differential equation (1.3), Z
Ω
W D(uh ) − f dΩ = 0
(1.24a)
provided in
W =0
ΓD
& Γq = Φ
(1.24b)
i.e. the weighted integral of the residual with an admissible approximate function uh as the trial function vanishes exactly to zero provided the weighting function W vanishes at the Dirichlet boundary, and there are no natural boundary conditions imposed on the system, (i.e. Γq is an empty set). If however Γq is not an empty set, then the flux at Γq should vanish and W = 0 at ΓD , so that the boundary terms from ΓD and Γq all vanish. Under such conditions only, equation (1.24a) is valid. Example 1.1 Using the method of weighted residual, find an approximate solution to the one– dimensional Poisson’s equation d2 u = −(x + 1) dx2
(a)
in the one-dimensional domain Ω bounded by x=0 and x=1. The boundary conditions for the field variable u are given by u=0 u=1
at at
x=0 x=1
(b)
Compare the approximate results with the exact solution. Exact solution of (a) The analytical (exact) solution of (a) satisfying the kinematic boundary conditions (b) is given by u=x+
x(1 − x) x(1 − x2 ) + 2 6
where 0 ≤ x ≤ 1. The exact fluxes at the Dirichlet boundaries are given by
(c)
1.8 Computational Fluid Dynamics
10 du =− qL = − dx x=0 6
qR =
du dx
Net flux inflow from the boundaries = qL + qR = − Thus net flux outflow from the boundaries is
= x=1
1 6
(d)
10 1 3 + =− 6 6 2
3 . 2 1
3 . 2 0 3 Thus flux outflow from boundaries = flux generated internally from source= . 2 Flux generated internally from the source p=(x +1) is given by
Z
(x+1)dx =
Thus flux balance is maintained in accordance with Gauss’s law. Approximate solution by the method of weighted residual An admissible function that satisfies the Dirichlet boundary conditions (b) is first chosen. uh = x + αx(x − 1)
(e)
An admissible weighting function that can be used here is given by W = x(x − 1)
(f)
which vanishes at the Dirichlet boundaries, x =0,1. Since only Dirchlet boundary conditions are specified and no natural (flux) conditions are imposed, one uses the weak form (1.22) Z
1
0
dW dx
duh dx
dx =
Z
1
W.(x + 1)dx
(g)
0
which gives Z
1
(2x − 1) {1 + α(2x − 1)} dx =
0
or
Z
1
x(x − 1).(x + 1)dx
0
α
Z
1 2
(2x − 1) dx = 0
Z
1 0
x3 − 3x + 1 dx
3 Solving this linear equation, we get α = − . Thus the approximate solution to 4 equation (a) with a weighting function W given by (f ) can be expressed as 3 uh = x + x(1 − x) 4
(h)
Method of Weighted Residuals 1.9 The variations of the exact and the approximate solutions are shown graphically in Fig 1.2.
1 Exact solution u
0.9
Approximate solution uh
0.8
u and uh
0.7 0.6 0.5 0.4 0.3 0.2 0.1 0
0
0.1
0.2
0.3
0.4
0.5 x
0.6
0.7
0.8
0.9
1
Figure 1.2: Variation of the exact and approximate weighted residual solution to the one-dimensional Poisson’s equation of example 1.1. The exact solution is denoted by u. and the approximate solution, denoted by uh is obtained with weighting function W=x (x -1). Example 1.2 Using the weighted residual method, find an approximate solution to the one– dimensional Poisson’s equation d2 u = −(x + 1) dx2
(a)
in the one-dimensional domain Ω bounded by x=0 and x=2. The boundary conditions for the field variable u are given by u=0 du =1 dx Exact solution of (a)
at
x=0 (b)
at
x=2
1.10 Computational Fluid Dynamics The analytical (exact) solution of (a) satisfying the kinematic boundary conditions (b) is given by x2 (x + 3) 6 The exact fluxes at the Dirichlet boundaries are given by u = 5x −
qL =
du = −5 − dx x=0
qR =
du dx
(c)
=1
(d)
x=2
Net flux inflow from the boundaries = qL + qR = −5 + 1 = −4 Flux generated internally from the source p=(x +1) is given by
Z
2
(x+1)dx = 4.
0
Thus flux outflow from boundaries = flux generated internally from source=4. Approximate solution by the method of weighted residual A kinematically admissible function that satisfies the Dirichlet boundary condition u(x =0) = 0 is first chosen. a1 (e) uh = a1 x + a2 x2 = x x2 a2 A similar weighting function that can be used here is given by c W = cx + dx2 = x x2 d
(f)
Using the weak form (1.20), and using the condition that W (x=0)=0, and h specified flux condition qR =1, one obtains Z
2
0
dW dx
T
duh dx
dx =
Z
2 T
W T (x + 1)dx + (Wx=2 ) .1
(g)
0
where the superscript T is used for denoting the transpose of a vector or matrix. After substituting for uh and W, equation (g) gives
c d
T Z
0
2
1
2x
T
1
= or
2x
c d
dx
a1 a2
T Z
0
2
x
2
x
T
(x + 1)dx +
2 4
Method of Weighted Residuals
c d
T Z
0
2
1 2x 2x 4x2 =
c d
1.11
a1 dx a2
T Z
2
0
x2
x
T
2 4
(x + 1)dx +
(x + 1)dx +
For non-trivial vector {c,d }T , one gets from above Z
0
or
2
1 2x 2x 4x2
Z 2 a1 = dx x a2 0 2 4 4 32/3
a1 a2
=
x2
T
20/3 32/3
2 4
Solving this linear set of simultaneous equations, one gets 16 a2 = −1 3 Thus the approximate solution is given by a1 =
uh =
16 x − x2 3
(h)
The variations of the exact and the approximate solutions are graphically presented in Fig 1.3. Example 1.3 Using the method of weighted residual, find an approximate solution for the Poisson’s equation ∂2u ∂2u + 2 =p ∂x2 ∂y
(a)
with p as a constant source for the entire rectangular domain Ω, shown in Fig 1.4. The kinematic boundary conditions for the field variable u are given by u=0 u=0
at at
x = ±a y = ±b
(b)
Let us approximate the solution by a trial function of the form uh = α x2 − a2
y 2 − b2
(c)
1.12 Computational Fluid Dynamics
7 6
Exact solution u Approximate solution uh
u and uh
5 4 3 2 1 0
0
0.2
0.4
0.6
0.8
1 x
1.2
1.4
1.6
1.8
2
Figure 1.3: Exact and approximate solutions u and uh of the Poisson’s equation of example 1.2
Figure 1.4: The rectangular domain of sides 2a and 2b for the twodimensional Poisson’s equation.
This is an admissible function since it satisfies the kinematic boundary conditions of the problem. The final form of the function will be obtained after the appropriate coefficient α is evaluated. For this purpose, we invoke an admissible weighting function, given by
πx πy cos W = cos 2a 2b
(d)
Method of Weighted Residuals
1.13
so that the following kinematic boundary conditions are satisfied by W, at at
W =0 W =0
x = ±a y = ±b
(e)
The weighted residual method demands that ZZ
W
Ω
∂ 2 uh ∂ 2 uh + − p dxdy = 0 ∂x2 ∂y 2
or Z
b
−b
Z
a
−a
πy πx cos 2α y 2 − b2 + 2α x2 − a2 − p dxdy = 0 2a 2b
cos
This can be further expanded to the form 2α
(Z
) Z a πy 2 πx 2 cos y − b dy dx cos 2b 2a −b −a b
+ 2α
(Z
b
−b
πy cos dy 2b =p
) πx 2 2 cos x − a dx 2a −a a
Z
Z
b
−b
(f)
a
πy πx cos dxdy cos 2a 2b −a
Z
Using the trigonometric results Z
a
−a
πx 2 4a3 cos x − a2 dx = 2a π
8 1− 2 π
and
a
πx 4a cos dx = 2a π −a
Z
one obtains the following form from equation (f )
2α
4b3 π
8 1− 2 π
4a π
+
4b π
4a3 π
Solving for α from this equation, one obtains
8 4a 4b 1− 2 =p π π π
1.14 Computational Fluid Dynamics
α=
pπ/2 (a2 + b2 ) (1 − 8/π 2 )
(g)
Thus the approximate solution to the Poisson’s equation of constant source p is given by, uh = α x2 − a2 =
1.3
y 2 − b2
pπ/2 (a2 + b2 ) (1 − 8/π 2 )
(h) x2 − a2
y 2 − b2
The Galerkin’s Method
The Galerkin’s method is a variant of the weighted residual method. In this method, the forms of the weighting functions are identical to those of the trial functions. In these circumstances, the restriction (1.5) imposed upon the weighting function is relaxed when necessary. In the Galerkin’s method, the weak form is always derived and employed to set up the equations that are to be solved to determine the unknown coefficients associated with the approximate expressions of the field variable of the differential equation. Galerkin’s method is extensively employed in solving boundary value problems by the Finite Element Method (FEM) [Reddy(1993)]. In this method, the entire domain is discretized into a finite number of elements connected to each other by discrete points, called nodes. The field variable in each element is approximated by interpolation functions with nodal variables (or nodal degrees of freedom) as the pivoting values. The Galerkin method is then adopted to establish the equations in each element with nodal variables as the unknowns. Finally, the element equations as assembled and then solved with appropriate domain boundary conditions imposed. The following example demonstrates the application of Galerkin’s method. Example 1.4 Using the Galerkin’s method, find an approximate solution to the one–dimensional Poisson’s equation d2 u = −(x + 1) (a) dx2 in the one-dimensional domain Ω bounded by x=0 and x=1. The boundary conditions for the field variable u are given by
Method of Weighted Residuals
u=0 u=1
at at
x=0 x=1
1.15
(b)
Compare the approximate solution with the exact one.
Figure 1.5: Domain for the variable uh for the 1-D Poisson’s equation of example 1.4. A set of quadratic Lagrangian interpolation functions between the variables at discrete points 1, 2 and 3 is employed as the trail and weighting functions. At the domain boundaries, kinematic conditions are imposed upon the field variable, u (x =0)=0, u (x =1)=1.
If u 1 , u 2 and u 3 represent discrete values of field variables (see Fig 1.5) at points x 1 =0, x 2 =0.5 and x 3 =1 in the domain (0,1), the approximation of the variable can be represented by a quadratic interpolation function, given by,
uh = M1 u1 + M2 u2 + M3 u3 =
M1
M2
u1 M3 u2 u3
(c)
where Mi are the Lagrangian interpolation functions, given by
M1 =
(x − x2 )(x − x3 ) (x1 − x2 )(x1 − x3 )
M2 =
(x − x1 )(x − x3 ) (x2 − x1 )(x2 − x3 )
M3 =
(x − x2 )(x − x1 ) (x3 − x2 )(x3 − x1 )
(d)
1.16 Computational Fluid Dynamics
For the given problem, these interpolation functions reduce to the following forms
M1 =
(x − 0.5)(x − 1) = 2 (x − 0.5) (x − 1) (0 − 0.5)(0 − 1)
M2 =
(x − 0)(x − 1) = 4x (1 − x) (0.5 − 0)(0.5 − 1)
M3 =
(x − 0.5)(x − 0) = 2x (x − 0.5) (1 − 0.5)(1 − 0)
(e)
Using uh as the weighting function and the trial function, equation (1.20) reduces to
Z
0
1
duh dx
2
dx =
Z
1 h h uh pdx + u1 .qL + u3 .qR
0
=
Z
(f)
1 h h uh (x + 1)dx + u1 .qL + u3 .qR 0
Superscript h indicates that the relevant terms are all approximate. Equation (f ) represents the weak form of the given boundary value problem using the Galerkin’s method. Using (c), it can be expanded in the following form,
T M1′2 u1 Z 1 M1′ M2′ u2 0 u3 M1′ M3′
M1′ M2′ M2′2 M2′ M3′
M1′ M3′ u1 u2 dx M2′ M3′ u3 M3′2
T h u 1 Z 1 M 1 qL u2 M2 0 = (x + 1)dx + 0 h u3 M3 qR
where Mi′ = dMi /dx. For non-trivial solution of the vector one gets from above
u1
u2
u3
T
,
Method of Weighted Residuals
Z
0
1
M1′2 M1′ M2′ M1′ M3′ =
M1′ M2′ M2′2 M2′ M3′
Z
0
1
M1′ M3′ u1 u2 dx M2′ M3′ u3 M3′2
1.17
(g)
h M1 qL M2 0 (x + 1)dx + h M3 qR
Performing the integrations and incorporating the kinematic boundary conditions (u 1 =0, u 2 =1) one can express (g) as
h 7/3 −8/3 1/3 =? u1 = 0 1/6 qL −8/3 16/3 −8/3 u2 =? 1 0 = + h 1/3 −8/3 7/3 u3 = 1 1/3 qR =?
(h)
A question mark ‘?’ beside a variable indicates that the value of the variable is not specified and hence unknown before equation (h) is solved. It can be h h observed that the computed values for the boundary fluxes qL and qR corresponding to the specified kinematic conditions (u 1 =0 and u 3 =1) are unknown. On the other hand, for the unknown variable u 2 the corresponding net flux is known. As a matter of fact, either kinematic (geometric) or natural (force) conditions associated with a nodal variable is known at every discrete nodal point in the domain. This is a significant phenomenon that is associated with the nature of variational formulation for any boundary value problem. The matrix equation (h) yields the following three independent equations −8 1 1 7 h ×0+ × u2 + ×1= + qL 3 3 3 6 8 8 16 − ×0+ × u2 + − ×1=1 3 3 3 8 7 1 1 h ×0+ − × u2 + ×1= + qR 3 3 3 3 Solving the second of these equations, one determines the value of u 2 as, u2 =
11 16
(i)
Using this value for u 2 in the first and the third equations, one determines the values of the boundary fluxes as
h = − qL
10 6
and
h qR =
1 6
(j)
1.18 Computational Fluid Dynamics
The approximate solution for the variable is thus given by
uh = M1 u1 + M2 u2 + M3 u3 =
11 x x (1 − x) + 2x (x − 0.5) = (7 − 3x) 4 4
(k)
The exact (analytical) solution is given as u=x+
x(1 − x) x(1 − x2 ) + 2 6
(l)
The approximate and analytical field gradients are duh 7 3 = − x dx 4 2
10 x du = −x 1+ 6 2 dx
(m)
An approximate solution suffers from the following inequalities of the computed field gradients and the fluxes at the domain boundaries.
h qL
duh 6= − dx x=0
h qR
6=
duh dx
(n) x=1
This is an inevitable consequence of a using an approximate function in a variational formulation. In contrast, the exact values of the boundary fluxes can be calculated from the analytical field gradients as
qL =
10 du − =− dx x=0 6
qR =
du dx
= x=1
1 6
(o)
Thus for this problem the boundary fluxes computed through the Galerkin’s method (in equation (j )) using an approximate trial function agree with the exact ones (in equation (o)). However, it should be pointed out here that the computed fluxes from Galerkin’s method are not always equal to the exact ones. There are cases where the computed fluxes determined by employing approximate functions deviate from the exact ones [Sangeeta et al.(2006), Mukherjee et al.(2010)]. The variations of the exact and approximate solutions of the field variable and the field gradient are presented graphically in Fig 1.6. Example 1.5 Using the Galerkin’s method, find an approximate solution to the one–dimensional Poisson’s equation
Method of Weighted Residuals
1.19
1 0.9
u
0.8
uh
u and uh
0.7 0.6 0.5 0.4 0.3 0.2 0.1 0
0
0.1
0.2
0.3
0.4
0.5 x
0.6
0.7
0.8
0.9
1
0.9
1
(a)
1.8 du/dx
1.6
duh/dx
du/dx and duh/dx
1.4 1.2 1 0.8 0.6 0.4 0.2 0
0
0.1
0.2
0.3
0.4
0.5 x
0.6
0.7
0.8
(b)
Figure 1.6: The variations of the exact solution and the approximate solution of example 1.4 (using Galerkin’s method) of the onedimensional Poisson’s equation with source p=x +1 in a domain bounded by x=0 and x=1. The kinematic boundary conditions are u (x=0 ) and u (x=1 )=1 (a) Field variables u and uh and (b) field gradients du/dx and duh /dx.
1.20 Computational Fluid Dynamics
d2 u = −(x + 1) dx2
(a)
in the one-dimensional domain Ω bounded by x=0 and x=1. The boundary conditions for the field variable u are given by
at
u=0
x=0 (b)
du =1 dx
at
x=1
Compare the approximate results with the exact results.
Figure 1.7: Domain for the variable uh for the 1-D Poisson’s equation of example 1.5. A set of quadratic Lagrangian interpolation functions between the variables at discrete points 1, 2 and 3 is employed as the trail and weighting functions. The Galerkin’s method can now be used to get the following weak form,
Z
0
1
duh dx
2
dx =
Z
1 h h uh (x + 1)dx + u1 .qL + u3 .qR
(c)
0
Since the domain of the field is identical to that of example 1.4 (see Fig.1.7), the same interpolation function uh can be employed in the Galerkin’s method.
uh = M1 u1 + M2 u2 + M3 u3 =
For non-trivial solution of the vector
M1
M2
u1
u2
u3
T
u1 M3 u2 u3
, one gets from (c)
(d)
Method of Weighted Residuals
Z
0
1
M1′2 M1′ M2′ M1′ M3′
M1′ M2′ M2′2 M2′ M3′
M1′ M3′ u1 u2 dx M2′ M3′ u3 M3′2
1.21
(e)
h qL 1 M1 = (x + 1)dx + 0 M2 0 h M3 qR Z
Performing the integrations and incorporating the boundary conditions h (u1 = 0, qR = qR = 1) as shown in Fig.1.7, one gets from (e)
h 7/3 −8/3 1/3 =? u1 = 0 1/6 qL −8/3 16/3 −8/3 u2 =? 1 = 0 + h 1/3 −8/3 7/3 u3 =? 1/3 qR = 1
(f)
This gives the following three independent equations, −8 1 1 7 h ×0+ × u2 + × u3 = + qL 3 3 3 6 8 16 8 ×0+ × u2 + − × u3 = 1 − 3 3 3 8 7 1 1 ×0+ − × u2 + × u3 = +1 3 3 3 3
Solving the second and the third of the above equations, one gets 53 11 , (g) u3 = 48 6 Using these values in the first of the three linear equations, one determines the flux at the left boundary as u2 =
h qL =−
5 2
(h)
The following shows the flux balance, 1
3 5 (x + 1)dx = − + 1 + = 0 2 2 0 Thus the approximate trial function and its derivative representing the field variable and its gradient respectively are given by h h qL + qR +
Z
uh = M1 u1 + M2 u2 + M3 u3 =
22 53 x(1 − x) + x(2x − 1) 3 48
22 53 duh = (1 − 2x) + (4x − 1) dx 3 48
(i)
1.22 Computational Fluid Dynamics
2 1.8
Exact solution u Approximate solution uh
1.6
u and uh
1.4 1.2 1 0.8 0.6 0.4 0.2 0
0
0.1
0.2
0.3
0.4
0.5 x
0.6
0.7
0.8
0.9
1
0.9
1
(a)
2.6 2.4 du/dx
du/dx and duh/dx
2.2
duh/dx
2 1.8 1.6 1.4 1.2 1
0
0.1
0.2
0.3
0.4
0.5 x
0.6
0.7
0.8
(b)
Figure 1.8: The variations of the exact solution and the approximate solution of example 1.5 (using Galerkin’s method) of the onedimensional Poisson’s equation with source p=x +1 in a domain bounded by x=0 and x=1. The kinematic boundary conditions are u at x=0 is equal to 0 and du/ dx at x=1 is equal to 1. (a) Field variables u and uh and (b) field gradients du/dx and duh /dx.
Method of Weighted Residuals
1.23
The exact solutions for the field and the field gradient are given as 5 x2 5 x du x − (x + 3), = − (x + 2) (j) 2 6 dx 2 2 Again, it can be shown that the approximate solution suffers from the following inequalities of the computed field gradients and the fluxes at the boundaries. u=
h qL
6=
duh − dx
x=0
h qR
6=
duh dx
(k) x=1
The variations of the exact and approximate solutions of the field variable and the field gradient are presented graphically in Fig 1.8.
1.4
Other variants of the weighted residual method
Apart from the Galerkin’s method, there are many variants of the weighted residual technique that differ from each other by the choice of the type of weighting function employed.
1.4.1
The Collocation Method
This is a variant of the weighted residual method. In this approach, the weighting functions are chosen as the Dirac-delta functions δ(x-xi ) at some chosen discrete points of co-ordinates xi within the domain. Thus at a point i, the weighting function is described as ∞ when x = xi Wi = δ (x − xi ) = (1.25) 0 when x 6= xi For a differential equation of the form D(u) − f = 0, the collocation method determines an approximate solution uh for which the mean residual over the domain with Dirac-delta as the weighting function at a discrete point vanishes, i.e. Z δ (x − xi ) D(uh ) − f dΩ = 0 (1.26) Ω
Since the Dirac-delta and its derivative are not continuous functions in the domain, the weak forms are never used in the collocation method. This also implies that this method can be employed for problems with only Dirichlet boundary conditions, and it cannot be used for any problems where specified natural boundary conditions are to be satisfied. The following are important properties of the Dirac-delta function,
1.24 Computational Fluid Dynamics
Z
b
δ (x − xi ) dx = 1
(1.27a)
δ (x − xi ) f (x)dx = f (xi )
(1.27b)
a
Z
b
a
where a < xi < b and f (x ) is a function defined in the domain [a,b].
1.4.2
The Sub-domain method
In this method, the weighting functions employed are such that each of them is of unit value in a certain chosen sub-domain, or region, but vanishes in the other regions of the domain, i.e.
Wi =
1 when
0 when
x ∈ Ωi Ωi ⊆ Ω
(1.28)
x∈ / Ωi
Thus the sub-domain method actually employs the following form of the weighted residuals. Z
Ω
This implies that
Wi D(uh ) − f dΩ = 0 Z
εi dΩ = 0
(1.29)
(1.30)
Ωi
where εi = D(uh ) − f Ωi is the residual in the differential equation in the sub-domain Ωi . Note that the weak form is never used in the sub-domain method. The method is restricted to boundary value problems with only kinematic (Dirichlet) boundary conditions. The sub-domain method forms the basis for the Finite Volume technique of Patankar and Spalding [Patankar(1980)]. In the Finite Volume Method, values are calculated at discrete places on a meshed geometry. ”Finite volume” refers to the small volume surrounding each node point on a mesh. Volume integrals in a partial differential equation that contain a divergence term are converted to surface integrals, using the divergence theorem. These terms are then evaluated as fluxes at the surfaces of each finite volume. Because the flux entering a given volume is identical to that leaving the adjacent volume, these methods are conservative. Another advantage of the finite volume method is that it is easily formulated to allow for unstructured meshes. The method is used in many computational fluid dynamics software packages.
Method of Weighted Residuals
1.4.3
1.25
The Least Squares Method
This method is based on the condition that the integral of the least square residual of the differential equation with an approximate function in the domain is stationary, i.e. ∂ ∂ai
Z
Ω
ε2 dΩ = 2
Z Ω
∂ε ε dΩ = 0 ∂ai
(1.31)
where ai are the unknown independent coefficients of the function uh approx imating the field variable of the differential equation, and ε = D(uh ) − f is the residual. From equation (1.31) it is evident that the least squares technique effectively employs a weighting function that is equal to ∂ε/∂ai . Example 1.6 Using the collocation method, find an approximate solution to the one–dimensional steady heat equation inside a fin whose ends are maintained at temperatures T0 and TL . The steady state heat equation in the fin, presented in Fig 1.9, can be expressed as P d2 T − q(x) = 0 (a) dx2 kA in the one-dimensional domain Ω bounded by x=0 and x=L. Here k, P and A represent the thermal conductivity, fin perimeter and area of the fin cross section, and q(x ) represents the heat loss per unit length from the lateral surface of the fin. The boundary conditions (at the fin ends) for the temperature T are given by at x = 0 T = T0 (b) at x = L T = TL
Figure 1.9: The fin represented by a rectangular panel. A third degree polynomial is employed here to approximate the temperature distribution in the fin under steady state.
1.26 Computational Fluid Dynamics
T h = a0 + a1 x + a2 x2 + a3 x3
(c)
The boundary condition at end x =0 gives a 0 =T 0 . Hence from (c) one has
T h = T0 + a1 x + a2 x2 + a3 x3
(d)
The boundary condition at the other end x =L gives another equation
T L = T 0 + a1 L + a2 L 2 + a3 L 3 which can be rearranged into the following form a1 + a2 L + a3 L2 = (TL − T0 ) /L
(e)
Two points, x 1 =L/3 and x 2 =2L/3 are chosen here for the Dirac-delta functions.The collocation method prescribes the use of the following equation Z
0
L
δ (x − xi )
P d2 T h − q(x) dx = 0 dx2 kA
(f)
Employing the property of the Dirac-delta function, expressed in equation (1.27b), one gets the following two equations from equation (f ) P L L − =0 (g) q 2a2 + 6a3 . 3 kA 3 2L P 2L 2a2 + 6a3 . − =0 (h) q 3 kA 3 Equations (e), (g) and (h) can be expressed in the following matrix form
1 0 0
L L 2 a1 a2 2 2L = a3 2 4L
TL − T0 L L P q kA 3 2L P q kA 3
(i)
Solving (i) one can determine the values of the coefficients a 1 , a 2 and a 3 . Thus the approximate expression for the temperature distribution can now be obtained using expression (d ). Example 1.7 Using the sub-domain method, find an approximate solution to the equation
Method of Weighted Residuals
1.27
d2 u + 4u + x2 = 0 dx2
(a)
u(0) = u(1) = 0
(b)
with boundary conditions
Let the approximate solution be of the following form that is admissible uh = x (1 − x) (α1 + α2 x)
(c)
The error of the solution is given by d2 uh + 4uh + x2 = 2 (α2 − α1 ) + (4α1 − 6α2 )x + (4α2 − 4α1 + 1) x2 − 4α2 x3 dx2 (d) 1 The complete domain Ω : [0, 1] can be divided into two sub-domains Ω1 : [0, ] 2 1 and Ω2 : [ , 1]. Equation (1.30) then yields the following two independent 2 equations Z 0.5 Z 1 εdx = 0 and εdx = 0
ε=
0
0.5
These lead to the following two independent equations 2 17 1 − α1 + α2 = 0 24 3 48 7 2 49 − α1 − α2 = 0 24 3 48
Solving these, one determines the following values of the coefficients 7 2 α2 = 44 11 The expression that approximates the field variable is thus given by 2 7 + x (e) uh = x (1 − x) 44 11 The exact solution to the given differential equation (a) satisfying the boundary conditions (b) is 1 1 + cos 2 2 (f) u= sin 2x − cos 2x + 1 − 2x 8 sin 2 The variations of the exact and approximate solutions with x are shown in Fig 1.10. α1 =
1.28 Computational Fluid Dynamics
0.07 Exact u
0.06
Approximate uh
u and uh
0.05 0.04 0.03 0.02 0.01 0
0
0.1
0.2
0.3
0.4
0.5 x
0.6
0.7
0.8
0.9
1
Figure 1.10: The exact and approximate solutions of the differential equation of example 1.7. The approximate solution is obtained by the subdomain method
References 1. Brebbia, C.A., The Boundary Element Method for Engineers, Pentech Press, 1978. 2. Dym, C.L., Shames, I. H., Solid Mechanics- A Variational Approach, McGraw Hill, 1973. 3. Finlayson, B.A., The Method of Weighted Residuals and Variational Principles, Academic Press, 1972. 4. Mukherjee, S., Jafarali, P., Prathap’s best-fit paradigm and optimal strain recovery points in indeterminate tapered bar analysis using linear element, Commnucation in Numerical Methods in Engineering, Vol 26, pp. 12461262, 2010. 5. Patankar, S.V., Numerical Heat Transfer and Fluid Flow, Hemisphere, 1980. 6. Reddy, J.N., An introduction to the Finite Element Method, McGraw Hill, 1993. 7. Sangeeta, K., Mukherjee, S., Prathap, G.,Conservation of the Best-Fit Paradigm at Element level, International Journal for Computational Methods in Engineering Science & Mechanics, Vol. 7, pp. 1-2, 2006.
Method of Weighted Residuals
1.29
Problems 1. Using the weighted residual method (with a weighting function W and approximate solution or trial function, uh ) find the weak forms of the following differential equations, with the given boundary conditions. d 2 du 0≤x≤1 + u = x2 f or 1+x − dx dx (i) du =2 u (0) = 1, dx x=1 d du 0≤x≤L − u =f f or dx dx (ii)
du = 0, u (1) = 2 u dx x=0
Also indicate the boundary conditions that the weighting function W and the trial function uh should satisfy. 2. Using algebraic and trigonometric expressions, find approximate solutions for the following differential equation du d 0≤x≤1 (1 + x) = x2 f or − dx dx u (0) = 0, u (1) = 0 Recommended functions; uh (x) = ax (1 − x) and uh (x) = a sin (πx) 3. Using any permissible function uh (x, y) in the plane, find an approximate solution for the Poisson’s equation in the plane (x,y) for steady state heat conduction in a square domain (of dimensions a× a), −k∇2 T = q0 The given boundary conditions are T=0 on sides x=a and y=a ∂T = 0 on (insulted) sides x=0 and y=0 ∂n 4. Using the collocation and the sub-domain methods solve the equation of heat conduction in the fin of example 1.6.
Chapter 2
Finite Difference Method 2.1
Classification of Partial Differential Equations
For analysing the equations for fluid flow problems, it is convenient to consider the case of a second-order differential equation given in the general form as A
∂2φ ∂2φ ∂2φ ∂φ ∂φ +B +C 2 +D +E + F φ = G(x, y) 2 ∂x ∂x∂y ∂y ∂x ∂y
(2.1)
In the coefficients A, B, C, D, E and F are either constants or functions of only (x, y) (do not contain φ or its derivatives), it is said to be a linear equation, otherwise it is a non-linear equation. An important subclass of non-linear equations is quasilinear equations. In this case, the coefficients may contain φ or its first derivative but not the second (highest) derivative. If G = 0, the aforesaid equation is homogeneous, otherwise it is non-homogeneous. Again for the above mentioned equation if
B 2 − 4AC = 0,
the equation is parabolic
if
B 2 − 4AC < 0,
the equation is elliptic
if
2
B − 4AC > 0,
the equation is hyperbolic
The unsteady Navier-Stokes equations are elliptic in space and parabolic in time. At steady-state, the Navier-Stokes equations are elliptic. In elliptic problems, the boundary conditions must be applied on all confining surfaces. These are boundary value problems. A physical problem may be steady or unsteady. In the following text, we shall discuss mathematical aspects of some of the equations that describe fluid flow and heat transfer problems. The Laplace equations and the Poisson equations are generally associated with the steady-state problems. These are elliptic equations and can be written
2.2 Computational Fluid Dynamics respectively as ∂2φ ∂x2 ∂2φ ∂x2
+ +
∂2φ = 0 ∂y 2 ∂2φ + S = 0 ∂y 2
(2.2) (2.3)
The velocity potential in steady, inviscid, incompressible, and irrotational flows satisfies the Laplace equation. The temperature distribution for steady-state, constant-property, two-dimensional conduction satisfies the Laplace equation if no volumetric heat source is present in the domain of interest and the Poisson equation if a volumetric heat source is present. The parabolic equation in conduction heat transfer is of the form ∂2φ ∂φ (2.4) =B 2 ∂t ∂x The one-dimensional unsteady conduction problem is governed by this equation when t and x are identified as the time and space variables, respectively φ denotes the temperature and B is the thermal diffusivity. The boundary conditions at the two ends and an initial condition are needed to solve such equations. The unsteady conduction problem in two- dimensions is governed by an equation of the form 2 ∂φ ∂ φ ∂2φ (2.5) + 2 +S =B ∂t ∂x2 ∂y Here t denotes the time variable, and a source term S is included. By comparing the highest derivatives in any two of the independent variables, with the help of the conditions given earlier, it can be concluded that Eq. (2.5) is parabolic in time and elliptic in space. An initial condition and two conditions for the extreme ends in each spacial coordinate is required to solve this equation. Fluid flow problems generally have nonlinear terms due to the inertia or acceleration component in the momentum equation. These terms are called advection terms. The energy equation has nearly similar terms, usually called the convection terms, which involve the motion of the flow field. For unsteady two-dimensional problems, the appropriate equations can be represented as 2 ∂φ ∂φ ∂φ ∂ φ ∂2φ +S (2.6) + +u +v =B ∂t ∂x ∂y ∂x2 ∂y 2 where φ denotes velocity, temperature or some other transported property, u and v are velocity components, B is the diffusivity for momentum or heat, and S is a source term. The pressure gradients in the momentum or the volumetric heating in the energy equation can be appropriately substituted in S. Eq. (2.6) is parabolic in time and elliptic in space. However, for very high-speed flows, the terms on the left side dominate, the second-order terms on the right hand side become trivial, and the equation becomes hyperbolic in time and space.
Finite Difference Method 2.3
2.1.1
Boundary and Initial Conditions
In addition to the governing differential equations, the formulation of the problem requires a complete specification of the geometry of interest and appropriate boundary conditions. An arbitrary domain and bounding surfaces are sketched in Fig. 2.1. The conservation equations are to be applied within the domain. The number of boundary conditions required is generally determined by the order of the highest derivatives appearing in each independent variable in the governing differential equations.
y
A1 n
r
A2
A3 Surface A
x Figure 2.1: Schematic sketch of an arbitrary domain. The unsteady problems governed by a first derivative in time will require initial condition in order to carry out the time integration. The diffusion terms require two spatial boundary conditions for each coordinate in which a second derivative appears. The spatial boundary conditions in flow and heat transfer problems are of three general types. They may be stated φ = φ1 (r) ∂φ = φ2 (r) ∂n ∂φ = φ3 (r) a(r)φ + b(r) ∂n
∈ A1
(2.7)
∈ A2
(2.8)
∈ A3
(2.9)
where A1 , A2 and A3 denote three separate zones on the bounding surface in Fig. 2.1. The boundary conditions on φ in Eqns. (2.7) to (2.9) are usually referred to as Dirchlet, Neumann and mixed boundary conditions, respectively. The boundary conditions are linear in the dependant variable φ. In Eqns. (2.7) to (2.8), ~r = ~r(x, y) is a vector denoting position on the boundary,
2.4 Computational Fluid Dynamics ∂ is the directional derivative normal to the boundary, and φ1 , φ2 , φ3 , a, and ∂n b are arbitrary functions. The normal derivative may be expressed as ∂φ − =→ n · ∇φ ∂n = (nxˆi + ny ˆj) · = nx
∂φ ∂φ + ny ∂x ∂y
∂φ ˆ ∂φ ˆ i+ j ∂x ∂y (2.10)
→ Here, − n is the unit vector normal to the boundary, ∇ is the nabla operator, [·] → denotes the dot product, (nx , ny ) are the direction-cosine components of − n and (ˆi, ˆj) are the unit vectors aligned with the (x, y) coordinates.
2.2
Finite Differences
Analytical solutions of partial differential equations provide us with closed-form expressions which depict the variation of the dependant variables in the domain. The numerical solutions, based on finite differences, provide us with the values at discrete points in the domain which are known as grid points. Consider Fig. 2.2, which shows a domain of calculation in the x − y plane. Let us assume that the spacing of the grid points in the x−direction is uniform, and given by ∆x. Likewise, the spacing of the points in the y−direction is also uniform, and given by ∆y. It is not necessary that ∆x or ∆y be uniform. We could imagine unequal spacing in both directions, where different values of ∆x between each successive pairs of grid points are used. The same could be presumed for ∆y as well. However, often, problems are solved on a grid which involves uniform spacing in each direction, because this simplifies the programming, and often results in higher accuracy. In some class of problems, the numerical calculations are performed on a transformed computational plane which has uniform spacing in the transformed-independent-variables, but non-uniform spacing in the physical plane. These typical aspects will be discussed later in the Chapter on grid generation. In the present chapter we shall consider uniform spacing in each coordinate direction. According to our consideration, ∆x and ∆y are constants, but it is not mandatory that ∆x be equal to ∆y. Let us once again refer to Fig. 2.2. The grid points are identified by an index i which increases in the positive x-direction, and an index j, which increases in the positive y-direction. If (i, j) is the index of point P in Fig. 2.2, then the point immediately to the right is designated as (i + 1, j) and the point immediately to the left is (i − 1, j). Similarly the point directly above is (i, j + 1), and the point directly below is (i, j − 1). The basic philosophy of finite difference methods is to replace the derivatives of the governing equations with algebraic difference quotients. This will result in a system of algebraic equations which can be solved for the dependant variables at the discrete grid points in the flow field. Let us
Finite Difference Method 2.5 now look at some of the common algebraic difference quotients in order to be acquainted with the methods related to discretization of the partial differential equations.
y ∆x i−1,j+1
i,j+1
i+1,j+1
i−1,j
P i,j
i+1,j
i−1,j−1
i,j−1
i+1,j−1
∆y
x Figure 2.2: Discrete grid points.
2.2.1
Elementary Finite Difference Quotients
Finite difference representations of derivatives are derived from Taylor series expansions. For example, if ui,j is the x−component of the velocity ui+1,j at point (i + 1, j) can be expressed in terms of Taylor series expansion about point (i, j) as 2 3 2 3 ∂u (∆x) (∆x) ∂ u ∂ u ui+1,j = ui,j + ∆x + + + · · · (2.11) ∂x i,j ∂x2 i,j 2 ∂x3 i,j 6 Mathematically, Eq. (2.11) is an exact expression for ui+1,j if the series converges. In practice, ∆x is small and any higher-order term of ∆x is smaller than ∆x. Hence, for any function u(x), Eq. (2.11) can be truncated after a finite number of terms. For example, if terms of magnitude (∆x)3 and higher order are neglected, Eq. (2.11) becomes 2 2 ∂u (∆x) ∂ u ui+1,j ≈ ui,j + ∆x + ··· (2.12) ∂x i,j ∂x2 i,j 2
2.6 Computational Fluid Dynamics Eq. (2.12) is second-order accurate, because terms of order (∆x)3 and higher have been neglected. If terms of order (∆x)2 and higher are neglected, Eq. (2.12) is reduced to ∂u ∆x (2.13) ui+1,j ≈ ui,j + ∂x i,j Eq. (2.13) is first-order accurate. In Eqns. (2.12) and (2.13) the neglected higherorder terms represent the truncation error. Therefore, the truncation errors for Eqns. (2.12) and (2.13) are ∞ X
∂nu ∂xn
=
∂nu ∂xn
n=3
and
∞ X
(∆x)n n! i,j
=
n=2
(∆x) n! i,j
n
It is now obvious that the truncation error can be reduced by retaining more terms in the Taylor series expansion of the corresponding derivative and reducing the magnitude of ∆x. Let us once again return to Eq. (2.11) and solve for (∂u/∂x)i,j as:
∂u ∂x
i,j
ui+1,j − ui,j = − ∆x
or
∂u ∂x
=
i,j
∂2u ∂x2
∆x − i,j 2
∂3u ∂x3
(∆x)2 + ··· 6 i,j
ui+1,j − ui,j + O(∆x) ∆x
(2.14)
In Eq. (2.14) the symbol O(∆x) is a formal mathematical nomenclature which means “terms of order of ∆x”,expressing the order of magnitude of the truncation error. The first-order-accurate difference representation for the derivative (∂u/∂x)i,j expressed by Eq. (2.14) can be identified as a first-order forward difference. We now consider a Taylor series expansion for ui−1,j , about ui,j ui−1,j = ui,j +
∂u ∂x
(−∆x) +
∂u ∂x
(∆x) +
i,j
∂2u ∂x2
2
(−∆x) + 2 i,j
∂ 3u ∂x3
3
(−∆x) + ··· 6 i,j
or ui−1,j = ui,j −
i,j
∂ 2u ∂x2
3 2 3 (∆x) (∆x) ∂ u − + · · · (2.15) 2 ∂x3 i,j 6 i,j
Solving for (∂u/∂x)i,j , we obtain
∂u ∂x
i,j
=
ui,j − ui−1,j + O(∆x) ∆x
(2.16)
Finite Difference Method 2.7 Eq. (2.16) is a first-order backward expression for the derivative (∂u/∂x) at grid point (i, j). Subtracting Eq. (2.15) from ( 2.11) 3 3 (∆x) ∂u ∂ u ui+1,j − ui−1,j = 2 (∆x) + + ··· (2.17) ∂x i,j ∂x3 i,j 3 and solving for (∂u/∂x)i,j from Eq. (2.17) we obtain ui+1,j − ui−1,j ∂u = + O(∆x)2 ∂x i,j 2∆x
(2.18)
Eq. (2.18) is a second-order central difference for the derivative (∂u/∂x) at grid point (i, j). In order to obtain a finite-difference for the second-order partial derivative (∂ 2 u/∂x2 )i,j , add Eq. (2.11) and (2.15). This produces 4 2 4 (∆x) ∂ u ∂ u 2 (∆x) + + ··· (2.19) ui+1,j + ui−1,j = 2ui,j + ∂x2 i,j ∂x4 i,j 12 Solving Eq. (2.19) for (∂ 2 u/∂x2 )i,j , we obtain 2 ∂ u ui+1,j − 2ui,j + ui−1,j = + O(∆x)2 ∂x2 i,j (∆x)2
(2.20)
Eq. (2.20) is a second-order central difference form for the derivative (∂ 2 u/∂x2 ) at grid point (i, j). Difference quotients for the y-derivatives are obtained in exactly the similar way. The results are analogous to the expressions for the x-derivatives. ui,j+1 − ui,j ∂u = + O(∆y) [Forward difference] ∂y i,j ∆y ∂u ui,j − ui,j−1 = + O(∆y) [Backward difference] ∂y i,j ∆y ui,j+1 − ui,j−1 ∂u = + O(∆y)2 [Central difference] ∂y i,j 2∆y 2 ∂ u ui,j+1 − 2ui,j + ui,j−1 = + O(∆y)2 [Central difference of second ∂y 2 i,j (∆y)2 derivative] It is interesting to note that the central difference given by Eq. (2.20) can be interpreted as a forward difference of the first order derivatives, with backward differences in terms of dependent variables for the first-order derivatives. This is because 2 ∂u ∂u ∂ u ∂ ∂u ∂x i+1,j − ∂x i,j = = ∂x2 i,j ∂x ∂x i,j ∆x
2.8 Computational Fluid Dynamics or
or
∂2u ∂x2
=
i,j
∂2u ∂x2
ui+1,j − ui,j ∆x
i,j
=
−
ui,j − ui−1,j ∆x
1 ∆x
ui+1,j − 2ui,j + ui−1,j (∆x)2
The same approach can be made to generate a finite difference quotient for the mixed derivative (∂ 2 u/∂x∂y) at grid point (i, j). For example, ∂ ∂u ∂ 2u (2.21) = ∂x∂y ∂x ∂y In Eq. (2.21), if we write the x−derivative as a central difference of y-derivatives, and further make use of central differences to find out the y−derivatives, we obtain ∂u ∂u − ∂y i+1,j ∂y i−1,j ∂2u ∂ ∂u = = ∂x∂y ∂x ∂y 2(∆x) 2 ∂ u ui+1,j+1 − ui+1,j−1 ui−1,j+1 − ui−1,j−1 1 = − ∂x∂y 2(∆y) 2(∆y) 2(∆x) 2 ∂ u 1 = (ui+1,j+1 +ui−1,j−1 −ui+1,j−1 −ui−1,j+1 )+O[(∆x)2 , (∆y)2 ] ∂x∂y 4∆x∆y (2.22) Combinations of such finite difference quotients for partial derivatives form finite difference expressions for the partial differential equations. For example, the Laplace equation ∇2 u = 0 in two dimensions, becomes ui,j+1 − 2ui,j + ui,j−1 ui+1,j − 2ui,j + ui−1,j + =0 (∆x)2 (∆y)2 or ui+1,j + ui−1,j + λ2 (ui,j+1 + ui,j−1 ) − 2(1 + λ2 )ui,j = 0
(2.23)
where λ is the mesh aspect ratio (∆x)/(∆y). If we solve the Laplace equation on a domain given by Fig. 2.2, the value of ui,j will be ui,j =
ui+1,j + ui−1,j + λ2 (ui,j+1 + ui,j−1 ) 2(1 + λ2 )
(2.24)
It can be said that many other forms of difference approximations can be obtained for the derivatives which constitute the governing equations for fluid flow and heat transfer. The basic procedure, however, remains the same. In order to appreciate some more finite difference representations see Tables 2.1 and 2.2. Interested readers are referred to Anderson, Tannehill and Pletcher (1984) for more insight into different kind of discretization methods.
Finite Difference Method 2.9
2.3
Basic Aspects of Finite-Difference Equations
Here we shall look into some of the basic aspects of difference equations. Consider the following one dimensional unsteady state heat conduction equation. The dependent variable u (temperature) is a function of x and t (time) and α is a constant known as thermal diffusivity. ∂2u ∂u =α 2 ∂t ∂x
(2.25)
It is to be noted that Eq. (2.25) is classified as a parabolic partial differential equation. If we substitute the time derivative in Eq. (2.25) with a forward difference, and a spatial derivative with a central difference (usually called FTCS, Forward Time Central Space method of discretization), we obtain n u − 2uni + uni−1 un+1 − uni i (2.26) = α i+1 ∆t (∆x2 ) In Eq. (2.26), the index for time appears as a superscript, where n denotes conditions at time t, (n + 1) denotes conditions at time (t + ∆t), and so on. The subscript denotes the grid point in the spatial dimension. However, there must be a truncation error for the equation because each one of the finite-difference quotients has been taken from a truncated series. Considering Eqns. (2.25) and (2.26), and looking at the truncation errors associated with the difference quotients we can write un − 2uni + uni−1 un+1 − uni ∂2u ∂u −α 2 = i − α i+1 ∂t ∂x ∆t (∆x2 ) 4 n 2 n (∆t) (∆x)2 ∂ u ∂ u +α + ··· + − ∂t2 i 2 ∂x4 i 12
(2.27)
In Eq. (2.27), the terms in the square brackets represent truncation error for the complete equation. It is evident that the truncation error (TE) for this representation is O[∆t,(∆x)2 ]. With respect to Eq. (2.27), it can be said that as ∆x → 0 and ∆t → 0, the truncation error approaches zero. Hence, in the limiting case, the difference equation also approaches the original differential equation. Under such circumstances, the finite difference representation of the partial differential equation is said to be consistent.
2.3.1
Consistency
A finite difference representation of a partial differential equation (PDE) is said to be consistent if we can show that the difference between the PDE and its finite difference (FDE) representation vanishes as the mesh is refined, i.e, lim (P DE − F DE) =
mesh→0
lim (T E) = 0
mesh→0
2.10 Computational Fluid Dynamics
Table 2.1: Difference Approximations for Derivatives
∂3u ∂x3 4
∂ u ∂x4
=
ui+2,j − 2 ui+1,j + 2 ui−1,j − ui−2,j + O(h2 ) 2 h3
=
ui+2,j − 4 ui+1,j + 6 ui,j − 4 ui−1,j + ui−2,j + O(h2 ) h4
=
−ui+3,j + 4 ui+2,j − 5 ui+1,j + 2 ui,j + O(h2 ) h2
=
−ui+2,j + 8 ui+1,j − 8 ui−1,j + ui−2,j + O(h4 ) 12 h
=
−ui+2,j + 16 ui+1,j − 30 ui,j + 16 ui−1,j − ui−2,j + O(h4 ) 12 h2
i,j
i,j
∂2u ∂x2 i,j ∂u ∂x i,j 2 ∂ u ∂x2 i,j
h
= grid spacing in x-direction
Table 2.2: Difference Approximations for Mixed Partial Derivatives
∂2u ∂x∂y ∂2u ∂x∂y ∂2u ∂x∂y ∂2u ∂x∂y ∂2u ∂x∂y
=
1 ∆x
ui+1,j − ui+1,j−1 ui,j − ui,j−1 − ∆y ∆y
+ O(∆x, ∆y)
=
1 ∆x
ui,j+1 − ui,j ui−1,j+1 − ui−1,j − ∆y ∆y
+ O(∆x, ∆y)
=
1 ∆x
ui+1,j+1 − ui+1,j−1 ui,j+1 − ui,j−1 − 2∆y 2∆y
=
1 2 ∆x
=
1 2 ∆x
i,j
i,j
i,j
i,j
i,j
ui+1,j+1 − ui+1,j−1 ui−1,j+1 − ui−1,j−1 − 2∆y 2∆y
ui+1,j − ui+1,j−1 ui−1,j − ui−1,j−1 − ∆y ∆y
+ O[(∆x), (∆y)2 ]
+ O[(∆x)2 , (∆y)2 ]
+ O[(∆x)2 , (∆y)]
Finite Difference Method
2.11
A questionable scheme would be one for which the truncation error is O(∆t/∆x) and not explicitly O(∆t) or O(∆x) or higher orders. In such cases the scheme would not be formally consistent unless the mesh were refined in a manner such that (∆t/∆x) → 0. Let us take Eq. (2.25) and the Dufort-Frankel (1953) differencing scheme. The FDE is # " uni+1 − un+1 − uin−1 + uni−1 un+1 − uin−1 i i (2.28) =α 2∆t (∆x2 ) Now the leading terms of truncated series form the truncation error for the complete equation: α 12
∂4u ∂x4
n
(∆x)2 − α
i
∂2u ∂t2
n i
∆t ∆x
2
−
1 6
∂3u ∂t3
n
(∆t)2
i
The above expression for truncation error is meaningful if (∆t/∆x) → 0 together with ∆t → 0 and ∆x → 0. However, (∆t) and (∆x) may individually approach zero in such a way that (∆t/∆x) = β. Then if we reconstitute the PDE from FDE and TE, we shall obtain 2 ∂ u lim (P DE − F DE) = lim (T E) = −αβ 2 ∆t,∆x→0 mesh→0 ∂t2 and finally PDE becomes ∂2u ∂2u ∂u + αβ 2 2 = α 2 ∂t ∂t ∂x We started with a parabolic one and ended with a hyperbolic one! So, DuFort-Frankel scheme is not consistent for the 1D unsteady state heat conduction equation unless (∆t/∆x) → 0 together with ∆t → 0 and ∆x → 0.
2.3.2
Convergence
A solution of the algebraic equations that approximate a partial differential equation (PDE) is convergent if the approximate solution approaches the exact solution of the PDE for each value of the independent variable as the grid spacing tends to zero. The requirement is uni = u¯(xi , tn )
as ∆x, ∆t → 0
where, u¯(xi , tn ) is the solution of the system of algebraic equations.
2.3.3
Explicit and Implicit Methods
The solution of Eq. (2.26) takes the form of a “marching” procedure (or scheme) in steps of time. We know the dependent variable at all x at a time level
2.12 Computational Fluid Dynamics from given initial conditions. Examining Eq. (2.26) we see that it contains one unknown, namely un+1 . Thus, the dependent variable at time (t + ∆t) is i obtained directly from the known values of uni+1 , uni and uni−1 . n u − 2uni + uni−1 un+1 − uni i = α i+1 (2.29) ∆t (∆x2 ) This is a typical example of an explicit finite difference method. Let us now attempt a different discretization of the original partial differential equation given by Eq. (2.25) . Here we express the spatial differences on the right-hand side in terms of averages between n and (n + 1) time level " # n+1 n+1 n+1 α ui+1 + uni+1 − 2ui − 2uni + ui−1 + uni−1 un+1 − uni i (2.30) = ∆t 2 (∆x2 ) The differencing shown in Eq. (2.30) is known as the Crank-Nicolson implicit scheme. The unknown un+1 is not only expressed in terms of the known quani tities at time level n, but also in terms of unknown quantities at time level (n + 1). Hence Eq. (2.30) at a given grid point i, cannot itself result in a solution of un+1 . Eq. (2.30) has to be written at all grid points, resulting in a i system of algebraic equations from which the unknowns un+1 for all i can be i solved simultaneously. This is a typical example of an implicit finite-difference solution (Fig. 2.3). Since they deal with the solution of large systems of simultaneous linear algebraic equations, implicit methods usually require the handling of large matrices. Generally, the following steps are followed in order to obtain a solution. Eq. (2.30) can be rewritten as r n + uni+1 − 2un+1 − 2uni + un+1 (2.31) un+1 − uni = [un+1 i i−1 + ui−1 ] i 2 i+1 where r = α(∆t)/(∆x)2 or n+1 n n n −r un+1 − r un+1 i−1 + (2 + 2r)ui i+1 = rui−1 + (2 − 2r)ui + rui+1
or −un+1 i−1 +
2 + 2r r
n un+1 − un+1 i i+1 = ui−1 +
2 − 2r r
uni + uni+1
(2.32)
Eq. (2.32) has to be applied at all grid points, i.e., from i = 1 to i = k + 1. A system of algebraic equations will result (refer to Fig. 2.3). at i = 2
− A + B(1)un+1 − un+1 = C(1) 2 3
at i = 3
− un+1 + B(2)un+1 − un+1 = C(2) 2 3 4
at i = 4 .. .
− un+1 + B(3)un+1 − un+1 = C(3) 3 4 5 .. .
at i = k
n+1 − un+1 − D = C(k − 1) k−1 + B(k − 1)uk
Finite Difference Method
2.13
t
n+2 n+1
x
n i=1
i=k+1
BC u = A at x=0
BC u = D at x=L
Figure 2.3: Crank Nicolson implicit scheme.
Finally the equations will be of the form:
B(1) −1 0 0 −1 B(2) −1 0 0 −1 B(3) −1 .. . 0
0
0
...
un+1 (C(1) + A)n 2 un+1 C(2)n 3n+1 n u C(3) 4 = . . .. .. n n+1 −1 B(k − 1) (C(k − 1) + D) uk (2.33) ... ... ...
0 0 0
Here, we express the system of equations in the form of Ax = C, where C is the right-hand side column vector (known), A the tridiagonal coefficient matrix (known) and x the solution vector (to be determined). Note that the boundary values at i = 1 and i = k + 1 are transferred to the known right-hand side. For such a tridiagonal system, different solution procedures are available. In order to derive advantage of the zeros in the coefficient-matrix, the well known Thomas algorithm (1949) can be used (see appendix).
2.14 Computational Fluid Dynamics
2.3.4
Explicit and Implicit Methods for Two-Dimensional Heat Conduction Equation
The two-dimensional conduction equation is given by 2 ∂ u ∂2u ∂u =α + 2 ∂t ∂x2 ∂y
(2.34)
Here, the dependent variable, u (temperature) is a function of space (x, y) and time (t) and α is the thermal diffusivity. If we apply the simple explicit method to the heat conduction equation, the following algorithm results n n un+1 uni,j+1 − 2uni,j + uni,j−1 ui+1,j − 2uni,j + uni−1,j i,j − ui,j =α + ∆t (∆x2 ) (∆y 2 )
(2.35)
When we apply the Crank-Nicolson scheme to the two-dimensional heat conduction equation, we obtain n un+1 α i,j − ui,j n = (δx2 + δy2 )(un+1 i,j + ui,j ) ∆t 2
(2.36)
where the central difference operators δx2 and δy2 in two different spatial directions are defined by uni+1,j − 2uni,j + uni−1,j (∆x2 ) n u,j+1 − 2uni,j + uni,j−1 δy2 [uni,j ] = (∆y 2 )
δx2 [uni,j ] =
(2.37)
The resulting system of linear algebraic equations is not tridiagonal because of n+1 n+1 n+1 n+1 the five unknowns un+1 i,j , ui+1,j , ui−1,j , ui,j+1 and ui,j−1 . In order to examine this further, let us rewrite Eq. (2.36) as n+1 n+1 n+1 n+1 n a un+1 i,j−1 + b ui−1,j + d ui,j + b ui+1,j + a ui,j+1 = ci,j
(2.38)
where α∆t 1 = − Py 2 2(∆y) 2 1 α∆t = − Px b=− 2(∆x)2 2 d = 1 + Px + Py α∆t 2 (δx + δy2 )uni,j cni,j = uni,j + 2 a=−
Eq. (2.38) can be applied to the two-dimensional (6 × 6) computational grid shown in Fig. 2.4. A system of 16 linear algebraic equations have to be solved
Finite Difference Method
jmax
2.15
y
5 u = ub
4
u = u b = boundary value
3 2 j=1
x i= 1
2
3
4
5
imax
Figure 2.4: Two-dimensional grid on the (x-y) plane. at (n + 1) time level, in order to get the temperature distribution inside the domain. The matrix equation will be as the following: ′′′ c2,2 d b 0 0 a 0 0 u2,2 c′ b d b u3,2 ′3,2 a c4,2 0 b d b u4,2 a ′′′ c5,2 0 u5,2 b d b a ′′ a u2,3 c2,3 0 d b a 0 a u3,3 c3,3 b d b a u4,3 c4,3 a 0 b d b a ′′ u5,3 c a b d 0 a 5,3 ′′ u2,4 = a 0 d b a c 2,4 u3,4 a b d b a c 3,4 u4,4 c a b d b a 0 4,4 ′′ u5,4 a b d 0 a c 5,4 u2,5 ′′′ a 0 d b 0 c2,5 u3,5 a b d b 0 c′ a b d b u4,5 ′3,5 c4,5 a b d u5,5 ′′′ c5,5 (2.39) where ′
c = c − a ub ′′
c = c − b ub c
′′′
= c − (a + b) ub
The system of equations, described by Eq. (2.39) requires substantially more computer time as compared to a tridiagonal system. The equations of this type
2.16 Computational Fluid Dynamics are usually solved by iterative methods. These methods will be described in a subsequent section. The quantity ub is the boundary value.
2.3.5
ADI Method
The difficulties described in the earlier section, which occur when solving the two-dimensional equation by conventional algorithms, can be removed by alternating direction implicit (ADI) methods. The usual ADI method is a two-step scheme given by n+1/2
ui,j
− uni,j n+1/2 = α(δx2 ui,j + δy2 uni,j ) ∆t/2
(2.40)
and n+1/2
un+1 i,j − ui,j ∆t/2
n+1/2
= α(δx2 ui,j
+ δy2 un+1 i,j )
(2.41)
The effect of splitting the time step culminates in two sets of systems of linear algebraic equations. During step 1, we get the following "( n+1/2 ) # n+1/2 n+1/2 n+1/2 ui,j − uni,j ui+1,j − 2ui,j + ui−1,j uni,j+1 − 2uni,j + uni,j−1 =α + (∆t/2) (∆x2 ) (∆y 2 ) or [b ui−1,j + (1 − 2b) ui,j + b ui+1,j ]n+1/2 = uni,j − a [ui,j+1 − 2ui,j + ui,j−1 ]n Now for each “j” rows (j = 2, 3...), we can formulate a tridiagonal matrix, for the varying i index and obtain the values from i = 2 to (imax − 1) at (n + 1/2) level Fig. 2.5(a). Similarly, in step-2, we get n+1/2
un+1 i,j − ui,j (∆t/2)
=α
"(
n+1/2
n+1/2
n+1/2
ui+1,j − 2ui,j + ui−1,j 2 (∆x )
)
+
(
n+1 n+1 un+1 i,j+1 − 2ui,j + ui,j−1 (∆y 2 )
)#
or n+1/2
[a ui,j−1 + (1 − 2a) ui,j + a ui,j+1 ]n+1 = ui,j
− b[ui+1,j − 2ui,j + ui−1,j ]n+1/2
Now for each “i” rows (i = 2, 3....), we can formulate another tridiagonal matrix for the varying j index and obtain the values from j = 2 to (jmax − 1) at nth level Figure 2.5(b). With a little more effort, it can be shown that the ADI method is also second-
Finite Difference Method
t
t
n+ 1 − 2 y = j ∆.y 4 3 2 n
2.17
IMPLICIT
n+1 IMPLICIT
1 n+ − 2
x = i ∆x
2 3 45 . . . .
(a)
i
(b)
Figure 2.5: Schematic representation of ADI scheme. n+1/2
on order accurate in time. If we use Taylor series expansion around ui,j either direction, we shall obtain 2 3 ∂u 1 ∂2u ∆t 1 ∂3u ∆t ∆t n+1/2 n+1 + ui,j = ui,j + + + ··· ∂t 2 2! ∂t2 2 3! ∂t3 2 and uni,j
=
n+1/2 ui,j
−
∂u ∂t
∆t 2
1 + 2!
∂2u ∂t2
∆t 2
2
1 − 3!
∂3u ∂t3
∆t 2
3
+ ···
Subtracting the latter from the former, one obtains 3 ∂u 2 ∂3u ∆t n un+1 − u = (∆t) + + ··· i,j i,j 3 ∂t 3! ∂t 2 or n un+1 ∂u 1 i,j − ui,j = − ∂t ∆t 3!
∂3u ∂t3
∆t 2
2
+ ···
The procedure above reveals that the ADI method is second-order accurate with a truncation error of O [(∆t)2 , (∆x)2 , (∆y)2 ]. The major advantages and disadvantages of explicit and implicit methods are summarized as follows:
Explicit: • Advantage: The solution algorithm is simple to set up. • Disadvantage: For a given ∆x, ∆t must be less than a specific limit imposed by stability constraints. This requires many time steps to carry out the calculations over a given interval of t.
2.18 Computational Fluid Dynamics
Implicit: • Advantage: Stability can be maintained over much larger values of ∆t. Fewer time steps are needed to carry out the calculations over a given interval. • Disadvantages: - More involved procedure is needed for setting up the solution algorithm than that for explicit method. - Since matrix manipulations are usually required at each time step, the computer time per time step is larger than that of the explicit approach. - Since larger ∆t can be taken, the truncation error is often large, and the exact transients (time variations of the dependant variable for unsteady flow simulation) may not be captured accurately by the implicit scheme as compared to an explicit scheme. Apparently finite-difference solutions seem to be straightforward. The overall procedure is to replace the partial derivatives in the governing equations with finite difference approximations and then finding out the numerical value of the dependant variables at each grid point. However, this impression is indeed incorrect! For any given application, there is no assurance that such calculations will be accurate or even stable! Let us now discuss about accuracy and stability.
2.4 2.4.1
Errors and Stability Analysis Introduction
There is a formal way of examining the accuracy and stability of linear equations, and this idea provides guidance for the behavior of more complex non-linear equations which are governing the equations for flow fields. Consider a partial differential equation, such as Eq. (2.25). The numerical solution of this equation is influenced by the following two sources of error.
Discretization: This is the difference between the exact analytical solution of the partial differential Eq. (2.25) and the exact (round-off free) solution of the corresponding finite-difference equation (for example, Eq. (2.26). The discretization error for the finite-difference equation is simply the truncation error for the finitedifference equation plus any errors introduced by the numerical treatment of the boundary conditions.
Finite Difference Method
2.19
Round-off: This is the numerical error introduced for a repetitive number of calculations in which the computer is constantly rounding the number to some decimal points. If A = analytical solution of the partial differential equation. D = exact solution of the finite-difference equation N = numerical solution from a real computer with finite accuracy Then, Discretization error = A - D = Truncation error + error introduced due to treatment of boundary condition Round-off error = ǫ = N - D or, N =D+ǫ (2.42) where, ǫ is the round-off error, which henceforth will be called “error” for convenience. The numerical solution N must satisfy the finite difference equation. Hence from Eq. (2.26) n n Di+1 + ǫni+1 − 2Din − 2ǫni + Di−1 + ǫni−1 Din+1 + ǫn+1 − Din − ǫni i =α ∆t (∆x2 ) (2.43) By definition, D is the exact solution of the finite difference equation, hence it exactly satisfies n n Di+1 − 2Din + Di−1 Din+1 − Din (2.44) =α ∆t (∆x2 ) Subtracting Eq. (2.44) from Eq. (2.43) n ǫ − 2ǫni + ǫni−1 ǫn+1 − ǫni i = α i+1 ∆t (∆x2 )
(2.45)
From Equation 2.45, we see that the error ǫ also satisfies the difference equation. If errors ǫi are already present at some stage of the solution of this equation, then the solution will be stable if the ǫi ’s shrink, or at least stay the same, as the solution progresses in the marching direction, i.e from step n to n + 1. If the ǫi ’s grow larger during the progression of the solution from step n to n + 1, then the solution is unstable. Finally, it stands to reason that for a solution to be stable, the mandatory condition is n+1 ǫi (2.46) ǫn ≤ 1 i
For Eq. (2.26), let us examine under what circumstances Eq. (2.46) holds good. Assume that the distribution of errors along the x−axis is given by a Fourier series in x, and the time-wise distribution is exponential in t, i.e, X ǫ(x, t) = eat eIkm x (2.47) m
2.20 Computational Fluid Dynamics where I is the unit complex number and k the wave number 1 Since the difference is linear, when Eq. (2.47) is substituted into Eq. (2.45), the behaviour of each term of the series is the same as the series itself. Hence, let us deal with just one term of the series, and write ǫm (x, t) = eat eIkm x
(2.48)
Substitute Eq. (2.48) into ( 2.45) to get at Ikm (x+∆x) e e − 2eat eIkm x + eat eIkm (x−∆x) ea(t+∆t) eIkm x − eat eIkm x =α ∆t (∆x)2 (2.49) Divide Eq. (2.49) by eat eIkm x Ikm ∆x ea∆t − 1 − 2 + e−Ikm ∆x e =α ∆t (∆x)2 or, ea∆t = 1 +
α(∆t) (∆x)
2
eIkm ∆x + e−Ikm ∆x − 2
Recalling the identity cos(km ∆x) =
(2.50)
eIkm ∆x + e−Ikm ∆x 2
Eq. (2.50) can be written as ea∆t = 1 +
α(2∆t) (∆x)2
(cos(km ∆x) − 1)
or, ea∆t = 1 − 4
α(∆t) (∆x)
2
sin2 [(km ∆x)/2]
(2.51)
From Eq. (2.48), we can write ea(t+∆t) eIkm x ǫn+1 i = = ea∆t n ǫi eat eIkm x Combining Eqns. (2.51),(2.52) and (2.46), we have n+1 ǫi α(∆t) (k ∆x) m a∆t 2 ≤1 ǫn = |e | = 1 − 4 (∆x)2 sin 2 i
(2.52)
(2.53)
1 Let a wave travel with a velocity v. The time period “T ′′ is the time required for the wave to travel a distance of one wave length λ, so that λ=vT . Wave number k is defined by k = 2π/λ.
Finite Difference Method
2.21
Eq. (2.53) must be satisfied to have a stable solution. In Eq. (2.53) the factor α(∆t) 2 (km ∆x) 1 − 4 2 sin 2 (∆x)
is called the amplification factor and is denoted by G. Evaluating the inequality in Eq. (2.53) , the two possible situations which must hold simultaneously are (a) 1−4
α(∆t) 2
(∆x)
sin2
(km ∆x) ≤1 2
Thus, 4
α(∆t) (∆x)
2
sin
2
(km ∆x) ≥0 2
Since α(∆t)/(∆x)2 is always positive, this condition always holds. (b) 1−4
α(∆t)
2
sin
2
(∆x)
(km ∆x) ≥ −1 2
Thus, 4α(∆t) (∆x)
2
2
sin
(km ∆x) −1≤1 2
For the above condition to hold α(∆t) (∆x)
2
≤
1 2
(2.54)
Eq. (2.54) gives the stability requirement for which the solution of the difference Eq. (2.26) will be stable. It can be said that for a given ∆x the allowed value of ∆t must be small enough to satisfy Eq. (2.54). For α(∆t)/(∆x)2 ≤ (1/2) the error will not grow in subsequent time marching steps in t, and the numerical 2 solution will proceed in a stable manner. On the contrary, if α(∆t)/(∆x) > (1/2), then the error will progressively become larger and the calculation will be useless. The above mentioned analysis using Fourier series is called as the Von Neumann stability analysis.
2.22 Computational Fluid Dynamics
2.4.2
First-Order Wave Equation
Before we proceed further, let us look at the system of first-order equations which are frequently encountered in a class of fluid flow problems. Consider the second-order wave equation 2 ∂2u 2∂ u = c (2.55) ∂t2 ∂x2 Here c is the wave speed and u is the wave amplitude. This can be written as a system of two first-order equations. If v = ∂u/∂t and w = c(∂u/∂x), then we may write ∂v/∂t = c(∂w/∂x) and ∂w/∂t = c(∂v/∂x). Rather, the system of equations may be written as ∂U ∂U + [A] =0 ∂t ∂x which is a first-order equation. 0 −c It is implicit that U = { wv } and A = −c 0 . The eigenvalues λ of the [A] matrix are found by det [A − λI] = 0,
λ2 − c2 = 0
or
Roots of the characteristic equation are λ1 = +c and λ2 = −c, representing two travelling waves with speeds given by dx dx = c and = −c dt 1 dt 2 The system of equations in this example is hyperbolic and it has also been seen that the eigenvalues of the A matrix represent the characteristic differential representation of the wave equation. Euler’s equation may be treated as a system of first-order wave equations. For Euler’s equations, in two dimensions, we can write a system of first order as ∂E ∂E ∂E + [A] + [B] = [S] ∂t ∂x ∂y
(2.56)
where E=
u , v
0 v
v B= 0
2.4.3
0 , u 1 ∂p − and S = ρ1 ∂x ∂p − ρ ∂y A=
u 0
Stability of Hyperbolic and Elliptic Equations
Let us examine the characteristics of the first-order wave equation given by ∂u ∂u +c =0 ∂t ∂x
(2.57)
Finite Difference Method
2.23
Here we shall represent the spatial derivative by the central difference form un − uni−1 ∂u = i+1 ∂x 2∆x
(2.58)
We shall replace the time derivative with a first-order difference , where u(t) is represented by an average value between grid points (i + 1) and (i − 1), i.e u(t) =
1 n (u + uni−1 ) 2 i+1
Then
un+1 − 21 (uni+1 + uni−1 ) ∂u = i ∂t ∆t Substituting Eqns. (2.58) and (2.59) into (2.57), we have un+1 = i
uni+1 + uni−1 ∆t (uni+1 − uni−1 ) −c 2 ∆x 2
(2.59)
(2.60)
The time derivative is called Lax method of discretization, after the well known mathematician Peter Lax who first proposed it. If we once again assume an error of the form ǫm (x, t) = eat eIkm x (2.61) as done previously, and substitute this form into Eq. (2.60), following the same arguments as applied to the analysis of Eq. (2.26), the amplification factor becomes ea∆t = cos(km ∆x) − IC sin(km ∆x) where C = c(∆t/∆x). The stability requirement is |ea∆t | ≤ 1. Finally the condition culminates in ∆t C=c ≤1 (2.62) ∆x In Eq. (2.62), C is the Courant number. This equation restricts ∆t ≤ ∆x/c for the solution of Eq. (2.62) to be stable. The condition posed by Eq. (2.62) is called the Courant-Friedrichs-Lewy condition, generally referred to as the CFL condition.
Physical Example of Unstable Calculation Let us take the heat conduction once again, ∂u ∂2u =α 2 ∂t ∂x as
(2.63)
Applying FTCS discretization scheme depicts simple explicit representation n ui+1 − 2uni + uni−1 un+1 − uni i (2.64) =α ∆t (∆x2 )
2.24 Computational Fluid Dynamics or un+1 = r (uni+1 + uni−1 ) + (1 − 2r) uni , i
where r = α∆t/(∆x2 )
(2.65)
This is stable only if r ≤ 1/2. Let us consider a case when r > 1/2. For r = 1 (which is greater than the stability restriction), we get un+1 = 1 · (100 + 100) + (1 − 2) · 0 = 200o C, (which i is impossible). The values of u are shown in Fig. 2.6. Next, an example demonstrating the application of Von Neumann method
Figure 2.6: Physical violations resulting from r=1. to multidimensional elliptic problems is taken up. Let us take the vorticity transport equation: 2 ∂ω ∂ω ∂ω ∂ ω ∂2ω +u +v =ν + (2.66) ∂t ∂x ∂y ∂x2 ∂y 2 We shall extend the Von Neumann stability analysis for this equation, assuming u and v as constant coefficients (within the framework of linear stability analysis). Using FTCS scheme n n n+1 n n n ωi,j − ωi,j ωi+1,j − ωi−1,j ωi,j+1 − ωi,j−1 =−u −v ∆t 2∆x 2∆y n n n ωi+1,j − 2ωi,j + ωi−1,j +ν (∆x2 ) n n n ωi,j+1 − 2ωi,j + ωi,j−1 +ν (2.67) (∆y 2 ) Let us consider N = D + ǫ with ǫ(x, y, t) = eat
X
e(Ikm x+Ikm y)
(2.68)
m
where N is the numerical solution obtained from computer, D the exact solution of the FDE and ǫ error. Substituting Eq. (2.68) into Eq. (2.67) and using the trignometric identities, we finally obtain ǫn+1 ea(t+∆t) eIkm (x+y) i,j = = ea∆t = G n ǫi,j eat eIkm (x+y)
Finite Difference Method
2.25
where G =1 − 2(dx + dy ) + 2dx cos(km ∆x) + 2dy cos(km ∆y) − I[Cx sin(km ∆x) + Cy sin(km ∆y)] where dx =
ν∆t (∆x)
2,
dy =
ν∆t
2,
(∆y)
Cx =
u∆t , ∆x
Cy =
v∆t ∆y
The obvious stability condition |G| ≤ 1, finally leads to dx + dy ≤
1 , 2
Cx + Cy ≤ 1
when dx = dy = d which means
(for ∆x = ∆y), ν∆t (∆x)
2
≤
d≤
(2.69) 1 4
1 4
This is twice as restrictive as the one-dimensional diffusive limitation (compare with Eq. (2.54). Again for the special case (u = v and ∆x = ∆y) Cx = Cy = C,
hence C ≤
1 2
which is also twice as restrictive as one dimensional convective limitation (compare with Eq. (2.62). Finally, let us look at the stability requirements for the second-order wave equation given by ∂2u ∂2u = c2 2 2 ∂t ∂x We replace both the spatial and time derivatives with central difference scheme (which is second-order accurate) # " n n n un+1 − 2uni + uin−1 2 ui+1 − 2ui + ui−1 i (2.70) =c 2 2 (∆t) (∆x) Again assume N =D+ǫ
(2.71)
ǫni = eat eIkm x
(2.72)
and Substituting Eq. (2.72) and (2.71) in (2.70) and dividing both sides by eat eIkm x , we get ea∆t − 2 + e−a∆t = C 2 eIkm ∆x + e−Ikm ∆x − 2 (2.73)
2.26 Computational Fluid Dynamics where C, the Courant number =
c(∆t) ∆x
From Eq. (2.73), using trignometric identities, we get km ∆x ea∆t + e−a∆t = 2 − 4C 2 sin2 2
(2.74)
(2.75)
and, the amplification factor n+1 ǫ G = i n = |ea∆t | ǫi
However, from Eq. (2.75) we arrive at km ∆x e2a∆t − 2 1 − 2C 2 sin2 ea∆t + 1 = 0 2
(2.76)
(2.77)
which is a quadratic equation for ea∆t . This equation, quite obviously, has two roots, and the product of the roots is equal to +1. Thus, it follows that the magnitude of one of the roots (value of ea∆t ) must exceed 1 unless both the roots are equal to unity. But ea∆t is the magnification factor. If its value exceeds 1, the error will grow exponentially which will lead to an unstable situation. All these possibilities mean that Eq (2.77) should possess complex roots in order that both have the values of ea∆t equal to unity. This implies that the discriminant of Eq. (2.77) should be negative.
1 − 2C 2 sin2
km ∆x 2
or C2
ǫ
The choice of Hǫ (φ) instead of φ for computing n guarantees a finite thickness of the transition region of 2ǫ. The curvature κ is given by ˆ =∇· κ = −∇ · n
φ2y φxx − 2φx φy φxy + φ2x φyy ∇φ =− |∇φ| (φ2x + φ2y )3/2
(8.30)
Eqs. (8.28) and (8.30) are discretized by ordinary central-differencing schemes. Instead of using expression (8.22) for the calculation of the surface tension force based on the continuum surface force model of Brackbill et al. (1992), the continuous surface stress model (CSS) (Lafaurie et al., 1994; Scardovelli et al., 1999) ˆ ⊗n ˆ ) σδs ]. Both expressions can be shown can also be used, i.e. fsv = ∇ · [(1 − n
8.12 Computational Fluid Dynamics to be equivalent for constant σ (Lafaurie et al., 1994).Tests of the CSS method in the context of the CLSVOF approach applied to the problem of an equilibrium rod as discussed in Sec.8.4.1 shows that the CLSVOF-CSF method works slightly better than the CLSVOF-CSS approach. Hence the results presented below are based on the CLSVOF-CSF method.
8.2.4
Outline of the numerical solution procedure
The methods in Sec.8.2.1 - 8.2.3 describe the special features of volume-of-fluid methods compared with common one-fluid finite differencing flow solvers. These methods are incorporated into a solution process as follows. A staggered MAC grid (Harlow and Welch, 1965) is used as the basis for the numerical algorithm. The convective term in the momentum equation (8.3) is discretized by an essentially non-oscillatory (ENO) scheme of second order (see, e.g,(Chang et al., 1996). All other space derivatives are centered. Suppose the void fraction distribution F n at the time tn = n ∆t is known, the densities and viscosities at tn are calculated from Eqs. (8.4) and (8.5) based on the smoothed void fraction field F˜ for the K8 method (Eq.(8.26)) and on the Heaviside function (Eq.(8.29)) for the CLSVOF method. Also the surface tension force (Eq.(8.24)) is computed using the methods in Sec.8.2.3. Then the discretized form of the momentum equation (8.3) is solved explicitly, resulting in an intermediate velocity field, which is, in general, not divergence free (Eq. (8.3)), because the pressure gradient is discretized using values at the old time step tn . Therefore, the velocity at the new time step is eliminated from the disretized continuity and momentum equations in such a way that the solution of the resulting pressure equation assures that the velocity field satisfies the continuity equation. An iterative method based on a preconditioned conjugate gradient scheme of Van der Vorst (1992) is used for solving the pressure equation. Based on the velocity field at the new time step, the advection equations (8.10) and (8.11) (for the combined level-set and volume-of-fluid approach also Eqs. (8.17) and (8.19)) are solved followed by a reconstruction of the interface. The solution scheme described above is second order in space and first order in time. Time step restrictions exist for the present procedure owing to the advection algorithm and the explicit treatment of the convection term in Eq. (8.3). Of these two CFL constraints, the first one is more restrictive, which requires that the sum of the volume fluxed over the cell faces must be smaller than the total cell volume. This can be ensured by ∆tc ≤
h 2 max(| v |)
(8.31)
Furthermore, the explicit treatment of the surface tension term also results in a restriction as given in Brackbill et al. (1992) as 1/2 (ρ1 + ρ2 )h3 ∆ts < (8.32) 4πσ
Volume-of-Fluid Methods.. 8.13 The time step is chosen to be smaller than ∆tc and ∆ts . Finally, the two different algorithms compared in Sec. 8.5 have to be defined. Since the advection algorithm is the same for all approaches, only the interface reconstruction methods and the surface tension models are listed. • K8 : LVIRA (interface reconstruction, Sec.8.2.2.1), K8 kernel (surface tension model, Sec.8.2.3.1). • CLSVOF: Sec.8.2.2.2 (interface reconstruction) and 8.2.3.3 (surface tension model).
8.3
Formulation of the problems involving liquid and its own vapor
The mass and momentum conservation equations for the incompressible Newtonian fluids for the liquid and vapor phases are given by Eq. (8.1) and (8.2). The energy conservation equation is ∂θ + v · ∇θ = ∇ · (k∇θ) (8.33) ρcp ∂t
Here v, cp , ρ, θ and k are the fluid velocity, specific heat, density, temperature and thermal conductivity respectively. The dissipation term in the energy equation has been neglected.
8.3.1
Jump conditions at liquid vapor interface
The mass transfer across the interface is modeled following Welch and Rachidi (2002). We consider a computational cell containing a volume of the liquid phase adjacent to a volume of the vapor phase. Figure 8.2 can be used for this purpose. The gas filled part of the cell may be considered as the vapor filled region. We write a mass balance for each phase as Z Z Z d ρ(v − vl ).ndS = 0 (8.34) ρv.ndS + ρdV + dt Vg (t) Sl (t) Sg (t) Z Z Z d ρdV + ρv.ndS + ρ(v − vl ).ndS = 0 (8.35) dt Vl (t) Sl (t) Sl (t) Here Vl , Sl , Vg , Sg are the volume and surface of the liquid and vapor regions, respectively. Sl is the phase interface at the common boundary of the two regions, moving with velocity vl . The normal vector n points into the liquid phase on Sl . From the above, and taking into account the incompressibility of each phase, and under the situation that the overall volume is time invariant, the conservation of mass statement for the cell volume is determined as Z Z k (v − vl ) k .ndS = 0 (8.36) v.ndS + Sc
SI (t)
8.14 Computational Fluid Dynamics Here k . k indicates the jump in the variable of interest across the phase interface and Sc is the surface bounding the computational cell. The mass and energy jump conditions at the interface may be estimated as k ρ(v − vl ) k .n = 0
(8.37)
k ρh(v − vl ) k .n = − k q k .n
(8.38)
entails the contribution of jump in the conservation of mass equation as 1 k q k .n 1 − (8.39) k (v − vl ) k .n = ρl ρg hlg Here h is the enthalpy and hlg = hg − hl is the latent heat of vaporization while q is the heat flux vector. We assume the phase interface to be at the saturation temperature of the liquid pressure θl = θsat (Pl )
(8.40)
The temperature condition in Equation (8.40) is a widely used approximation. Son and Dhir (1998) justify this approximation. We neglect kinetic energy and viscous work terms in the energy jump and the viscous dissipation is also neglected.
8.3.2
Numerical procedure for handling problems with liquid-vapor interface
The numerical procedure as described in 8.2.4 is applicable for such problems. The additional feature is solution of energy equation which can be accomplished in the following way. The spatial discretization of governing equations is obtained using a staggered grid arrangement of Harlow and Welch (1965) with scalars located at the cell centers and velocity components located at the center of the cell faces. The convection terms in energy equation are discretized by QUICK (Leonard, 1979). The temporal discretization is described by a semiimplicit forward Euler method. We begin a time cycle by solving the explicit energy equation in the bulk fluid phases θn+1 = θn +
δt n [−v.∇(ρcp θ) + ∇.(k∇θ)] ρcp
(8.41)
After every time step with the help of new temperature field is calculated. The temperature field is deployed to form the interfacial heat flux jump appearing in the mass source term. The continuity and momentum equations are discretized as Z Z 1 1 k q n+1 k .n vn+1 .ndS + − dS = 0 (8.42) ρl ρg hl g Sl (t) Sc
Volume-of-Fluid Methods.. 8.15
vn+1 = vn − δt(v. ∇v)n −
δt ∇P n+1 + (ρg)n ρn (8.43) +∇ · [µ(∇v + (∇v)T )]n + σ(κ∇˜ α)n
The numerical scheme is based on the explicit time-advancement strategy. The time step is determined from the limit imposed on a capillary wave traveling in an infinite medium. The wave is not allowed to travel more than half a cell width during a time step and the strategy for determining time step has been explained in the section 8.2.4 8.3.2.1 The CLSVOF advection algorithm A coupled second-order conservative operator split advection scheme is used for discretization of Eqs. (8.7) and (8.8) as described in 8.2.1. This is done in three steps, as follows. 1. The LS function and void fraction are fluxed across the cell boundaries in one direction (say the x direction) as shown in Fig. 8.1. 2. The interface is reconstructed using the newly obtained void fraction field and LS function. 3. The LS function and void fraction are fluxed across the cell boundaries in the other direction (say the y direction). The flux directions are swapped after every time iteration. At each time step after finding the updated level set function φn+1 and the volume-of-fluid function, F n+1 , the level-set function is reinitialized to the exact signed normal distance from the reconstructed interface by coupling the level-set function to the volume fraction (Sussman et al., 2000).
8.4
Validation of the interface tracking algorithms
Before the two methods (K8 kernel and CLSVOF) are applied to solve the Navier-Stokes equations including surface tension effects, the interface reconstruction and advection algorithms are validated. Two test cases were chosen from Rudman (1997), namely the advection of a hollow square and a circle in shear flow. For the simulation of such test cases, the initial field of F is carefully provided and the initial interface is reconstructed. The velocity field is known in advance and is held constant with respect to time. The time cycle itself consists only of the advection sweeps of F (and φ for the CLSVOF method) followed by an interface reconstruction. Analytical solutions allow a rigorous check of the methods.
8.16 Computational Fluid Dynamics
8.4.1
Advection of a hollow square
The configuration of this test case is a hollow square, which is aligned with the coordinate axes as given in Rudman (1997) and outlined in Fig. 8.3. The square is exposed to a constant, unidirectional velocity field v = (2, 1). Using a mesh size of 200 × 200, the hollow square is advected 500 time steps with a cell Courant number (CFL) of 0.25.
F=0 F=1 F=0
v=1
40 CV
u=2 y
10 CV 10 CV
x Figure 8.3: Configuration of a hollow square aligned with the coordinate axes. The methods tested are distinguished by their interface reconstruction method (Sec.8.2.2), since the advection algorithm is identical in all methods. The accuracy of each method can be measured by the error E, given as P comp exact − Fi,j | i,j |Fi,j P (8.44) E= 0 i,j Fi,j comp exact where Fi,j and Fi,j are the computed and the exact void fraction after 500 0 time steps and Fi,j is the initial distribution. The results are provided in Table 8.1. In addition to Rudman’s value using his modified Youngs’ method, results of advecting F with a first- and second- (ENO) order upwind discretization scheme are added. The present results are in good agreement with the literature value. A more detailed examination of the simulations shows that all methods face the problem of resolving the corners of the hollow square. This leads to rounding of the corners. At least for the LVIRA method, it is known that second-order accuracy can only be obtained if the interface is sufficiently smooth Pucket et al. (1997). Hence improvements to Youngs’ first-order method are small or the results are even slightly worse. As known in the literature, ordinary upwind discretization schemes are not appropriate for the present purpose.
Volume-of-Fluid Methods.. 8.17
Table 8.1: Results of the hollow square after 500 time steps with CFL= 0.25. Method Youngs LVIRA CLSVOF PROST upwind O(1) ENO O(2) Youngs (Rudman)
8.4.2
E 2.691 · 10−2 3.340 · 10−2 2.410 · 10−2 2.789 · 10−2 0.733 0.285 2.58 · 10−2
Circle in shear flow
The second advection test represents a more realistic problem than the translation test in the previous section. In such translation test cases, the deformation of the interface is missing, i.e. the velocity field satisfies not only ∇ · v = 0, but also ∂u/∂x 6= 0 and ∂v/∂y 6= 0. This was pointed out by Rider and Kothe (1995), showing that simple translation and rotation problems are not sufficient to verify the ability of interface tracking methods. Typically interfaces in real problems undergo strong topological changes, including merging and fragmentation. A test problem taking such shear effects into account is the circle placed in a single vortex Rider and Kothe (1995). In the present study, parameters of this test case are taken from Rudmann (1997). The velocity field is defined by u = sin(x) cos(y) and v = − cos(x) sin(y)
(8.45)
The computational domain has a square shape of edge length π resolved by 100 × 100 control volumes. A circle of radius π/5 is placed at (π/2, π/4). In order to check the results with a known solution, the simulations are integrated in time N = 1000 or 2000 time steps forward followed by the same number of time steps backward, in which the signs of the velocity components (Eq. (8.45)) are reversed. Hence the final void fraction distribution should be exactly the same as the initial one. The error is calculated by Eq. (8.44). The mesh Courant number is 0.25. The results of the error norm are provided for the two cases N = 1000 and 2000 in Table 8.2. The development of the interface for N = 1000 is depicted in Fig. 8.4 after 1000∆t forward and after 1000∆t forward and backward integrations. The interface represents the true interface computed by the interface reconstruction method, i.e. the midpoint of each linear segment is shown. Using contour lines of the void fraction field would mean to smooth the interface representation. The results of the present study prove the reliability of the interface capturing algorithms. It should be noted that the mass conservation, which can be defined as the change of liquid in the domain during computations as ∆Vl =
8.18 Computational Fluid Dynamics
Table 8.2: Results of a circle in shear flow after 1000∆t and 2000∆t integrated forwards and backwards. The CFL number is 0.25. Method Youngs LVIRA CLSVOF PROST Youngs (Rudman)
E(N = 1000) 8.389 · 10−3 6.550 · 10−3 5.084 · 10−3 6.215 · 10−3 8.60 · 10−3
E(N = 2000) 3.725 · 10−2 3.340 · 10−2 2.648 · 10−2 3.191 · 10−2 3.85 · 10−2
3
2.5
y
2
1.5
1
0.5
0
0
0.5
1
1.5
2
2.5
3
x
Figure 8.4: Computed interfaces after 1000∆t forward and after 1000∆t forward and backward time integrations using the CLSVOF method.
X X 0 Fi,j )∆x∆y, of the shear test case is smaller (10−4 ) than that in Fi,j − ( i,j
i,j
the simple translation case (10−9 ) for all methods. This effect of strong vorticity can be improved by grid refinement.
Volume-of-Fluid Methods.. 8.19
8.5 8.5.1
Results and Discussion Capillary wave
This test case deals with the damped oscillation of an interface between two viscous fluids without external forces. The interface has initially a cosine-shaped perturbation and the two fluids being quiescent. The parameters of the test are the same as given by Popinet and Zaleski (1999), who used a different approach for interface tracking. In contrast to the volume-of-fluid methods used in the present study, which can be called an implicit or front-capturing method, they used an explicit or front-tracking method, because the interface is given explicitly by interface marker particles. Hence the capabilities of our methods can be directly compared with another approach well established in the literature (Juric and Tryggvason, 1998). Furthermore, an analytical solution based on the work of Prosperetti (1981) serves as a measure of the absolute deviation compared with the true solution. The computational domain is a square box of width H = λ = 2π/K, where λ and K are the wavelength and wavenumber, respectively. The viscosities and densities of the two fluids are the same, resulting in a non-dimensional viscosity ǫ = µK 2 /(ρω0 ) = 6.472 × 10−2 , where ω0 is defined by the dispersion relation ω02 = σK 3 /(2ρ) of the linear theory of an interface oscillation √ between two inviscid fluids. The Ohnesorg number Oh = µ/(σρλ)1/2 = 1/ 3000 and the initial interface perturbation is 0.01H. The time evolution of the capillary wave is given in Fig. 8.5 for the three methods under consideration up to a non-dimensional time τ = t ω0 = 25. The amplitude is normalized by the height of the initial perturbation. The results of the PROST (Renardy and Renardy, 2002) and CLSVOF methods are close and can be better examined by calculating the relative error with the analytical solution. The error is defined by the rms of the difference between the normalized solutions. For comparison, the values of Popinet and Zaleski (1999) for this test case are added. The PROST and CLSVOF methods are shown to perform well and the results are comparable to those of the front-tracking method of Popinet and Zaleski.
8.5.2
Rayleigh-Taylor instability
The instability of an interface between two fluid layers is considered when the heavier fluid lies over a lighter fluid and acceleration is directed from the heavier to the lighter fluid. If the interface is disturbed by a small perturbation, the instability grows exponentially as exp(nt) with time. Under the assumptions that the fluids are inviscid, incompressible and of infinite depth and the nonlinear terms are small, Bellman and Pennington (1954)extended the work of Rayleigh and Taylor by including surface tension in their analytical solution.
8.20 Computational Fluid Dynamics
1
analytic PROST CLSVOF K8
0.5
0
−0.5
−1
0
5
10
15
20
25
τ
Figure 8.5: Amplitude of the capillary wave in the viscous case compared with the analytical solution of Prosperetti. The results of the PROST and CLSVOF methods are not distinguishable in this figure. The growth rate n was given by them as 2 n = Kg A −
K 2σ g(ρ1 + ρ2 )
(8.46)
where K is the wavenumber of the perturbation, g is the gravitational acceleration perpendicular to the interface, A = (ρ2 − ρ1 )/(ρ1 + ρ2 ) and ρ1 and ρ2 are the densities of the lighter and heavier fluid, respectively. Following Daly (1969), it is helpful to introduce a ratio Φ=
σ σK 3 = σc (ρ2 − ρ1 )g
(8.47)
where σc is a critical value of the surface tension coefficient for which n = 0. This ratio is a useful measure of the importance of the surface tension compared with acceleration, implying instability for Φ < 1. Numerical simulations are performed in the range 0.05 < Φ < 0.9. K is chosen to be unity, leading to a domain width of L = (2π/K) = 2π. The Atwood number is A = 0.6. For normalization, the characteristic length K −1 and time n(σ = 0)−1 are used. The non-dimensional time is denoted by τ . In the following, attempts have been made to examine the influence of the
Volume-of-Fluid Methods.. 8.21 surface tension (Φ) on the evolution of the instability and the influence on the efficiency of the surface tension algorithms. The interface shapes for different values of Φ at the particular time instant τ = 10 are depicted in Fig. 8.6 for computations on an 80 × 240 grid using the PROST method. It can be seen that the growth rate of the instability is significantly delayed if Φ is increased.
2 1
Φ=0.9 0
y
Φ=0.75 Φ=0.5 Φ=0.25
-1 -2 -3
Φ=0.05 -4
0
1
2
3
x
4
5
6
Figure 8.6: Shape of the interface for different values of Φ depicted at τ = 10. The growth rate n can be examined by a comparison with the analytical solution. Therefore, a dependence n = f (Φ) can be obtained by combining Eqs. (8.46) and (8.47). Numerically, the growth rate is calculated by observing the interface amplitude at the middle of the domain width with time. A linear region can be identified, when the logarithm of the amplitude is plotted, which will give the growth rate by applying linear regression. This was done for the three algorithms for Φ = 0.05, 0.25, 0.5, 0.75 and 0.9. The results using the PROST method for three different grid levels (20 × 60, 40 × 120 and 80 × 240) are compared with the analytical solution in Fig. 8.7. The agreement with the analytical curve is excellent and the results can be seen to be improved compared with those of Brackbill et al. (1992). The three methods can be compared more accurately by calculation of the error between the computed and analytical results as provided in Table 8.4. For high values of Φ (0.75, 0.9), the K8 method diverges or fails to predict the growth rate of the Rayleigh-Taylor instability. This can be ascribed to the strong spurious currents occurring at the inter-
8.22 Computational Fluid Dynamics
Figure 8.7: Convergence study of the growth rate n and comparison with the analytical solution. face in the case of the K8 method. The resulting interface oscillations disturb the evolution of the interface. However, for the remaining values of Φ converging results were obtained. Additionally, an increase in the error with increasing Φ for the CLSVOF and K8 methods can be identified. In contrast, the behavior of the PROST method can be seen to be independent of Φ.
8.6
Bubble formation at an underwater orifice
The last problem considered here deals with the process of bubble formation and its detachment from an underwater orifice. The formation process of gas bubbles from orifices is of importance in many industrial applications. In the case of inter-phase transport processes, one of the aims is to increase the interfacial area between the two phases to obtain greater transfer rates. Thus the bubble size distribution produced at the orifices is of interest. In this section the combined level-set and volume-of-fluid method is applied to simulate the bubble formation process at a single orifice with the aims, firstly, to demonstrate the capability of the CLSVOF method to simulate engineering problems and, secondly, to present a test case for the comparison and validation between the numerical and analytical results for the bubble formation at low flow rates. For the present case of very low flow rate (Q˙ = 1 ml/min), the formation can be predicted analytically by means of the solution of the Young-Laplace
Volume-of-Fluid Methods.. 8.23
6
5
z [mm]
4
3
2
1
0 -3
-1.5
0
1.5
3
1.5
3
r [mm] (a)
6
5
z [mm]
4
3
2
1
0 -3
-1.5
0
r [mm] (b)
Figure 8.8: Comparison of the bubble shapes at formation betweenthe CLSVOF method (dots) and the analytical solution (circles).
8.24 Computational Fluid Dynamics equation, as it was done, for example, by Longuet-Higgins et al. (1991). Thus the formation is considered to happen quasi-static, so that the force balance at the bubble interface consists only of capillary and pressure forces. The resulting ordinary differential equation still contains the radius of curvature at the bubble apex R0 as a free parameter and has to be solved numerically. The result of the solution of the Young-Laplace equation is an axisymmetric bubble shape and thus its volume can be determined for given boundary conditions. The complete evolution of a static formation can be predicted by solving the differential equation for varying values of R0 in such a way that the bubble volume and height increases in each step consecutively. This procedure can be continued until the largest bubble volume in equilibrium is found under given boundary conditions (Longuet-Higgins, 1991). It may be mentioned that after this stage, the bubble detaches dynamically. For the present theoretical calculations, the method described in Gerlach et al. (2005)has been applied and a good agreement was found there between the analytical and experimental results for the quasi-static bubble formation. For the numerical simulation of the bubble formation, the CLSVOF method (Sec. 8.2) was transformed to an axisymmetrical (r, z) coordinate system. Water and air at 20◦ C were chosen as the working fluids for the present calculations, i.e. the density ratio is about 1000. At the orifice of diameter 2 mm and 3 mm the gas flows with a defined parabolic velocity profile. A flow rate of 1 ml/min into the computational domain is considered. Symmetry boundary conditions are defined at the sidewalls and outflow conditions at the top boundary. The bubble is forced to be attached to the orifice rim. Variable time stepping was employed to overcome the problem of different time scales during quasi-static formation and highly dynamic detachment. In Fig. 8.8 the comparison between the CLSVOF simulation and the analytical bubble shapes is shown. For the CLSVOF method the bubble contour is given by dots, where each dot corresponds to the midpoint of a line segment in a two-phase cell, and the analytical solution is represented by a few points of the calculated contour (circles). The time difference between the shapes shown is 0.5 s, except the last one, which presents the final equilibrium shape obtainable with the analytical approach. From this time instant the formation continues dynamically, as shown by the further results of the CLSVOF method in Fig. 8.9, where a time period of about 0.01 s is shown. In order to calculate theoretically the bubble volume after detachment, one typically takes the neck volume (bubble volume above the bubble neck) of the last static bubble (Longuet-Higgins, 1999), since it cannot be assumed that the gas above the orifice detaches completely (see, e.g., Fig. 8.9). The theoretically predicted time period for detachment at the 3 mm orifice is 3.06 s. The time period measured by the CLSVOF method is 2% higher. Further comparisons have been done for a 2 mm orifice, where the same level of accuracy has been obtained. The agreement between theory and simulation confirms the quality of the present CLSVOF approach also for high density ratios.
10
10
8
8
z [mm]
z [mm]
Volume-of-Fluid Methods.. 8.25
6
6
4
4
2
2
0 -6
-4.5
-3
-1.5
0
1.5
3
4.5
0 -6
6
-4.5
-3
-1.5
0
r [mm]
r [mm]
(a)
(b)
1.5
3
4.5
6
10
z [mm]
8
6
4
2
0 -6
-4.5
-3
-1.5
0
1.5
3
4.5
6
r [mm]
(c)
Figure 8.9: Detachment of a bubble computed with the CLSVOF method.
8.26 Computational Fluid Dynamics
8.7
Simulations for vapor bubbles at near critical pressure
A planar simulation of bubble (vapor) growth was performed (Tomar et al., 2005) in water at near critical pressure for different degrees of superheat. The effect of superheat on the frequency of bubble formation was analyzed. It took around 758 minutes to compute two consecutive bubble-detachments (water at near critical pressure, ∆Tsup = 10K, 180 × 360 grid-mesh, ∆t = 5 × 10−6 ) using a Pentium IV 3.6 GHz HT processor having 2GB RAM. Properties given in Table 8.3 are used for the liquid and vapor phases of water at the near critical conditions. The periodic bubble release patterns at the nodes and anti-nodes with growing interface are shown in Figures 8.10 (a), (b), (c), (d) and (e). The average Nusselt number of this study compares favorably with that of Berenson (1961). For higher superheat (17 K), a very tall and slender vapor column formation was observed (Tomar et al., 2005). The columnar jet remained stable at the node and the periodic bubble formation occurred at the antinodes. Similar profiles were observed in the experiments of Reimann and Grigull (1975). Table 8.3: Properties of liquid and vapor phases of water at near critical pressure (Pr = 0.99) Water Near Critical: Tsat = 646K; Psat = 21.9M P a; hlg = 276.4kJ/kg; σ = 0.07mN/m Density(ρ) Viscosity (µ) Conductivity(k) Specific Heat(cp ) (kg/m3 ) (µN s/m2 ) (mW/mK) (kJ/kgK) Liquid 402.4 46.7 545 2.18 × 102 Vapor 242.7 32.38 538 3.52 × 102
8.8
Conclusions
The methods considered here are based on the pioneering work pertaining to VOF of Welch and Wilson (2000), LVIRA of Puckett et al. (1997) and a combined level-set and volume-of-fluid approach based on the work of Sussman et al. (2000) and Son (2003). Another method using a piecewise-parabolic representation of the interface for the surface tension and the interface normal calculation due to Renardy and Renardy (2002) was deployed in this text for comparison purpose. The accuracy, the convergence behavior and the influence of “parasitic currents”, which are a consequence of inaccurate calculations of
Volume-of-Fluid Methods.. 8.27
Figure 8.10: Interface morphology at different instants of a bubble release cycle for water (Pr = 0.99) with ∆Tsup = 10K the surface tension force, were examined in detail in this text.
8.28 Computational Fluid Dynamics The implementation of the CLSVOF method is straightforward and the algorithm is the fastest considered here. Recent improvements of this method are highly promising Sussman (2003). The K8 method was demonstrated to have weaknesses in the surface force calculation. The parasitic currents at the interface led to diverging or wrong results for the case of the Rayleigh-Taylor instability (Table 8.4). Finally, the present CLSVOF method was used to simulate the formation of a gas bubbles at an underwater orifice and vapor bubbles at near critical condition on a heated surface. Table 8.4: Error of the growth rate n between the numerical and analytical results for the three methods considered (PROST, CLSVOF, K8 ) depending on the relative importance of the surface tension Φ.
PROST
CLSVOF
K8 exact n
grid 20 × 60 40 × 120 80 × 240 20 × 60 40 × 120 80 × 240 20 × 60 40 × 120 80 × 240
Φ = 0.05 5.7% 2.3% 1.0% 7.4% 2.7% 0.8% 8.7% 3.6% 1.5% 2.365
Φ = 0.25 6.2% 2.4% 1.0% 7.7% 3.4% 1.5% 8.1% 3.4% 1.0% 2.101
Φ = 0.5 6.1% 2.7% 0.9% 8.5% 4.4% 2.1% 9.1% 3.8% 2.1% 1.716
Φ = 0.75 6.0% 2.7% 1.9% 10.1% 5.2% 2.7% 1.4% 2.2% 3.0% 1.213
Φ = 0.9 3.5% 0.9% 0.9% 15.3% 7.5% 3.5% 26.0% 26.0% 29.0% 0.767
Good agreement was found between the numerically calculated bubble contours with their analytical counterpart.
8.9
Acknowledgment
Authors gratefully acknowledge contribution of (i) Dr. Ing. Daniel Gerlach who carried out his PhD dissertation entitled “Analyse von kapillar dominanten Zweiphasenstr¨omungen mit einer kombinierten Volume-of-Fluid und Level-Set Methode” under the joint guidance of Prof. Dr. Franz Durst and Prof G. Biswas at the University of Erlangen Nuremberg, Germany, in 2008 and (ii) Dr. Gaurav Tomar who completed his PhD dissertation entitled “Analysis of Interfacial Instabilities in Adhesion Dewetting and Phase change” under the joint guidance of Prof. Gautam Biswas and Prof. Ashutosh Sharma at the Indian Institute of Technology Kanpur, India, in 2007.
Volume-of-Fluid Methods.. 8.29
References 1. Agarwal, D.K., Welch, S.W.J., Biswas, G. and Durst, F., Planer Simulation of Bubble Growth in Film Boiling in Near-Critical Water Using a Variant of the VOF Method, J. Heat Transfer (ASME), Vol. 126, pp. 329- 338, 2004. 2. Bellman, R., Pennington, R.H., Effects of Surface Tension and Viscosity on Taylor Instability, Quart. Appl. Meth, Vol. 12, pp. 151-162, 1954. 3. Berenson, P.J., Film-Boiling Heat Transfer from a horizontal Surface, J. Heat Transfer (ASME), Vol. 83, pp. 351- 358, 1961. 4. Brackbill, J.U., Kothe, D.B. and Zemach, C., A Continuum Method for Modeling Surface Tension, J. Comput. Phys., Vol. 100, pp. 335-354, 1992. 5. Chakraborty, I., Ray, B., Biswas, G., Durst, F., Sharma A. and Ghoshdastidar, P.S., Computational investigation on bubble detachement from submerged orfice in quiescent liquid under normal and reduced gravity, Physics of Fluids, Vol. 21, pp. 062103-1-062103-17, 2009. 6. Chakraborty, I., Biswas, G. and Ghoshdastidar, P.S., Bubble Generation in Quiescent and Co-flowing liquid, Int. J. Heat and Mass Transfer, Vol. 54, pp. 4673- 4688, 2011. 7. Chang, Y.C., Hou, T.Y., Merriman B. and Osher, S., A Level Set Formulation of Eulerian Interface Capturing Methods for Incompressible Fluid Flows, J. Comput. Phys., Vol. 124, pp. 449-464, 1996. 8. Daly, B.J., Numerical Study of the Effect of Surface Tension on Interface Instability, Physics of Fluids, Vol. 12, pp. 1340- 1354, 1969. 9. Gerlach, D., Biswas, G., Durst, F., Kolobaric, V., Quasi-static Bubble Formation on Submerged Orifices, Int. J. Heat Mass Transfer, Vol. 48, pp. 425- 438, 2005. 10. Gerlach, D., Tomar, G., Biswas, G. and Durst, F., Comparison of volumeof-fluid methods for surface tension-dominant two-phase flows, Int. J. Heat Mass Transfer, Vol. 49, pp. 740- 754, 2006. 11. Harlow, F.H and Welch, JE, Numerical Calculation of Time-dependent Viscous Incompressible Flow of Fluid with Free Surface, Physics of Fluids, Vol. 8, pp. 2182- 2188, 1965. 12. Hirt, C.W., and Nichols, B.D., Volume of Fluid (VOF) Method for the Dynamics of Free Boundary, J. Comput. Phys. Vol. 39, pp. 201- 225, 1981. 13. Juric, D. and Tryggvason, G., Computations of Boiling Flows, Int J. Multiphase Flow, Vol. 24, pp. 387-410, 1998.
8.30 Computational Fluid Dynamics 14. Laufaurie, B., Nardone, C., Scardovelli, R., Zaleski, S. and Zanetti, G., Modelling Merging and Fragmentation in Multiphse Flows with SURFER, J. Comput. Phys., Vol. 113, pp. 134- 147, 1994. 15. Leonard, B.P., A Stable and Accurate Convective Modelling Procedure based on Quadratic Upstream Interpolation, Comp. Methods Appl. Mech. Engr., Vol. 19, pp. 59-98, 1979. 16. Longuet-Higgins, M.S., Kerman, B.R., Lunde, K., The Release of Air Bubbles From an Underwater Nozzle, J. Fluid Mech., Vol. 230, pp. 365390, 1991. 17. Noh, W.F and Woodward, P.R., SLIC (Simple line interface calculation) in: Vooren, A.V., and Zandberger, P. (Eds), Lecture Notes in Physics, Springer Verlag, New York- Berlin, Vol. 59, pp. 330, 1976. 18. Osher, S. and Sethian, J.A., Fronts Propagating with Curvature-dependent speed: Algorithms based on Hamilton-Jacobi Formulations, J. Comput. Phys., Vol. 79(1), pp. 12-49. 1988. 19. Osher, S., and Fedkiw, R.P., Level set methods: an overview and some recent results, J. Comput. Phys., Vol. 169, pp. 463- 502, 2001. 20. Popinet, S. Zaleski, S., A front-tracking algorithm for accurate representation of surface tension, Int. J. Numer. Methods Fluids Vol. 30, pp. 775- 793, 1999. 21. Puckett, E.G., Almgren, A.S., Bell, J.B., Marcus, D.L. and Rider, W.J., A high-order projection method for tracking fluid interfaces in variable density incompressible flows, J. Comput. Phys., Vol. 130, pp. 269- 282, 1997. 22. Ray, B., Biswas, G. and Sharma, A., Generation of Secondary Droplets in Coalescence of a Drop at a Liquid-Liquid Interface, J. Fluid Mech, Vol. 655, pp. 72- 104, 2010. 23. Ray, B., Biswas, G., and Sharma, A., Bubble Pinch-off and Scaling During Liquid Drop Impact on Liquid Pool, Physics of Fluids, Vol. 24, pp. 082108-1-082108-11, 2012. 24. Reimann, M. and Grigull, U., Warmeubergang bei freier Konvektion und Filmsieden im kritischen Gebiet von Wasser und Kohlendioxid, Warmeund Stoffubertragung, Vol. 8, pp. 229- 239, 1975. 25. Renardy, Y. & Renardy, M., PROST: a parabolic reconstruction of surface tension for the volume-of-fluid method, J. Comput. Phys. Vol. 183, pp. 400- 421, 2002. 26. Rider, W.J., Kothe, D.B., Stretching and Tearing Interface Tracking Methods, AIAA Paper, 95- 1717.
Volume-of-Fluid Methods.. 8.31 27. Rider, W.J. and Kothe, D.B., Reconstructing Volume Tracking, J. Comput. Phys., Vol. 141, pp. 112- 152, 1998. 28. Rudman, M., Volume-Tracking Methods for Interfacial Flow Calculations, Int. J. Numer. Methods Fluids, Vol. 24, pp. 671- 691, 1997. 29. Rudman, M., A Volume-Tracking Method for Incompressible Multi-fluid Flows with Large Density Variations, Int. J. Numer. Methods Fluids, Vol. 28, pp. 357- 378, 1998. 30. Scardovelli, R., Zaleski, S., Direct Numerical Simulation of Free-surface and Interfacial Flow, Annu. Rev. Fluid Mech., Vol. 31, pp. 567- 603, 1999. 31. Sethian, J.A., Level Set Methods and Fast Marching Methods, Cambridge University Press, UK, 1999. 32. Son, G. and Hur, A., A Coupled Level-Set and Volume-of-Fluid Method for the Buoyancy-driven Motion of Fluid particles, Num. Heat Transfer B, Vol. 42, pp. 523-542, 2002. 33. Son, G., Efficient Implementation of a Coupled Level-Set and Volume-ofFluid Method for 3-Dimensional Incompressible Two-phase Flows, Numer. Heat Transfer B, Vol. 6, pp. 549- 565, 2003. 34. Son, G., and Dhir, V.K., Numerical Simulation of Film Boiling Near Critical Pressures with a Level Set Method, J. Heat Transfer (ASME), Vol. 120, pp. 183- 192, 1988. 35. Sussman, M., Smereka, P., Osher, S., A Level Set Approach for Computing Solutions to Incompressible Two-phase Flow, J. Comput. Phys., Vol. 114, pp. 146-159, 1994. 36. Sussman, M., Puckett, E.G., A Coupled Level Set and Volume-of-Fluid Method for Computing 3D and Axisymmetric Incompressible Two-phase Flows, J. Comput. Phys., Vol. 162, pp. 301-337, 2000. 37. Sussman, M., A Second Order Coupled Level-set and Volume-of-Fluid Method for Computing Growth and Collapse of Vapor Bubbles, J. Comput. Phys., Vol. 180, pp. 110-136, 2003. 38. Strang, G., On the Construction and Comparison of Difference Schemes, SIAM J. Numer. Anal., Vol. 5, pp. 506- 517, 1968. 39. Tomar, G., Biswas, G., A. Sharma and A. Agrawal, Numerical Simulation of Bubble Growth in Film Boiling using a Coupled Level Set and Volumeof-Fluid Method, Physics of Fluids, Vol. 17, pp. 112103-1 - 112103-13, 2005.
8.32 Computational Fluid Dynamics 40. Tomar, G., Gerlach, D., Biswas, G., Alleborn, N., Sharma A., Durst, F., Welch, S.W.J., and Delgado, A., Two-phase Electrohydrodynamic Simulations Using a Volume-of-Fluid Approach, Journal of Computational Physics, Vol. 227, pp. 1267- 1285, 2007. 41. Tomar, G., Biswas, G., Sharma A. and Welch, S.W.J., Multimode Analysis of Bubble Growth in Saturated Film Boiling, Physics of Fluids, Vol. 20, pp. 092101-1 - 092101-7, 2008. 42. Tomar, G., Biswas, G., Sharma A. and Welch, S.W.J., Influence of Electric Field on Saturated Film Boiling, Physics of Fluids, Vol. 21, pp. 032107-1 - 032107-8, 2009. 43. Van der Vorst, H.A., Bi-CGSTAB: A Fast and Smoothly Converging Variant of Bi-CG for Solution of Non-Symmetric Lincar Systems, SIAM J. Sci. Stat. Comput., Vol. 12, pp. 631- 644, 1992. 44. Welch, S.W.J. and Wilson, J., A Volume of Fluid Based Method for Fluid Flows with Phase Change, J. Comput. Phys., Vol. 160, pp. 662- 682, 2000. 45. Welch, S.W.J. and Rachidi, T., Numerical Simulation of Film Boiling Including Conjugate eat Transfer, Numerical Heat Transfer, Part B, Vol. 42, pp. 35- 53, 2002. 46. Welch, S.W.J. and Biswas, G., Direct Simulation of Film Boiling Including Electrohydrodynamic Forces, Physics of Fluids, Vol. 19, pp. 012106, 2007. 47. Williams, N.W., Kothe, D.B. and Puckett, E.G., Accuracy and Convergence of Continuum Surface-tension Models, in: Shyy, W. and Narayanan, R. (Eds.), Fluid Dynamics of Inter faces, Cambridge univ. Press, Cambridge, pp. 294- 305, 1998. 48. Youngs, D.L., Time-Dependent Multi-Material Flow with Large Fluid Distortion, In Numerical Methods for Fluid Dynamics, edited by K.W. Morton and M.J. Baines (Academic Press, New York), 1982.
Volume-of-Fluid Methods.. 8.33
Nomenclature E error F void fraction function fsa surface tension force per unit area fsv surface tension force per unit volume g gravitational acceleration G error function h grid spacing Hǫ smoothed Heaviside function K wavenumber K8 smoothing kernel l shifting length of an interface to the cell center n normal vector Oh Ohnesorg number P pressure r radial component (cylindrical polar coordinates) t time u velocity component in x-direction v velocity component in y-direction v velocity vector (u, v) V liquid volume fluxed through a cell face x horizontal coordinate x position vector y vertical coordinate z vertical component (cylindrical polar coordinates) Greek symbols: δs interface Dirac delta function δV void fraction fluxed through a cell face ∆t time step ∆x, ∆y grid spacing in x and y direction ǫ half width of the transition region κ mean curvature λ wavelength µ dynamic viscosity ρ density θ temperature σ surface tension coefficient φ level set function Subscripts: g gas property i, j ith and jth computational cell in x and y direction l liquid property x, y derivative with respect to x or y
8.34 Computational Fluid Dynamics Superscripts: ¯ approximated value ˆ unit vector ˜ smoothed field ∗ intermediate value n nth time step x, y components in x or y direction
Index ADI 2.16, 2.17 Advection 2.2, 8.1, 8.2, 8.3, 8.5, 8.6, 8.8, 8.9, 8.12, 8.13, 8.15-8.17
Control volume 2.30, 3.1-3.7, 6.26.5, 6.7,6. 32 Convection equation 2.43
Body-fitting coordinates 6.30
Conservative form 2.30, 6.3, 6.12, 6.13, 6.22, 6.23, 6.27, 6.32
Boundary conditions 1.1, 1.2, 1.3, 1.5-1.14, 1.17, 1.19-1.25, 1.27, 2.1, 2.2, 2.3, 2.18, 3.1, 3.4, 3.5, 3.13, 3.14, 6.13, 6.19, 6.32
Courant number 2.23, 2.26, 2.33, 2.38
Dirichlet conditions 2.3, 4.23 Numann conditions 2.3 Mixed conditions 2.3 Burgers equation 2.43 Cartesian coordinates 2.30, 3.7, 3.9, 6.1, 7.2, 7.3, 7.4, 7.7 Cell Peclet number 2.39, 7.17 CFL condition 2.23, 2.26, 2.34, 2.39, 2.42
Convergence 2.11, 6.10, 6.12, 6.18, 6.28, 8.26
Courant-Friedrichs-Lewy condition 2.23 Crank-Nicolson method 7.20 Curvilinear coordinates 7.1, 7.25 Cylindrical coordinates 3.15 Deferred correction procedure 2.37 Differencing 2.11, 2.12, 2.29, 2.332.37
Classification of PDE 2.1
Backward 2.7
Collocation method 1.23, 1.25, 1.26, 3.1
Forward 2.7
Conduction of heat Cartesian 2.30, 3.7, 3.9, 3.16
Central 2.7, 3.9 Dissipation 2.38, 6.25, 6.27 DuFort-Frankel scheme 2.11
Cylindrical 3.15 Spherical 6.32
Elliptic equation 2.1, 2.22
steady state 1.25, 2.1,2.2,2.34, 3.3, 6.27
Energy equation 2.2, 6.25-6.27, 8.13, 8.14
transient 2.18, 2.34 Conservative property 2.27-2.30, 2.43, 3.7, 3.9 Consistency 2.3 Continuity equation 3.7, 6.3, 6.4, 6.8, 6.12-6.13, 6.18, 6.32, 7.2
Thermal energy equation 6.33 Errors 2.18 Discretization 2.18, 3.8, 3.9, 8.3, 8.7, 8.9, 8.10, 8.11, 8.15, 8.16 round-off 2.19 truncation 2.6, 2.9, 2.11, 2.172.19, 2.41, 2.43
I.2
Index
Euler equation 2.22, 2.27
MAC algorithm 6.12
Explicit method 2.11, 2.14
Momentum interpolation 7.22, 7.25, 7.27
Exponential scheme 7.15, 7.18 False diffusion 2.34 See artificial viscosity Finite difference method 2.4, 3.1, 3.5, 3.8 Consistency 2.9 Stability analysis 2.18, 2.21, 2.24, 2.26, 2.27, 2.31, 2.38 Finite element method 1.14, 2.5 Assembly boundary conditions Finite volume method 1.24, 3.1, 3.2, 3.6-3.9, 3.13, 6.3 Fifth-order upwind scheme 2.38 FTCS 2.9
Navier-Stokes equation 2.1, 2.30, 2.41, 6.1-6.3, 6.12, 6.31-6.33, 7.1, 7.26, 7.27, 7.28 Neumann conditions 2.3 von Neumann stability 2.21, 2.24, 2.26, 2.27, 2.31, 2.38 Non-homogeneous 2.1 Parabolic equation 2.2 Partial differential equation 1.1, 1.24, 2.1, 2.4, 2.5, 2.8, 2.9, 2.11, 2.12, 2.18, 2.19, 2.27, 3.9 Peclet number 2.39, 6.26 Poisson equation for pressure 1.3, 2.2, 6.16, 6.19, 6.30 Potential flow 2.2
Galerkin method 1.2, 1.14, 1.16, 1.18-1.20, 1.22-1.23, 4.9
Power-Law scheme
Gaussian elimination 2.44
Pressure correction equation 6.10, 6.18
Gauss-Seidel method 5.3, 6.28
Prandtl number 6.34
Green’s function 3.7, 3.9, 3.11
Pressure equation 8.12
Hyperbolic equation 2.26
QUICK scheme 2.38, 6.22, 6.28, 8.14
Homogeneous 2.1
Reynolds number 2.39, 6.33, 8.3 Implicit method 2.11, 6.2, 6.3 Incompressible flow 2.30, 6.1, 6.2, 6.12, 6.13, 6.25, 6.27 Initial conditions 2.3, 2.12, 3.14 Interpolation 1.14-1.16, 1.20, 3.3, 6.2, 6.14, 6.22, 7.13, 7.14, 7.20, 7.21, 7.22, 7.23, 7.25, Jakobian 7.8 Laminar flow 6.23 Laplace equation 2.1, 2.2, 2.8 Least squares 1.25
Reynolds transport theorem First order equation 2.22 Semi-explicit method 2.14, 2.23 Second Upwind Differencing 2.35 SIMPLE 6.3, 7.20, 7.23 Algorithm 2.13, 2.14, 2.16, 2.17, 2.18, 2.34, 2.36, 2.44, 4.23, 5.3, 6.2, 6.3, 6.9, 6.10, 6.12, 6.21, 6.23, 6.24, 6.30, 6.33, 7.13, 7.20, 7.23, 7.25, 8.1, 8.2, 8.3, 8.5, 8.7, 8.10, 8.12,
Index 8.13, 8.15, 8.16, 8.17, 8.21, 8.28 Source term 1.3, 6.28
I.3
Upwinding 2.31, 6.16, 6.21, 6.22 also see false diffusion, artificial
Linearization Spherical coordinates 6.31, 6.32 Square cylinder 6.30, 6.31, 6.33 Stability 2.18, 2.21-2.27, 2.31, 2.36, 2.38, 2.39, 6.16, 6.21 considerations 6.21
Vorticity 2.24, 2.28, 5.2, 5.4-5.11, 6.2, 6.23, 6.31, 8.18 transport equation 2.24, 2.27, 5.2, 5.9 Wake 6.24
Stream function 6.2, 6.31
Wave equation 2.22, 2.25, 2.42
Stress tensor 7.2, 7.3
Weighted residual formulation 1.2 Weighting function 1.2
Taylor series 2.6 TDMA 6.10 Thomas algorithm 2.44, 6.9 Transportive property 2.31 Trial function 1.5 Turbulent flow 6.24
Weak form 1.6