# Analytical Solution to Heat Equations

I have the steady state equation with an internal source as

$$\frac{1}{r^2}\frac{\partial}{\partial r}\left(r^2k\frac{\partial T}{\partial r}\right)+Q=0$$

which has the analytic solution

$$T(r)=-\frac{Qr^2}{6k}+\frac{C_1}{r}+C_2$$

where I know $$C_1$$ and $$C_2$$ based on some boundary conditions.

However, if I would like to find at what depth a particular temperature ($$T_i$$) occurs, should I go about this using a numerical approximation such as the midpoint method or I could solve analytically, recovering three different solutions for the depth:

$$r_i=\left[-C_1,\pm\sqrt{-\frac{6k(T_i-C_2-C_1)}{Q}} \right]$$

Analytical solutions are always best, so how do I know which one to use for this? Should I make sure that the temperature I am estimating the depth for falls between the boundary conditions?

The steady-state heat equation (Fourier) for a spherical geometry (with full symmetry) with internal heat generation $$Q$$ ($$\mathrm{Wm^{-3}}$$) can be written as: $$\frac{1}{r^2}[kr^2 T'(r)]'+Q=0$$

where $$T(r)$$ is the temperature in function of $$r$$ and $$k$$ is the thermal diffusivity of the material. We get: $$\frac{1}{r^2}(2kr T'+kr^2T'')+Q=0$$ $$\frac{2T'}{r}+kT''+Q=0$$ $$krT''+2kT'+Qr=0$$

This solves indeed (Wolfram alpha confirmed) to:

$$T(r)=-\frac{Qr^2}{6k}+\frac{C_1}{r}+C_2$$ where $$C_1$$ and $$C_2$$ are integration constants, to be determined by the boundary conditions (BCs).

Boundary conditions:

Firstly, look at the term $$C_1/r$$. It makes $$T(r) \to \infty$$ for $$r \to 0$$. Such a singularity can of course not be accepted and we must assume that $$C_1=0$$, a very common assumption in similar cases.

So that:

$$T(r)=-\frac{Qr^2}{6k}+C_2\tag{1}$$

Resolving $$r$$ for a give $$T(r)$$ now becomes easy:

$$r=\sqrt{\frac{6k\big(C_2-T(r)\big)}{Q}}$$

As regards the second BC, we're quite limited in our choice.

A BC containing the term $$\Big(\frac{\text{d}T}{\text{d}r}\Big)_{r=R}$$ would be related heat flowing off the boundary, $$r=R$$.

Or, assuming the sphere loses heat through convection, then with Newton's Cooling Law:

$$QV=hA[T(R)-T_e]\tag{2}$$

where $$V$$ is the volume of the sphere, $$A$$ its surface area, $$h$$ the heat transfer coefficient and $$T_e$$ the temperature of the environment. The equation relies on 'heat in = heat out'.

$$T(R)$$ can easily be extracted from $$(2)$$.

So the simplest BC is $$[R,T(R)]$$. Inserted into $$(1)$$ this will yield $$C_1$$.

Note that maintaining $$[R,T(R)]$$ means constant cooling of the boundary at $$r=R$$ is needed, because of the constant heat flux $$Q$$.