# Finite Element Method (FEM)

The finite element approach is based on the discretization of the domain into a set of finite elements, which are usually triangles or quadrilaterals in a two dimensions and tetrahedral, hexahedra, pyramids or wedges in three dimensions, and using variational principles to solve the problem by minimizing an associated error function or residual.

The unknown variables are approximated over the domain using interpolation procedure in terms of nodal values and set of known functions called shape functions. This approximation is substituted into the governing (conservation) equations in their differential form and the resulting error (residual) is minimized in an average sense using a weighted residual approach.

The variational or weighted residual formulations transforms the governing equations into an integral form called the global weak form. The weak form when applied to each finite element results in a set of discrete equations in terms of the nodal unknown which can then be solved by a number of methods.

In this formulation the governing differential equation for a quantity $\phi$ is expressed as: (1)
$L\left(\phi \right)=\frac{\partial \phi }{\partial t}+\frac{\partial }{\partial {x}_{j}}\left({f}_{j}-{f}_{j}^{d}\right)-s=0$
where
• $L$ is a differential operator with its associated initial and boundary conditions.
• ${f}_{j}=f\left({u}_{j},\phi \right)$ is the convective flux vector.
• ${f}_{j}^{d}=f\left(ϵ\frac{\partial \phi }{\partial {x}_{j}}\right)$ is the diffusive flux vector.
• $s$ is the contribution due to a source.
An approximate solution $\overline{\phi }$ of the above equation is assumed, having the form: (2)
$\phi \left(x\right)\approx \overline{\phi }\left(x\right)=\sum _{i}{N}_{i}{\phi }_{i}\left(x\right)$
where
• ${N}_{i}$ is the prescribed shape (interpolation) function.
• ${\phi }_{i}$ is the unknown value of the variable $\phi$ at a discrete spatial point $i$ .

Finite element method requires transformation of the governing differential equation into an integral equation over the domain. This is accomplished through approaches such as weighted residual formulation and least squares formulation.

Overall, the finite element approach contains the following steps.

A few of the approaches used to convert the differential equations into their weak integral forms are discussed below.

## Weighted Residual Formulation

Substitution of the approximated form into the governing equations results in an error or residual function denoted by $R$ and expressed as: (3)
In order to determine the nodal values ${\phi }_{i}$ , the inner product of the residual with a prescribed weighted function ${w}_{i}$ is set to zero (4)
The above equation is called the strong form of the weighted residual method. In many cases it is possible to perform integration by parts and obtain the weak form of the equation which contains lower order derivatives than the ones occurring in $L$ and has reduced continuity requirement for the weighted function. The weak form is expressed as: (5)

where $A$ , $B$ and $C$ are the differential operators with lower order derivatives than $L$ and $\text{Ω}$ represents the domain and $\Gamma$ the boundary of the domain.

Different solution methods are obtained based on the choice of the weight function. Some of these approaches are:
• Point Collocation: ${w}_{i}\left(x\right)=\delta \left(x,{x}_{i}\right)$ where $\delta$ is the Dirac-Delta function. This is analogous to the finite difference approach.
• Subdomain Collocation: ${w}_{i}\left(x\right)=1$ for the ${i}^{th}$ subdomain (element) and zero elsewhere. This leads to a finite volume formulation.
• Galerkin method: ${w}_{i}\left(x\right)={N}_{i}\left(x\right)$ where $N$ is a shape function assumed over an element.
• Petrov Galerkin method: ${w}_{i}\left(x\right)\ne {N}_{i}\left(x\right)$ . This represents a generalization of all methods except the Galerkin method.

## Least Squares Formulation

The least square approach is based on minimizing the residual function in a least square sense. A least square function is constructed by taking the inner product of residual function with itself and defined as: (6)
Using variational principles leads to a least square weak form written as: (7)

## Galerkin Least Squares Formulation

Galerkin least square approach is an extension of the Galerkin weighted residual method and the least square approach. It uses stabilizing terms obtained by minimizing the residual of the governing equation. The use of variational principles on the resulting equations results in the following formulation: (8)
$L\left({\phi }_{i}\right),{w}_{i}+{S}^{GLS}=L\left({\phi }_{i}\right),{w}_{i}+\sum _{k}L\left({\phi }_{i}\right),{\tau }_{k}L{\left({w}_{i}\right)}_{k}=0$
where
• $L\left({\phi }_{i}\right),{w}_{i}$ represents the Galerkin approximation.
• ${S}^{GLS}$ represents the least squares stabilization.
• $〈,〉$ represents the inner dot product of the comma separated terms.
• ${\tau }_{k}$ represents the stabilization parameter.