0% found this document useful (0 votes)
176 views15 pages

The Basic Finite Volume Method

The finite volume method involves: 1) Dividing the domain into control volumes and storing variables at cell centers. 2) Integrating the transport equations over each control volume to obtain discrete conservation equations. 3) Approximating convective and diffusive fluxes at cell faces using interpolation schemes like upwinding. 4) Approximating source terms by evaluating them at cell centers. 5) Assembling the discrete equations into a system that can be solved numerically, providing a second-order accurate solution that ensures global conservation properties.

Uploaded by

Alasdi Ahmed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
176 views15 pages

The Basic Finite Volume Method

The finite volume method involves: 1) Dividing the domain into control volumes and storing variables at cell centers. 2) Integrating the transport equations over each control volume to obtain discrete conservation equations. 3) Approximating convective and diffusive fluxes at cell faces using interpolation schemes like upwinding. 4) Approximating source terms by evaluating them at cell centers. 5) Assembling the discrete equations into a system that can be solved numerically, providing a second-order accurate solution that ensures global conservation properties.

Uploaded by

Alasdi Ahmed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

1 CFD Course Basic of Finite Volume Method

The Basic Finite Volume Method

◮One important feature of finite volume schemes is their conservation


properties. Since they are based on applying conservation principles over
each small control volume, global conservation is also ensured.

◮ The method starts by dividing the flow domain into a number of small
control volumes.

◮ The grid points where variables are stored are typically defined as being
at the center of each control volume.

◮ Extra boundary nodes are often added, as shown in the figure.

◮ The transport equation(s) are then integrated over each control volume.

◮ In earlier lectures we saw how finite difference methods could


approximate a differential equation by a set of discretized algebraic ones.

◮ Employing Taylor series analysis allowed us to determine truncation


errors, and to develop schemes with different orders of accuracy.

◮ Such methods are relatively easy to apply when the flow geometry allows
a simple Cartesian set of grid points to be adopted.

◮ However, in complex geometries more work is needed.

1
2 CFD Course Basic of Finite Volume Method

◮ In such cases it may not be possible to arrange orthogonal grid lines as


shown, meaning we could not approximate ∂ ϕ /∂ x purely in terms of
values along a constant j line.

◮ Another drawback of finite difference schemes in engineering fluids


problems is that care is needed to ensure conservation properties.

◮ We consider a general (steady) transport equation for some quantity ϕ:

(1)

Or

(2)

Integrating this over the control volume gives:

(3)

(4)

2
3 CFD Course Basic of Finite Volume Method

The convection and diffusion terms can be combined:

(5)

The divergence theorem can be used to convert the left hand side volume
integral to an integral around the boundary, ∂Ω, of the control volume:

(6)

◮ U.ndS is the convective flux of across the part of the boundary


edge dS, and .ndS is the diffusive flux across the same boundary
part.

◮ The left hand side of equation (6) is thus simply the total net
convective and diffusive flux of into the control volume.

◮ Equation (6) is thus a statement of conservation for the control


volume. In the case of the momentum equation, where = U for
example, it is simply the force-momentum principle applied over the
control volume.

◮ Provided the same expressions are used for fluxes across faces in
neighboring cells, this approach ensures that the conservation
properties will also be satisfied globally over the flow domain.

◮ The surface integral is generally approximated in a discretized form


by

(7)

3
4 CFD Course Basic of Finite Volume Method

where (U−▽)k is evaluated at the center of edge k of the cell, and


(S)k and nk are the area and unit vector normal to this edge.
◮ This approximation of the surface integral can be shown to be of
second order accuracy; for some function f a Taylor series expansion
gives:

(8)

for any point lying somewhere on the line being integrated along.

◮ The integration of terms on the right hand side of equation (8) can
then be carried out, using a suitable change of variable, to give

◮ In fact, when is taken as the mid-point of the face then the above
approximation has leading order term of O((s)3), and the
approximation is third order.

◮ The source terms in the volume integral of equation (6) are


approximated as

(9)

where ̅̅̅is the “average” value of Sover the control volume and
(S)P is simply its value at the cell center node P.

4
5 CFD Course Basic of Finite Volume Method

◮ This approximation can also be shown to be generally of second


order accuracy.

Finite-Volume Method on a 2-D Rectangular Grid

◮ To complete the discretization, one needs to consider how to


approximate the convective and diffusive fluxes at the cell faces and,
if necessary, the source terms at the cell center.

◮ To simplify the explanation for now, consider the steady U


momentum equation in 2-D and a uniform rectangular grid.

◮ The velocity U is stored at the nodes P, N, S, E, W, located at


control volume centers; cell faces are denoted by lower case n, s, e,
w.
◮ The finite-volume method starts by integrating the momentum
equation over the P control volume:

(10)

◮ This leads to

5
6 CFD Course Basic of Finite Volume Method

Evaluating Source Terms

◮ The source terms can be approximated by evaluating them at the


cell centre and multiplying by the volume of the cell:

(12)

◮ In the example considered, the pressure gradient at the cell center,


(P/x)P, is evaluated by interpolating pressure values from
surrounding nodes, if necessary. This will be addressed in more
detail in later lectures.

◮ Other source terms can be evaluated similarly, interpolating where


necessary to estimate cell center values.

Evaluating Diffusive Fluxes


◮ The diffusive fluxes can then be approximated by

(13)

◮ The gradients U/x and U/y at the cell faces can be evaluated
using central differences, so that the diffusion terms become

(14)

◮ This is again a second order, centered, approximation.


◮ The discretized diffusion terms can thus be written as

(15)

whetre

6
7 CFD Course Basic of Finite Volume Method

Evaluating Convective Fluxes


◮ The convection terms can be approximated as

where Cxe, Cxw, etc are simply the mass fluxes through the east, west,
north and south faces.

◮ The values of U at the cell faces, Ue, Uw, Un and Us need to be


obtained by interpolation between nodal values.

◮ The scheme used to interpolate these values will affect both the
stability and accuracy of the overall solution, and a few commonly-
used alternatives are outlined below.

1- First Order Upwind Scheme

◮ A very simple scheme for approximating cell face values for the
convective terms is the first-order upwind convection scheme:

(17)

◮ This gives a convection contribution to the discretized equation of

(18)

7
8 CFD Course Basic of Finite Volume Method

where

◮ Note that the coefficients , etc are all positive, as is . The final
set of terms in is the net mass flux into the cell, which should be
zero, so in practice can simply be taken as the sum +
+ + .
.

◮ Combining the convection and diffusion terms results in a


discretized equation of the form

(19)

where ae = + , etc, ap = ae +aw +an+as, and su represents the


source terms arising from the pressure gradient.

◮ We thus get a set of equations relating UP to the values of U at


surrounding nodes.

◮ Having obtained the coefficients and source terms for each grid
cell, the resulting system of equations can be solved by a suitable
numerical algorithm.

◮ The above upwind scheme is always bounded. However, as


implied by its name, it is only first order accurate.

◮ To illustrate this, we assume that Cxe > 0. Then the scheme


approximates

(20)
◮ The leading error term in this can thus be written as

8
9 CFD Course Basic of Finite Volume Method

where the ‘numerical viscosity’ (u)e = Cxex/(2y).

◮ The error is therefore diffusive in nature, and so tends to make the


solution stable, but inaccurate.

◮ The order of accuracy gives information on how rapidly numerical


errors decrease as the grid is refined. Since the error in the above
scheme decreases only linearly with grid spacing, a very fine grid can
be needed in order to achieve sufficient accuracy.

◮ For this reason, whilst first order schemes are often used, it is
usually preferable to employ a higher order scheme.

◮ Note, however, that in practical applications it is a fairly common


practice to begin a calculation with a first order scheme, for its
stability, and then switch to a higher order one once the solution is
closer to convergence.

2- Central Difference Scheme

This scheme simply interpolates linearly between UP and UE to


approximate Ue. For a uniform grid this gives

(21)

◮ This is a second order approximation, which can be seen by writing


Taylor series expansions for UP and UE around Ue:

(22)

(23)

9
10 CFD Course Basic of Finite Volume Method

◮ Adding equations (23) and (22) then leads to

(24)

◮ The central difference scheme is thus more accurate than the first
order upwind scheme, although it can produce oscillatory solutions.

3- QUICK Scheme
◮ The QUICK (Quadratic Upwind Interpolation for Convection
Kinetics) scheme fits a parabola between three points to approximate
Ue.

◮ If Cxe > 0 a parabola is fitted through the points W, P and E.


◮ If Cxe < 0 a parabola is fitted through the points P, E and EE.
◮ For Cxe > 0, on a regular grid we get

(25)

◮ The QUICK scheme can be shown to be third order accurate.

◮ However, it is not bounded, and can produce undershoots and


overshoots in regions of steep gradients.

◮ Note that the discretization stencil associated with the QUICK


scheme is larger than that of the first and second order schemes

10
11 CFD Course Basic of Finite Volume Method

outlined earlier, since contributions from UEE, UWW, UNN and USS now
appear.

◮ QUICK (and other) schemes are often coded as “deferred


corrections”. This means that the upwind scheme contributions are
included in the coefficients ae, aw, etc. whilst the additional
contributions from the QUICK (or other) scheme are simply placed in
the source term Su.

◮ This maintains the five point stencil of points treated implicitly, and
the positivity of the coefficient matrix.

◮ Higher order schemes can also be devised and employed.


However, in order to benefit significantly from them the simple
formulations introduced earlier for approximating surface and volume
integrals (which are only second order accurate) should also be
replaced by a higher order method.

Numerical Flow Solver Strategy

◮ Each momentum equation can be discretized as described, leading


to a set of algebraic equations relating the nodal values of U, V and
W.
◮ Other transport equations (for temperature, mass fraction, etc.) can
be treated similarly.
◮ However, the equations are coupled in a non-linear fashion,
through the convection terms (and sometimes source terms).

◮ An often-used practice is to solve the equations in an iterative,


segregated, manner:

◮ Assemble the discretized equations for U, and hence update U.


◮ Assemble the discretized equations for V, and hence update V.
◮ Assemble the discretized equations for W, and hence update W.
◮ Update the pressure field.
◮ Repeat until the solution has converged.

11
12 CFD Course Basic of Finite Volume Method

◮ At this stage it is not clear how the pressure field is updated, since
we do not have a transport equation for the pressure. This issue is
addressed in the following section.

◮ For illustration we consider a cell at the east boundary of the flow


domain.
◮ Typical boundary conditions might be one of

= 0 at xE or /x = 0 at xE

◮ The discretized form of the transport


equation can be written as

(26)

where the coefficients ae, aw, an and as contain the convective and
diffusive contributions, and ap = ae +aw +an +as.

◮ The first type of boundary condition above can be simply


implemented by setting the value of E to zero.

◮ The zero gradient condition can be implemented by setting ae = 0;


the contributions aeP and aeE are then effectively removed from the
left and right hand sides of equation (26) respectively.

◮ Fixed flux conditions (eg. prescribed heat flux) can also be


implemented by setting ae to zero and adding the desired flux to the
source term s.

12

You might also like