This example solves the weak form of the following diffusion equation with a source term,
using the Galerkin Finite Element method. , and are the positive definite and symmetric rank two conductivity tensor, a scalar parameter (e.g. thermal capacity) and a function of the dependent variable (linear in this example) respectively. The dependent variable is a spatially varying scalar field (e.g. temperature). In this example an isotropic and homogeneous material with (identity tensor) and is considered.
The function or source term takes the following linear form.
In general, parameters and are functions of the independent variable , but since the material is homogeneous (no spatially varying physical properties), they remain unchanged throughout the domain.
Note that boundary conditions are prescribed to match those required for the analytical solution.
The fortran version of the example can be configured and built with CMake:
git clone https://github.com/OpenCMISS-Examples/diffusion_equation_with_linear_source mkdir diffusion_equation_with_linear_source-build cd diffusion_equation_with_linear_source-build cmake -DOpenCMISSLibs_DIR=/path/to/opencmisslib/install ../diffusion_equation_with_linear_source make
This will create the example executable "diffusion_equation_with_linear_source" in ./src/fortran/ directory.
Fortran version:
cd ./src/fortran/ ./diffusion_equation_with_linear_source
Results can be visualised by running visualise.cmgui with the Cmgui visualiser.
The following figure shows the three-dimensional finite element mesh (computational domain), solution of the primary variable, and source term, .
Figure 1. (a) Finite element mesh (b) Primary variable solution (c) Source
The expected results from this example are available in expected_results folder.
There are no additional input files required for this example as it is self-contained.
License applicable to this example is described in LICENSE.