# 3.4.9. Element Topology and Shape Functions

The standard mesh configuration for cell-centered CVFEM’s is to co-locate all flow variables at the nodes, also called grid points. The nodes are the vertices of the finite-elements, as shown in Figure 3.28. The finite-volumes, also called control volumes, are centered about the nodes. Each element contains a set of sub-faces that define control-volumes. The sub-faces consist of the segments or surfaces that bisect the element faces. For example, each control volume on an orthogonal mesh of rectangular elements is defined by four neighboring elements with contributions from the nine nodal values.

Interpolation functions are formed inside each element. In standard finite element methods, the interpolation functions are called shape functions and they are used to evaluate the integral quadratures. The same bilinear or trilinear shape functions are used in CVFEM to construct fluxes at the sub-faces. Finite-element basis functions are used as interpolation functions to integrate fluxes over control volume faces which are internal to an element. The control-volume flux interpolation functions are element based; a restriction by choice, motivated by code development considerations. In an element-based scheme, only information that defines an element may be used to assemble fluxes. Nodal information outside the element cannot be used. As a result, the global spatial accuracy is restricted to second order.

Isoparametric shape functions are used for quadrilateral and hexahedral elements. The geometry of an isoparametric element is approximated with the same shape function as the solution variables so that the bilinear/trilinear variation within remains independent of orientation. Triangular and tetrahedral elements do not require an isoparametric formulation because they are linear. The triangles and tetrahedra can be made to look like isoparametric elements in order to create a general element evaluation algorithm.

## 3.4.9.1. Quadrilateral Elements

The quadrilateral element has four nodes and four control volume faces. The element configuration is shown in Figure 3.33. The parametric variables are and , and they are coincident with the faces of the control volumes. The control volume faces are formed by the straight line segments the connect the bisection points of opposing element edges. The parametric variables have the range and .

Geometric information inside the element is interpolated from the nodal coordinates. Derivatives of the physical coordinates are the most fundamental geometric quantity, contributing to the surface areas and gradients.

(3.1124)

(3.1125)

(3.1126)

(3.1127)

(3.1128)

(3.1129)

The subscripts on the shape functions correspond to the element-local node numbering. The isoparametric shape functions and shape function derivatives for quadrilateral elements are given in Table 3.22.

Fig. 3.33 Quadrilateral element topology and numbering

Table 3.22 Nodal shape functions and derivatives for quadrilateral elements
node |  | } |
--- | --- | --- | ---

The physical surface differentials are related to differentials in parametric space. The surface area differentials, are derived from their three-dimensional counterpart, (3.1133), where , , and . The derivatives used in the mapping from a differential in parametric space to a differential in physical space are evaluated using (3.1126) and (3.1128). The differential surfaces of a control-volume sub-face are surfaces of constant or . Along Face 1 and 3, the differential . Along Face 2 and 4, the differential . For the purposes of constructing a general-purpose computational flux algorithm, integration over both parametric components is retained. On each face, only one surface area component will be non-zero.

(3.1130)

The usefulness of the general approach will become more apparent when triangular elements are considered.

The normals to the control-volume surfaces are positive in the direction of positive coordinate axes. The normal to a -constant face is along the positive -axis. The normal to a -constant face is along the positive -axis. The signs on the differentials are selected such that the fluxes have the proper signs relative to the control volume. The values of the element variables and the surface differentials at the control-volume faces are given in Table 3.23. The differential is negative for Face 3 because the direction for out/in flow from Node 3 to Node 4 is opposite in direction of the surface normal defined by .

Table 3.23 Element variable values and differentials at control-volume faces for quadrilateral elements. Face-to-edge number mapping.
face | Edge ( ) |  |  |  |
--- | --- | --- | --- | --- | ---

Volume integrals require the volume differential, . In terms of the element parameters, the volume differential is

(3.1131)

where

(3.1132)

The quadrature points and differential values are shown in Table 3.24.

Table 3.24 Element variable values and differentials at sub-control volume centers for quadrilateral elements.
sub-volume |  |  |
--- | --- | --- | ---

## 3.4.9.2. Triangular Elements

The triangular element has three nodes and three control volume faces. The element configuration is shown in Figure 3.34. The control volume faces run from the centroid of the element to the element edge bisection points.

Fig. 3.34 Triangular element topology and numbering

The parametric coordinate system is defined by the triangle natural coordinates, , and , since a Cartesian mapping cannot be defined. The natural coordinates are the shape functions. As an example, the value of at an interpolation point is the shape function associated with Node 1. The value of is the fraction of the element triangle area covered by a sub-triangle, formed by the interpolation point and the edge opposite of Node 1, shown in Figure 3.35. For consistency with the quadrilateral element notation, the parametric variables are defined as and , where is defined by the fact that the natural coordinates always sum to one.

The linear shape functions and shape function derivatives for triangular elements are given in Table 3.25.

Fig. 3.35 Triangular natural coordinate system, shaded area corresponds to opposite node.

Table 3.25 Nodal shape functions and derivatives for triangular elements.
node |  | } |
--- | --- | --- | ---

The surface integrals are tricky because there is no surface that lays on a line of constant or . Along Face 1, and . Along Face 2, and . Along Face 3, and . The integrations are taken from the centroid to the element edges.

The values of the element variables and the surface differentials at the control-volume faces are given in Table 3.26.

Table 3.26 Element variable values and differentials at control-volume faces for triangular elements
face | Edge ( ) |  |  |  |
--- | --- | --- | --- | --- | ---

The form of the volume differentials are the same as with the quadrilateral elements. For volume integrals, quadrature points and differential values are shown in Table 3.27.

Table 3.27 Element variable values and differentials at sub-control volume centers for triangular elements.
sub-volume |  |  |
--- | --- | --- | ---

## 3.4.9.3. Hexahedral Elements

For hexahedral elements, there are eight nodes and twelve subfaces defining control volumes, shown in Figure 3.36. The shape functions are trilinear functions of the element variables, , , and . The shape functions and derivatives at each node are given in Table 3.28.

Fig. 3.36 Hexahedral element topology and numbering

Table 3.28 Nodal shape functions and derivatives for hexahedral elements. Range is (-1,1).
node |  |  |  |
--- | --- | --- | --- | ---

The control volume sub-face numbering, shown in Table 3.29, follows the convention that the face has the same number as the element edge that connects the nodes that define the two adjacent sub-control volumes.

The surface integrals require the vector of differential surface area components, , which is equivalent to the differential surface area multiplied by the unit surface normal vector . Since the control volume surfaces are constructed using four points within an element, it is noted that assuming the surfaces are planar results in an error. Sometimes this error is deemed acceptable, and a faster algorithm is used to compute the surface area and volume. However, when strict conservation is required, an exact algorithm using a polyhedral decomposition is employed to compute the exact volume and surface area. These are detailed below.

### 3.4.9.3.1. Volume and Area Calculation Assuming Planar Surfaces

The differential surface area, , is calculated in parametric space by taking the cross-product of two differential surface-tangent vectors. Let the surface be described by the collection of points . For example, a tangent vector in the -direction is . The normal surface area component for all three possible surface parameterizations is

(3.1133)

where is the alternating unit tensor and defines the cross product.

(3.1134)

Using a shortened notation,

(3.1135)

(3.1136)

(3.1137)

where the Jacobian notation is defined by

(3.1138)

The values of the element variables and the surface differentials at the control-volume faces are given in Table 3.29.

Volume integrals require the volume differential, . In terms of the element parameters, the volume differential is

(3.1139)

where

(3.1140)

(3.1141)

(3.1142)

The quadrature points and differential values are shown in Table 3.30.

Table 3.29 Element variable values and differentials at control-volume faces for hexahedral elements. Face-to-edge number mapping.
face | Edge ( ) |  |  |  |  |  |
--- | --- | --- | --- | --- | --- | --- | ---

Table 3.30 Element variable values and differentials at sub-control volume centers for hexahedral elements.
sub-volume |  |  |  |
--- | --- | --- | --- | ---
|  |  |  | 1
|  |  |  | 1
|  |  |  | 1
|  |  |  | 1
|  |  |  | 1
|  |  |  | 1
|  |  |  | 1
|  |  |  | 1

### 3.4.9.3.2. Exact Volume and Surface Area Calculation

When the planar surface assumption for the control volumes is insufficient, the volume and surface areas can be calculated exactly. To accomplish this, a set of subcontrol points is constructed that defines the subcontrol surfaces. The locations and numbering of these subcontrol points are shown in Figure 3.37. The coordinates of the edge points are the average of the two adjacent vertices, the coordinates of the facial points are the average of the four vertices defining the face, and the coordinates of the interior point is the average of the eight vertices defining the volume.

Fig. 3.37 Hexahedron subcontrol points numbering

The 12 subcontrol surfaces for the Hexahedron are the defined using points in counterclockwise ordering as shown in Table 3.31. These surfaces are further broken down into four triangles defined by the four points on the surface and a simply averaged midpoint. The four triangles are defined by points , , , and , respectively. The area vectors of each triangle are summed to calculate the total surface area vector. Noting that the triangles are planar, the area vector of each triangle is calculated exactly using half the cross product of any two right-hand oriented vectors.

Table 3.31 Subcontrol face definitions for exact surface area calculation on hexahedral elements.
Face | Point Set
--- | ---
1 | 21 | 9 | 13 | 27
2 | 25 | 10 | 13 | 27
3 | 11 | 13 | 27 | 24
4 | 12 | 26 | 27 | 13
5 | 14 | 21 | 27 | 18
6 | 18 | 15 | 25 | 27
7 | 18 | 16 | 24 | 27
8 | 17 | 18 | 27 | 26
9 | 20 | 21 | 27 | 26
10 | 21 | 19 | 25 | 27
11 | 23 | 24 | 27 | 25
12 | 22 | 26 | 27 | 24

The eight subcontrol volumes are defined using the points shown in Table 3.32. The formula to calculate the exact volume is based on the Gauss Divergence formula,

(3.1143)

The surfaces for the surface integral are decomposed into triangular facets as in the surface area calculation. To accomplish the decomposition, the coordinates on each face are averaged to the midpoints, and thus each hexahedral volume is constructed using 14 coordinates–eight vertices and six facial midpoints, resulting in 24 total facets. Since the triangular facets are planar, the normal is constant over the surface. Thus, the surface integral over each triangular facet is equivalent to the scalar product of the outward facing normal area vector and the centroid coordinates, . The total surface integral is the sum of the integrals on each triangular facet,

(3.1144)

The area vectors are calculated as described above. The centroid coordinates are simply the average of the three vertices constructed the triangular facet.

Table 3.32 Subcontrol volume definitions for exact volume calculation on hexahedral elements.
Volume | Point Set
--- | ---
1 | 1 | 9 | 13 | 12 | 20 | 21 | 27 | 26
2 | 9 | 2 | 10 | 13 | 21 | 19 | 25 | 27
3 | 13 | 10 | 3 | 11 | 27 | 25 | 23 | 24
4 | 12 | 13 | 11 | 4 | 26 | 27 | 24 | 22
5 | 20 | 21 | 27 | 26 | 5 | 14 | 18 | 17
6 | 21 | 19 | 25 | 27 | 14 | 6 | 15 | 18
7 | 27 | 25 | 23 | 24 | 18 | 15 | 7 | 16
8 | 26 | 27 | 24 | 22 | 17 | 18 | 16 | 8

## 3.4.9.4. Tetrahedral Elements

For tetrahedral elements, there are four nodes and six subfaces defining control volumes, shown in Figure 3.38. The parametric coordinate system is defined by the tetrahedron natural coordinates, , , , and , since a Cartesian mapping cannot be defined. The natural coordinates are the shape functions. As an example, the value of at an interpolation point is the shape function associated with Node 2. The value of is the fraction of element tetrahedral volume covered by a sub-tetrahedron, formed by the interpolation point and the face opposite of Node 2. For consistency with the hexahedral element notation, the parametric variables are defined as , , and , where is defined by the fact that the natural coordinates always sum to one.

Fig. 3.38 Tetrahedral element topology and numbering

Table 3.33 Nodal shape functions and derivatives for tetrahedral elements. Range is (0,1).
node |  | } |  |
--- | --- | --- | --- | ---

The control volume sub-face numbering, shown in Table 3.34, follows the convention that the face has the same number as the element edge that connects the nodes that define the two adjacent sub-control volumes.

The values of the element variables and the surface differentials at the control-volume faces are given in Table 3.34.

Table 3.34 Element variable values and differentials at control-volume faces for tetrahedral elements. Face-to-edge number mapping.
face | Edge ( ) |  |  |  |  |  |
--- | --- | --- | --- | --- | --- | --- | ---

Again the control volumes are constructed using surfaces defined with four points and two methods are available to define the surface area and volume.

### 3.4.9.4.1. Volume and Area Calculation Assuming Planar Surfaces

The form of the volume differentials are the same as with the hexahedral elements. For volume integrals, quadrature points and differential values are shown in Table 3.35.

Table 3.35 Element variable values and differentials at sub-control volume centers for tetrahedral elements.
sub-volume |  |  |  |
--- | --- | --- | --- | ---

### 3.4.9.4.2. Exact Volume and Surface Area Calculation

Following the approach in Exact Volume and Surface Area Calculation, a set of subcontrol coordinates is defined to decompose the tetrahedral element, which are shown in Figure 3.39.

Fig. 3.39 Tetrahedron subcontrol points numbering

Six subcontrol surfaces for the tetrahedron are the defined using points in counterclockwise ordering as shown in Table 3.36. Surface area vectors are calculated using the same approach as in Exact Volume and Surface Area Calculation.

Table 3.36 Subcontrol face definitions for exact surface area calculation on tetrahedral elements.
Face | Point Set
--- | ---
1 | 5 | 8 | 15 | 14
2 | 8 | 15 | 11 | 6
3 | 7 | 13 | 15 | 8
4 | 12 | 14 | 15 | 13
5 | 14 | 10 | 11 | 15
6 | 11 | 9 | 13 | 15

Four subcontrol volumes are defined using the points shown in Table 3.37. Since the subcontrol volumes are hexahedrons, the same volume calculation is used as above.

Table 3.37 Subcontrol volume definitions for exact volume calculation on tetrahedral elements.
Volume | Point Set
--- | ---
1 | 1 | 5 | 8 | 7 | 12 | 14 | 15 | 13
2 | 2 | 6 | 8 | 5 | 10 | 11 | 15 | 14
3 | 3 | 7 | 8 | 6 | 9 | 13 | 15 | 11
4 | 4 | 10 | 14 | 12 | 9 | 11 | 15 | 13

## 3.4.9.5. Wedge Elements

For wedge elements, there are six nodes and nine subfaces defining control volumes. The parametric coordinate system is a linear hybrid of triangular natural coordinates. The natural coordinates are the shape functions. The local coordinates and are in the plane of the triangular surfaces while is in the normal direction.

Table 3.38 Nodal shape functions and derivatives for wedge elements. Range is (0,1) and (-1,1).
node |  | } |  |
--- | --- | --- | --- | ---

The control volume sub-face numbering, shown in Table 3.39, follows the convention that the face has the same number as the element edge that connects the nodes that define the two adjacent sub-control volumes.

### 3.4.9.5.1. Volume and Area Calculation Assuming Planar Surfaces

The values of the element variables and the surface differentials at the control-volume faces are given in Table 3.39.

Table 3.39 Element variable values and differentials at control-volume faces for wedge elements. Face-to-edge number mapping.
face | Edge ( ) |  |  |  |  |  |
--- | --- | --- | --- | --- | --- | --- | ---

For volume integrals, quadrature points and differential values are shown in Table 3.40.

Table 3.40 Element variable values and differentials at sub-control volume centers for wedge elements.
sub-volume |  |  |  |
--- | --- | --- | --- | ---

### 3.4.9.5.2. Exact Volume and Surface Area Calculation

Following the approach in Exact Volume and Surface Area Calculation, a set of subcontrol coordinates is defined to decompose the wedge element, which are shown in Figure 3.40.

Fig. 3.40 Wedge subcontrol points numbering

Nine subcontrol surfaces for the tetrahedron are the defined using points in counterclockwise ordering as shown in Table 3.41. Surface area vectors are calculated using the same approach as in Exact Volume and Surface Area Calculation.

Table 3.41 Subcontrol face definitions for exact surface area calculation on wedge elements.
Face | Point Set
--- | ---
1 | 7 | 10 | 21 | 17
2 | 8 | 10 | 21 | 19
3 | 10 | 9 | 20 | 21
4 | 11 | 17 | 21 | 14
5 | 14 | 12 | 19 | 21
6 | 13 | 14 | 21 | 20
7 | 16 | 17 | 21 | 20
8 | 17 | 15 | 19 | 21
9 | 20 | 21 | 19 | 18

Six subcontrol volumes are defined using the points shown in Table 3.42. Since the subcontrol volumes are hexahedrons, the same volume calculation is used as above.

Table 3.42 Subcontrol volume definitions for exact volume calculation on wedge elements.
Volume | Point Set
--- | ---
1 | 1 | 16 | 17 | 6 | 9 | 20 | 21 | 10
2 | 10 | 7 | 2 | 7 | 21 | 17 | 15 | 19
3 | 9 | 10 | 8 | 2 | 20 | 21 | 19 | 18
4 | 20 | 16 | 17 | 21 | 13 | 4 | 10 | 14
5 | 21 | 17 | 15 | 19 | 14 | 11 | 4 | 12
6 | 20 | 21 | 19 | 18 | 13 | 14 | 11 | 6

## 3.4.9.6. Pyramid Elements

For pyramid elements, there are five nodes and eight subfaces defining control volumes. The local coordinates and are in the plane of the quadrilateral surfaces while is in the normal direction.

Table 3.43 Nodal shape functions and derivatives for pyramid elements. Range is (-1,1) and (0,1).
node |  | } |  |
--- | --- | --- | --- | ---

The control volume sub-face numbering, shown in Table 3.44, follows the convention that the face has the same number as the element edge that connects the nodes that define the two adjacent sub-control volumes.

### 3.4.9.6.1. Volume and Area Calculation Assuming Planar Surfaces

The values of the element variables and the surface differentials at the control-volume faces are given in Table 3.44.

Table 3.44 Element variable values and differentials at control-volume faces for pyramid elements. Face-to-edge number mapping.
face | Edge ( ) |  |  |  |  |  |
--- | --- | --- | --- | --- | --- | --- | ---

For volume integrals, quadrature points and differential values are shown in Table 3.45.

Table 3.45 Element variable values and differentials at sub-control volume centers for pyramid elements.
sub-volume |  |  |  |
--- | --- | --- | --- | ---

### 3.4.9.6.2. Exact Volume and Surface Area Calculation

It is noted here that for pyramid elements, the planar assumption is not good even on the reference element. The volume that composes the tip is an octohedron four planar faces and four highly skewed faces. Computations have shown that the planar assumption results in severe conservation errors.

Following the approach in Exact Volume and Surface Area Calculation, a set of subcontrol coordinates is defined to decompose the pyramid element, which are shown in Figure 3.41.

Fig. 3.41 Pyramid subcontrol points numbering

Eight subcontrol surfaces for the tetrahedron are the defined using points in counterclockwise ordering as shown in Table 3.46. Surface area vectors are calculated using the same approach as in Exact Volume and Surface Area Calculation.

Table 3.46 Subcontrol face definitions for exact surface area calculation on pyramid elements.
Face | Point Set
--- | ---
1 | 6 | 10 | 19 | 13
2 | 7 | 10 | 19 | 15
3 | 8 | 10 | 19 | 17
4 | 9 | 18 | 19 | 10
5 | 12 | 13 | 19 | 18
6 | 11 | 15 | 19 | 13
7 | 14 | 17 | 19 | 15
8 | 16 | 18 | 19 | 17

Five subcontrol volumes are defined using the points shown in Table 3.47. The first four subcontrol volumes are hexahedrons, so the same volume calculation is used as above. The tip of the pyramid composes an octohedron, but the computation of the volume is only slightly different. The Gauss Divergence Theorem is still used to calculate the volume. However, because the four faces on the pyramid faces must be planar, these faces are decomposed into two triangles–composed of the face midpoint and the pyramid tip vertex–instead of four triangles. The four-point faces interior to the triangle are not planar and are decomposed into four triangles, resulting in 24 triangular facets total. Equation (3.1144) is then applied to compute the volume.

Table 3.47 Subcontrol volume definitions for exact volume calculation on pyramid elements.
Volume | Point Set
--- | ---
1 | 1 | 6 | 10 | 9 | 12 | 13 | 19 | 18 |  |
2 | 6 | 2 | 7 | 10 | 13 | 11 | 15 | 19 |  |
3 | 7 | 3 | 8 | 10 | 15 | 14 | 17 | 19 |  |
4 | 9 | 10 | 9 | 4 | 18 | 19 | 17 | 16 |  |
5 | 5 | 19 | 16 | 18 | 12 | 13 | 11 | 15 | 14 | 17