practical5_assessed
practical5_assessed
The goal of this practical is to write your first piece of code to solve a geophysically relevant
case of the heat equation using finite di↵erences.
What is required: Answer all the questions, and produce a document containing your an-
swers and the plots as requested. DO NOT COPY YOUR CODE into the final document, but
attach all your .m files with your submission.
1
Here we would like to compute the evolution of temperature across a cooling dyke as a
function of time. The governing equation for the temperature T is
@T @2T
=↵ 2, (1)
@t @x
where t is the time, ↵ is the thermal di↵usivity of the rock, and x is the distance across the dyke
(x = 0 at the center).
We assume the following initial condition:
where w is the width of the dyke and Td its peak center temperature. The boundary conditions
are a constant temperature far from the dyke T (x = L, t) = T0 (where L w), and zero flux
at the center of the dyke @T /@x = 0 at x = 0.
Question 1. What will the solution T (x, t) look like? Use an annotated sketch of the solution
for temperature T as a function of position x at t = 0, and a few additionnal time steps. [10%]
Question 2. Discretise the space coordinate x and the time t, and write a finite di↵erence
numerical scheme for Equation 1 and its boundary conditions. [10%]
Question 3. How do you choose the time and space steps ? Justify. [15%]
Question 4. Write a Matlab code that solves the problem for t = 0 to tfinal = 100 days, using
the following parameter values: [15%]
↵ = 1 mm2 /s
L = 20 m
T0 = 0 C
Td = 1000 C
w = 20 cm.
Question 5. Plot the evolution of temperature as a function of space and time. (try a range
of Matlab functions, like pcolor, contour, or use regular plot commands, and produce one or
two clear figures. Think about the (ink)/(information) ratio !). [15%]
Question 6. Write a Matlab code to extract and plot the maximum temperature reached at
every point x throughout cooling. [10%]
Question 7. At which position x10% is the temperature perturbation less than 0.1Td ? Does
that depend on Td ? [10%]
Question 8. Repeat the calculation and the plot of question 5 for a range of w and ↵. How
does the position x10% scales wth w and ↵? [Hint: this is where nondimensional quantities can
be useful!] [15%]