Solution Algorithm
Solution Algorithm
Dynamics
Solution algorithms
1-1
Difference Equation
In CFD we represent the partial derivatives by means of algebraic finite
difference quotient. When all the partial derivatives in partial difference
equation is replace by e finite difference quotient then resulting algebraic
equation is known as difference equation.
Consider unsteady, one dimension heat conduction equation with constant
thermal diffusivity,
1-2
Difference Equation
1-3
Difference Equation
1-4
Difference Equation
1-5
Difference Equation
1-6
1-7
1-8
1-9
1-10
1-11
1-12
1-13
1-14
1-15
1-16
1-17
1-18
1-19
1-20
1-21
1-22
Example
1-23
Example
1-24
Example
1-25
Example
1-26
Example
1-27
Example
1-28
Example
1-29
Here, a nozzle of specified area distribution, A = A(x), is given, and the reservoir
conditions are known. Let us consider a quasi-one-dimensional solution where
the flow field variables are functions of x (in the steady state).
1-30
1-32
1-33
1-34
1-35
1-36
The behaviour of this type of solution is illustrated in Figs. 7.2. In Fig. 7.2, the
temperature distribution through a given nozzle is shown. The dashed line
labelled t = 0 is the initially assumed values for T throughout the nozzle.
The curve above it labelled 8t is the temperature distribution after eight time
steps following the above procedure. The curves labeled 16t and 32t are
similar results after 16 and 32 time steps respectively. Note that the temperature
1-37
distribution has rapidly changed from the assumed initial distribution
at t = 0.
1-39
MacCormacks Method
Let us use the same nozzle problem discussed in previous Section to illustrate
MacCormacks method in the present section. MacCormacks method, like the
Lax-Wendroff method, is based on a Taylors series expansion in time. Once
again, as in previous Section, let us consider the density at grid point i.
1-40
MacCormacks Method
1-41
MacCormacks Method
1-42
MacCormacks Method
The above predictorcorrector approach is carried out for all grid points
throughout the nozzle, and is applied simultaneously to the momentum and energy
equations in order to generate uit+t and eit+t.
In this fashion, the flow field through the entire nozzle at time t +t is calculated.
This is repeated for a large number of time steps until the steady state is achieved,
just as in the case of the Lax-Wendroff method described in previous section.
MacCormacks technique as described above, because a two-step predictor
corrector sequence is used with forward differences on the predictor and rearward
differences on the corrector, is a second-order accurate method. Therefore, it has
the same accuracy as the Lax-Wendroff method described in previous section
However, the MacCormack method is much easier to apply, because there is no
need to evaluate the second time derivatives as was the case for the Lax-Wendroff
method. To see this more clearly, recall Eqs. (7.7) and (7.8), which are required for
the Lax-Wendroff method but MacCormacks method does not require such
second derivatives, and hence does not deal with equations such as Eqs. (7.7) and
1-43
(7.8).
MacCormacks Method
A few comments are made with regard to the specific application to the quasi
one- dimensional nozzle flow shown in Fig. 7.1.
At the inflow boundary (the first grid point at the left), the values of p, T and
are fixed, independent of time, and are assumed to be reservoir values. The inflow
velocity, which is a very small subsonic value, is calculated from linear
extrapolation using the adjacent internal points, or it can be evaluated from the
momentum equation applied at the first grid point using one-sided differences.
At the outflow boundary (the last grid point at the right in Fig. 7.1), all the
dependent variables are obtained from linear extrapolation from the adjacent
internal points, or by applying the governing equations at this point, using onesided differences
Finally, we note that results obtained from the LaxWendroff method and from
the MacCormack method are virtually identical
1-44
Stability Criterion
Examine Eq. (7.1), which is vital to the LaxWendroff method. Note that it
requires the specification of a time increment, t. Examine Eqs. (7.9) and (7.11),
which are vital to the MacCormack method. They too require the specification of a
time increment, t.
For explicit methods, the value of t cannot be arbitrary, rather it must be less
than some maximum value allowable for stability. The time-dependent
applications described in Sects. 7.2 and 7.3 are dealing with governing flow
equations which are hyperbolic with respect to time. For a two or threedimensional flow
Where C is the Courant number. The maximum allowable value of C for stability in
1-45 from approximately
explicit time-dependent finite difference calculations can vary
1-46
1-47
1-48
1-49
1-50
1-51
1-52
1-53
1-54
1-55
1-56
1-58
1-59
1-60
1-61
1-62
1-63
1-64
1-65
1-66
1-67
1-68
Central differentiation of Incompressible NevierStokes equation and need for staggered grid
1-69
Central differentiation of Incompressible NevierStokes equation and need for staggered grid
1-70
Central differentiation of Incompressible NevierStokes equation and need for staggered grid
1-71
Central differentiation of Incompressible NevierStokes equation and need for staggered grid
1-72
Central differentiation of Incompressible NevierStokes equation and need for staggered grid
1-73
Central differentiation of Incompressible NevierStokes equation and need for staggered grid
1-74
Central differentiation of Incompressible NevierStokes equation and need for staggered grid
1-75
1-76
1-77
1-78
1-79
1-80
1-81
1-82
1-83
1-84
1-85
1-86
1-87
1-88
1-89
1-90
1-91
1-92
1-93
1-94