Review of the lectures
To prepare the quiz, student must know the following skills (including understanding and
memorizing all the formula).
1. Being able to use Euler method to solve differential equations (need to understand and
memorize formula). Being able to use Runge-Kutta method to solve equations (formula of
this method will be given).
2. Converting partial differential equations (diffusion equation, convection-diffusion equation
and convection equations) into Finite Difference Method (FDM) formula.
3. Converting partial different operator (partial derivatives) into finite difference formula.
Solving the equation by hand using a calculator for a couple of computational time steps.
4. Determining the stability condition for diffusion equation, convection-diffusion equation,
first-order upwind scheme of convection equation.
5. All the formula listed in this document will not be given in the quiz. You need to memorize
them.
Euler method formula.
dx
f x, t
dt
x t x 0 t f 0 t t
x 2 t x1t f 1t t
x ( n 1) t x nt f nt t
One dimensional equations:
1. Diffusion equation
T 2T t 1
2 , stability criterion for the FTCS is:
t x x 2 2
2. Convection-diffusion equation:
T T 2T ௨௱௧ ఈ௱௧ t 1
u 2 , The stability criteria for the FTCS scheme is: 1 and
t x x ଶ௱௫ ௱௫ మ x 2
2
(must satisfy both conditions).
3. Pure convection equation
T T
u , FTCS scheme is unconditionally unstable.
t x
First order upwind scheme stability condition is CFL condition.
4. Courant-Friedrichs-Lowy condition (CFL condition):
ut
1.
x
5. Courant number C is defined as
ut
C 1
x
Formula for converting partial differential operator (or partial derivatives) into finite difference
formula
Central space formula (explicit)
n
2T Ti n1 2Ti n Ti n1
x 2 i
x 2
n
T Tin1 Tin1
x i 2x
n
T Ti n 1 Ti n
t i t
Upwind formula for convection term:
n
T Ti n Ti 1
n
, if u>0
x i x
n
T T n T n
i 1 i , if u<0
x i x
Two dimensional equations:
Being able to convert two-dimensional equations into FDM formula.
CFL condition for two-dimensional problems.
Note
(1) This is only examples to let you know the style and format of the
questions in the quiz. The quiz questions must be different from the
questions given in this document.
(2) These examples are related to first three lectures only. The quiz
will cover all the contents in this unit.
Mock-Up Quiz Paper
Multiple choice questions
Note: you cannot make any mistakes in the calculation to get correct answers of multiple choice
questions.
1. The heat transfer follows the one-dimensional convection-diffusion equation:
T T 2T
u 2
t x x
The velocity u=0.1 m/s and the diffusion coefficient is 0.01 m2/s. If the above equation is to be
solved by Forward Time Central Space (FTCS) finite difference method (FDM) with grid size of
Δx=0.1 m, what is the stability condition for the time step is: Δt<0.5 s .
2. A two-dimensional convection diffusion equation is to be solved by the FDM method. The
convection velocities in the x- and y-directions are u=0.1 m/s and v=0.2 m/s, respectively. The
computational grid size in the x- and y-directions are Δx=0.01 m and Δy=0.005 m, respectively.
To ensure the CFL condition, what is the stability condition for the time step is: Δt<0.025 s .
(a) Δt<0.025 s; (b) Δt<0.1 s; (c) Δt<0.3 s; (d) Δt<0.4 s; (e) Δt<0.5 s; (f) Δt<0.6 s; (g) none of the
above.
3. The flow velocity (represented by x) follows the following function of time:
dx
a1 a2 cos(2t / T )
dt
where a1 = 0.1 m/s2, a2 = 0.2 m/s2 and T=12 s.
The above equation is solved by Fourth-order Runge-Kutta method with Δt=0.1 s. If the velocity
at t=2Δt is 0.1 m/s, the velocity at t=3Δt is (a) .
(a) 0.1298 m/s; (b) 0.23 m/s; (c) 0.15 m/s; (d) 0.5 m/s; (e) none of the above.
Fourth-order Runge-Kutta method:
t
x ( n 1) t x nt k1 2k2 2k3 k4 (3)
6
where
k1 f (nt , x nt )
k2 f ((n 1 / 2)t , x nt k1t / 2)
k3 f ((n 1 / 2)t , x nt k2 t / 2)
k4 f ((n 1)t , x nt k3t )
4. Which of the following numerical method is unconditionally unstable? The answer is (c) .
(a) FTCS of diffusion equation; (b) FTCS of convection-diffusion equation; (c) FTCS of
convection equation; (d) Upwind scheme of convection equation; (e) explicit scheme of
convection-diffusion equation.
Problem solving
Question - 1
1. Problem definition
The carbon monoxide (CO) is the hazardous gas in the smoke that threats people’s health and lives.
The density of CO in the air is commonly quantified by ppm (parts per million). In this case, ppm is
defined as the mass ratio of mg/kg. 1 ppm means that there is 1mg CO in 1kg air.
Assuming there is a 20-m long straight corridor in a building. CO is generated due to a fire at one
end of the corridor. The released CO will travel towards the other end by diffusion (assume the air is
still). Assuming the density of CO at the left end is a constant of 10,000 ppm.
Assuming the CO only moves in the longitudinal direction of the corridor, this is a one-dimensional
(1D) diffusion problem. The governing equation for 1D diffusion is
c 2c
2 (1)
t x
where c is the concentration of the CO in mg/kg.
Assume, initially there no CO in the air in the corridor. The parameters are listed below
Parameters Value
Diffusion coefficient α=2×10-4 m2/s
CO concentration at the left end (constant) 10000 ppm
Corridor length 20 m
Questions
1. Write the initial condition and the boundary condition for this problem.
2. Write the finite difference formula for simulating the CO diffusion in the corridor.
3. Divide the corridor into 5 grids (grid size Δx=4 m), and choose time step Δt=1000 s, find out the
concentration of the CO at all the nodes at 2000 seconds.
Question - 2
The water on the ground flows into the soil through the pore space of the soil (the space between soil
particles). The flow velocity is very small of 0.0005 m/s and it does not change along the vertical
direction. Initially, the temperature is 10°C in the whole soil (including soil and the water in the soil).
Then, the temperature of the water on top of the ground level becomes 30°C and remains to be 30°C.
Develop a finite difference method formula to simulate the temperature evolution of the water in the
pore space of the soil layer with a thickness of 2 m.
Ground level
i=1
2 m Water flow
Soil
x i=6
A coordinate x is defined with its origin on the ground level and pointing downwards. The governing
equation is the convection diffusion equation
T T 2T
u 2
t x x
where
T is the temperature
t is the time
u is the water flow velocity
α=0.0001 m2/s is the heat diffusion coefficient (the influence of the soil has been considered).
Questions:
1. Write the initial conditions and boundary conditions of the problem.
2. Derive the finite difference formulae for solving the problem.
3. Choose Δx=0.4 m and Δt=50 s, find out the temperature at all the nodes at t=100 s.
Question - 3
The trajectory of a basketball thrown in the air
A basketball was thrown into the windy air at an initial shooting angle β as shown in the figure. The
ball is initially 2 m above the ground. A coordinate system is defined with its x-axis located on the
ground level (see the figure below).
y Wind speed
V0
basketball
β
xe
Y0
O Ground level x
Questions
1. Considering the forces from the air, the weight and the buoyancy force, find out the differential
equations for calculating the displacements of the ball in both the x- and y-direction.
2. Develop an Euler numerical method formulae and computer program to predict the basketball’s
trajectory and horizontal travel distance.
3. The time step is 0.1 s, find the velocity at the third step (you need to do two steps of calculation).
Parameter Symbol Value
Gravitational acceleration g 9.81 m/s2
Diameter of the sphere D 0.24 m
Mass of the sphere m 0.625 kg
Density of the fluid ρ 1.2 kg/m3
Initial vertical position of the ball Y0 2m
Initial velocity of the ball V0 20 m/s
Shooting angle β 45°
Wind speed Uwind 2 m/s
Drag coefficient CD 1.2
Answer booklet
Multiple Choice questions
Please choose the correct answers. The answers have been given in the
question.
Problem solving questions
Solution of Question ‐1
Solution of Question 2
Solution of Question‐3
Initial conditions at t=0 (the first step)
X 0 and Y Y0
V x V0 cos( ) and V y V0 sin( )
The velocities of the ball relative to the air are:
x direction : Vrx Vx U wind
y direction : Vry Vy
Vr Vrx2 Vry2
A is the projected area.
The forces experienced by the ball include:
x-direction
1
o FDx CD AVrVrx is the drag force from the air in the x-direction
2
y-direction
1
o FDy CD AVrVry is the drag force from the air in the y-direction
2
o W mg is the weight of the ball
o FB m d g is the buoyancy force