M578 - Alexiades
Lab 6
Axially Symmetric Heat Transfer - Explicit FV Code
Consider the problem (from Lab 5) describing axially symmetric heat conduction in a hollow cylinder:
Rin ≤ r ≤ Rout, 0 ≤ z ≤ Z,
with imposed temperature boundary conditions on all boundaries,
starting with a given temperature.
A problem with exact solution:
Choose diffusivity D=1 ; Rin=1, Rout=2,
Z=π ;
Initial Condition: u(r,z,0) = LOG(r)*SIN(z) ;
and Boundary Conditions:
u(Rin, z, t) = 0 , u(Rout, z, t) = EXP(-t)*LOG(2)*SIN(z) ,
u( r , 0 , t) = 0 , u( r , π , t) = 0.
1. Verify (by hand, on paper!) that
u(r,z,t) = EXP(−t)*LOG(r)*SIN(z)
is the exact solution of this (weird) problem.
2. Implement the explicit scheme (Lab 5) for imposed temperature,
and compare the numerical solution with the exact solution above,
on MMr=MMz=32 mesh, at time 0.1 and at time 1.0 , using factor=0.9 .
Calculate the max error at each of these times.
NOTE: BCs are time-dependent (as in Lab3), so time should be updated before calling FLUX.
NOTE: Z=π may create problems... code fluxes for non-uniform grid (do not use dz/2, dz, use zj−zj-1).
NOTE: Best way to set π to full precision, in any language, is Pi = 4*atan(1.d0)
3. Submit only:
============================
Max error at t = 0.1
Max error at t = 1.0
============================
your code