]>
HeatConduction
Code verification using the Method of Manufactured Solutions.
This problem and its solution in `COMSOL Multiphysics <https://www.comsol.com>`_ software
is described in the COMSOL blog:
`Verify Simulations with the Method of Manufactured Solutions (2015)
<https://www.comsol.com/blogs/verify-simulations-with-the-method-of-manufactured-solutions>`_.
Here, a 1D transient heat conduction problem in a bar of length L is solved using the FE method:
.. code-block:: none
dT/dt - k/(rho*cp) * d2T/dx2 = 0, x in [0,L]
with the following boundary:
.. code-block:: none
T(0,t) = 500 K
T(L,t) = 500 K
and initial conditions:
.. code-block:: none
T(x,0) = 500 K
The manufactured solution is given by function u(x):
.. code-block:: none
u(x) = 500 + (x/L) * (x/L - 1) * (t/tau)
The new source term is:
.. code-block:: none
g(x) = du/dt - k/(rho*cp) * d2u/dx2
The terms in the source g term are:
.. code-block:: none
du_dt = (x/L) * (x/L - 1) * (1/tau)
d2u_dx2 = (2/(L**2)) * (t/tau)
Finally, the original problem with the new source term is:
.. code-block:: none
dT/dt - k/(rho*cp) * d2T/dx2 = g(x), x in [0,L]
The mesh is linear (a bar) with a length of 100 m:
.. image:: _static/bar(0,100)-20.png
:width: 500 px
The comparison plots for the coarse mesh and linear elements:
.. image:: _static/tutorial_cv_5-results-5_elements-I_order.png
:width: 400 px
The comparison plots for the coarse mesh and quadratic elements:
.. image:: _static/tutorial_cv_5-results-5_elements-II_order.png
:width: 400 px
The comparison plots for the fine mesh and linear elements:
.. image:: _static/tutorial_cv_5-results-20_elements-I_order.png
:width: 400 px
The comparison plots for the fine mesh and quadratic elements:
.. image:: _static/tutorial_cv_5-results-20_elements-II_order.png
:width: 400 px
$\mathit{HeatConduction}$