Abstract
In previous chapters the procedure for discretizing and solving the general transport equation for the variable \( \phi \) in the presence of a known velocity field was formulated. In general, the velocity field is not known and has to be computed by solving the set of Navier-Stokes equations. For incompressible flows this task is complicated by the strong coupling that exist between pressure and velocity and by the fact that pressure does not appear as a primary variable in either the momentum or continuity equations. The focus of this chapter is on presenting a method that addresses these two issues, and computes the flow field for incompressible fluid flows. This is accomplished initially on a one dimensional staggered grid, then on a collocated one dimensional grid and finally on a collocated three dimensional unstructured grid. In addition to fully deriving the SIMPLE, SIMPLEC, PRIME and PISO algorithms, the Rhie-Chow interpolation and its extension to transient, relaxation and body force terms are clearly formulated. Finally, the implementation details for a number of frequently encountered boundary conditions are presented.
Access provided by Autonomous University of Puebla. Download chapter PDF
Similar content being viewed by others
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
1 The Main Difficulty
The general conservation equation dealt with in previous chapters can be reformed into an equation similar to the continuity and momentum equations. Yet the numerical techniques presented up till now are not enough to allow for the resolution of the Navier-Stokes equations. Solving general fluid flows requires an algorithm [1] that can deal with the pressure velocity coupling. To understand this issue, the continuity and momentum equations are reproduced below.
That Eqs. (15.1) and (15.2) are nonlinear is not by itself an unsurmountable difficulty, since such a problem is usually handled by adopting an iterative approach. Moreover, Eq. (15.2) is a vector equation, which when written in terms of its components results in a system of scalar equations that can be solved sequentially. Furthermore, the stress tensor can be reformulated into a diffusion-like term and treated implicitly, with its second part (i.e., the transpose of the velocity gradient) evaluated explicitly based on previous iteration values and added to the source. The main issue that cannot be addressed directly with the numerics of the general scalar equation, is the unavailability of an explicit equation for computing the pressure field that appears in the momentum equation.
A review of Eqs. (15.1) and (15.2) reveals that while the velocity field can be computed using the momentum equation, the pressure field appearing in the momentum equation cannot be computed directly from the continuity equation. This strong yet implicit coupling can be made more evident by rewriting the set of equations in a matrix form as
In this form, Eq. (15.3) shows a zero diagonal block in the system, which is a characteristic of saddle point problems, indicating that it cannot sustain the solution of the pressure and velocity fields by any iterative mean. Consequently, an equation for pressure is required and should be derived.
One approach is to simply reformulate the system of momentum and continuity equations by decomposing matrix A into a lower (L) and an upper (U) triangular matrices as
where the term −BF −1 B T is the Schur complement matrix.
This is in essence the approach that needs to be followed in order to iteratively solve the Navier-Stokes equations. This technique is embodied in the classical segregated SIMPLE (Semi Implicit Method for Pressure Linked Equations) algorithm of Patankar and Spalding [1–3].
The solution procedure is based on reformulating the Navier-Stokes equations in terms of a momentum and a pressure equation, which are then discretized and solved sequentially. The pressure equation is constructed by combining the semi-discretized momentum and continuity equations (approximation of the Schur complement matrix).
The algorithm is driven by a Picard type iterative procedure during which the momentum equation is solved using the pressure field of the previous iteration. The resulting velocity field conserves momentum but not necessarily mass. This velocity field is then used to construct the pressure equation whose solution is used to correct both the pressure and velocity fields so as to enforce mass conservation. A new iteration is then started and the sequence is repeated until the velocity and pressure fields satisfy both mass and momentum conservation.
This algorithm can be described in matrix form as
followed by an update to the velocity field using
where in Eqs. (15.5) and (15.6) F −1 is approximated by its inverse diagonal, D −1, and the superscript (*) refers to intermediate values at the current iteration. The steps required are summarized as follows:
-
Solve: Fv * = f b
-
Solve: −BD −1 B T p * = −Bv *
-
Update: v = v * − D −1 B T p *
-
Update: p = p *
This kind of splitting is similar to that used in the SIMPLE family of algorithms, which is the subject of this chapter.
2 A Preliminary Derivation
The difficulties faced in developing a solution algorithm for incompressible flow problems will be highlighted by performing the discretization in a one dimensional space over the uniform grid displayed in Fig. 15.1. For simplicity, the flow is assumed to be steady. The simplified continuity and momentum equations (written in conservative form) are given by
2.1 Discretization of the Momentum Equation
The discretization of the momentum equation starts by integrating Eq. (15.8) over element C shown in Fig. 15.1 to yield
The volume integrals of the convection and diffusion terms in Eq. (15.9) are then transformed into surface integrals by invoking the divergence theorem to give
Representing the surface integrals by summation of fluxes over the faces of the element, and using a single Gaussian point for the face integrals, the semi-discretized forms of the left and right hand sides of Eq. (15.8) become
which can be rewritten as
The convection and diffusion terms can be discretized using any of the techniques described in previous chapters to yield an algebraic equation of the form
The discretization of the pressure term is deferred till after the discretization of the continuity equation.
2.2 Discretization of the Continuity Equation
The discretized form of the continuity equation is obtained by integrating Eq. (15.7) over element C displayed in Fig. 15.1 to give
Again making use of the divergence theorem to transform the volume integral into a surface integral and then into summation of fluxes over the faces of the element, the discrete form of the continuity equation is obtained as
or
2.3 The Checkerboard Problem
The discretization of the pressure term may be accomplished by adopting either of the following two approaches. In the first approach, the volume integral is computed via a single Gaussian integration point resulting in
Using a central difference scheme, the discretized form of Eq. (15.17) is obtained as
In the second approach, the volume integral of the pressure gradient term is transformed into a surface integral such that
Rewriting the surface integral as a summation of fluxes over the faces of the element, Eq. (15.19) becomes
Selecting a linear interpolation profile for the variation of pressure, the pressure gradient term can be rewritten as a function of pressure values at the main grid points as
Thus either approach leads to the same expression involving the pressure difference between the alternating points E and W.
In a similar way, using a linear interpolation profile and noticing that the density is constant and \( (\Delta y)_{e} = (\Delta y)_{w} = \, (\Delta y)_{C} \), the continuity equation can be expressed as
which also relates the velocity at two alternating grid points.
In Eq. (15.21) the pressure gradient term in element C depends on the values of pressure at the two alternating, not consecutive, grid points straddling the element. The same is true for the continuity equation, which enforces conservation only for alternating velocity elements. This implies that non-physical zigzag (or checkerboard) pressure and velocity fields, like the ones shown in Fig. 15.2, will be sensed as uniform fields by the numerical scheme.
For the pressure and velocity values shown in Fig. 15.2, the pressure gradient at points W, C, and E are found to be
and the continuity equation seems to be enforced for each element since
In multi dimensional situations a similar non-physical behavior can arise even if it is harder to visualize. This sets the ground for the next step that presents one approach to resolve this problem.
2.4 The Staggered Grid
The culprit in the previous formulation is the uncoupling between the pressure and velocity fields. Coupling can be enforced if the different variables are stored at staggered locations such that no interpolation is needed to calculate the pressure gradient in the momentum equation and the velocity field in the continuity equation. Such a staggered grid is shown in Fig. 15.3a, b. In the staggered grid the velocity field is stored at cell faces (Fig. 15.3a), while pressure and all other variables are stored at cell centroids (Fig. 15.3b).
With this formulation, the discretized continuity equation for element C becomes
with no need for interpolation as the velocity values are available at the e and w locations. Moreover, the momentum equation is integrated over elements similar to element e resulting in the following discretized momentum equation:
The pressure gradient is related to values at the consecutive grid points straddling the element face with no interpolation needed. Therefore checkerboard pressure and velocity field solutions are inadmissible as they will be easily detected and eliminated by the numerical method.
2.5 The Pressure Correction Equation
The derivations presented next are based on the work of Patankar and Spalding [2, 3], who developed the initial implementation of the SIMPLE (Semi Implicit Method for Pressure Linked Equations) algorithm.
Starting with the continuity and momentum equations given respectively by (Fig. 15.3)
the solution proceeds by providing an initial guess for the velocity and pressure fields. Denoting the initial guess or the solution at the starts of any iteration with a superscript (n), then the tentative velocity and pressure fields are given by u (n) and p (n). At any iteration, solving the momentum equation first for the velocity field, the solution obtained is denoted by a superscript * as it is not the final solution at the current iteration. Thus, the momentum equation satisfies
where the pressure field is still based on values from the previous iteration. The computed velocity field u * satisfies the momentum equation but not necessarily the continuity equation, since the pressure field is not exact. Therefore a correction is sought to ensure that the velocity (or the mass flow rate) and pressure fields satisfy the continuity equation.
Denoting the correction fields with a superscript prime, i.e., \( \left( {u^{\prime},p^{\prime}} \right) \), then the sought after velocity and pressure are given by
Note that the mass flow rate at cell faces will also be corrected according to
such that the exact mass flow rate satisfies the continuity equation, i.e.,
which can be rewritten as
This is an interesting form of the continuity equation showing that once the computed mass flow rate reaches the exact solution and satisfies the continuity equation, then the RHS becomes zero leading to a zero correction field. Thus it is the mass conservation error of the current fields that drives the correction field. The mass flow rates and mass flow rate corrections at an element faces are given by
and
where in Eqs. (15.32) and (15.33) the fact that \( S_{e}^{x} =\Delta y_{e} \) and \( S_{w}^{x} = -\Delta y_{w} \) has been used.
The pressure field does not appear in Eq. (15.31) and to bring it into the equation, the discrete form of the momentum equation is used. The process starts by rewriting Eq. (15.26) in a more compact form as
where
For the case of the computed velocity field, the above equation is written as
Subtracting the computed momentum equation, Eq. (15.36), from the exact one, Eq. (15.34), an equation for the correction field is obtained as
A similar approach is used for the w face yielding
Substituting Eq. (15.33) into the continuity equation, Eq. (15.31), its expanded form becomes
Then replacing the discrete forms of \( u^{\prime}_{e} \) and \( u^{\prime}_{w} \) computed from Eqs. (15.37) and (15.38), respectively, in Eq. (15.39), an equation involving pressure correction is obtained and is given by
In this equation the pressure field appears in a diffusion like form, which after discretization becomes
or
Rearranging, the pressure correction equation is formulated as
where
The underlined terms in Eqs. (15.37), (15.38), and (15.44) involve corrections which become zero at the state of convergence. Therefore they have no effect on the final solution. Different approximations to these terms result in different algorithms as will be explained later. In the original SIMPLE algorithm these terms are simply neglected. Moreover for one dimensional constant area situations Δy may be set to 1 and dropped from the equations.
2.6 The SIMPLE Algorithm on Staggered Grid
Using the momentum and pressure correction equations, a solution to the flow problem can be obtained. In the SIMPLE algorithm this solution is found iteratively by generating pressure and velocity fields that consecutively satisfy the momentum and continuity equations, while approaching the final solution (which satisfies both equations) at every iteration [4–6]. This sequential, rather than simultaneous, solution of the equations is denoted in the literature by the segregated approach. The sequence of events in the segregated SIMPLE algorithm can be summarized as follows:
-
1.
Start with a guessed pressure and velocity fields p (n) and u (n), respectively.
-
2.
Solve the momentum equation given by Eq. (15.27) to obtain a new velocity field \( u_{f}^{*} \).
-
3.
Update the mass flow rates using the momentum satisfying velocity field to obtain the \( \dot{m}_{f}^{*} \) field.
-
4.
Using the new mass flow rates solve the pressure correction equation to obtain a pressure correction field \( p^{\prime} \).
-
5.
Update the pressure and velocity fields to obtain continuity-satisfying fields using the following equations:
$$ \begin{aligned} u_{f}^{**} & = u_{f}^{*} + u^{\prime}_{f} \quad u^{\prime}_{f} = -D_{f}^{u} \left( {\frac{{\partial p^{\prime}}}{\partial x}} \right)_{f} \\ p_{C}^{*} & = p_{C}^{(n)} + p^{\prime}_{C} \\ \dot{m}_{f}^{**} & = \dot{m}_{f}^{*} + \dot{m}^{\prime}_{f} \quad \dot{m}^{\prime}_{f} = - \rho_{f} D_{f}^{u}{\Delta y}_{f} \left( {\frac{{\partial p^{\prime}}}{\partial x}} \right)_{f} \\ \end{aligned} $$(15.45) -
6.
set \( u^{(n)} = u^{**} \) and \( p^{(n)} = p^{*} \)
-
7.
Go back to step 2 and repeat until convergence.
The SIMPLE algorithm is best illustrated via the example presented next.
Example 1
Flow in a Pipe Network
A portion of a water pipe system is shown in Fig. 15.4 . The momentum equation for the flow in the pipes can be written as
where D A = 0.5, D B = D F = 0.4, D C = D E = 0.3, D D = 0.19, D G = 0.1875, and D H = 0.35. Using the SIMPLE algorithm, calculate the unknown mass flow rates and pressures in the system.
Solution
In this system, the mass flow rate field is used as a variable instead of the velocity field. This is not problematic since the momentum equation has been simplified by dropping the convection and diffusion terms as their values are negligible compared to the pressure head.
The solution using the SIMPLE algorithm starts by first computing an initial velocity field using the assumed pressure field, and then predicting a pressure field that enforces continuity on the just computed velocity field.
This procedure is summarized as
-
1.
Start with a guessed pressure field.
-
2.
Compute the mass flow rates using the given momentum equation.
-
3.
Construct a pressure correction equation that enforces continuity (mass conservation) and use it to correct the pressure and velocity fields.
No iterations will be needed since there are no non-linear effects induced by a convection term.
step 1
Start by assigning guessed values to the pressure at the locations where solutions are to be found. Thus assume the following:
\( \begin{array}{*{20}c} {p_{3}^{(n)} = 300} & {p_{6}^{(n)} = 200} & {p_{8}^{(n)} = 120} \\ \end{array} \) (other values could have been used)
step 2
Based on the assumed pressure values calculate the various mass flow rates using the momentum equations according to
step 3
Check whether the mass flow rates satisfy continuity by computing \( \sum\limits_{\sim k} {\dot{m}_{k}^{*} } \) at all interior points, i.e.,
Since mass conservation is not satisfied, correction fields are needed and pressure correction equations are derived as follows:
In term of pressure corrections, mass flow rate corrections can be expressed as
Note that \( p^{\prime}_{1} \), \( p^{\prime}_{2} \), \( p^{\prime}_{4} \), \( p^{\prime}_{5} \) and \( p^{\prime}_{7} \) are set to zero since the corresponding pressure values are known and hence represent the exact values.
The flow field at nodes 3, 6, and 8 are respectively given by
and using pressure corrections as
After simplification the above equations become
Substituting the tentative mass flow rates, the various correction fields satisfy
Solving the system of pressure correction equations yields
With the pressure correction computed, the velocity and pressure fields can now be updated to produce a mass conserving velocity field. The mass flow rates are computed as
while the pressure is updated using
Treat the corrected values as a new guess and repeat. Better estimate for the mass flow rates are computed using the momentum equations as
The imbalance in the mass flow rate at nodes 3, 6, and 8 are computed as
The pressure correction equations become
The solution to the pressure correction field is found to be
Thus the solution is obtained in one iteration.
2.7 Pressure Correction Equation in Two Dimensional Staggered Cartesian Grids
In a two dimensional Cartesian grid, three grid systems are used. One for the u-velocity component, a second one for the v-velocity component, and a third grid system for the pressure and other variables as illustrated in Fig. 15.5.
The derivations presented above for the pressure correction equation in one dimensional domains can be easily extended into multi dimensional situations. For element C shown in Fig. 15.6, the pressure correction equation is obtained as
where
Example 2
In the two dimensional problem shown in Fig. 15.7 , the following quantities are given u w = 50, v s = 20, p N = 0 and p E = 10.
The flow is steady and the density is uniform and equal to 1. The momentum equations for u e and v n are given by
where the constants d e = 1 and d n = 0.25. The element shown has Δx = Δy = 1. Use the SIMPLE algorithm to compute the values of u e , v n , and p C .
Solution
Start by assigning a guessed value to the pressure at the C location where solution is to be found. Thus assume the following:
\( p_{C}^{(n)} = 100 \) (other values could have been guessed)
Based on the assumed pressure value calculate the various velocities using the momentum equation according to
Since the density is uniform and equal to 1 and Δx = Δy = 1, then
Check whether the mass flow rates satisfy continuity over element C by computing \( \sum\limits_{\sim f} {\dot{m}_{f}^{*} } \) at the element faces.
In the above mass conservation equation the negative sign for \( \dot{m}_{w}^{*} \) and \( \dot{m}_{s}^{*} \) is explicitly used. Since mass conservation is not satisfied, correction fields are needed and a pressure correction equation is derived as follows:
In term of pressure corrections, mass flow rate corrections can be expressed as
The correction equation becomes
Applying the correction to the mass flow rate and pressure fields, continuity satisfying fields are obtained as
Treat the corrected values as a new guess and repeat.
The imbalance in the mass flow rate is computed as
The pressure correction equations become
The solution to the pressure correction field is found to be
Thus the solution is obtained in one iteration as
2.8 Pressure Correction Equation in Three Dimensional Staggered Cartesian Grid
Without going into details and for completeness of presentation, the pressure correction equation over the three dimensional staggered Cartesian grid shown in Fig. 15.8, where the u, v, and w velocity components are stored at the (e, w), (n, s), and (t, b) element faces, respectively, is given by
where
3 Disadvantages of the Staggered Grid
The use of staggered grids was critical to the development of the SIMPLE algorithm. Nevertheless adopting a staggered grid arrangement has its disadvantages. As mentioned above, in two and three dimensions, three and four staggered grid systems, respectively, are required with the velocity components integrated over different elements, as shown in Fig. 15.5 for a two dimensional situation.
Besides the memory requirement to store a grid system for every velocity component and a grid system for pressure and other variables, the staggering procedure itself becomes an issue for non-Cartesian grids and more so for unstructured grids.
In curvilinear grids, the use of Cartesian velocity components can lead to problems when one or more of the surfaces become aligned with the staggered velocity component as shown in Fig. 15.9.
Therefore a better alternative in this case is to use either covariant or contra-variant curvilinear velocity components, as shown in Fig. 15.10a, b, respectively.
An example of staggering using contra-variant velocity components is shown in Fig. (15.11).
Unfortunately complications arise when discretizing the momentum equations in curvilinear coordinates [1, 3, 4, 7], due to the increased complexity in the treatment of the diffusion term, and because the equations gain non-conservative terms.
Another option shown in Fig. 15.12 is to stagger all Cartesian velocity components in all directions so as to have all velocity components at all faces. This would double (in two dimensions) or triple (in three dimensions) the number of momentum equations to be solved. The problem is further complicated in the case of an unstructured grid. In this case there is no obvious staggering direction, and the only way for a staggering concept to apply is by changing the size of the cell elements used for the pressure and velocity components, or by resorting to staggering all velocity components along all the faces, again dramatically increasing the number of variables to be solved. Finally, the geometric information stored is more than doubled, as a new unstructured grid need to be used for the velocity components.
It turns out that the use of a cell-centered collocated grid system (Fig. 15.13), where all variables are stored at the same location (the cell centroid), is a more attractive solution. It is worth noting that while the velocity components are stored at the centroids of the elements as is the case for pressure or any other variable, the mass flux, a scalar value, in a collocated grid is stored at the element faces. The mass flux can actually be viewed as a contra-variant component, except that in this case it is computed using a custom interpolation of the discrete momentum equation, known as the Rhie-Chow interpolation, which is the subject of the next section.
4 The Rhie-Chow Interpolation
The deficiency in the original collocated formulation presented earlier was in the linear interpolation used to calculate the velocities at the element faces. This interpolation resulted in decoupling the pressure and velocity values at the cell level giving rise to the checkerboard problem. In 1983, Rhie and Chow [8] reported on an interpolation procedure that allowed the formulation of the SIMPLE algorithm on a collocated grid [9–16]. In their method a dissipation term, representing the difference between two estimates of the cell face pressure gradient, is added to the linearly interpolated cell face velocity. As shown in Fig. 15.14 the two pressure gradient estimates are based on different grid stencils.
This procedure will be shown to be equivalent to constructing a pseudo-momentum equation at the element face with its coefficients linearly interpolated from the coefficients of the momentum equations at the centroids of the elements straddling the face and its pressure gradient computed using a small grid stencil. In that respect, the Rhie-Chow interpolation simply mimics the small stencil pressure-velocity coupling of the staggered grid arrangement.
Starting with the discretized x-momentum equations for cells C and F, which are
A u f velocity equation similar to that of Eq. (15.50), with the pressure gradient linked to the local neighboring pressure values, as illustrated in Fig. 15.14, will have the following form:
Since in a collocated grid, the coefficients of this equation cannot be directly computed, they are approximated by interpolation from the coefficients of the neighboring nodes. Using a linear interpolation profile, these coefficients are computed as
Employing the values given in Eq. (15.52), the pseudo-momentum equation at the element face becomes
This is in all practical sense the momentum equation on a “staggered” grid, which is reconstructed using the collocated grid momentum coefficients.
In all above equations and for later use, values with an over bar are obtained by linear interpolation between the values at points C and F according to
where g C and g F are geometric interpolation factors related to the position of the element face f with respect to the nodes C and F, as explained in previous chapters.
Using Eq. (15.50), \( \overline{{H_{f} }} \) is rewritten as
where the coefficient approximation can be shown to be second order accurate, i.e.,
Substituting Eq. (15.55) into Eq. (15.53), the velocity at the element face using the Rhie-Chow interpolation method is obtained as
For a multi dimensional situation, similar interpolation formulae can be derived for the y and z velocity components and are given by
Equations (15.57)–(15.59) can be written in a vector form, more suitable for deriving the multi-dimensional pressure correction equation, as
where
and where ∇p f is computed as per Sect. 9.4 using
and yielding a stencil in the CF direction formed only from the adjacent cell values p F and p C as
With the face velocities closely linked to the pressure of adjacent cells, checkerboard fields are inadmissible rendering solutions on collocated grids viable.
5 General Derivation
Before proceeding with the development of the multidimensional collocated pressure correction equation, the discretized multidimensional momentum equation is first presented.
5.1 The Discretized Momentum Equation
The momentum equation given by Eq. (15.2) is slightly modified and written as
The discretized form of Eq. (15.64) in the time interval [t − Δt/2, t + Δt/2] is sought over element C shown in Fig. 15.15.
In Eq. (15.64), the three underlined expressions represent, from left to right, the unsteady, convection, and diffusion term, respectively. The discretization of these terms proceeds as presented in previous chapters. The remaining terms are evaluated explicitly and treated as sources. The volume integral of the second part of the shear stress term is transformed into a surface integral using the divergence theorem and then into a summation of surface fluxes as
where the expanded form of \( \left( {\nabla {\mathbf{v}}} \right)_{f}^{\text{T}} \cdot {\mathbf{S}}_{f} \) in a three dimensional coordinate system is given by
The volume integral of the pressure gradient is also treated as a source term and evaluated explicitly as
or transformed into a surface integral according to Eq. (2.85) and computed as
The body force term is integrated directly over the control volume to yield
Using a first order Euler scheme for the discretization of the unsteady term, a HR scheme for the convection term implemented via the deferred correction approach, and decomposing the diffusion flux into an implicit part aligned with the grid and an explicit cross diffusion part, the discretized momentum equation is written in vector form as
where the coefficients are given by
with the face fluxes calculated using
and the element fluxes computed from
Even though the algebraic form of the momentum equation, Eq. (15.70), is linear, its coefficients depend on the velocity and pressure fields. This nonlinearity is handled by an iterative process during which the coefficients are calculated at the start of every iteration based on values of the dependent variables obtained in the previous iteration. This change in the values of the coefficients results in large changes in v and affects the rate of convergence to the degree of even causing divergence. To slow down the changes, under-relaxation can be applied when the transient time steps used are large. Denoting the under relaxation factor by λ v and adopting Patankar’s implicit relaxation approach, the under relaxed momentum equation can be written as
By redefining \( a_{C}^{{\mathbf{v}}} \) and \( {\mathbf{b}}_{C}^{{\mathbf{v}}} \) such that
the under-relaxed momentum equation can be rewritten as
For the derivation of the collocated pressure correction equation, the pressure gradient is taken out of the \( {\mathbf{b}}_{C}^{{\mathbf{v}}} \) source term and displayed explicitly to yield
Substituting back in Eq. (15.76), the momentum equation becomes
Defining the following vector operators:
Equation (15.78) is reformulated as
a form that will be useful in later derivations.
5.2 The Collocated Pressure Correction Equation
As in the case of a staggered grid, starting with guessed values or values obtained from the previous iteration \( \left( {{\mathbf{v}}^{(n)} ,\dot{m}^{(n)} ,p^{(n)} } \right) \), the momentum equation, Eq. (15.80), is first solved to obtain a momentum conserving velocity field v *. Thus the obtained solution satisfies
while the final solution should satisfy Eq. (15.80). The difference between these two equations is that the velocity field in Eq. (15.80) satisfies both the momentum and continuity equations while the one in Eq. (15.79) does not necessarily satisfy the continuity equation because of the linearization in which pressure and velocity are based on the previous iteration values. Therefore corrections to the velocity, mass flow rate, and pressure fields are needed to enforce mass conservation. Denoting these corrections by \( \left( {{\mathbf{v^{\prime}}},p^{\prime},\dot{m}^{\prime}} \right) \) the relations between the exact and computed fields can be written as
Substituting the mass flow rate given by Eq. (15.82) into Eq. (15.25), the continuity equation becomes
with the face velocity computed using the Rhie-Chow interpolation as
When the computed mass flow rate field is conservative, the RHS of Eq. (15.83) is zero yielding a zero correction field. On the other hand, an incorrect velocity field leads to an imbalance in mass and a nonzero value of the RHS of Eq. (15.83) implying the need for a correction field for conservation to be enforced.
Mass flow rate corrections can be written in terms of velocity corrections, which can be derived by subtracting Eq. (15.81) from Eq. (15.80) to yield
A similar equation holds for element F and is given by
The mass flow rate correction at a cell face can be expressed as
where the face velocity correction is obtained by subtracting Eq. (15.84) from Eq. (15.60) to give
Substitution of Eqs. (15.87) and (15.88) in Eq. (15.83), leads to the following form of the pressure correction equation:
In this equation the underlined part represents the effects of the neighboring velocity corrections on the velocity correction of the element under consideration. This influence becomes clearer by interpolating Eqs. (15.85) and (15.86) to the face yielding the following equivalent expression for the underline terms:
Substituting Eq. (15.90) in Eq. (15.89), the pressure correction equation is rewritten as
or more explicitly in the form
In Eq. (15.91) or (15.92) the treatment of the underlined term is critical to rendering the equation solvable. In the original SIMPLE algorithm it is neglected, thus linking the velocity correction at a point directly to pressure corrections. Because this is a correction equation the modification or dropping of the term will not affect the final solution, since at convergence the corrections become zero. However it will affect the convergence rate in that the larger is the neglected term the higher will be the error present in the approximation at each iteration.
The remaining terms in Eq. (15.91) or (15.92) can be easily treated. The coefficients of the pressure correction equation are obtained as per the discretization of the diffusion term in Chap. 8, specifically the treatment of anisotropic diffusion.
Thus the term on the LHS is modified into a gradient dot product of the form
The expanded expression of \( {\mathbf{S^{\prime}}}_{f} \) is given by
Working with \( {\mathbf{S^{\prime}}}_{f} \), the discretization of the pressure correction gradient term proceeds as usual resulting in
where the following decomposition of \( {\mathbf{S^{\prime}}}_{f} \) was used:
The type of decomposition could be any of those reviewed in Chap. 8, as will be detailed later. The underlined term, arising due to grid non-orthogonality, can either be neglected or retained. If neglected, it will not affect the final solution as it is a correction term. If retained, then it will be treated explicitly with an internal loop (non-orthogonal loop in OpenFOAM®). As the solution starts with a zero pressure correction field at every iteration, the term has to be updated iteratively while solving the equation.
Dropping the non-orthogonal contribution, the linearized term of the pressure correction equation becomes
Substituting back in Eq. (15.91) the algebraic form of the pressure correction equation is obtained as
with the coefficients given by
Note that different approximations to the underlined terms in Eq. (15.99) result in different algorithms. In the original SIMPLE algorithm these terms are simply neglected.
Finally the mass flow rate \( \dot{m}_{f}^{*} \) in Eq. (15.99), is the one computed after solving the momentum equation using as usual the Rhie-Chow interpolation technique with the latest velocity field, i.e.,
Following the calculation of the pressure correction field, the pressure and velocity at the element centroids and the mass flow rate at the element faces are all corrected. As mentioned above, the underlined term in Eq. (15.99) is neglected in the SIMPLE algorithm resulting in large pressure correction values that may slow the rate of convergence or cause divergence. To increase robustness and improve the convergence behavior, pressure correction values obtained from Eq. (15.98) are explicitly under relaxed. No under relaxation is used when updating the velocity and mass flow rate fields since the pressure correction will ensure mass conservation for these fields. Denoting the under relaxation factor by λ p, the following correction equations are used:
5.3 Calculation of the \( {\mathcal{D}}_{f} \) Term
The type of decomposition suggested in Eq. (15.96) could be any of those reviewed in Chap. 8 with different approaches leading to different expressions for \( {\mathcal{D}}_{f} \) as derived below.
5.3.1 Minimum Correction Approach
For this approach E f is obtained by substituting \( {\mathbf{S^{\prime}}}_{f} \) for S f in Eq. (8.68) leading to
where e CF is a unit vector in the CF direction. Combining Eqs. (15.94), (15.102), and (8.64), E f becomes
Using Eq. (15.103), the following expression for \( {\mathcal{D}}_{f} \) is derived:
5.3.2 Orthogonal Correction Approach
The definition of E f in this case is obtained from Eq. (8.69) and written as
Combining Eqs. (15.105), (15.94), and (8.64), \( {\mathcal{D}}_{f} \) is found to be
5.3.3 Over-Relaxed Approach
In this method, E f is computed from Eqs. (8.64) and (8.70) as
Combining Eq. (15.107) with Eq. (15.94), \( {\mathcal{D}}_{f} \) is found to be
Any of the above approaches can be adopted to calculate the value of \( {\mathcal{D}}_{f}. \)
5.4 The Collocated SIMPLE Algorithm
The sequence of events in the collocated SIMPLE algorithm is displayed in Fig. 15.16 and can be summarized as follows:
-
1.
To compute the solution at iteration n + 1, start with the solution at time t for pressure, velocity, and mass flow rate fields, i.e., p (n), u (n), and \( \dot{m}^{(n)} \), respectively, as the initial guess.
-
2.
Solve the momentum equation given by Eq. (15.70) to obtain a new velocity field v *.
-
3.
Update the mass flow rate at the element faces using the Rhie-Chow interpolation (Eq. 15.100) to compute a momentum satisfying mass flow rate field \( \dot{m}^{*} \).
-
4.
Using the new mass flow rates assemble the pressure correction equation (Eq. 15.98) and solve it to obtain a pressure correction field \( p^{\prime} \).
-
5.
With the pressure correction field update the pressure and velocity fields at the element centroids and the mass flow rate at the element faces to obtain continuity-satisfying fields using Eq. (15.101). These resulting fields are denoted by u **, \( \dot{m}^{**} \), and p *, respectively.
-
6.
Treat the obtained solution as a new initial guess, return to step 2 and repeat until convergence.
-
7.
Set the solution at time n + 1 (i.e., t + Δt) to be equal to the converged solution and set the current time n + 1 (i.e., t + Δt) to be n (i.e., t).
-
8.
Advance to the next time step.
-
9.
Return to step 1 and repeat until the last time step is reached.
Example 3
In the two dimensional problem shown below, the following quantities are given p W = 100, p N = 20 and p E = 50 and an inlet condition at face s with v s = 20 and zero pressure gradient.
The flow is steady state and the density is uniform of value 1. The momentum equations for u e and v n are
and
where the constants d x = 1 and d y = 0.25. The element shown has Δx = Δy = 1. Use the collocated SIMPLE algorithm to derive the pressure correction equation and solve it to find the pressure for element C. Take \( p_{C}^{(n)} = 70 \) as an initial guess for pressure at C (Fig. 15.17).
Solution
At the inlet the zero gradient condition can be used to compute
now compute \( u_{C}^{(n)} ,v_{C}^{(n)} \) using
and
since \( p_{e}^{(n)} = 0.5\left( {p_{E}^{(n)} + p_{C}^{(n)} } \right),\;p_{n}^{(n)} = 0.5\left( {p_{E}^{(n)} + p_{N}^{(n)} } \right) \) and \( {p}_{w}^{(n)} = 0.5\left( {p_{E}^{(n)} + p_{W}^{(n)} } \right) \)
Now the pressure correction equation is constructed by substituting the mass flux and its correction into the mass conservation equation. Using the Rhie-Chow interpolation the face fluxes are computed as
similarly for the n and w face
with \( \dot{m}_{s} = - 20\Delta x = - 20 \) the pressure correction equation is constructed from
and
now
thus we have
or
if the E, N and W values were exact then we would have
or
then we would proceed with correcting the pressure and velocity components at C to yield
so
6 Boundary Conditions
A boundary element has at least one face located at a boundary patch, which is denoted as a boundary face (Fig. 15.18). The treatment of boundary conditions at a boundary face is critical to the accuracy and robustness of any CFD code. Thus for any pressure-based code to succeed, it is imperative for the boundary conditions of both momentum and pressure-correction equations to be properly implemented. This section describes in detail the implementation of a variety of boundary conditions.
A first note of interest is the expression of the Rhie-Chow interpolation at a boundary face, which has to be modified since the averaging cannot be performed in a fashion similar to an interior face. The average at a boundary face is written in terms of the element value as
where b refers to the boundary face centroid and C to the element centroid. Adopting this practice, the averages in the Rhie-Chow interpolation, the velocity, and the mass flow rate at a boundary face become
In what follows the implementation of boundary conditions is first presented for the momentum equation, followed by the implementation of the boundary conditions for the pressure (correction) equation. For the cases when the boundary conditions for the momentum and pressure correction equations are co-dependent, their full treatment is detailed in the pressure correction equation section.
6.1 Boundary Conditions for the Momentum Equation
The semi-discretized form of the momentum equation can be expressed as
where the discretization type of the various terms is explicitly stated. Terms that are evaluated at the element faces should be modified along a boundary face in accordance with the type of boundary condition used. Therefore, for boundary elements, the terms evaluated at the element faces are written as
where subscript b refers to a value at the boundary. As previously stated, the pressure term may be discretized following either an element or a face discretization. In either case the expanded form is the same since \( V_{C} \left( {\nabla p} \right)_{C} \) is calculated as \( \sum\limits_{f\sim nb(C)} {p_{f} {\mathbf{S}}_{f} } \) implying that the value at the boundary is always required. To show the way boundary pressure affects solution, the expanded form of the pressure gradient (i.e., face discretization) is adopted in the implementation of boundary conditions.
6.1.1 Wall Boundary Conditions
Generally a no-slip or a slip boundary condition may be applied to a moving or a stationary wall. The implementation involves computing and linearizing the shear stress at the wall. This is different from the Dirichlet condition, though for a cartesian grid the two conditions may be shown to be identical.
6.1.1.1 No-Slip Wall Boundary \( \left( {p_{b} = ?;\dot{m}_{b} = 0;{\mathbf{v}}_{b} = {\mathbf{v}}_{wall} } \right) \)
A no slip boundary condition implies that the velocity of the fluid at the wall v b is equal to the velocity of the wall v wall . For a stationary wall, the boundary velocity v b is zero. The known velocity at the wall could be wrongly viewed as a Dirichlet boundary condition. However this is not really the case, since what is needed is to have a zero normal boundary flux while also accounting for the shear stress. This cannot be satisfied by simply setting v b = v wall . Figure 15.19 shows that this can be guaranteed by ensuring a shear stress that is tangential to the wall in addition to a boundary velocity equation that is equal to the wall velocity. The force F b exerted by the wall on the fluid can be written as
where \( {\mathbf{F}}_{\parallel } \) is in the tangential direction to the wall and \( {\mathbf{F}}_{ \bot } \) is in the normal direction, which is supposed to be zero. Thus
where \( \tau_{wall} \) is the shear stress exerted by the wall on the fluid given by
In Eq. (15.119) \( {\mathbf{v}}_{\parallel } \) is the velocity vector in the direction parallel to the wall and \( d_{ \bot } \) is the normal distance from the centroid of the boundary element to the wall computed as
and \( {\mathbf{n}}\) the wall normal unit vector. The velocity vector \( {\mathbf{v}}_{\parallel } \) can be written as the difference between v and its normal component as
From Eq. (15.119), the wall shear stress can be approximated using
from which the boundary force for a laminar flow can be obtained as
Using Eq. (15.123) the coefficients of the boundary elements for the momentum equation in the x, y and z directions are modified as follows:
-
u-component equation
-
v-component equation
-
w-component equation
The unknown boundary pressure p b is extrapolated from the interior solution using either a truncated Taylor series expansion around point C such that pressure is found from
or the mass flow rate expressed via the Rhie-Chow interpolation as
Since the mass flow rate and velocity at the wall boundary are zero, the above equation reduces to
which can be modified into
Expressing \( {\mathbf{S^{\prime}}}_{b} \) as the sum of the two vector E b and T b , Eq. (15.130) becomes
Since E b is in the direction of Cb, the above equation can be modified to
from which the boundary pressure is obtained as
6.1.1.2 Slip Wall Boundary \( \left( {p_{b} = ?;\dot{m}_{b} = 0;{\mathbf{F}}_{b} = 0} \right) \)
For this boundary condition, the wall shear stress is zero (Fig. 15.20). Therefore the boundary force is zero. The boundary pressure is computed as for the no-slip wall boundary case using Eq. (15.127) or Eq. (15.133). The coefficients of the momentum equation (in vector form) are modified as follows:
6.1.2 Inlet Boundary Conditions
Three types of inlet boundary conditions are considered. (i) specified velocity; (ii) specified static pressure and velocity direction; and (iii) specified total pressure and velocity direction. All treatments of the pressure boundary conditions will be detailed in the pressure correction boundary conditions section.
6.1.2.1 Specified Velocity \( \left( {p_{b} = ?;\dot{m}_{b} \,specified;{\mathbf{v}}_{b} \,specified} \right) \)
For a specified velocity boundary condition at inlet (Fig. 15.21) the convection \( \left( {\dot{m}_{b} {\mathbf{v}}_{b} } \right) \) and diffusion \( \left( {{\mathbf{F}}_{b} = \tau_{b} \cdot {\mathbf{S}}_{b} } \right) \) terms at the boundary face are calculated using the known values of velocity v b and mass flow rate \( \dot{m}_{b} \). The pressure at the boundary is extrapolated from the boundary element centroid as
The terms involving the boundary velocity are treated explicitly by adding them to the source term and setting the coefficient \( a_{F = b}^{{\mathbf{v}}} \) to zero while adding its value to the \( a_{C}^{{\mathbf{v}}} \) coefficient.
The coefficients of the boundary element are modified according to
6.1.2.2 Specified Pressure and Velocity Direction \( \left( {p_{b}} = p_{specified} ;\;\right. \left.{\dot{m}_{b} ?;{\mathbf{e}}_{{\mathbf{v}}} \;specified;{\mathbf{v}}_{b} ?} \right) \)
In the case of a specified static pressure at inlet (Fig. 15.22), p b is known. The velocity being unknown, has to be computed from the pressure gradient at the boundary. To this end, a velocity direction should be specified as part of the boundary condition.
As the boundary pressure p b is known, its value is directly used in calculating the pressure gradient in the boundary element without any special treatment. Therefore p b is used in calculating \( \nabla p_{C} \).
The mass flow rate at the boundary is computed from the continuity equation (see next section). Then, for a specified velocity direction given by the unit vector e v , the velocity for a specified pressure boundary condition at inlet is obtained as
The velocity at the boundary is computed at every iteration and the problem is solved as in the case of a specified velocity with the coefficients in the momentum equation modified according to Eq. (15.136).
Specified Total Pressure and Velocity Direction \( \left( {p_{o,b}} = p_{o,specified} ; \right. \) \( \left.{\dot{m}_{b} ?;{\mathbf{e}}_{{\mathbf{v}}} \;specified;{\mathbf{v}}_{b} ?} \right) \)
In the case of a specified total pressure at inlet (Fig. 15.23) the velocity direction should also be specified. However, the magnitude of the velocity and the pressure at the boundary are unknown though related using the total pressure definition given by
where p 0 is the total pressure, p the static pressure, ρ the density, and v the velocity vector. The mass flow rate at the boundary is computed from the continuity equation (see next section). Knowing the mass flow rate, the velocity is computed in the same manner as for the specified pressure case using Eq. (15.137). The velocity is thus treated as a known velocity condition (i.e., a Dirichlet boundary condition) with the coefficients in the momentum equation modified according to Eq. (15.136).
6.1.3 Outlet Boundary Conditions
Three types of boundary conditions at an outlet are considered: (i) a specified static pressure, (ii) a specified mass flow rate, and (iii) a fully developed flow.
6.1.3.1 Specified Static Pressure \( \left( {p_{b} = p_{specified} ;\dot{m}_{b} ?;{\mathbf{v}}_{b} ?} \right) \)
For the momentum equation, fully developed conditions are assumed at a specified pressure outlet (Fig. 15.24) implying a zero velocity gradient along the direction of the surface vector at outlet. This is also equivalent to assuming the velocity at the outlet to be equal to that of the boundary element. Thus it is similar to a zero flux boundary condition whose implementation is rather simple.
The modifications to the coefficients are given by
This sets the contribution of the outlet velocity to zero and uses the specified pressure boundary value in the computation of the pressure gradient.
However to ensure that the flux is zeroed in the outflow surface vector direction only, the velocity is usually extrapolated to the outlet using the boundary flux, which is computed from the boundary element flux as
This ensures that the gradient along the boundary surface vector is zero. Then, using a Taylor series expansion, the velocity at the boundary is computed as
where \( \nabla {\mathbf{v}}_{b} \) is used instead of \( \nabla {\mathbf{v}}_{C} \). Therefore an additional correction is now added to the source term and the modifications to the coefficients become
6.1.3.2 Specified Mass Flow Rate \( \left( {\dot{m}_{b} = \dot{m}_{specified} ;p_{b} ?{\mathbf{v}}_{b} ?} \right) \)
Since the flow is incompressible, a specified mass flow rate boundary condition (Fig. 15.25) is equivalent to specifying the normal component of velocity at the boundary. The velocity is calculated by assuming its direction to be the same as that at the main grid point, i.e., \( \left( {{\mathbf{e}}_{{\mathbf{v}}} } \right)_{b} = \left( {{\mathbf{e}}_{{\mathbf{v}}} } \right)_{C} \). Thus, the velocity is expressed as
with \( \left| {{\mathbf{v}}_{b} } \right| \) obtained from
allowing v b to be calculated. Thus for momentum, a specified velocity boundary condition is applied. The coefficients of the boundary elements are modified according to Eq. (15.136).
6.1.3.3 Fully Developed Outlet Flow
For a fully developed flow, the velocity gradient normal to the outlet surface is assumed to be zero. Hence the velocity at the outlet is assumed to be known and computed from the zero normal gradient using Eqs. (15.140) and (15.141). As for the pressure at the boundary, it can be extrapolated from the interior pressure field using
The velocity is treated as known and the coefficients of the momentum equation are modified according to Eq. (15.142).
6.1.4 Symmetry Boundary Condition
A scalar is reflected across a symmetry boundary. Thus, a symmetry boundary condition for a scalar variable is imposed by setting its normal gradient to zero, as with an insulated wall boundary condition. For the velocity vector, the symmetry condition shown in Fig. 15.26 also implies that it is reflected about the symmetry boundary with its parallel component (i.e., parallel to the symmetry boundary) retaining magnitude and direction, while its normal component becoming zero. This results in a zero shear stress but a non-zero normal stress along the symmetry boundary. Thus, the same boundary condition can be used to impose a slip wall boundary condition for viscous flows.
The unit vector in the direction normal to the boundary \( {\mathbf{n}}\) and the normal distance to the boundary \( d_{ \bot } \) are given by Eq. (15.120). Therefore the velocity components normal and parallel to a symmetry boundary satisfy
The normal component of velocity can be written as
while the parallel component is given by Eq. (15.121). The boundary force F b can be decomposed into a normal component \( {\mathbf{F}}_{ \bot } \) and a parallel component \( {\mathbf{F}}_{||} \). As the shear stress along a symmetry boundary is zero, the parallel component of F b is zero. Denoting the normal stress by \( \sigma_{ \bot } \), the force F b is given by
The normal stress component can be approximated as
from which the boundary force is found to be
The pressure gradient in the direction normal to a symmetry boundary is zero. Mathematically this is written as
The pressure at a symmetry boundary should be extrapolated from the interior of the domain. Therefore to ensure a zero normal gradient, the pressure gradient at the symmetry boundary is computed as
Thus, the pressure is obtained from
Using the above equations, the coefficients of the boundary elements for the momentum equation in the x, y and z directions are modified as follows:
-
u-component equation
$$ \begin{aligned} a_{C}^{u} & \leftarrow \underbrace {{a_{C}^{u} }}_{interior \, faces \, contribution} + \underbrace {{\frac{{2\mu_{b} S_{b} }}{{d_{ \bot } }}n_{x}^{2} }}_{boundary \, face \, contribution} \\ 0 & \leftarrow a_{F = b}^{u} \\ b_{C}^{u} & \leftarrow \underbrace {{b_{C}^{u} }}_{interior \, faces \, contribution}\underbrace {{ - \frac{{2\mu_{b} S_{b} }}{{d_{ \bot } }}\left[ {v_{C} n_{y} + w_{C} n_{z} } \right]n_{x} - p_{b} S_{b}^{x} }}_{boundary \, face \, contribution} \\ \end{aligned} $$(15.154) -
v-component equation
$$ \begin{aligned} a_{C}^{v} & \leftarrow \underbrace {{a_{C}^{v} }}_{interior \, faces \, contribution} + \underbrace {{\frac{{2\mu_{b} S_{b} }}{{d_{ \bot } }}n_{y}^{2} }}_{boundary \, face \, contribution} \\ 0 & \leftarrow a_{F = b}^{v} \\ b_{C}^{v} & \leftarrow \underbrace {{b_{C}^{v} }}_{interior \, faces \, contribution}\underbrace {{ - \frac{{2\mu_{b} S_{b} }}{{d_{ \bot } }}\left[ {u_{C} n_{x} + w_{C} n_{z} } \right]n_{y} - p_{b} S_{b}^{y} }}_{boundary \, face \, contribution} \\ \end{aligned} $$(15.155) -
w-component equation
$$ \begin{aligned} a_{C}^{w} & \leftarrow \underbrace {{a_{C}^{w} }}_{interior \, faces \, contribution} + \underbrace {{\frac{{2\mu_{b} S_{b} }}{{d_{ \bot } }}n_{z}^{2} }}_{boundary \, face \, contribution} \\ 0 & \leftarrow a_{F = b}^{w} \\ b_{C}^{w} & \leftarrow \underbrace {{b_{C}^{w} }}_{interior \, faces \, contribution}\underbrace {{ - \frac{{2\mu_{b} S_{b} }}{{d_{ \bot } }}\left[ {u_{C} n_{x} + v_{C} n_{y} } \right]n_{z} - p_{b} S_{b}^{z} }}_{boundary \, face \, contribution} \\ \end{aligned} $$(15.156)
While this is not a comprehensive list of momentum boundary conditions, it does cover the most common types.
6.2 Boundary Conditions for the Pressure Correction Equation
The continuity equation for a boundary cell can be written as
or
where \( \dot{m}_{b}^{*} \) is the boundary mass flux and \( \dot{m}^{\prime}_{b} \) is its correction. While for an internal face the mass flux and its correction are defined by Eqs. (15.100) and (15.101), for a boundary face the definition is slightly different. Since at a boundary face only the boundary cell contributes to the average quantities, the use of Eq. (15.109) in combination with Eqs. (15.100) and (15.101) gives
In implementing boundary conditions the values of \( \dot{m}_{b}^{*} \), \( \dot{m}^{\prime}_{b} \), p b , and \( p^{\prime}_{b} \) must be calculated. Based on the discussions related to the momentum equation, three types of boundary conditions can be inferred. The first type is designated by “specified mass flow rate” (e.g., walls or velocity specified at inlets). For this category \( \dot{m}^{\prime}_{b} = 0 \), which is similar to a zero scalar flux boundary condition, and no modification to the pressure-correction equation is needed. The pressure however has to be computed at the boundary from the interior field. The second type of boundary conditions is termed “pressure specified” where \( p^{\prime}_{b} = 0 \) and for which a Dirichlet-like condition has to be enforced for the pressure-correction equation. For this condition, \( \dot{m}_{b}^{*} \) is computed from the boundary and interior pressure field. In the third type, an implicit relation exists between the pressure and the mass flow rate, as in a specified total pressure boundary condition. In this case, an explicit equation is extracted from the implicit relation and substituted into the pressure-correction equation.
Details regarding the various types of boundary conditions and their implementation are now given.
6.2.1 Wall Boundary Condition
6.2.1.1 \( \left( {p_{b} = ?;\dot{m}_{b} = 0;{\mathbf{v}}_{b} = {\mathbf{v}}_{wall} } \right)\quad {\text{or}}\quad \left( {p_{b} = ?;\dot{m}_{b} = 0;{\mathbf{F}}_{b} = 0} \right) \)
Whether it is a slip (Fig. 15.20) or no-slip (Fig. 15.19) wall boundary condition the mass flow rate is zero. Therefore \( \dot{m}^{\prime}_{b} = 0 \), which is equivalent to a specified zero flux and implying that no modification is needed for the pressure-correction equation. However the pressure at the wall is required and is computed using Eq. (15.127) or Eq. (15.133) or a low order extrapolation profile, as shown below.
6.2.2 Inlet Boundary Conditions
6.2.2.1 Specified Velocity \( \left( {p_{b} = ?;\dot{m}_{b}\, specified;{\mathbf{v}}_{b} \,specified} \right) \)
For a specified velocity at inlet (Fig. 15.21), the mass flux is known and its correction is set to zero, i.e., \( \dot{m}^{\prime}_{b} = 0 \). Thus, similar to a wall boundary condition, the term is simply dropped from the pressure-correction equation. The pressure at the boundary is extrapolated from the internal pressure field using Eq. (15.127) or Eq. (15.133) or a low order extrapolation profile as summarized in Eq. (15.160).
6.2.2.2 Specified Pressure and Velocity Direction \( \left( {p_{b}} = p_{specified} ;\right. \) \( \left.{\dot{m}_{b} ?;\,{\mathbf{e}}_{{\mathbf{v}}} \,specified;{\mathbf{v}}_{b} ?} \right) \)
In the case of a specified static pressure at inlet (Fig. 15.22), p b is known and thus \( p^{\prime}_{b} \) is set to zero but \( \dot{m}^{\prime}_{b} \ne 0 \). The inlet is treated as a Dirichlet boundary condition for the pressure-correction equation. The coefficient of the \( p^{\prime} \) equation becomes
6.2.2.3 Specified Total Pressure and Velocity Direction \( \left( {p_{o,b}} = p_{o,specified} ;\right. \;\left.{\dot{m}_{b} ?;\;{\mathbf{e}}_{{\mathbf{v}}} \,specified;{\mathbf{v}}_{b} ?} \right)\)
As mentioned earlier, for a specified total pressure (Fig. 15.23), the velocity direction should also be specified. The total pressure relation given by Eq. (15.138) is first rewritten as a function of the mass flow rate and pressure by replacing the velocity magnitude by the mass flux. Thus,
Using a Taylor expansion about p b , \( p^{\prime}_{b} \) is obtained as
Differentiating Eq. (15.162) with respect to \( \dot{m}_{b} \) and substituting into Eq. (15.163), the final form of \( p^{\prime}_{b} \) is found to be
Substituting Eq. (15.164) in Eq. (15.159), the mass flux correction is expressed as
Replacing \( \dot{m}_{b}^{\prime} \) in the expanded continuity equation (Eq. 15.158) by its expression from Eq. (15.165), the modified \( a_{C}^{{p^{\prime}}} \) coefficient for the boundary cell becomes
6.2.3 Outlet Boundary Conditions
6.2.3.1 Specified Pressure \( \left( {p_{b} = p_{specified} ;\dot{m}_{b} ?; \;{\mathbf{v}}_{b} ?} \right) \)
For a specified pressure at outlet (Fig. 15.24) \( p^{\prime}_{b} \) is set to zero. On the other hand, \( \dot{m}^{\prime}_{b} \) is computed as
The velocity direction being needed, it is customary to take the direction of v b to be that of the upwind velocity v C . The expression of the \( a_{C}^{{p^{\prime}}} \) coefficient in the pressure-correction equation becomes
6.2.3.2 Specified Mass Flow Rate \( \left( {\dot{m}_{b} = \dot{m}_{specified} ;p_{b} ?{\mathbf{v}}_{b} ?} \right) \)
For a specified mass flow rate at outlet (Fig. 15.25), \( \dot{m}^{\prime}_{b} \) is zero and is simply dropped from the pressure correction equation with no modifications required for the coefficients of the boundary elements. By setting \( \dot{m}^{\prime}_{b} \) to zero in Eq. (15.159), the pressure correction (or pressure) at the boundary is set equal to the pressure correction (or pressure) at the boundary cell centroid.
6.2.3.3 Fully Developed Outlet Flow
For a fully developed flow, the velocity at the outlet is assumed to be known and computed from the zero normal gradient. This means that \( \dot{m}_{b} \) at the outlet is known. Therefore no correction is needed and \( \dot{m}^{\prime}_{b} \) is set to zero. However, as the boundary pressure is unknown, it is extrapolated from the interior pressure field. Since the velocity is iteratively updated, the above treatment does not guarantee overall conservation except at convergence. It is customary with incompressible flows to overcome this issue and to enforce global mass conservation at any iteration by modifying \( \dot{m}_{b} \) at the boundary to satisfy overall mass conservation. This is done by calculating the total mass flow rate entering the domain \( \sum {\dot{m}_{in} } \). Then based on the calculated mass flow rates at outlet boundaries, the total mass flow rate leaving the domain \( \sum {\dot{m}_{out} } \) is computed. The mass flow rate at an outlet is adjusted according to
To be able to apply the above treatment, the outlet should be placed far away from any recirculation zone.
6.2.4 Symmetry Boundary Condition
The mass flow rate across a symmetry line (Fig. 15.26) is zero and as such its correction is set to zero, i.e., \( \dot{m}^{\prime}_{b} = 0 \). Thus, similar to a wall boundary condition, the mass flow rate correction term is simply dropped from the pressure-correction equation. The pressure at the boundary is extrapolated from the internal pressure field using Eq. (15.127) or Eq. (15.133) or a low order extrapolation profile as summarized in Eq. (15.160).
6.2.5 The Relative Nature of Pressure
For incompressible flow problems in which the normal velocities are prescribed on all boundaries, a difficulty arises due to the relative nature of pressure. In such cases, since only the pressure gradient appears in the momentum equation, there is no means for determining the absolute level of pressure, and only pressure differences have physical meaning. This indeterminacy of the pressure level leads to a singular coefficient matrix A and the direct solution of the system \( {\mathbf{A}}\phi = {\mathbf{b}} \) fails. The singularity is easily removed by simply setting the pressure at one point in the domain to a prescribed value. The remaining pressures are then calculated relative to this value.
7 The SIMPLE Family of Algorithms
In the SIMPLE algorithm [13], velocity and pressure are treated in a segregated (sequential) manner, with the pressure field computed by deriving a pressure correction equation that exploits the discrete momentum equation to replace the velocity field in the continuity equation with a pressure term. In the derivation, a velocity correction term, \( \overline{{{\mathbf{H}}_{f} }} [{\mathbf{v^{\prime}}}] \), was neglected as retaining it renders the equation unmanageable.
Discarding this term does not affect the final solution since its value is zero at convergence. Rather, it affects the path to convergence because during the initial iterations its value can be significant. This large value may either cause divergence or slow down the rate of convergence as a result of an overestimated pressure correction field. To counterbalance that, in SIMPLE the pressure is under relaxed by computing its value using \( p = p^{*} + \lambda^{p} p^{\prime} \), where \( \lambda^{p} \) is the pressure under relaxation factor. For optimum convergence, \( \lambda^{p} \) is usually set equal to \( ( 1 { }{-}\lambda^{{\mathbf{v}}} ) \), where \( \lambda^{{\mathbf{v}}} \) is the momentum under relaxation factor, with more information on this provided later.
Despite the use of under relaxation, the rate of convergence of the SIMPLE algorithm remains problem dependent and researchers sought alternatives for further improvements. Their effort culminated in the development of a SIMPLE-like family of algorithms such as SIMPLEC [17], SIMPLER [3], PISO [18], SIMPLEX [5], PRIME [19], SIMPLEM [20], and SIMPLEST [21]. Moukalled and Darwish [22] unified the formulation of these algorithms for both incompressible and compressible flows while Darwish et al. [23] and Jang et al. [24] assessed their performance. It is not the intention here to give a full account of these algorithms, rather, attention will be focussed on the two most popular variants, which are the SIMPLEC (SIMPLE Consistent) algorithm of Van Doormal and Raithby and the PISO (Pressure-Implicit Split Operator) algorithm of Issa. These two algorithms present two different approaches for dealing with the \( \overline{{{\mathbf{H}}_{f} }} [{\mathbf{v^{\prime}}}] \) term. In SIMPLEC the velocity correction at the main grid point is approximated as the weighted average of the velocity corrections at the neighboring locations altering the term \( \overline{{{\mathbf{H}}_{f} }} [{\mathbf{v^{\prime}}}] \) into a modified one, \( {\tilde{\mathbf{H}}}_{f} [{\mathbf{v^{\prime}}}] \), of smaller magnitude, which is then neglected. In the PISO algorithm, the \( \overline{{{\mathbf{H}}_{f} }} [{\mathbf{v^{\prime}}}] \) term is accounted for as part of the split operator approach. In all other algorithms, the \( \overline{{{\mathbf{H}}_{f} }} [{\mathbf{v^{\prime}}}] \) term is neglected as in SIMPLE and modifications are introduced either to the momentum equations or the D v operator. Because the PISO algorithm is equivalent to one step of the SIMPLE algorithm and one or more steps of the PRIME algorithm, the latter is also detailed.
In the PRIME [19] algorithm the momentum equation is solved explicitly. This explicit treatment of the momentum equation is justified by its small contribution to the convergence of the entire flow field. On the other hand, finding the correct solution for the pressure field represents the most important factor impacting the overall convergence.
In SIMPLEST [21], the coefficients in the momentum equation are separated into their convection and diffusion parts with the convection terms treated explicitly and the diffusion terms implicitly, thus affecting D v and H. The justification for the explicit treatment of convection is based on the similarity between the propagation of disturbances at a finite speed without any change in magnitude in a pure convection situation, and the propagation of error, from a particular point to the neighboring grid points, in a single iteration of explicit iterative methods. While the implicit treatment of diffusion is argued based on the similarity between the propagation of disturbances in a pure diffusion situation instantaneously in all directions with rapid decay in their amplitude and the reduction of errors throughout the entire solution domain, in a single iteration, by implicit solution methods.
In SIMPLEM (SIMPLE-Modified) [20], the pressure-correction equation is solved before the momentum equation implying that the pressure field is computed using the old velocity field. This results in better pressure corrections than velocity corrections and interchange the disadvantages and advantages of the SIMPLE algorithm.
In SIMPLER (SIMPLE-Revised) [3], an additional equation is developed from which the pressure is directly calculated while the SIMPLE-like pressure-correction equation is used to update the velocity field. The reason for a separate pressure equation being that, once the velocity field is updated using the predicted pressure correction field, it no longer satisfies the momentum equations. Therefore, the pressure should be calculated from another equation to match the velocities, so that the momentum equations are also satisfied.
The SIMPLEX algorithm [5] was developed with the aim of ensuring that the rate of convergence will not degrade with grid refinement. It differs from SIMPLE in the way the D v field is computed. This is done by using an additional set of equations, which is developed and solved based on the assumption that the influence of the spatial distribution of pressure difference changes little with grid refinement. Therefore, if the pressure difference influence is restricted to a cell, it would be appropriate to assume that, by extrapolation, the pressure difference at the main grid point adequately represents the pressure differences at the element faces.
Though all of the above algorithms were originally derived for a segregated grid, they are applicable within a collocated grid framework.
7.1 The SIMPLEC Algorithm
The SIMPLEC (SIMPLE-Consistent) [17] algorithm is a modified version of the SIMPLE algorithm derived by simply assuming that the velocity correction at point C is the weighted average of the corrections at the neighboring grid points. Mathematically this is expressed by
and using the H operator, Eq. (15.170) can be written as
Therefore instead of neglecting the \( \overline{{{\mathbf{H}}_{C} }} [{\mathbf{v^{\prime}}}] \) term as in SIMPLE, it is replaced by the approximate value given by the above equation. With this approximation the velocity correction given by Eq. (15.85) becomes
Equation (15.172) can then be used to derive the pressure correction equation.
The same result can be achieved by adding and subtracting the term \( \sum\limits_{F \sim NB(C)} {a_{F}^{{\mathbf{v}}} {\mathbf{v}}_{C} } \) from the momentum equation obtained by combining Eqs. (15.76) and (15.77), leading to the following modified equation:
which, in turn, can be written as
By using Eq. (15.174), the velocity correction equation becomes
Then the term \( {\tilde{\mathbf{H}}}_{C} [{\mathbf{v^{\prime}}} - {\mathbf{v^{\prime}}}_{C} ] \) is dropped, which is equivalent to the approximation given by Eq. (15.171), and the modified velocity correction is used in deriving the pressure correction equation.
Due to a better estimate in SIMPLEC (i.e., a smaller term is dropped), the relaxation of pressure becomes unnecessary and as compared to SIMPLE, the resulting velocity corrections will satisfy better the momentum equations. Consequently, a higher rate of convergence is obtained. Thus, with the exceptions of dropping \( {\tilde{\mathbf{H}}}_{C} [{\mathbf{v^{\prime}}} - {\mathbf{v^{\prime}}}_{C} ] \) rather than \( {\mathbf{H}}_{C} [{\mathbf{v^{\prime}}}] \) and replacing \( {\mathbf{D}}_{C}^{{\mathbf{v}}} \) by \( {\tilde{\mathbf{D}}}_{C}^{{\mathbf{v}}} \), the steps involved in the SIMPLEC algorithm are similar to those of the SIMPLE algorithm.
7.2 The PRIME Algorithm
In the PRIME (PRessure Implicit Momentum Explicit) [19] algorithm, the momentum equation is solved explicitly. This explicit treatment is justified by the small contribution to the convergence of the entire flow field by the iterative sweeps of the momentum equation. On the other hand, finding the correct solution for the pressure field represents the most important factor in the overall convergence. Based on this argument, the PRIME algorithm can be summarized as follows:
The momentum equation is solved explicitly to obtain a new velocity field v * using
This velocity field is employed to derive the pressure correction equation. Thus defining the correction fields such that
the corrected field would satisfy
leading to the following expression relating velocity and pressure correction:
Substituting Eq. (15.179) and its correction into the continuity equation yields
where the underlined terms in Eqs. (15.179) and (15.180) are neglected.
The terms neglected in PRIME \( \left( {{\mathbf{H}}_{C} \left[ {{\mathbf{v}}^{*} {-}{\mathbf{v}}^{(n)} } \right] \, + {\mathbf{H}}_{C} [{\mathbf{v^{\prime}}}]} \right) \) can become smaller than the term neglected in SIMPLE \( \left( {{\mathbf{H}}_{C} [{\mathbf{v^{\prime}}}]} \right) \) if \( {\mathbf{H}}_{C} [{\mathbf{v^{\prime}}}] \) and \( {\mathbf{H}}_{C} \left[ {{\mathbf{v}}^{*} {-}{\mathbf{v}}^{(n)} } \right] \) are of opposite signs. It is worth noting that \( {\mathbf{H}}_{C} [{\mathbf{v^{\prime}}}\left] { \, = {\mathbf{H}}_{C} } \right[{\mathbf{v}}^{**} {-}{\mathbf{v}}^{*} ] \) is a correction to satisfy continuity, while \( {\mathbf{H}}_{C} \left[ {{\mathbf{v}}^{*} {-}{\mathbf{v}}^{(n)} } \right] \) is a correction to satisfy momentum. Usually the corrector added to satisfy momentum is opposite to that added to satisfy continuity and hence, the neglected term \( \left( {{\mathbf{H}}_{C} \left[ {{\mathbf{v}}^{*} {-}{\mathbf{v}}^{(n)} } \right] \, + {\mathbf{H}}_{C} [{\mathbf{v^{\prime}}}]} \right) \) is smaller. Moreover, since the momentum equations are explicitly solved, no under-relaxation is required. This has the advantage of increasing the stability of the algorithm.
7.3 The PISO Algorithm
In the PISO algorithm [18, 25], the \( {\mathbf{H}}_{C} [{\mathbf{v^{\prime}}}] \) term is accounted for as part of a correction procedure composed of two or more steps. The first step is similar to the SIMPLE algorithm where \( \mathbf{v}^{\prime} \) is computed from Eq. (15.83) while neglecting \( {\mathbf{H}}_{C} [{\mathbf{v^{\prime}}}] \). The continuity satisfying velocity v ** and pressure p * fields are used to recalculate the coefficients of the momentum equation and then to solve it explicitly. The new velocity field v *** is used to calculate the mass flow rate field \( \dot{m}^{***} \) at the element faces using the Rhie-Chow interpolation. Then, \( {\mathbf{H}}_{C} [{\mathbf{v^{\prime}}}] \) is partially recovered in a second corrector step where the velocity correction is written as
In Eq. (15.181) the underlined term represents the portion of the \( {\mathbf{H}}_{C} [{\mathbf{v^{\prime}}}] \) that is recovered by the second corrector step. The second velocity correction satisfies
Using Eq. (15.181) with the Rhie-Chow interpolation between points C and F, a new pressure-correction field is obtained as
where the underlined terms in Eqs. (15.182) and (15.183) are again neglected. This corrector step may be repeated as many times as desired, each time recovering a new additional portion of \( {\mathbf{H}}_{C} [{\mathbf{v^{\prime}}}] \).
By following the sequence of events, it can be easily seen that PISO may be considered as a combination of one SIMPLE step and one or more PRIME steps, hence combining the implicitness of the SIMPLE algorithm with the stability of the PRIME algorithm. The sequence of events in the collocated PISO algorithm can be summarized as follows:
-
1.
To compute the solution at time t + Δt, use as an initial guess the solution at time t for pressure, velocity, and mass flow rate fields p (n), u (n), and \( \dot{m}^{(n)} \), respectively.
-
SIMPLE Step
-
2.
Solve implicitly the momentum equation given by Eq. (15.70) to obtain a new velocity field v *.
-
3.
Update the mass flow rate at the cell faces using the Rhie-Chow interpolation technique (Eq. 15.100) to obtain a momentum satisfying mass flow rate field \( \dot{m}_{f}^{*} \).
-
4.
Using the new mass flow rates, assemble the pressure correction equation (Eq. 15.98) and solve it to obtain a pressure correction field p′.
-
5.
Update the pressure and velocity fields at the cell centroids and the mass flow rate at the cell faces to obtain continuity-satisfying fields using Eq. (15.101).
-
PRIME Step(s)
-
6.
Using the latest available velocity and pressure fields, calculate the coefficients of the momentum equation and solve it explicitly.
-
7.
Update the mass flow rate at the cell faces using the Rhie-Chow interpolation technique.
-
8.
Using the new mass flow rates, assemble the pressure correction equation (Eq. 15.183) and solve it to obtain a pressure correction field.
-
9.
Update pressure, velocity, and mass flow rate fields using expressions similar to the ones given in Eq. (15.101).
-
10.
Go to step 6 and repeat based on the desired number of corrector steps.
-
11.
Set the initial guess for velocity, mass flow rate, and pressure as u **, \( \dot{m}^{**} \), and p *.
-
12.
Go back to step 2 and repeat until convergence.
-
13.
Set the solution at time t + Δt to be equal to the converged solution and set the current time t + Δt to be t.
-
14.
Advance to the next time step.
-
15.
Go back to step 1 and repeat until the last time step is reached.
A flowchart of the PISO algorithm is presented in Fig. 15.27.
8 Optimum Under-Relaxation Factor Values for v and \( p^{\prime} \)
To promote convergence in the SIMPLE algorithm the momentum and continuity equations are under relaxed using the under relaxation factors λ v and λ p, respectively. An important task is to find the under relaxation values that will result in the optimum convergence rate. Recalling that the velocity correction is obtained without any under relaxation from
Moreover, in calculating the pressure field, the pressure correction is under relaxed in order for the velocity correction field given by Eq. (15.184) to satisfy the exact velocity correction equation given by
Equating Eqs. (15.184) and (15.185), an expression for λ p is obtained as
The SIMPLEC algorithm eliminated the need to under relax pressure correction and resulted in the optimum acceleration rate. Therefore, using the approximation introduced in SIMPLEC, the velocity correction at C can be written as the weighted average of the velocity corrections at the neighboring grid points such that
From Eqs. (15.70)–(15.73) the coefficient \( a_{C}^{{\mathbf{v}}} \) can be expressed as
which in the limit of a steady state solution (the case for which under relaxation is used, since for an unsteady situation the time step plays the role of the under relaxation factor) reduces to
Substituting Eq. (15.189) in Eq. (15.187), the velocity correction is approximated as
substituting Eq. (15.190) in Eq. (15.186), an expression relating λ v and λ p is obtained as
Experience has shown that the performance of the SIMPLE algorithm with its under relaxation factors satisfying Eq. (15.191) is similar to that of the SIMPLEC algorithm.
9 Treatment of Various Terms with the Rhie-Chow Interpolation
9.1 Treatment of the Under-Relaxation Term
The use of the collocated grid method with the Rhie-Chow interpolation resulted in solutions that are dependent on the value of under relaxation factor in the momentum equation. To eliminate this dependence, a modification to the Rhie-Chow interpolation is required. The under relaxed momentum equation is written as
where \( {\mathbf{b}}_{C}^{{\mathbf{v}}} \) is the source term of the momentum equation from which the pressure and under relaxation source terms are extracted and \( {\mathbf{v}}_{C}^{(n)} \) is the previous iteration value of velocity at cell centroid C. The corresponding under relaxed momentum equation using a staggered grid formulation can be expressed as
The Rhie-Chow interpolation method mimics the staggered grid formulation by forming a pseudo-momentum equation at the cell face. It is because of this behavioral imitation that the Rhie-Chow interpolation is successful. Therefore as a guiding principle, the yardstick to any modification to the Rhie-Chow interpolation should be whether the modified formulation is similar to the staggered grid formulation. Therefore, the form of the under relaxed equation using the Rhie-Chow interpolation should be given by
The average of the first term on the right hand side is obtained as
Substituting Eq. (15.195) into Eq. (15.194), the extended Rhie-Chow interpolated cell face velocity \( {\mathbf{v}}_{f} \) is obtained as
Not accounting for the effect of under-relaxation on the face velocity results in solutions that depend on the under relaxation factor.
9.2 Treatment of the Transient Term
When solving a transient problem with a backward Euler transient scheme the discretized momentum equation can be written as
where \( {\mathbf{b}}_{C}^{{\mathbf{v}}} \) is the source term of the momentum equation from which the pressure and transient source terms are extracted. The equivalent equation for the staggered grid variable arrangement has a similar form given by
Using the Rhie-Chow interpolation method, a pseudo cell-face equation will be constructed as
The average of the first term on the right hand side is obtained as
Substituting into Eq. (15.84), the extended Rhie-Chow interpolated cell face velocity \( {\mathbf{v}}_{f} \) is obtained
Not accounting for the effect of the unsteady term on the face velocity results in solutions that are time step dependent and have an oscillatory behavior for small time step. This correction is valid only for the first order Euler discretization. In case of more accurate time discretization schemes similar corrections can be performed following the same principles.
9.3 Treatment of the Body Force Term
When treating body forces in the staggered grid arrangement, the stencil of the body force term is exactly that of the pressure gradient term. In the case of a collocated grid arrangement, the body force, velocity, and momentum variables are calculated at the same location. Thus, in order to have a discretization of the body force that retains a similar stencil as the pressure, a redistribution of the body force term is needed. The discretized momentum equation is written as
where the double bar indicates two averaging steps. The first step is to compute \( \overline{{{\mathbf{B}}_{C}^{{\mathbf{v}}} }} \) (Fig. 15.28) at the cell face as
while the second (Fig. 15.29) is to get an average of these face values at the cell centre.
The average values at cell center can best be derived [26] by considering the one dimensional situation depicted in Fig. 15.30.
For the case of a stationary fluid, the pressure gradient should be in equilibrium with the body forces leading to
Expanding the above equation, a relation between the pressures at C and F can be written as
or more generally as
where B f is the magnitude of B f given by
For incompressible flows, the variation with temperature of the density appearing in the body force term is modeled using the Boussinesq approximation as given by Eq. (3.101).
Again for cell C the pressure gradient should be in equilibrium with the body forces, resulting in
However the pressure gradient for cell C is computed as
substituting from Eq. (15.206) gives
which implies that
The second requirement is that the cell-face velocity be similar to that of the staggered arrangement equation:
where \( {\mathbf{b}}_{C}^{{\mathbf{v}}} \) is the source term given in Eq. (15.71) from which the pressure and body force terms are extracted. The averaging of the coefficients yields
and substituting into Eq. (15.179), the extended Rhie-Chow interpolated cell face velocity \( {\mathbf{v}}_{f} \) is obtained as
where \( \overline{{\overline{\overline{{{\mathbf{B}}_{f}^{{\mathbf{v}}} }}} }} \) is calculated as
The above additional treatment of the cell face velocity increases the overall robustness of the solution procedure for situations where variations in body forces are important (e.g., free-surface flows).
9.4 Combined Treatment of Under-Relaxation, Transient, and Body Force Terms
In general all three terms described above should be dealt with together. This necessitates modifying the Rhie-Chow interpolation to account for all three effects. Fortunately this can easily be derived by using the principle of superposition leading to the following interface velocity:
where in calculating \( \overline{{{\mathbf{D}}_{f}^{{\mathbf{v}}} }} \) the under relaxed value of the \( a_{C}^{{\mathbf{v}}} \) coefficient is used.
10 Computational Pointers
10.1 uFVM
In uFVM, the pressure correction equation is implemented in one script file denoted by cfdAssembleMdotTerm. Listing 15.1 shows the core of the algorithm whereby the coefficients of the pressure correction equation are assembled by linearizing the fluxes at each of the interior faces. In addition, the mdot field (i.e., the mass flow rate at the faces) is calculated based on Eq. (15.216), which is subdivided into 9 terms (i.e., terms I trough IX) and assembled step by step to produce the cell face velocity. The terms into which the velocity at the face is decomposed are as follows:
-
term I: the interpolated velocity field \( \overline{{{\mathbf{v}}_{f} }} \),
-
terms II and III: the face and average pressure gradients \( - \overline{{{\mathbf{D}}_{f}^{{\mathbf{v}}} }} \left( {\nabla p_{f} - \overline{{\nabla p_{f} }} } \right) \),
-
terms IV and V: the average and redistributed body forces \( \overline{{{\mathbf{D}}_{f}^{{\mathbf{v}}} }} \left( {\overline{{{\mathbf{B}}_{f}^{{\mathbf{v}}} }} - \overline{{\overline{\overline{{{\mathbf{B}}_{f}^{{\mathbf{v}}} }}} }} } \right) \),
-
terms VI and VII: the transient fluxes \( \frac{{\overline{{a_{f}^{ \circ } {\mathbf{D}}_{f}^{{\mathbf{v}}} }} }}{{V_{f} }}\left( {{\mathbf{v}}_{f}^{ \circ } - \overline{{{\mathbf{v}}_{f}^{ \circ } }} } \right) \), and
-
terms VIII and IX: the relaxation correction term \( (1 - \lambda^{\textbf{v}} )({\mathbf{v}}_{f}^{(n)} - \overline{{{\mathbf{v}}_{f}^{(n)} }} ) \).
10.2 OpenFOAM®
The numerical techniques introduced so far are used in what follows to develop OpenFOAM® [27] applications for solving the incompressible Navier-Stokes equations.
10.2.1 Pressure Correction SIMPLE Solvers
Based on the SIMPLE algorithm, a number of solvers will be constructed. The base solver, simpleFoam, will be presented first. This is followed by a number of versions, with each one adding more capabilities to the base code. These solvers can be summarized as follows:
-
1.
simpleFoam (not the OpenFOAM® built-in solver) is the base code that incorporates the SIMPLE Algorithm in its most basic form.
-
2.
simpleFoamImproved extends the base code to allow for improved treatment of relaxation.
-
3.
simpleFoamTransient adds transient capabilities to the steady-state simpleFoam.
-
4.
simpleFoamBuoyancy adds to the code the body force treatment.
More versions will be covered in the chapters to follow, each one with extended capabilities, added by modifying the base code described in this chapter. A list of the versions that will be covered in the next chapters is given below.
-
5.
simpleFoamCompressible is the compressible version of simpleFoam (Chap. 16)
-
6.
simpleFoamTurbulent includes capabilities for treating turbulent flows (Chap. 17).
-
simpleFoam
Before reviewing the simpleFoam code, some basic notational issues are addressed. The first step is to define, as shown in Listing 15.2, the geometric fields and parameters that will be initialized and used in the code.
In Listing 15.2, the #include macro directives outside the main function are needed to define the types of objects that are then declared and used in the application. The #include “fvCFD.H” contains a list of definitions for classes that are in general necessary to build any application in OpenFOAM®. In the developed application an additional header, not present in the fvCFD.H header, necessary for the SIMPLE solver implementation will be added.
The use of the #include statements inside the main function is a compacting procedure, with each declared statement representing a piece of the code moved to the corresponding file name. For example, the statement #include “createMesh.H” just represents the code shown in Listing 15.3, which is necessary to instantiate the mesh class.
Once the necessary initialization has been performed, the next step is the definition of the proper fields or variables needed by the solver. These are defined in file “createFields.H”. The first defined field, shown in Listing 15.4, is the pressure field (p).
Since the solution is obtained by solving a pressure correction equation instead of a pressure equation, a pressure correction field (pp) is also defined (Listing 15.5).
It is worth noting that in Listing 15.5 a different constructor is used to define the pressure correction field. Since the pressure corrector represents the pressure itself, the same boundary conditions defined for the real pressure can be used for the pressure correction field without the need to define the same quantity twice.
The list of pressure boundary types displayed in Listing 15.6 are now copied under the pbt variable in Listing 15.5 and directly used in the constructor of pp.
The corrector should reset to zero the correction field at every iteration and should also apply a zero value at all boundaries for which a Dirichlet boundary condition is used for the pressure.
The velocity and corresponding mass flux fields must also to be defined. As depicted in Listing 15.7, the velocity field is defined through an input file while the mass flux field can be defined as a derived quantity.
Finally the fluid thermo-physical properties should also be defined. For incompressible laminar flows this involves simply assigning a value to the kinematic viscosity nu, as shown in Listing 15.8.
After defining all variables the implementation of the SIMPLE algorithm can proceed. A while loop can be used for the cases when the stopping criterion is the number of SIMPLE iterations. For each single loop, the momentum and pressure correction equations are solved and updates of the variables are performed. Starting with the momentum equation written as (the form solved in OpenFOAM®),
where the kinematic viscosity v is defined as
and p represents the pressure divided by the density, i.e.,
its solution is translated into the script shown in Listing 15.9.
The first instruction in Listing 15.9 defines the finite volume discretization of the momentum equation in vector form with its storage matrix (the three components of the velocity vector are solved in a segregated manner despite its vectorial implementation). The system is then implicitly relaxed and solved via an iterative solver.
Once the momentum equation is solved, a new guess for the velocity field is obtained. This velocity does not satisfy the continuity equation in general and the assembly of the continuity equation in the form of a pressure correction equation is now required to correct the flow field. The pressure correction equation is written as
where a component of \( {\bar{\mathbf{D}}}\) at an element centroid is computed as
with values at the faces obtained by interpolation. Its implementation is translated into the following syntax (Listing 15.10):
where div(mDot) is basically \( \sum {\dot{m}_{f} } \), while pp represents p′ and is reset to zero at each iteration. Moreover, the DUf variable is the value of D at the cell face obtained, as shown in Listing 15.11, by linear interpolation using the values at the nodes straddling the face. Further, .A() represents the diagonal terms in the momentum matrix divided by the volume.
Listing 15.12 computes the mass flow rate at cell faces (mDot) using the Rhie-Chow interpolation where the calculation of ∇p f and \( \overline{{\nabla p_{f} }} \) is clearly shown.
The pressure correction equation is now fully set and is solved by executing the statement in Listing 15.13.
Once the pressure correction equation is solved, the velocity, pressure, and mass flow rate fields are updated using the obtained pressure correction field. Starting with the mass flow rate field (i.e., the mDot flux), it is updated by executing the below statement (Listing 15.14).
The flux() function in Listing 15.14 provides the matrix multiplication, the extra diagonal matrix coefficients, and the corresponding solution. Recalling the finite volume discretization of the diffusion term, each extra diagonal of coefficients represents a face of the mesh. Thus the update of the fluxes can be performed in a more consistent way using directly the matrix coefficients and cell values. A simplified version of the flux() function is shown in Listing 15.15.
In Listing 15.15 the correction flux mDotPrime (Eq. 15.101) is basically evaluated by performing a loop over the faces using the upper and lower coefficients of the matrix and multiplying these coefficients with the corresponding cell values.
Finally the velocity and pressure at cell centroids are updated using the script shown in Listing 15.16,
where the variable URF is the explicit relaxation factor for pressure update λp, necessary for a stable SIMPLE solver.
-
simpleFoamImproved
In simpleFoamImproved the Rhie-Chow interpolation is extended to account for the relaxation of the velocity field. This is translated into the syntax presented below in Listing 15.17 that expands the generic Rhie-Chow interpolation to include the additional term in Eq. (15.196).
Thus the fields mdotf.prevIter() and U.prevIter() need to be defined.
-
simpleFoamTransient
In simpleFoamTransient the Rhie-Chow interpolation is extended to account for the transient term. Thus the expression for the mass flow rate becomes (Listing 15.18).
Furthermore the main loop is modified to add a transient loop, with the main code becoming as shown in Listing 15.19.
-
simpleFoamBuoyancy
The simpleFoamBuoyancy solver adds to simpleFoamTransient the following capabilities: (i) the solution of the energy equation, (ii) the inclusion of a body source term in the momentum equation, and (iii) an account of the effects of the body force term redistribution in the Rhie-Chow interpolation.
The codes used to introduce these modifications are shown in Listings (15.20), (15.21), and (15.22).
The code needed to solve the energy equation is given in Listing (15.20).
The source term in the momentum equation is implemented as (Listing 15.21),
while the calculation of the mass fluxes using the Rhie-Chow interpolation are as displayed in Listing (15.22).
11 Closure
This chapter presented the segregated pressure-based approach for solving incompressible flow problems on collocated grids. It also demonstrated that the success of the Rhie-Chow interpolation on collocated grids is due to its formation of a pseudo-momentum equation at the cell face that has a tight pressure gradient stencil similar to the one resulting from a staggered grid formulation. In addition, the details of implementing the most commonly encountered boundary conditions in the momentum and pressure-correction equations were discussed. The next chapter will extend the pressure based method to predict compressible fluid flow at all speeds.
12 Exercises
Exercise 1
A portion of a water-supply system is shown in Fig. 15.31. The flow rate \( \dot{m} \) in a pipe section is given by
where Δp is the pressure drop over the length of the pipe section, and C is the hydraulic conductance. The following data is known:
Find p 3, p 4, p 5, \( \dot{m}_{A} ,\dot{m}_{B} ,\dot{m}_{C} ,\dot{m}_{D} \) and \( \dot{m}_{E} \) using the following procedure
-
Start with a guess for p 3, p 4, and p 5.
-
Compute \( \dot{m}^{*} \) values based on the guessed pressures.
-
Construct the pressure-correction equations and solve for \( p^{\prime}_{3} \), \( p^{\prime}_{4} \) and \( p^{\prime}_{5} \).
-
Update the pressures and the \( \dot{m}^{*} \) values
Do you need to iterate? Why?
Exercise 2
A one dimensional flow through a porous material is governed by
where c is a constant. The continuity equation is
Use the SIMPLE procedure for the grid shown in Fig. 15.32 to compute p 2, u A , and u B from the following data:
with the size and area at the center of each control volume given by
Exercise 3
In the Steady, one dimensional, constant density situation shown in Fig. 15.33, the velocity u is calculated at locations B and C, while the pressure is calculated at locations 1 and 2. The velocity correction formulae are written as
where the values of D B and D C are 3 and 4, respectively. The boundary conditions are u A = 5 and p 3 = 70.
-
(a)
If at a given stage in the iteration process, the momentum equations give \( u_{B}^{*} = 4 \) and \( u_{C}^{*} = 6 \), calculate the values of p 1 and p 2.
-
(b)
Explain how you could obtain the values of p 1 and p 3 if the right hand boundary condition is given as u C = 5 instead of p 3 = 70.
Exercise 4
Consider the main control volume shown in Fig. 15.34. A staggered mesh is used with the u and v velocity components stored as shown. The following quantities are given: u w = 7, v s = 3, p N = 0 and p E = 50. The flow is steady and the density is constant. The momentum equations for u e and v n are given by:
Also given D e = 2, D n = 1.6, and the control volume has Δx = Δy = 1.
-
(a)
Starting with a guessed value of \( p_{C}^{(n)} = 50 \), use the SIMPLE algorithm to find u e and v n .
-
(b)
Is an iteration loop needed for this problem? Explain.
Exercise 5
Consider the simplified one-dimensional Forchheimer model for flow in porous media given by
with the continuity equation given by
In the above equations b is a constant and ε is the porosity coefficient that accounts for the effective porous area.
Devise a SIMPLE-like procedure to compute p C , u e , and u w for the following data:
Start with the following initial values for velocity and pressure (Fig. 15.35):
Exercise 6
Compute the interface velocities u e and u w using the Rhie-Chow interpolation and compare it to the averaged values \( \bar{u}_{e} \) and \( \bar{u}_{w} \) knowing the following data (Fig. 15.36):
Exercise 7
In OpenFOAM® develop a SIMPLEC pressure correction algorithm by modifying the SIMPLE algorithm described in this chapter. Hint: in order to find the summation of the extra diagonal coefficients use the H1() function of the fvMatrix.
Exercise 8
Check the pisoFoam solver located in $FOAM_SRC/../applications/solvers/incompressible/pisoFoam/pisoFoam.C and compare it with the algorithm described in this chapter, i.e., “The Collocated PISO Algorithm”. Find out the inconsistency with the standard OpenFOAM® implementation.
Exercise 9
Develop a pressure correction PISO algorithm for OpenFOAM®.
References
Patankar SV (1981) A calculation procedure for two dimensional elliptic situations. Numer Heat Transfer 4(4):409–425
Patankar SV (1980) Numerical heat transfer and fluid flow. Hemisphere, NY
Patankar SV, Spalding DB (1972) A calculation procedure for heat, mass and momentum transfer in three-dimensional parabolic flows. Int J Heat Mass Transf 15(10):1787–1806
Harlow FH, Welch JE (1965) Numerical calculation of time-dependent viscous incompressible flow of fluid with free surface. Phys Fluids 8(12):2182–2189
Van Doormaal JP, Raithby GD (1985) An evaluation of the segregated approach for predicting incompressible fluid flows. ASME Paper 85-HT-9, Presented at the national heat transfer conference, Denver, Colorado
Raithby GD, Schneider GE (1979) Numerical solution of problems in incompressible fluid flow: treatment of the velocity-pressure coupling. Numer Heat Transfer, Part A 2(4):417–440
Patankar SV (1975) Numerical prediction of three-dimensional flow. In Launder BE (ed) studies in convection: theory, measurement, and application, vol 1. Academic, New York, pp 1–9
Rhie CM, Chow WL (1983) Numerical study of the turbulent flow past an airfoil with trailing edge separation. AIAA J 21:1525–1532
Rhie CM (1988) A three-dimensional passage flow analysis method aimed at centrifugal impellers. Comput Fluids 13:443–460
Majumdar S (1988) Role of under relaxation in momentum interpolation for calculation of flow with nonstaggered grids. Numer Heat Transfer 13:125–132
Miller TF, Schmidt FW (1988) Use of a pressure-weighted interpolation method for the solution of incompressible Navier-Stokes equations on a nonstaggered grid system. Numer Heat Transfer 14:213–233
Karki KC, Patankar SV (1988) Calculation procedure for viscous incompressible flows in complex geometries. Numer Heat Transfer 14:295–307
Choi SK, Nam HY, Cho M (1993) Use of the momentum interpolation method for numerical solution of incompressible flows in complex geometries: choosing cell face velocities. Numer Heat Transfer, Part B 23:21–41
Choi SK, Nam HY, Lee YB, Cho M (1993) An efficient three-dimensional calculation procedure for incompressible flows in complex geometries. Numer Heat Transfer, Part B 23:387–400
Choi SK, Nam HY, Cho M (1994) Use of staggered and nonstaggered grid arrangements for incompressible flow calculations on nonorthogonal grids. Numer Heat Transfer, Part B 25(2):193–204
Choi SK, Nam HY, Cho M (1994) Systematic comparison of finite-volume calculation methods with staggered and nonstaggered grid arrangements. Numer Heat Transfer, Part B 25(2):205–221
Van Doormaal JP, Raithby GD (1984) Enhancement of the SIMPLE method for predicting incompressible fluid flows. Numer Heat Transfer 7:147–163
Issa RI (1982) Solution of the implicit discretized fluid flow equations by operator splitting. Mechanical Engineering Report, FS/82/15, Imperial College, London
Maliska CR, Raithby GD (1983) Calculating 3-D fluid flows using non-orthogonal grid. In: Proceedings of the third international conference on numerical methods in laminar and turbulent flows, Seattle, pp 656–666
Acharya S, Moukalled F (1989) Improvements to incompressible flow calculation on a non-staggered curvilinear grid. Numer Heat Transfer, Part B 15:131–152
Spalding DB (1980) Mathematical modelling of fluid mechanics, heat transfer and mass transfer processes. Mechanical Engineering Department Report HTS/80/1, Imperial College of Science, Technology and Medicine, London
Moukalled F, Darwish M (2000) A unified formulation of the segregated class of algorithms for fluid flow at all speeds. Numer Heat Transfer, Part B 37:103–139
Darwish M, Asmar D, Moukalled F (2004) A comparative assessment within a multigrid environment of segregated pressure-based algorithms for fluid flow at all speeds. Numer Heat Transfer, Part B 45(1):49–74
Jang DS, Jetli R, Acharya S (1986) Comparison of the PISO, SIMPLER and SIMPLEC algorithms for the treatment of the pressure-velocity coupling in steady flow problems. Numer Heat Transfer 10:209–228
Yen RH, Liu CH (1993) Enhancement of the SIMPLE algorithm by an additional explicit corrector step. Numer Heat Transfer, Part B 24:127–141
Mecinger J (2012) An alternative finite volume discretization of body force field on collocated grids. In: Petrova R (ed) Finite volume method-powerful means of engineering design. ISBN:978-953-51-0445-2
OpenFOAM, 2015 Version 2.3.x. http://www.openfoam.org
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
Copyright information
© 2016 Springer International Publishing Switzerland
About this chapter
Cite this chapter
Moukalled, F., Mangani, L., Darwish, M. (2016). Fluid Flow Computation: Incompressible Flows. In: The Finite Volume Method in Computational Fluid Dynamics. Fluid Mechanics and Its Applications, vol 113. Springer, Cham. https://doi.org/10.1007/978-3-319-16874-6_15
Download citation
DOI: https://doi.org/10.1007/978-3-319-16874-6_15
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-16873-9
Online ISBN: 978-3-319-16874-6
eBook Packages: EngineeringEngineering (R0)