Examples5 PDF

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Fundamentals of Numerical Thermo-Fluid Dynamics 322.

061
Examples for home preparation

Exercise 5: Implicit time-stepping schemes

To be presented on June 3, 2020

5.1 Solve numerically the one-dimensional transport of a passive scalar

∂t T = −u∂x T + κ ∂xx T on Ω = [−2, 2], (1a)


(
1 if x < 0
T (t = 0) = , (1b)
0 if x ≥ 0
T =1 at x = −2, (1c)
∂x T = 0 at x = 2. (1d)

with diffusivity κ = 0.001 and convective velocity u = 1. First discretize the problem
in space on a uniform grid with ∆x = 10−2 using second order central differencing,
to form an initial value problem
∂Tj
= Ajk Tk . (2)
∂t
Then discretize this initial value problem using Crank-Nicolson method with the
time-step ∆t = 5 × 10−3 . Compute the numerical solution at t = 1.

5.2 Repeat the previous example, but use the 4-point upwind scheme for the first spatial
derivative:

n n
Tj+1 − Tj−1 Tj−2 − 3Tj−1 + 3Tjn − Tj+1
∂x T ≈ + (3)
2∆x 6∆x
On the second grid point from left use the standard second order centered scheme.

5.3 Assume that T (x, t) is a local temperature. We want to impose a zero-flux on both
boundaries, such that the total amount of heat Q ∝ T̄ inside of the domain Ω is
conserved. This can be achieved by applying Robin condition on both boundaries
∂T
(~u · ~n)T − κ = 0 at x = −2 and x = 2
∂~n

1
Exercise 5 322.061: Fundamentals of Numerical Thermo-Fluid Dynamics

where ~n is the outward-pointing normal to the domain boundary. Apply these


boundary conditions instead of (1d,1e) and discretize the problem (1) using second-
order central differencing with ∆x = 10−2 in space and implicit Euler scheme with
∆t = 5 × 10−3 in time. Compute the numerical solution at t = 1. Check if the
amount of heat inside the domain is conserved.

5.4 We want to write a numerical solver for steady two-dimensional thermal diffusion
with heating

∂xx T + ∂yy T = −q on Ω (4a)


T = TD on Γ (4b)

The best way to verify the implementation is to compare the numerical result to an
exact analytical solution. Let us consider a given temperature profile

T = sin(2πx) cos(2πy) (5)

which solves the following problem

∂xx T + ∂yy T = −8π 2 sin(2πx) cos(2πy) on Ω = [0, 1] × [0, 1], (6a)


T =0 at x = 0 and x = 1, (6b)
T = sin(2πx) at y = 0 and y = 1. (6c)

Discretize the problem using second-order centered finite difference scheme. Imple-
ment the discretization in MatLab using the same grid spacing in both directions
∆x = ∆y.

You might also like