In this blog post, I will try to give a description of the governing equation of the laplacianFoam that solves a simple Laplace equation, e.g. for thermal diffusion in a solid.
| Governing Equation |
The heat conduction equation is given by the following equation:
\begin{align}
\frac{\partial T}{\partial t} = \alpha \nabla^2 T + \frac{q}{\rho c_p}, \tag{1} \label{eq:conductionEqn}
\end{align}
where \(T\;{\rm [ K]}\) is the temperature field, \(\rho\;{\rm [kg/m^3]}\) is the density field, \(q\;{\rm [W/m^3]}\) is the rate of energy generation per unit volume, \(\alpha = k/\rho c_p\;{\rm [m^2/s]}\) is the thermal diffusivity, \(k\;{\rm [W/(m\cdot K)]}\) is the thermal conductivity and \(c_p\;{\rm [J/(kg\cdot K)]}\) is the specific heat at constant pressure.
The laplacianFoam doesn’t consider the heat generation and the implemented equation is
\begin{align}
\frac{\partial T}{\partial t} = \alpha \nabla^2 T. \tag{2} \label{eq:laplacianFoam}
\end{align}
We can find this equation solved in laplacianFoam.C and DT specified in the constant/transportProperties file represents the thermal diffusivity \(\alpha\).
|
56 57 58 59 60 61 62 |
while (simple.correctNonOrthogonal()) { solve ( fvm::ddt(T) - fvm::laplacian(DT, T) ); } |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
FoamFile { version 2.0; format ascii; class dictionary; location "constant"; object transportProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // DT DT [0 2 -1 0 0 0 0] 4e-05; // thermal diffusivity m^2/s // ************************************************************************* // |
| Comparison with Analytical Solution |
We consider the steady state problem of source-free heat conduction in a concentric cylinder whose inner and outer walls are maintained at constant temperature of 400 K and 300 K respectively. This problem can be analytically solved and the following relation holds for the temperature distribution in the radial direction \(T(r)\):
\begin{align}
\frac{T_1 – T(r)}{T_1 – T_2} = \frac{\ln{(r/r_1)}}{\ln{(r_2/r_1)}}, \tag{3} \label{eq:cylinderT}
\end{align}
where the subscripts 1 and 2 indicate the values at the inner and outer walls respectively shown in Figure 1.

The temperature distribution obtained using laplacianFoam is shown in Figure 2 and the comparison between the numerical and analytical solutions is shown in Figure 3. The agreement with the analytical solution is good.


| Introduction of Source Term |
In the next post, I’ll deal with a simple customization in order to introduce the heat generation source term into laplacianFoam using the fvOptions functionality (scalarSemiImplicitSource).





Thank you.