You are on page 1of 5

School of Mechanical Aerospace and Civil Engineering

Introduction

MSc/4th Year Advanced CFD When examining discretization and solution methods we have mainly considered incompressible, constant density, ows. In many applications there may be signicant changes in the density, or other uid properties.
g

Density Variation in Finite Volume Schemes


T. J. Craft
George Begg Building, C41

One example is buoyancy-affected ows, driven by temperature, or concentration variations.

T hot

T cold

Reading: J. Ferziger, M. Peric, Computational Methods for Fluid Dynamics H.K. Versteeg, W. Malalasekara, An Introduction to Computational Fluid Dynamics: The Finite Volume Method S.V. Patankar, Numerical Heat Transfer and Fluid Flow Notes: Blackboard and CFD/TM web server: http://cfd.mace.manchester.ac.uk/tmcfd - People - T. Craft - Online Teaching Material
Density Variation in Finite Volume Schemes 2011/12 1 / 18

y x

x y

Some ows may be driven completely by buoyancy (natural convection). In others there may be both forced and buoyant convection effects (mixed convection).

Density Variation in Finite Volume Schemes

2011/12

2 / 18

In compressible ows we also need to consider density changes, and the linkage between density, pressure and temperature. There is now a greater coupling between the transport equations than previously considered which may impact on solution methods and stability. Some of the algorithms considered earlier may require adaptation.

Buoyancy-Affected Flows

Gravitational force terms must now be included in the momentum equations: D P Ui + gi + ( Ui ) = Dt xi xj xj If the density is not constant, then gi cannot be absorbed within the pressure.

(1)

Another signicant problem in strongly compressible ows is the presence of shocks.

To avoid excessively large source terms, the buoyancy term is usually included as ( ref )gi , with ref chosen as some appropriate reference density in the particular ow problem. Buoyancy effects often arise from heating/cooling, and a relevant non-dimensional ow parameter is the Rayleigh number: Ra = g TL3 (2)

In this section we consider the solution of two broad classes of ow using nite volume methods:

Buoyancy-affected ows Compressible ows


2011/12 3 / 18

where L is a characteristic length for the problem, the thermal expansion coefcient, and the thermal diffusivity.
Density Variation in Finite Volume Schemes 2011/12 4 / 18

Density Variation in Finite Volume Schemes

Boussinesq Approximation

Solution Stability

If there is only moderate heating/cooling, density changes in other than the gravitation term can often be neglected. This is the Boussinesq approximation. The buoyancy term in the momentum equations can then be written in terms of temperature differences: ( ref )gi = ref gi (T Tref ) where is the coefcient of thermal expansion. (3)

Since temperature (or concentration) is no longer a passive scalar, there is a greater coupling between the various ow transport equations. For most problems a segregated solution strategy can still be employed, but it may be necessary to use more under-relaxation. If not using the Boussinesq approximation, density and other ow properties (eg. viscosity) should be re-computed after updating the temperature eld. Suitable reference values ref or Tref must be chosen to avoid excessively large source terms in the momentum equations. Typically, one might use an average between the hot and cold temperatures in a problem.
2011/12 6 / 18

In strongly heated/cooled ows the full variation of density and other uid properties (eg. viscosity) may need to be included.

Density Variation in Finite Volume Schemes

2011/12

5 / 18

Density Variation in Finite Volume Schemes

Compressible Flows

There is now a strong coupling between all the transport equations. This coupling means segregated solver strategies may not be as stable, or may require more under-relaxation, than in incompressible problems. Coupled solvers for the discretized equations can be used, but these have greater storage requirements, and typically involve more work per iteration. Other issues include which equation to use in updating each variable, and even which variables to solve for. Traditionally, different solution algorithms have been adopted for compressible and incompressible ows. Methods now exist to apply the main approaches to both ow regimes, although there can still be advantages in selecting one or the other approach for particular problems.

In addition to the continuity and momentum equations, we now need to solve an energy equation, and an equation of state. For a typical perfect gas, the governing equations are now:

( Uj ) = 0 + t xj P D( Ui ) + = Dt xi xj Ui Uj + xj xi Uk (2/3) xi xk
2

(4)

(5)

T Ui Ui Uj D( e) Uk Uk + (2/3) + + = P Dt xk xj xj xj xj xi xk
P = RT where e = Cp T is the internal energy.

(6) (7)

Note that in the limit of incompressibility the energy equation reduces to the simpler temperature transport equation considered earlier.
2011/12 7 / 18 Density Variation in Finite Volume Schemes 2011/12 8 / 18

Density Variation in Finite Volume Schemes

Pressure and Density Based Solvers

Density Based Solvers

There are two broad categories of solution schemes typically used for compressible ows. The different choices are partly historic, but also reect the different ow physics found in incompressible and compressible ows.

Density based solvers typically solve for the conserved variables ( , Ui , e, and P).

Ui and e are updated from the discretized momentum and energy equations.
Density is obtained from the continuity equation. The equation of state is then used to update the pressure.

Pressure Based Solvers

Pressure based solvers are essentially an extension of the approach normally used for incompressible ows. They solve for the primitive variables ( , Ui , e, P). The discretized momentum and energy equations are used to update velocities and energy. Pressure is obtained from the continuity equation via a pressure-correction type of algorithm. Density is then obtained from the equation of state.
2011/12 9 / 18

Density Variation in Finite Volume Schemes

Density Variation in Finite Volume Schemes

2011/12

10 / 18

Pressure vs. Density Based Solvers

Pressure Correction Methods

In general, density based solvers tend to be more suitable for high speed compressible ows with shocks (discontinuities). This is because they solve for the conserved quantities across the shock. Density based solvers require special treatments if they are to be used for incompressible ows. Articial compressibility methods tend to be used, in order to allow the continuity equation to give density and obtain pressure from the state equation. Pressure based solvers tend to be better for incompressible ows and still perform reasonably well for weakly or moderately compressible ows. They tend to not perform so well in ows with strong shock interactions.

In a typical pressure-based solver the pressure is obtained via a pressure-correction method. These are rather similar to those already considered for incompressible cases. For incompressible ows these methods (eg. SIMPLE) estimated pressure corrections designed to drive the velocity eld towards something satisfying continuity. An additional complication in compressible ows is that changes to the pressure affect not only the velocities, but also the density. Both velocity and density now affect the continuity balance. These two ways in which pressure corrections affect the continuity equation thus both need to be accounted for.

Density Variation in Finite Volume Schemes

2011/12

11 / 18

Density Variation in Finite Volume Schemes

2011/12

12 / 18

Modied SIMPLE Scheme


N n

In correcting the pressure eld, we will now be making corrections to the velocities and density:

= +
e E y

U = U + U

V = V +V

P = P + P

For simplicity, we consider a 2-D problem on a uniform rectangular grid.

s S x

where superscripts * represent corrected values, and primes the corrections.

Substituting these into the discretized continuity equation gives


P

The discretized momentum equations can be treated as before, leading to approximate relations between the pressure and velocity corrections:
Ue = Du (PP PE ) Vn = Dv (PP PN )

x y + ( U + U + U )y t

e w

+ ( V + V + V )x

n s

= Sm (10)

(8)

where Sm is the imbalance in the continuity equation: Sm =


o (P P ) x y + [ Uy ]e + [ V x ]n w s t

The discretized continuity equation (including the unsteady term) can now be written
o (P P ) x y + [ Uy ]e + [ V x ]n = 0 w s t

(11)

(9)

The products of corrections ( U etc) in equation (10) are assumed to be small, and hence neglected.

Density Variation in Finite Volume Schemes

2011/12

13 / 18

Density Variation in Finite Volume Schemes

2011/12

14 / 18

The equation for the corrections thus becomes:


P

The resulting equation is Cp x y PP + ( Duy )e (PP PE ) ( Duy )w (PW PP ) t + ( Dv x )n (PP PN ) ( Dv x )s (PS PP )


+ (Cp Uy )e Pe (Cp Uy )w Pw + (Cp V x )n Pn (Cp V x )s Ps = Sm (14)

x y + ( U + U )y t

e w

+ ( V + V )x

n s

= Sm

(12)

The velocity corrections can be related to pressure corrections at neighbouring nodes via equations (8) as before. The density corrections can be related to pressure ones via the state equation (assuming temperature remains xed):

P = Cp P
T

(13)

The cell face values of P must be approximated using an appropriate convection interpolation scheme (upwind, centred, etc), as in the discretized momentum and scalar transport equations. The resulting discretized equation for P can then be solved, and the pressure, velocity and density corrected.

For a perfect gas this gives P = PP /(RTP ).

Substituting into equation (12) leads to an equation linking P at the nodes P, E, W , N, S, and at the e, w, n and s faces.

Density Variation in Finite Volume Schemes

2011/12

15 / 18

Density Variation in Finite Volume Schemes

2011/12

16 / 18

Convection Schemes in Compressible Flows

Many schemes employed in general purpose solvers use some type of ux limiter to avoid numerical oscillations. Details are not give here, but the underlying idea is to apply a limit to the calculated face uxes, to ensure local minima or maxima of the ow variables are not obtained. One class of such schemes are TVD (Total Variation Diminishing) schemes. These avoid oscillations by ensuring that in a pure convection/diffusion problem the total variation of the ow quantities does not grow. TVq = |qi qi1 |
i

A further important consideration in highly compressible ows is the convection scheme. In earlier courses we considered a number of convection schemes, including upwind, central and QUICK schemes. The rst order upwind scheme gave bounded solutions, but required a very ne grid for accuracy. Higher order schemes gave smaller truncation errors, but could lead to under- or over-shoots in the solution. This can be a problem in compressible ows with shocks, where there should be very steep gradients in variables. Use of an unbounded scheme can lead to oscillations appearing in the solution around the shock. A number of schemes have been devised to address this problem.
2011/12 17 / 18

(15)

Other schemes, such as ENO (Essentially Non-Oscillatory) schemes adapt the computational stencil around shocks and discontinuities, to ensure differences are not taken across them.

Density Variation in Finite Volume Schemes

Density Variation in Finite Volume Schemes

2011/12

18 / 18

You might also like