Professional Documents
Culture Documents
CFD Module-III
CFD Module-III
Introduction
• Analytical solutions of partial differential equations involve closed-form expressions which give
the variation of the dependent variables continuously throughout the domain
• In contrast, numerical solutions can give answers at only discrete points in the domain, called grid
points
• For example, consider figure which shows a section of a discrete grid in the xy plane
• For convenience, let us assume that the spacing of the grid points in the x direction is uniform and
given by Δx and
that the spacing of the points in the y direction is also
uniform and given by Δy
• In general, Δx and Δy are different
• Indeed, it is not absolutely necessary that Δx or Δy be
uniform
Introduction
• Grid points are identified by an
index i in x-direction
index j in y-direction
• A two-dimensional flow field which is governed by the Navier-Stokes equations are partial
differential equations
• An analytical solution of these equations would provide, in principle, closed-form expressions for
u, v, p, ρ, etc., as functions of x and y, which could be used to give values of the flow-field
variables at any point in the flow, i.e., at any of the infinite number of (x,y) points in the domain
• On the other hand, if the partial derivatives in the governing equations are replaced by
approximate algebraic difference quotients, where the algebraic difference quotients are expressed
strictly in terms of the flow-field variables at two or more of the discrete grid points
• Replacing a partial derivative with a suitable algebraic difference quotient finite difference
which can be solved only at the discrete points only
• Most common finite difference representations of derivatives are based on Taylor’s series
expansions
Introduction to finite differences
•• u
i,j x-component of velocity at (i,j)
• Velocity ui+1,j at point (i+1,j) can be expresses in terms of Taylor series as
Finite - Truncation
difference error
representation
• To approximate the partial derivative with the above algebraic finite-difference quotient
• In above equation, the lowest order term in the truncation error involves Δx to the first power
finite difference expression is called first-order accurate
Introduction to finite differences
•• The
above expression can be written as
• Note that the finite-difference expression in above equation uses information to the right of grid
point (i, j); that is, it uses ui+1,j, as well as ui,j
• Note that the finite-difference expression in above equation uses information to the left of grid
point (i, j); that is, it uses ui-1,j, as well as ui,j
• In the truncation error, the lowest – order terms involves (Δx) 2 which is second order accuracy
finite difference quotient is second order central difference
Introduction to finite differences
•• Difference
expressions for the y derivatives are obtained in exactly the same fashion
• The first term on the right hand side is a central finite difference for the second derivative with
respect to x evaluated at grid point (i,j) second order central second difference
Introduction to finite differences
•• For
the case of mixed derivatives, such as , appropriate finite difference quotients can be found as
follows.
• Differentiating equation for ui+1,j with respect to y,
Introduction to finite differences
•• Replace
with
• Replace with
• Above equation gives the second-order central difference for the mixed derivative
Introduction to finite differences
Introduction to finite differences
• Pro’s and Con’s of higher-order accuracy are:
1. Higher-order-accurate difference quotients require more grid points, result in more computer
time required for each time wise or spatial step-a con.
2. On the other hand, a higher-order difference scheme may require a smaller number of total grid
points in a flow solution to obtain comparable overall accuracy-a pro.
3. Higher-order difference schemes may result in a "higher- quality" solution, such as captured
shock waves that are sharper and more distinct-also a pro.
Introduction to finite differences
•• What
happens at a boundary?
• What type of differencing is possible when we have only one direction to go, namely, the direction
away from the boundary?
• Consider figure, which illustrates a portion of a boundary to a flow field, with the y axis
perpendicular to the boundary. Let grid point 1 be on the boundary, with points 2 and 3 a distance
Δy and 2Δy above the boundary, respectively.
• To construct a finite-difference approximation for at the boundary.
• It is easy to construct a forward difference as
• Applied successively to the grid points in the figure yields at grid point 1 where y = 0
• Equation is a one-sided finite-difference expression for the derivative at the boundary-called one-
sided because it uses information only on one side of the grid point at the boundary, namely,
information only above grid point 1
• This illustrates an alternative approach to the formulation of finite-difference quotients
Introduction to finite differences
•• To
find the order of accuracy of the equation , we need to use Taylor series again
• Consider a Taylor series expansion about the point 1.
• Compare the polynomial expression with the above Taylor series expansion
• The first three terms in the polynomial expression is same as first three terms in Taylor series.
• Hence, it can be said that polynomial expression is of order three.
• In the numerator of u1, u2 and u3 can be expressed in terms of polynomial expression and is of
O(Δy)3
• The essence of finite-difference solutions in CFD is to use the difference quotients to replace the
partial derivatives in the governing flow equations, resulting in a system of algebraic difference
equations for the dependent variables at each grid point.
• For simplicity, choose a partial differential equation to examine which is less elaborate than the
governing flow equations.
Difference Equations
•• Consider
the unsteady, one-dimensional heat conduction equation with constant thermal diffusivity
• Write
•• Consider
again one dimensional heat conduction equation:
•
• consists of properties at time level n, which are known
• Applying this equations to grids points 2 through 6
• At grid point 2:
• Because of the stipulated boundary conditions at grid points 1 and 7, T1 in Eq. is a known number
• Denoting by , where is a known number
EXPLICIT AND IMPLICIT APPROACHES:
DEFINITIONS AND CONTRASTS
•• At
grid point 2:
• At grid point 3:
• At grid point 4:
• At grid point 5:
• At grid point 6:
• Since the grid point 7 is on a boundary, T7 is known from the stipulated boundary condition
• Grid point 6 equation can be rearranged as
is a non-linear pde
• This has virtually no effect on the explicit approach, where a difference equation can be written as
•
• The above equation is still linear in the single unknown because α is evaluated at level n.
EXPLICIT AND IMPLICIT APPROACHES:
DEFINITIONS AND CONTRASTS
•• If
Crank-Nicolson method is used for Eq., the right-hand-side is evaluated as an average between
time levels n and n + 1, resulting in α(T) being represented by
• The resulting difference equation is a nonlinear algebraic equation.
• An implicit solution would therefore demand a simultaneous solution of a large system of
nonlinear equations-an exceptionally difficult task
• This is a tremendous disadvantage of an implicit approach.
• To circumvent this problem, the difference equations are usually "linearized" in an approximate
fashion.
• If in Eq. α is simply evaluated at time level n rather than an average between levels n and n + 1,
then no nonlinear algebraic terms will appear in the difference equation; the resulting difference
equation will be evaluated with α as .
EXPLICIT AND IMPLICIT APPROACHES:
DEFINITIONS AND CONTRASTS
• With the complexity of the implicit approach relative to the explicit approach in mind, the
immediate question is: Why deal with the implicit approach at all?
• Why not always use an explicit approach?
• Note that the increments Δx and Δt appear in all the above difference equations
• For the explicit approach, once Δx is chosen, then Δt is not an independent, arbitrary choice;
rather, Δt is restricted to be equal to or less than a certain value prescribed by a stability criterion
• If Δt is taken larger than the limit imposed by the stability criterion, the time-marching procedure
will quickly go unstable, and your computer program will quickly shut down due to such things as
numbers going to infinity or taking the square root of a negative number
• In many cases, Δt must be very small to maintain stability; this can result in long computer running
times to make calculations over a given interval of time
• For most implicit methods, stability can be maintained over much larger values of Δt than for a
corresponding explicit method; indeed, some implicit methods are unconditionally stable, meaning
that any value of Δt, no matter how large, will yield a stable solution
EXPLICIT AND IMPLICIT APPROACHES
ERRORS AND AN ANALYSIS OF STABILITY
•• Explicit
methods are numerically unstable if the increment in marching direction (Δt) exceeds
prescribed value
• Choose the heat conduction equation,
• For the difference representation of this equation, choose the explicit form given as
• m =1, 2, 3, …
• The higher the wave number for a given L, the more waves fitted inside the interval
• In regard to a practical numerical solution which involves only a finite number of grid points,
there is a constraint imposed on the number of terms in Eq
• Consider Fig., which shows the interval L over which the numerical calculations are being made
• The largest allowable wavelength is λmax = L; this is the wavelength for the first term in above Eq.
and corresponds to m = 1
• In turn, the smallest possible wavelength is that having all three zeros of the sine ( or cosine)
function going through three adjacent grid points
• Hence, the smallest allowable wavelength is λmin= 2Δx
ERRORS AND AN ANALYSIS OF STABILITY
•• If
there are N + I grid points distributed over the interval L, then there are N intervals between
these grid points, and hence Δx = L/N
• With λmin= 2L/N,
• a constant
• Just one term of the series
ERRORS AND AN ANALYSIS OF STABILITY
• Substituting
into
Finite Volume Methods
Finite Volume Method
• The Finite Volume Method (FVM) is the technique by which the integral formulation of the
conservation laws is discretized directly in the physical space
• The reason behind the appeal to the FVM lies in its generality, its conceptual simplicity and its
ease of implementation for arbitrary grids, structured as well as unstructured
• FVM is based on cell-averaged values
• This distinguishes the FVM from the finite difference and finite element methods, where the main
numerical quantities are the local function values at the mesh points
• Once a grid has been generated, the FVM consists in associating a local finite volume, also called
control volume, to each mesh point and applying the integral conservation law to this local
volume
• An essential advantage of the FVM is connected to the very important concept of conservative
discretization through the direct discretization of the integral form of the conservation laws
Basis of the Finite Volume Method
• The finite volume method has been introduced in the field of numerical fluid dynamics
independently by Mc Donald (1971) and MacCormack and Paullay (1972) for the solution of two-
dimensional, time-dependent Euler equations and extended by Rizzi and Inouye (1973) to three-
dimensional flows
• The strength of the FVM is its direct connection to the physical flow properties
• The basis of the method relies on the direct discretization of the integral form of the conservation
law
• This distinguishes the FVM significantly from the finite difference method, since the latter
discretizes the differential form of the conservation laws
• The FVM requires setting up the following steps:
• Subdivide the mesh, obtained from the space discretization, into finite (small) volumes, one
control volume being associated to each mesh point.
• Apply the integral conservation law to each of these finite volumes
Conditions on Finite Volume Selections
• Due to its generality the finite volume
method can handle any type of mesh,
structured as well as unstructured
• Moreover, an additional degree of
freedom appears through the way we
relate the control volumes to the grid
Conditions on Finite Volume Selections
• The following constraints on the choice of the ΩJ volumes for a consistent finite volume method
have to be satisfied:
(i) Their sum should cover the entire domain ΩJ .
(ii) The subdomains ΩJ are allowed to overlap with the conditions that each part of the surface Γ J
appears as part of an even number of different subdomains such that the overall integral conservation
law holds for any combination of adjacent subdomains.
(iii) Fluxes along a cell surface have to be computed by formulas independent of the cell in which
they are considered.
• Requirement (iii) ensures that the conservative property is satisfied, since the flux contributions of
internal boundaries will cancel when the contributions of the associated finite volumes are added
Conditions on Finite Volume Selections
• The cells 1,2,3,4 have no common sides and their sum does not cover the whole volume
• In addition, the sides are not common to two volumes
• The cells 5,6,7 overlap, but have no common surfaces. Hence the conservative property will not be
satisfied
Definition of the Finite Volume Discretization
•• General
form of conservation equation is given as
• The advantage of this method, especially in absence of sources terms, is that the fluxes are
calculated only on two-dimensional surfaces instead of in the three-dimensional space
• Above Equation is replaced by its discrete form, where the volume integrals are expressed as the
averaged values over the cell and where the surface integral is replaced by a sum over all the
bounding faces of the considered volume J :
• This is the general formulation of the finite volume method and the user has to define, for a
selected ΩJ, how to estimate the volume and cell face areas of the control volume J and how to
approximate the fluxes at the faces
Definition of the Finite Volume Discretization
• Equation shows several interesting features which distinguish the interpretation of finite volume
methods from the finite difference and finite element approaches:
1. The coordinates of point J , that is the precise location of the variable UJ inside the control
volume ΩJ , do not appear explicitly. Consequently, UJ is not necessarily attached to a fixed
point inside the control volume and can be considered as an average value of the flow variable
U over the control cell. The first term of equation represents therefore the time rate of change of
the averaged flow variable over the selected finite volume
2. The mesh coordinates appear only in the determination of the cell volume and side areas. Hence,
referring to Figure, and considering for instance the control cell ABCD around point 1, only the
coordinates of A,B,C,D will be needed
3. In absence of source terms, the finite volume formulation expresses that the variation of the
average value U over a time interval t is equal to the sum of the fluxes exchanged between
neighboring cells. For stationary flows, the numerical solution is obtained as a result of the
balance of all the fluxes entering or leaving the control volume
4. The finite volume method also allows a natural introduction of boundary conditions, for instance
at solid walls where certain normal components are zero. For instance, for the mass conservation
equation, F =ρv and at a solid boundary F· dS =0. Hence, the corresponding contribution to
equation would vanish.
General Formulation of a Numerical Scheme
•• If
the integral form of the conservation law is integrated from t = n Δt to (n+1) Δt for a control
volume ΩJ associated to a node or cell J , we obtain
• Introducing the cell-averaged conservative variable and source at time n Δt, the cell- and time-
averaged sources , together with the numerical flux over each side, defined by
General Formulation of a Numerical Scheme
•• The
conservative discretization takes the form
• This is an exact relation for the time evolution of the space averaged conservative variables over
cell J
• The absence of a time index on the balance of fluxes and on the source term is meant to indicate
that one can choose between n for an explicit scheme and (n+1) for an implicit scheme.
• A general numerical scheme can then be defined as a system of ordinary differential equations in
time by
• The right-hand side defines the residual RJ as the balance of fluxes over a cell J plus the source
term contribution