08 solution heat equation explicit
TRANSCRIPT
-
8/6/2019 08 Solution Heat Equation Explicit
1/3
Heat EquationSolution sheet6. week
8 Heat Equation - Explicit
Aim of this exercise is the numerical solution of the heat equation (seeexercise 7) in explicit form.
a) Simplify the heat equation from exercise 7 to the one dimensional case.
Solution:t k
2x = 0 k > 0
b) Discretize the time derivative operator as usual (Euler-method).
Solution:
(x)n+1 = (x)n + t k 2x(x)
c) Discretize the spatial derivative in explicit form. The second derivativeis discretized in two steps:
First discretize the outer derivative as the divergence of theflux. The resulting scalar quantity is therefore stored at the cellcenter.
Secondly discretize the inner spatial derivative x at cell i.The result is assumed to be the above mentioned flux (in 3D thegradient is indeed a vector quantity) and should therefore bestored at the cell interfaces (staggered mesh).
Solution:
The outer derivative of F(x) = x yields to
(xF(x))i Fi+1/2 Fi1/2
x
The inner derivative yields to
Fi1/2 = (x)i1/2 i i1
x
1
-
8/6/2019 08 Solution Heat Equation Explicit
2/3
Combining these
2x(x) = x(x)
Fi+1/2 Fi1/2
x
(i+1 i) (i i1)
x2
=i+1 2i + i1
x2
The discretized heat equation in explicit form is
n+1i = ni + t kn
i+1 2n
i+ n
i1x2
d) Every explicit method yields to an upper limit of the timestep tmax.Derive this upper limit analytically (and test your result later on).
Solution:
The CFL condition leads to tmax = minxi|vi|
. In this particular
case the grid spacing x is constant in time and space and the velocityis given by the diffusion velocity:
F = vdiff = k
vdiff = kx(x)
(x)
The resulting upper limit for the timestep is
tmax = min
(x)x
k|x(x)|
e) Solve the explicit form of the heat equation numerically:
Use 100 grid points, x = 1.
Initial condition (for the density distribution) should be a simpleparabolic function (ax2 + b) with (x = xmin, t = 0) = 1 and
(x = xmax, t = 0) = 0.
The boundary of the domain is assumed to be an empty reservoirwith infinite capacity (x = ghost, t) = 0.
2
-
8/6/2019 08 Solution Heat Equation Explicit
3/3
Determine the upper limit of the timestep for this specific problem.
Solution:
With x(x) (x)x the upper limit of the timestep for this specific
problem is given by
tmax = min
(x)x2
k|(x)|
The highest jump in density is given at the left border. The density atthis innermost interface is 1/2 = 0.5(ghost + 1) = 0.5 and the jumpin density 1/2 = 1 ghost = 1. Therefore this scheme is unstable
for t > 0.5x2
k .Download the corresponding Mathematica file.
3