Time-Dependent Scalar-Transport Equation in CFD: One-Step and Multi-Step Methods, Study notes of Physics

The time-dependent scalar-transport equation in computational fluid dynamics (cfd), focusing on one-step and multi-step methods for solving the first-order differential equation. Forward, backward, and centred differencing methods, their advantages and disadvantages, and their implementation in cfd. Examples are provided to illustrate the concepts.

Typology: Study notes

2010/2011

Uploaded on 09/08/2011

the-princess
the-princess 🇬🇧

4.5

(4)

15 documents

1 / 10

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CFD 6 – 1 David Apsley
6. TIME-DEPENDENT METHODS SPRING 2012
6.1 The time-dependent scalar-transport equation
6.2 One-step methods
6.3 Multi-step methods
6.4 Uses of time-marching in CFD
Summary
Examples
6.1 The Time-Dependent Scalar-Transport Equation
The time-dependent scalar-transport equation for an arbitrary control volume is
sourcefluxnetamount
t
=+)(
d
d (1)
where:
amount = total quantity in a cell = mass × concentration;
flux = rate of transport through the boundary .
In Section 4 it was shown how the flux and source terms could be discretised as
P
FFFPP baasourcefluxnet φφ=
(2)
In this Section the time derivative will also be discretised.
We first examine numerical methods for the first-order differential equation
),(
d
dφ=
φ
tF
t
, 0
)0( φ=φ (3)
where F is an arbitrary scalar function of t and φ. Then we extend the methods to CFD
(where φ and F refer to all nodes of the mesh).
Initial-value problems of the form (3) are solved by time-
marching. There are two main types of method:
one-step methods: use the value from the previous time
level only;
multi-step methods: use values from several previous times.
t
φ
φ
φ
old
new
t
t
old new
∆φ
t
t
φ
t
(n+1)
φ
(n+1)
φ
(n)
φ
(n-1)
φ
(n-2)
t
(n)
t
(n-1)
t
(n-2)
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Time-Dependent Scalar-Transport Equation in CFD: One-Step and Multi-Step Methods and more Study notes Physics in PDF only on Docsity!

6. TIME-DEPENDENT METHODS SPRING 2012

6.1 The time-dependent scalar-transport equation 6.2 One-step methods 6.3 Multi-step methods 6.4 Uses of time-marching in CFD Summary Examples

6.1 The Time-Dependent Scalar-Transport Equation

The time-dependent scalar-transport equation for an arbitrary control volume is

amount netflux source t

d

d (1)

where: amount = total quantity in a cell = mass × concentration; flux = rate of transport through the boundary.

In Section 4 it was shown how the flux and source terms could be discretised as

P F

net flux − source = aP φ P −∑ aF φ F − b (2)

In this Section the time derivative will also be discretised.

We first examine numerical methods for the first-order differential equation

(, ) d

d = φ φ F t t

, φ( 0 )=φ 0 (3)

where F is an arbitrary scalar function of t and φ. Then we extend the methods to CFD (where φ and F refer to all nodes of the mesh).

Initial-value problems of the form (3) are solved by time- marching. There are two main types of method:

  • one-step methods: use the value from the previous time level only;
  • multi-step methods: use values from several previous times.

t

φ

φ

φ

old

new

t old^ tnew

∆φ

∆ t

t

φ

t(n+1)

φ (n+1)

φ (n) φ (n-2) φ (n-1)

t(n-2) t(n-1) t(n)

6.2 One-Step Methods

For the first-order differential equation

F t

φ d

d (3)

the one-step problem is: given φ at time t ( n )^ … compute φ at time t ( n +1)

The following notation is used:

  • identify everything at t ( n )^ by a superscript “ old ” – this is what we currently know;
  • identify everything at t ( n +1)^ by a superscript “ new ” – this is what we seek.

By integration of (3), or from the definition of average slope,

F^ av t

φ or φ = F av t (4)

Hence, φ new^ =φ old + F av t (5) These are exact. However, since the average derivative Fav^ isn’t available until the solution φ is known, this is a Catch-22 situation. For a numerical method Fav^ must be estimated.

6.2.1 Simple Estimate of Derivative

This is the commonest class of time-stepping scheme in general-purpose CFD. There are three obvious methods of making a single estimate of the average derivative.

Forward Differencing (Euler Method) Take Fav^ as the derivative at the start of the time-step:

Backward Differencing (Backward Euler) Take Fav^ as the derivative at the end of the time-step:

Centred Differencing (Crank-Nicolson) Take Fav^ as the average of derivatives at the beginning and end.

φ new^ =φ old + F old t φ new^ =φ old + F new t φ new^ =φ old +^12 ( F old + Fnew ) t

t

φ

φ

φ old

new

t old^ tnew^ t

φ

φ

φ

old

new

t old^ tnew^ t

φ

φ

φ

old

new

t old^ tnew

(^12) ∆ t (^12) ∆ t

For :

  • Easy to implement because explicit (the RHS is known).

For :

  • In CFD, no time-step restrictions;

For :

  • Second-order accurate in t.

Against :

  • Only first-order in t ;
  • In CFD, stability imposes time-step restrictions.

Against :

  • only first-order in t ;
  • implicit (although, in CFD, no more so than steady case).

Against :

  • Implicit;
  • In CFD, stability imposes time- step restrictions.

t

φ

φ

φ

old

new

t old^ tnew

∆φ

∆ t

6.2.2 Other Methods

For equations of the form F t

φ d

d , improved solutions may be obtained by making

successive estimates of the average gradient. Important examples include:

Modified Euler Method (2 function evaluations; similar to Crank-Nicolson, but explicit)

2 1 2 1

2 1

1

φ= φ + φ

φ = + φ + φ

φ = φ old old

old old

tFt t

tF t

Runge-Kutta (4 function evaluations)

6 1 2 3 4 1

4 3

2 2 1 2 1 3

2 1

1 2

1 2

1

φ= φ + φ + φ + φ

φ = + φ + φ

φ = + φ + φ

φ = + φ + φ

φ = φ

old old

old old

old old

old old

tFt t

tF t t

tFt t

tF t

More details of these – and other advanced methods – can be found in the course notes for the “Computational Mechanics” unit.

For scalar φ, such methods are popular. Runge-Kutta is probably the single most widely-used method in engineering. However, in CFD, φ and F represent vectors of nodal values, and calculating the derivative F (evaluating flux and source terms) is very expensive. The majority of CFD calculations are performed with the simpler methods of 6.2.1.

Exercise. Using Microsoft Excel (or other computational tool of your choice) solve the Classroom Examples from the previous subsection using Modified-Euler or Runge-Kutta methods.

6.2.3 One-Step Methods in CFD

General scalar-transport equation:

( ) 0 d

d V φ + net fluxsource = t

P (6)

For one-step methods the time derivative is always discretised as

t

V V

V

t

old P

new P P

d

d φ − φ φ → (7)

Flux and source terms could be discretised at any particular time level as

net flux − source = aP φ P −∑ aF φ F − b P (8)

Different time-marching schemes arise from the time level at which (8) is evaluated.

Forward Differencing

[ ] 0

  • φ − φ − =

φ − φ

old P P F F P

old P

new P (^) a a b t

V V

Rearranging, and dropping any “ new ” superscripts as tacitly understood: old P (^) t aP P bP aF F

V

t

V

Assessment.

  • Explicit; no simultaneous equations to be solved.
  • Timestep restrictions; for stability a positive coefficient of φ old (^) p requires − aP ≥ 0 t

V

Backward Differencing

[ ] 0

  • φ − φ − =

φ − φ

new P P F F P

old P

new P (^) a a b t

V V

Rearranging, and dropping any “ new ” superscripts:

P^ old P P F F P t

V

a a b t

V

φ

Assessment.

  • Straightforward to implement; amounts to a simple change of coefficients:

old P P P P t

V

b b t

V

aa + → +( ) (11)

  • No timestep restrictions.

Crank-Nicolson

[ ] [ ] 0

2

1 2

φ − φ + (^1) φ − φ − + φ − φ − =

new P P F F P

old P P F F P

old P

new P (^) a a b a a b t

V V

Rearranging, and dropping any “ new ” superscripts: old P P F F P t aP P bP aF F

V

a a b t

V

( + 21 )φ −^12 ∑ φ = 21 + ( − 21 )φ +^12 ( +∑ φ )

or, multiplying by 2 for convenience: old P P F F P aP P bP aF F t

V

a a b t

V

  • φ − φ = +^ − φ + + φ

Assessment.

  • Fairly straightforward to implement; amounts to a change of coefficients: old P P P P t aP P bP aF F

V

b b t

V

a a  

  • Timestep restrictions; for stability, a positive coefficient of φ old (^) p requires 2 − aP ≥ 0 t

V

6.3 Multi-Step Methods

One-step methods use only information from time level t ( n )^ to calculate (dφ/d t ) av.

Multi-step methods use the values of φ at earlier time levels as well: φ( n -1), φ( n -2), ....

One example is Gears method :

t t

n n n n

2

d

d () (^1 ) (^2 ) ( ) − − φ − φ +φ  = 

 φ^ (17)

This is second-order in t ; ( exercise : prove it).

A wider class of schemes is furnished by so-called predictor-corrector methods which refine their initial prediction with one (or more) corrections. A popular example of this type is the Adams-Bashforth-Moulton method:

predictor: φ npred +^1 =φ n + 241 t [ − 9 Fn −^3 + 37 Fn −^2 − 59 Fn −^1 + 55 Fn ] corrector: φ n^ +^1 =φ n + 241 t [ Fn −^2 − 5 Fn −^1 + 19 Fn + 9 Fpredn +^1 ]

Just as three-point advection schemes permit greater spatial accuracy than two-point schemes, so the use of multiple time levels allows greater temporal accuracy. However, there are a number of disadvantages which limit their application in CFD:

  • S torage : each computational variable has to be stored at all nodes at each time level.
  • Start-up : initially, only data at time t = 0 is available; the first step requires a single- step method (or other information).

6.4 Uses of Time-Marching in CFD

Time-dependent schemes are used in two ways: (1) for a genuinely time-dependent problem; (2) for time marching to steady state.

In case (1) accuracy and stability often impose restrictions on the timestep and hence how fast one can advance the solution in time. Because all nodal values must be updated at the same rate the timestep t is global ; i.e. the same at all grid nodes.

In case (2) one is not seeking high accuracy so one simply adopts a stable algorithm, usually Backward Differencing. Alternatively, if using an explicit scheme such as Forward Differencing, the timestep can be local , i.e. vary from cell to cell, in order to satisfy Courant- number restrictions in each cell individually.

In practice, for incompressible flow, steady flow should be computable without time- marching. This is not the case in compressible flow, where time-marching is necessary in transonic calculations (flows with both subsonic and supersonic regions).

t

φ

t(n+1)

φ (n+1)

φ (n) φ (n-2) φ (n-1)

t(n-2) t(n-1) t(n)

Summary

  • The time-dependent fluid-flow equations are first-order in time and are solved by time-marching.
  • Time-marching schemes may be explicit (time derivative known at the start of the timestep) or implicit (require iteration at each timestep).
  • Common one-step methods are Forward Differencing ( explicit ), Backward Differencing ( implicit ) and Crank-Nicolson ( semi-implicit ).
  • One-step methods are easily implemented via changes to the matrix coefficients. For the Backward-Differencing scheme the only concessions required are:

t

V

b b t

V

a a

old P P P P P

φ → + → +

  • The only unconditionally-stable two-time-level scheme is Backward Differencing (fully-implicit timestepping). Other schemes have time-step restrictions; typically, an upper limit on the Courant number

x

u t c =

  • The Crank-Nicolson scheme is second-order accurate in t. The Backward- Differencing and Forward-Differencing schemes are both first order in t , which means they need more timesteps to achieve the same time accuracy.
  • Multi-step methods may be used to achieve accuracy and/or stability. However, these are less favoured in CFD because of large storage overheads.
  • Time-accurate solutions require a global timestep. A local timestep may be used for time-marching to steady state. In the latter case, high time accuracy is not required and backward differencing is favoured as the most stable approach.

Q5. (MSc Exam, May 2010) (a) Explain what is meant by the terms explicit and implicit when applied to time- marching schemes for differential equations of the type

(, ) d

d = φ φ F t t

(b) The equation

4 d

d = −φ

φ t t

, φ = 2 when t = 0,

is to be solved numerically, using a timestep t = 0.1. Solve this equation up to time t = 0.4 using the following approaches to time-marching: (i) forward-differencing (“fully-explicit”); (ii) backward-differencing (“fully-implicit”); (iii) centred-differencing (“semi-implicit”). Note. Be very careful how you rearrange the implicit schemes for iteration.

(c) The 1-d time-dependent equation for a transported scalar φ is

= 0 ∂

∂ φ

∂ φ x

u t

where t is time, x is distance and u is a constant positive velocity. Using first-order upwind differencing for the advection term, determine the restriction on the size of the timestep when the time derivative is discretised by forward-differencing, and state the corresponding restriction on the Courant number (which should be defined).

Q6. (MSc Exam, May 2011 – part) For the equation

2 d

d ( ) =−φ

φ

  • φ t

t , φ = 2 when t = 0,

use the following methods with a timestep t = 0.25 to find the value of φ at t = 1: (a) forward differencing (“fully-explicit”); (b) backward differencing (“fully-implicit”); (c) centred differencing (“semi-implicit”).