# Introduction

I showed in Chapter 5 of the FEM fundamentals how to obtain the weak form from the strong form. The integration by parts was necessary!

In 2D or 3D, a similar integration type needs to be used. For this purpose we will make use of the **Green-Gauss theorem**, which is based on the **Gauss divergence theorem**.

Before talking about these theorems, we discuss the concept of the **gradient**.

# The Gradient

The term gradient has different meanings in mathematics. One of the most common associations with gradient is the slope.

The gradient as I will explain it, is often denoted by the symbol \nabla (â€śNablaâ€ť) and is often applied to a real function of three variables f(x_1,x_2,x_3) and can also be written as:

Consider a two-dimensional quantity \phi which is dependent from two variables (x,y), i.e. \phi = \phi(x,y). If we want to know how \phi varies over the region in which its variables x and y are defined, we use the chain rule and get:

The meaning of expression (1) is illustrated in the following graphic:

We will now introduce the column matrices \nabla \phi and d\mathbf{x}:

From the figure above d\mathbf{x} appears to be a vector with the components dx and dy. We can consider the same for the column matrix \nabla \phi with the components \partial\phi/\partial x and \partial\phi/\partial y in the x- and y-directions. The vector \nabla\phi is called the **gradient** of \phi. With the two column matrices above, expression (1) can be written as:

where d\phi is the **scalar product** of \nabla\phi and d\mathbf{x}.

In general the scalar product is given as:

where |\nabla\phi| and |d\mathbf{x}| are the lengths of the corresponding vectors and \theta is the angle between those two vectors.

**Contour curves** can be identified along which our quantity \phi remains constant, as \phi = \phi(x,y). We can achieve this if we set \phi(x,y) = C, where C is a constant. It follows that this expression provides us with a relation between x and y and describes a so called **contour curve**:

If we move along the contour curves, \phi is constant and we can assume that there is a vector d\mathbf{x} which is directed tangentially to this curve:

As \phi is constant along the curve we can conclude from equation (3) that:

which can only be fulfilled if cos\theta = 0. That means that the two vectors are orthogonal. Since d\mathbf{x} is orthogonal to the contour curve, we also know that the gradient \nabla\phi is orthogonal to the contour curve.

Another interesting question is in which direction \nabla\phi is showing. For this purpose we shall look at two infinitely close contour curves:

If we move from point P_1 to P_2 along d\mathbf{x} we can see that \phi is larger at the second point (P_2) than in P_1. With expression (3) we can conclude that the expression has to be larger than 0:

This is only true if the cos\theta > 0, which means that \nabla\phi is directed in the direction of increasing values of \phi as indicated in the picture above.

We can also conclude from equaton (3) that the largest increase of \phi only is possible when d\mathbf{x} is in the direction of the gradient itself.

Expression (3) can be rewritten in a more convenient way. The length of d\mathbf{x} can be substitude by dm:

We can then define a unit vector **m** in the direction of d\mathbf{x}. Splitting the components of **m** in m_x and m_y we get:

If we now divide expression (3) by dm and use the equation (5), it follows that:

We can observe that the fraction d\phi/dm is the **slope** of \phi in the direction of the derived unit vector **m**:

The whole derivation of the gradient can also be done for three dimensions \phi = \phi(x,y,z). The gradient \nabla\phi and d\mathbf{x} are given by:

and the unit vector **m**:

# Gaussâ€™ divergence & Green-Gauss theorem

Mathematical proofs of the now heurisitc derived theorems can be found in *Kaplan(1981)*, *Kreysig(1979)* and *Sokolnikoff and Redheffer (1958)*.

For the function \phi = \phi(x,y) defined over the area **A** (shown in the illustration below), consider an area integral

In the picture, points C and D indicate the maximum and minimum y-values. These two points divide the region into two curves x=x_1(y) & x=x_2(y).

Evaluating the integral given in expression (7), we get:

Expression (8) can be rewritten in a reduced manner since the first term on the right-hand side of the last line is the integral of the curve along the boundary x=x_2(y) and the second term on the right-hand side is the integral of the curve along the boundary x=x_1(y), both in couter-clockwise direction.

Formula (9) can be rewritten by using an **incremental arc length** d\mathcal{L} along the boundary. For this purpose consider the following image:

The normal vector **n** can be written as a column vector with **n_x** and a **n_y** component. Its length is given by:

The incremental vector d\mathcal{L} is given by:

According to the illustration above, the angle \theta can be identified two times. The first time in the triangle EFG and the second time in the triangle ECD:

Putting in the lengths:

where CE = |dx| = -dx

Using equation (9) and (12) we get:

The same goes with an arbitrary function \psi:

We introduce another arbitrary component, the so called vector \mathbf{q}:

Adding (13) & (14) with the use of (15), we obtain:

where div \ \mathbf{q} is the **divergence** of \mathbf{q} defined by

Considering a vector \phi\mathbf{q} instead of \mathbf{q} where \phi is a scalar, we now use expression (17):

Using the **definition of the gradient** \nabla \phi we get:

Inserting \phi \mathbf{q} instead of \mathbf{q} into (16) and use (19), we get the **Green-Gauss theorem**:

This **Green-Gauss theorem** can be seen as the 2D counterpart for integration by parts.

There are some different notations for this theorem. If the arbitrary vector \mathbf{q} is chosen so that q_x = \psi and q_y = 0 the equation becomes:

If \mathbf{q} is chosen in a manner so that q_x = 0 and q_y = \psi

The whole procedure also works for 3D!

Gaussâ€™ divergence then reads:

where we now integrate the div(\mathbf{q}) over a volume V and the quantity \mathbf{q}^T\mathbf{n} is integrated over the surface. The final form looks like this:

**Hints:**

In CFD this Gauss theorem is used to get the basic FVM formulation from a flux integral.

**Note:** Transforming the volume to a surface integral brings you back to the form used for the derivation of the Navierâ€“Stokes equations.

Applications of the mathematical derived theorems and how they are used in CFD (Open$\nabla$FOAM):

Click \rightarrow NUMERICAL SCHEMES

Sources:

â€˘ Introduction to the Finite Element Method - Niels Ottosen & Hans Petersson

â€˘ Gradient - Wikipedia

â€˘ Gradient -- from Wolfram MathWorld

â€˘ Divergence theorem - Wikipedia

â€˘ Green's theorem - Wikipedia

Pictures:

Created with PowerPoint2016

Errata:

If you find mistakes, please do not hesitate to contact me.