Week 11: Heat Equation
Contents
Week 11: Heat Equation¶
Heat diffusion equation has important applications in engineering and Earth science. Especially when it comes to studying the Earth energy balance. In this chapter, we will consider a very simple 1D thermal diffusion problem. We will also demonstrate that we can always go to higher-dimension problem using separation of variable.
History and Formula¶
The heat equation was first developed by Joseph Fourier in 1822 for the purpose of modeling how heat diffuses over a certain material. (later on, the readers will see why the solution of heat diffusion can be approached with Fourier transform.) The heat equation follows a very simple energy conservation law.
if we write it down in a mathematical form
where \(c(x)\) is the specific heat, \(\rho(x)\) is the density of the stick and \(q\) is the heat flux through the lateral (if other places are insulated) and \(Q(x,t)\) is the local heating source, which can come from molecular process (i.e., friction between atom or radiation). The equation above can be visualized as follow.
One can notice that the heat flux is proportional to the temperature difference between the stick and its neighbor, which is the key process in determining the energy redistribution. When there is no temperature gradient (and no external heat source), there is no temperature change. Our goal is to understand how the initial temperature, \(u(x,t)\), evolve as a function of \(x\) and \(t\). In some special cases, we can add convective process (advection) and radiation to the problem but we will keep it simple for now.
(144) can be rewritten as
where \(Q(x,t)\) is dropped for simplification and \(\kappa_{c}=\frac{\kappa}{c\rho}\), so-called diffusion coefficient. Again, here we use \(\kappa\) for simplicity.
Considering the solutions are bounded in a stick with \(0\leq x \leq L\). If we closely observe (145), we can find it is the combination of a 1st-order ODE in time and a 2nd-order ODE in space. Therefore, we need at least 1 initial condition and 2 boundary conditions, which usually have form of
The first two equations of (146) indicates that the temperature at both ends of the stick equals to their nearby environment. We can also use energy constraint where the temperature at both ends are not necessary the same as their environment. Therefore, the temperature difference will cause the heat radiating to its neighbor if the stick has higher temperature than its environment. This can be written as
where the \(\pm\) sign simply represents the direction of radiation. One can easily find these two kinds of boundary condition fall within the category of type I Sturm-Liouville problem. It’s also possible to have a mixed boundary condition, where
or vice versa.
Now let’s take a look of a few cases.
Example 1
First consider the problem
Using separation of variable of as what we did in previous chapter, consists of attempting a solution of the form
Substitute this into the differential equation to get
which is equivalent to
Observing the equation above, we can find the left hand side only depends on \(t\) and the right hand side only depends on \(x\). We also know that \(X(x)\) and \(T(t)\) vary independently. Therefore, only possibility exists: the ration of \(T^{'}\) and \(kT\) is a constant and so do \(X^{''}\) and \(X\). According to this, we can write down
One should notice that we can choose \(lambda\) on the right in stead. However, to satisfy the Fourier solution is space, we can only have \(-\lambda \). (readers can think about why?).
Now we have two differential equations. For the spatial structure equation,
The first equation has a solution of Fourier \(\sin\) function,
For the temporal structure equation,
This implies
Put two solutions together, we have
where
\(b_n\) is the Fourier \(\sin\) coefficients for each Fourier mode, which can be derived by projecting \(f(x)\) onto different Fourier basis
and the final solution is
From the solution above, one can find it will gradually approach 0 when \(t\rightarrow\infty\) because of \(e^{-\kappa_{c}\frac{n^2\pi^2}{L^2}t}\). This is consistent with physical intuition. Therefore, for a heat diffusion without the existence of external forcing, the solution will gradually be smoothed out.
Example 2: Diffusion on an Insulated Stick
Now considering a case where we have temperature gradient on a insulated stick. The first half has temperature of \(T\) and the second half has temperature \(0\).
Given the entire stick is insulated, we can expect that the equilibrium temperature will be \(\frac{T}{2}\) i.e., half of the heat moves from the left to the right. In addition, the insulated stick will have Fourier \(\cos\) function as solution given 0 radiation boundary condition. i.e.,
The equation above can be considered as that the environment and stick always have the same temperature which leads to 0 heat exchange between sticks and outside environment. For such condition, the solution has a form of Fourier \(\cos\) function. Therefore, the solution can be written as
To get the Fourier coefficient,
where
The solution can be written as
One can see that \(k\) only appears in \(e^{-\kappa_{c}\frac{n^2\pi^2}{L^2}t}\). If we choose a \(k\) big enough, the signal will flatten out very quickly.
From two cases above, the readers can extend to some more complicated cases such as one side has a constant temperature and the other side is radiation boundary condition. I will leave the practice to the readers.
Example 3: Nonhomogeneous Problem
Solve the following case,
where either \(T_1\) or \(T_2\) is not 0 (and \(T_1\neq T_2\)). Such case can be considered as a nonhomogeneous case. Because the temperature on both ends are different, there is always heat moving from one side to the other side. Thus, this problem is equivalent to a problem with a constant forcing. The simplest way of doing that is assuming \(u(x,t)\) has the following form
where \(\psi(x)\) can take care of the nonhomogeneous temperature of the stick and \(v(x,t)\) will to lead a homogeneous problem. i.e.,
to make the set of equation above homogeneous, we have \(\psi_{xx}(x)=0\). This implies \(\psi(x) = Ax+B\). Using the boundary condition, \(\psi(0) = B = T_1\) and \(\psi(L) = AL+T_1 = T_2\), we know \(\psi(0) = (T_2-T_1)x/L+T_1\). To solve \(v\), we can follow the same steps in example 1.
Example 4: Inclusion of Convection and other Processes
We can include convection and other processes,
We can first convert it to a form which we are familiar with
Recall that solving the 1st/2nd-order ODE, we usually guess a solution of \(e^{\alpha x+\beta t}\) to get a characteristic equation. However, it doesn’t satisfy the boundary condition where \(u(0,t) = u(L,t) = 0\). Therefore, we can use the same approach of variation of parameters and assume
which will lead to
and
The equation above implies
or
With the chosen \(\alpha\) and \(\beta\), we can reorganize the original equation to a solvable form.
Forced Solutions¶
While (145) takes heat flux as the only process for redistributing heat, we can have additional heat sources, \(F(x,t)\). Therefore, (145) is written as
It is easy to verify that separation of variables can be applied to the questions above when \(F(x,t)\) exist. However, we can do some scale analysis first… One can find that when \(F(x,t)\) is small, we can expect the solution has a form of Fourier \(\sin\) function. i.e.,
with the numbers the Fourier \(\sin\) coefficients of \(f(x)\). This suggests that, for the problem with the term of \(F(x,t)\), attempt a solution
because the spatial structure is constrained by both ends, which ensures the solution is the linear combination of Fourier \(\sin\) functions. According to (151), one can find that \(T_n(t)\) is simply the coefficients of Fourier \(\sin\) functions. i.e.,
Following similar veins, we take Fourier transform of the entire heat diffusion equation, which leads to
where
Evaluate the last integral in (153) by carrying out two integrate by parts.
substitute this result back to (153), we have
which is a solvable 1st-order ODE.
With an initial condition of
we can find the solution for \(T_n\)
and the final solution is
Solutions on a Real String¶
For certain cases, the heat diffusion does not necessarily happen on a stick or a string but instead…over an infinite domain. We first start with finite domain Fourier transform, where the solution are bounded in \([-L,L]\). Sturm-Liouville theorem tells us that the solution has a form of:
It is equivalent to
where
Here we introduce a small trick. If we let \(L\rightarrow\infty\), we will have \(\delta k = k(n+1)-k(n-1) = \frac{\pi}{L} \sim 0 \). One should notice that, infinite size of domain is equivalent to a limited size domain with infinite wave numbers. Therefore,
and
(164) is the Fourier transform of \(f(x)\) over an infinite domain.
Now we can use the Fourier transform in an infinite domain to solve the heat diffusion equation.
Example 4
Solve
Now we take Fourier transform with respect to space.
where \(\hat{u}\) is \(u\) in wave number space.
This leads to
and the solution is
\(e^{-\kappa_c k^2 t} \) is so-called diffusion kernel, which is a Gaussian function.
Then we take the inverse transform of the equation above,
One interesting fact is, the inverse Fourier transform of a Gaussian function is also a Gaussian function. (I will leave this practice to readers).
The entire solution is
Heat Diffusion on a 2D Plane¶
Thus far we have considered the heat equation in one space variable. In two space dimensions the heat equation is
Suppose that we want a temperature distribution on a square plate occupying the regions of \(0\leq x\leq L\) and \(0\leq y\leq K\). A zero environmental temperature condition is given i.e.,
also assume an initial condition,
We first attempt separation of variables in the heat equation, putting \(u(x,y,t) = X(x)Y(y)T(t)\) to get
Divide by \(XYT\) and rearrange the equation
while the left-hand-side of the equation only depends on \(X\) and right-hand-side of the equation only depends on \(T\) and \(Y\). That means both side of the equation will equal to the same constant. This is the only way that two independent equations are always equivalent.
indicating
or
Similarily, the second equation also implies
Now,
Along with the boundary conditions, we know the eigen solutions for X and Y ares
Also, the solutions for T are
Combining all three solutions together, we can have the final solution of heat diffusion on a 2D-plane. The readers can also try to think about the forced solution on a 2D-plane. What should it look like?