## 25.3.3 Evaluation of Gradients and Derivatives

Gradients are needed not only for constructing values of a scalar at the cell faces, but also for computing secondary diffusion terms and velocity derivatives. The gradient of a given variable is used to discretize the convection and diffusion terms in the flow conservation equations. The gradients are computed in FLUENT according to the following methods:

• Green-Gauss Cell-Based

• Green-Gauss Node-Based

• Least Squares Cell-Based

Green-Gauss Theorem

When the Green-Gauss theorem is used to compute the gradient of the scalar at the cell center , the following discrete form is written as

 (25.3-22)

where is the value of at the cell face centroid, computed as shown in the sections below. The summation is over all the faces enclosing the cell.

By default, the face value, , in Equation  25.3-22 is taken from the arithmetic average of the values at the neighboring cell centers, i.e.,

 (25.3-23)

To use this option, select Green-Gauss Cell-Based under Gradient Option in the Solver panel.

Alternatively, can be computed by the arithmetic average of the nodal values on the face.

 (25.3-24)

where is the number of nodes on the face.

The nodal values, in Equation  25.3-24, are constructed from the weighted average of the cell values surrounding the nodes, following the approach originally proposed by Holmes and Connel[ 146] and Rauch et al.[ 298]. This scheme reconstructs exact values of a linear function at a node from surrounding cell-centered values on arbitrary unstructured meshes by solving a constrained minimization problem, preserving a second-order spatial accuracy.

The node-based averaging scheme is known to be more accurate than the default cell-based scheme for unstructured meshes, most notably for triangular and tetrahedral meshes.

 The node-based gradient method is not available with polyhedral meshes.

To use this option, select Green-Gauss Node-Based under Gradient Option in the Solver panel.

In this method the solution is assumed to vary linearly. In Figure  25.3.4, the change in cell values between cell and along the vector from the centroid of cell to cell , can be expressed as

 (25.3-25)

If we write similar equations for each cell surrounding the cell c0, we obtain the following system written in compact form:

 (25.3-26)

Where [J] is the coefficient matrix which is purely a function of geometry.

The objective here is to determine the cell gradient ( î ) by solving the minimization problem for the system of the non-square coefficient matrix in a least-squares sense.

The above linear-system of equation is over-determined and can be solved by decomposing the coefficient matrix using Gram-Schmidt process [ 11]. This decomposition yields a matrix of weights for each cell. Thus for our cell-centered scheme this means that the three components of the weights ( ) are produced for each of the faces of cell c0.

Therefore, the gradient at the cell center can then be computed by multiplying the weight factors by the difference vector ,

 (25.3-27) (25.3-28) (25.3-29)

When a flow solution is solved on polyhedral meshes the cell-based least squares gradients are recommended for use over the default cell-based gradients, particularly if a more accurate flow solution is required. Although, the cell-based least squares gradients are available for use with triangular and tetrahedral meshes and their accuracy is comparable to node-based gradients, it is best if the node-based gradients are used on these meshes since they are known to be more stable.

To use this option, go to the Solver panel and select Least Squares Cell Based under Gradient Option.

Previous: 25.3.2 Temporal Discretization
Up: 25.3 Discretization
Next: 25.4 Pressure-Based Solver