Docsity

Heat Conduction and Advection-Diffusion Equation Solutions using Finite Difference Methods, Assignments of Civil Engineering

Toggle sidebar
bg1
UNIVERSITY OF NOTRE DAME
Department of Civil Engineering
and Geological Sciences
CE 30125 November 12, 2009
J.J. Westerink Due: November 24, 2009
Homework Set # 7
Problem 1
Solve the heat conduction equation using an explicit in time, central in space finite difference discretization.
i.c.’s
b.c.’s
Diffusion is defined as a constant in space and time:
Let’s determine the temperature distribution as follows. Develop a FD discretization for the given p.d.e. at a
point in space and time, , assuming constant grids in time and space; , as follows
- Apply a forward in time approximation for the time derivative.
- Apply a central type approximation in space at the known time level for the spatial derivative.
Prepare a Matlab or Fortran code to solve this problem for the following discretizations
(a)
(b)
(c)
Select time steps for all three cases which make sense (hint: consider stability constraints). Discuss how and
why you selected the time steps. Plot and compare your solutions at the following times: t = 0, 1.0, 2.0, 4.0, 8.0,
10.0
Problem 2
We will consider a pollutant advecting and diffusing down a river that is 500 m long. Assume that the pollutant
is distributed as a Gaussian distribution with a variance equal to m and an initial location equal to
x0=100 m. We must solve the advection-diffusion equation to solve this poblem.
i.c.’s
b.c.’s
∂T
∂t
------ ∂
∂x
----- D∂T
∂x
------
⎝⎠
⎛⎞
=
0x50≤≤
Tx() 40
25
------x10+=
0x25≤≤
Tx() 70 20
25
------x–=
25 x50≤≤
T0() 10=
T50() 30=
D100=
Δt
Δx
Δx10=
Δx1.0=
Δx0.1=
σ5=
∂C
∂t
-------U∂C
∂x
-------+ D∂2C
∂x2
---------=
0x500≤≤
Cxt,() xx
0
–()
2
2σ2
×
--------------------–
⎝⎠
⎜⎟
⎛⎞
exp=
0x500≤≤
C0t,() σ
σ22Dt××+
--------------------------------------0x0
–Ut×–()
2
2σ24Dt×+×
---------------------------------------–
⎝⎠
⎜⎟
⎛⎞
exp×=
pf3

Partial preview of the text

Download Heat Conduction and Advection-Diffusion Equation Solutions using Finite Difference Methods and more Assignments Civil Engineering in PDF only on Docsity!

UNIVERSITY OF NOTRE DAME

Department of Civil Engineering

and Geological Sciences

CE 30125 November 12, 2009

J.J. Westerink Due: November 24, 2009

Homework Set # 7

Problem 1

Solve the heat conduction equation using an explicit in time, central in space finite difference discretization.

i.c.’s

b.c.’s

Diffusion is defined as a constant in space and time:

Let’s determine the temperature distribution as follows. Develop a FD discretization for the given p.d.e. at a

point in space and time, , assuming constant grids in time and space; , as follows

- Apply a forward in time approximation for the time derivative.

- Apply a central type approximation in space at the known time level for the spatial derivative.

Prepare a Matlab or Fortran code to solve this problem for the following discretizations

(a)

(b)

(c)

Select time steps for all three cases which make sense ( hint: consider stability constraints ). Discuss how and

why you selected the time steps. Plot and compare your solutions at the following times: t = 0, 1.0, 2.0, 4.0, 8.0,

Problem 2

We will consider a pollutant advecting and diffusing down a river that is 500 m long. Assume that the pollutant

is distributed as a Gaussian distribution with a variance equal to m and an initial location equal to

x 0 =100 m. We must solve the advection-diffusion equation to solve this poblem.

i.c.’s

b.c.’s

∂ T

∂ t

∂ x

----- D ∂ T

∂ x

= (^) ⎝⎛ ------⎠⎞ 0 ≤ x ≤ 50

T x ( ) 40 25

= ------ x + 10 0 ≤ x ≤ 25

T x ( ) 70

= – ------ x 25 ≤ x ≤ 50

T ( 0 ) = 10

T ( 50 ) = 30

D = 100

( i j , ) Δ t Δ x

Δ x = 10 Δ x =1. Δ x =0.

σ = 5

∂ C

∂ t

------- U

∂ C

∂ x

+ ------- D

∂^2 C

∂ x

= -------- 2 - 0 ≤ x ≤ 500

C x t ( , )

( x – x 0 ) 2

2 ×σ^2

= exp 0 ≤ x ≤ 500

C ( 0 , t ) σ σ 2

  • 2 × D × t

( 0 – x 0 – U × t ) 2

2 ×σ^2 + 4 D × t

= × exp

The exact solution to this problem is:

We want to find out what the distribution looks like after 250 seconds from the initial time. Let us solve

this problem using a second order accurate central difference approximation in space and a first order accu-

rate backward approximation in time (Implicit in time, central in space solution). We will apply the exact

solution to compute the initial and boundary conditions.

Corbitt has been kind enough to code this up for us in Matlab in HW7Implicit.m Let us explore the pure

advection case with D =0 and U =1 and compute the solution using a range of node spacings and time steps,

as suggested in the table:

(a) Solve and plot and compare to the analytical solution each of the listed cases.

(b) Compute the Courant number for each case, and comment on the behavior of these solu-

tions relative to the Courant number.

(c) Comment on the spatial resolution relative to the distribution standard deviation needed to obtain a

good solution.

(d) Comment on the stability of the solutions.

(e) Comment on the b.c.’s and how well they work.

U m/s D m^2 /s m s

C ( 500 , t ) σ σ^2 + 2 × D × t

( 500 – x 0 – U × t ) 2

2 σ 2 × + 4 D × t

= × exp

C x t ( , ) σ σ^2 + 2 × D × t

( x – x 0 – U × t )^2 2 σ 2 × + 4 D × t

= × exp 0 ≤ x ≤ 500

Δ x Δ t

U × Δ t Δ x