Assignment 4: T T U T X
Assignment 4: T T U T X
(a) Use the von Neumann method to determine whether this scheme is stable.
(b) The numerical solution can be represented in the form
∞
X
T (x, t) = Tm e−p(m)t eim[x−q(m)t]
m=−∞
What do p(m) and q(m) represent? The amplification factor for a single time step for the
mth Fourier component is
Gm = e−p(m)∆t e−imq(m)∆t
For the Crank-Nicolson scheme what is the amplification factor for the mth Fourier compo-
nent? Equating the real and imaginary components of the two expressions for Gm obtain an
expression for q(m). For C = u∆t/∆x = 0.4 and ∆x = 0.1 compute q(m)/u for the four
modes m = 1, 2, 5, 9.
2. The equation
∂T ∂T
+u =0
∂t ∂x
where u is a constant, is to be solved with initial conditions
T = T0 (x) for 0 ≤ x ≤ π
where Tm are constants. For this initial condition what is the exact solution for T ? How
will you represent the numerical solution to take into account numerical dissipation and
dispersion? In the exact solution do modes with all different values of m propagate with
the same phase speed? Considering one Fourier mode with a particular value of m, what
is the ratio of the phase speed of the numerical solution to the phase speed of the exact
solution? Derive expressions for this ratio for the upwind scheme and the Crank-Nicolson
scheme. Assuming that the interval 0 ≤ x ≤ π is divided into 10 equal grid intervals and ∆t
is chosen such that the Courant number C = 0.8, calculate this ratio for the two methods for
the Fourier mode with m = 5.
1
3. How will you solve the one-dimensional linear convection equation using the leapfrog scheme?
Assume that the velocity is a constant. Using the von Neumann method determine when the
scheme is stable. Derive the modified equation for this scheme by retaining up to terms of
second order and show whether the scheme leads to numerical dispersion.
Tjn+1 − Tjn n − Tn
Tj+1 j−1
+u =0
∆t 2∆x
while the Lax method uses
Tjn+1 − 21 (Tj+1
n + Tn )
j−1
n − Tn
Tj+1 j−1
+u =0
∆t 2∆x
Using the von Neumann method determine whether these schemes are stable and whether
there is a condition for stability. Assume that u is constant. What is the artificial diffusivity
of each of these schemes? Assume that ∆t and ∆x are of the same order. Does there appear
to be a relation between the sign of the artificial diffusivity and the stability of the scheme?
Tjn+1 − Tjn n − Tn
Tj+1 j−1
+u =0
∆t 2∆x
using the von Neumann method determine if this scheme is stable. What is the artificial
diffusivity of the scheme and is it positive or negative?
Alternatively one can use an upwind scheme
2
Using the von Neumann method determine when this scheme will be stable. What is the
artificial diffusivity of this scheme?
Is the stability because of upwind differencing? To test this consider a scheme which uses a
second-order-accurate upwind difference approximation for the convection term
dT d2 T
u −α 2 =0
dx dx
where u and α are assumed to be constants, can be solved numerically using central difference
approximation for both the terms
Tj+1 − Tj−1 Tj−1 − 2Tj + Tj+1
u −α =0
2∆x (∆x)2
Do numerical solutions using this upwind scheme show unphysical spatial oscillations? Is the
answer dependent on the value of the cell Peclet number? Provide mathematical justification
for your answer. We can instead use the average of the central difference and upwind difference
approximations to approximate the convection term
u Tj+1 − Tj−1 Tj − Tj−1 Tj−1 − 2Tj + Tj+1
+ −α =0
2 2∆x ∆x (∆x)2
Do solutions using this scheme show unphysical spatial oscillations and if so what is the
condition so that such oscillations do not occur? If a weighted mean of the two approximations
is used
Tj+1 − Tj−1 Tj − Tj−1 Tj−1 − 2Tj + Tj+1
u q + (1 − q) −α =0
2∆x ∆x (∆x)2
3
where q is a constant between 0 and 1, what is the condition for which unphysical spatial
oscillations do not occur? What should be the value of q so that spatial oscillations do not
occur provided the cell Peclet number satisfies P 6 10? Is there any value of q other than zero,
for which spatial oscillations do not occur whatever be the value of the cell Peclet number?
∂T ∂T ∂2T
+u =α 2
∂t ∂x ∂x
where u and α are constants, can be solved using the fully implicit scheme
Tjn+1 − Tjn n − Tn
Tj+1 j−1
n+1
Tj+1 − 2Tjn+1 + Tj−1
n+1
+u =α
∆t 2∆x (∆x)2
or a scheme which is implicit for the convection term and explicit for the diffusion term
∂T ∂T ∂2T
+u −α 2 =0
∂t ∂x ∂x
can be solved using the upwind scheme
∂T ∂T ∂2T
+u −α 2 =0
∂t ∂x ∂x
4
a leapfrog scheme uses the finite difference approximation
Tjn+1 − Tjn−1 n − Tn
Tj+1 j−1
n − 2T n + T n
Tj+1 j j−1
+u −α 2
=0
2∆t 2∆x (∆x)
Assuming that u is constant, use the von Neumann method to derive an equation for the
amplification factor G for the scheme. Is the scheme stable? Provide proper justification in
support of your answer. Assume α 6= 0.
∂T ∂T ∂2T
+u −α 2 =0
∂t ∂x ∂x
using the Crank-Nicolson scheme? What is the order of accuracy of the scheme? Provide
a logical explanation for your reply. Using the von Neumann method determine whether
the scheme is stable and if so whether there is a condition for stability. Assume that u is a
constant.
The two-dimensional transport equation
∂2T ∂2T
∂T ∂T ∂T
+u +v −α + =0
∂t ∂x ∂y ∂x2 ∂y 2
can be solved using an alternating direction implicit (ADI) scheme comprising of two half
steps
∗ − Tn
Tj,k ∗
Tj+1,k ∗
− Tj−1,k n
Tj,k+1 n
− Tj,k−1
j,k
+u +v
∆t/2 2∆x 2∆y
∗
Tj−1,k ∗ ∗
− 2Tj,k + Tj+1,k n n n
Tj,k−1 − 2Tj,k + Tj,k+1
−α + = 0
(∆x)2 (∆y)2
Using the von Neumann method determine whether the scheme is stable and whether there
is a condition for stability. Again assume that u and v are constants.
∂2T ∂2T
∂T ∂T ∂T
+u +v −α + =0 (1)
∂t ∂x ∂y ∂x2 ∂y 2
5
T n+1 − T ∗
+ uLx T ∗ + vLy T n+1 − αLxx T ∗ − αLyy T n+1 = 0 (3)
∆t/2
where the operators Lx , Ly , Lxx and Lyy are defined as
Tj+1,k − Tj−1,k
Lx Tj,k =
2∆x
Tj,k+1 − Tj,k−1
Ly Tj,k =
2∆y
Tj+1,k − 2Tj,k + Tj−1,k
Lxx Tj,k =
(∆x)2
Tj,k+1 − 2Tj,k + Tj,k−1
Lyy Tj,k =
(∆y)2
The equations (2) and (3) apply at any arbitrary grid-point (j, k). Adding Eqs. (2) and (3)
and dividing by 2 we obtain
T n+1 − T n
n
T + T n+1
n
T + T n+1
∗ ∗
+ uLx T + vLy − αLxx T − αLyy = 0 (4)
∆t 2 2
The scheme will be an approximation to Eq. (1) correct to second order in time and space pro-
vided the terms in Eq. (4) can be shown to approximate the terms in Eq. (1) with truncation
error of O(∆t2 , ∆x2 , ∆y 2 ). Using appropriate Taylor series show that
n+1 n n+ 1
(a) T ∆t− T represents ∂T
2
∂t
1
n n+1
∂T n+ 2
(b) Ly T + T represents
2 ∂y
n+ 1
(c) Lx T ∗ represents ∂T
2
∂x
with truncation errors of O(∆t2 , ∆x2 , ∆y 2 ). To prove (c), first derive an expression for T ∗ in
terms of T n and T n+1 from Eqs. (2) and (3).
13. How will you solve the two-dimensional transport equation using an explicit finite-difference
approximation for the convection terms and an implicit finite-difference approximation for
the diffusion terms. Assume that the velocity is known and has a constant value which does
not vary with position or time. Carry out a stability analysis for this scheme using the
von Neumann method, assuming Fourier modes of the form exp[i(mx x + my y)]. Defining
θx = mx ∆x, θy = my ∆y obtain necessary condition(s) for stability by considering the two
limiting cases θx = θy = π and θx , θy 1. Prove that the necessary condition(s) also
constitute(s) sufficient conditions(s) for stability of all Fourier components in the error.