CMS-Flow Numerical Methods: Difference between revisions
No edit summary |
No edit summary |
||
Line 163: | Line 163: | ||
where the subscripts ''P'' and ''N'' refer to two neighboring cells, <math>|\delta_{\perp}| = |x_{\perp,N} - x_{\perp,P}| </math> is the distance between cells P and N, normal to the cell face (Figure 3-4), and <math>\bigtriangledown_\|</math> is the gradient operator in the direction parallel to face ''f''. Ham et al. (2002) compared the auxiliary node formulation to the fully-unstructured discretization proposed by Zwart et al. (1998) for the viscous terms and found that the auxiliary node formulation is significantly more stable. | where the subscripts ''P'' and ''N'' refer to two neighboring cells, <math>|\delta_{\perp}| = |x_{\perp,N} - x_{\perp,P}| </math> is the distance between cells P and N, normal to the cell face (Figure 3-4), and <math>\bigtriangledown_\|</math> is the gradient operator in the direction parallel to face ''f''. Ham et al. (2002) compared the auxiliary node formulation to the fully-unstructured discretization proposed by Zwart et al. (1998) for the viscous terms and found that the auxiliary node formulation is significantly more stable. | ||
=== | ==Cell-centered Gradient== | ||
{{Equation| | The cell-centered gradient operator is calculated using the Gauss’ Divergence Theorem as | ||
<math> | |||
\ | {{Equation|<math> | ||
</math> | \int_A \bigtriangledown_i \phi dA = \sum_f \hat{n_i}\phi_f \Delta l_f</math>|10}} | ||
| | |||
The equation above is second order and conservative for regular and non-uniform grids. | |||
==Reconstruction, Monotonicity, and Slope Limiters== | |||
Variables are linearly reconstructed within the cells as | |||
{{Equation|<math> | |||
\phi = \phi_P + \overrightarrow{r}\cdot \bigtriangledown \phi_P | |||
</math>|11}} | |||
where <math>\phi_P</math> is the cell-average value specified at the cell centroid, <math>\overrightarrow{r}</math> is the distance vector from the cell centroid to any location within the cell, and <math>\bigtriangledown \phi_P</math> is the cell-centered gradient. The reconstruction is second order and conservative in the sense that <math>\phi_P \Delta A_P = \int_A \phi dA</math>. The linear reconstruction is used when interpolating cell-face values (Equation 7) and calculating cell-face gradients (Equation 13). If the reconstruction satisfies the local maximum principle | |||
{{Equation|<math> | |||
min(\phi - \phi_P,0) \leq \overrightarrow{r}\cdot \bigtriangledown \phi_P \leq max(\phi - \phi_P,0) | |||
</math>|12}} | |||
then no new extrema are created within the cell, and the solution is monotonic. Figure 5 shows two examples of linear reconstruction with and without slope limiters to ensure monotonicity. | |||
<center>'''Figure 5. Schematics showing examples of (a) non-limited and (b) limited linear reconstructions.''' | |||
[[File:fig_5.bmp]] | |||
</center> | |||
For non-telescoping grids, the slope limiter is calculated as | |||
{{Equation|<math> | |||
\Phi(R) = \left\{\begin{align} | |||
&\frac {4R} {(R+1)^2}\quad van Leer (1979) \\ | |||
&\frac {2R} {(R^2 +1)}\quad van Albada 1979 \\ | |||
&min \left(1, \frac{4}{R+1}, \frac {4R} {R+1} \right) \quad MUSCL (van Leer 1979) | |||
\end{align}\right. | |||
</math>|13}} | |||
where <math>\sigma_{\perp, C} = x_{\perp,D} - x_{\perp,C}</math> . The Hybrid Linear/Parabolic Approximation scheme is second order. | where <math>\sigma_{\perp, C} = x_{\perp,D} - x_{\perp,C}</math> . The Hybrid Linear/Parabolic Approximation scheme is second order. |
Revision as of 16:18, 24 September 2014
Overview
CMS-Flow has both implicit and explicit solution schemes. The explicit solver is designed for dynamic problems with extensive wetting and drying that require small computational time-steps, while the implicit solver is intended for simulating tidal- and wave-induced circulation at tidal inlets, navigation channels, and adjacent beaches. A detailed description of the numerical formulation of the explicit solver of CMS-Flow can be found in Buttolph et al. (2006) and is not repeated here. The sections below specifically refer to the implicit solver of CMS-Flow.
The implicit solver uses the SIMPLEC (Semi-Implicit Method for Pressure Linked Equations Consistent) algorithm (van Doormal and Raithby 1984) on a non-staggered grid to handle the coupling of water level and velocity. Primary variables u-, v-velocity, and water level are stored on the same set of grid points, and fluxes at cell faces are determined using a Rhie and Chow (1983) type momentum interpolation method (Wu et al. 2011). The explicit solver uses a staggered grid with velocities at the cell faces and the water levels and water depths at the cell centers (Buttolph et al. 2006). CMS-Flow also calculates salinity, sediment transport, and morphology change. The governing equations for hydrodynamics and sediment and salinity transport have similar forms which can be written as a general transport (advection-diffusion) equation. In order to avoid redundant derivations of discretized equations, the discretization of the general transport equation is described in this chapter, and the same discretization may be applied to all of the transport equations. Then, the specific solution procedures for hydrodynamics, sediment transport, and bed change are introduced.
CMS-Flow Computational Grid
The explicit time scheme in CMS-Flow supports uniform and non-uniformly spaced Cartesian grids while the implicit version of CMS-Flow supports generic Cartesian grids which can be uniform, non-uniform, or telescoping. The telescoping locally refines the mesh by splitting a cell into subcells. The only requirement imposed by the numerical methods is that the cells must have a rectangular shape. Additional requirements are imposed by the user interface which limits the variety of types of Cartesian grids to help simplify the grid generation and avoid grid quality issues. The following requirements are applied:
- 1. Cells can only be subdivided into four subcells.
- 2. Only two neighboring cells are allowed in the same direction (i.e., north, south, east, and west).
- 3. Cells may have a maximum of six neighbors.
- 4. Refinement levels must be spaced by at least one cell apart (i.e., cells that share the same corner must be one refinement level apart).
Examples of violations of the above four requirements are shown in sequential order in Figure 3-1 from a to d. Limiting the number of neighboring cells to six avoids excessive cell refinement and limits the band width of the coefficient matrix for the linearlized system of equations solved by the implicit solution scheme. The last two requirements avoid having excessive cell refinement which can cause numerical instabilities. The first requirement simplifies the grid generation process but may be relaxed in future versions. The last requirement is enforced for grid quality purposes and a more smoothly varying grid resolution.
The CMS-Flow grids generated in the SMS interface can be classified as uniform, non-uniform Cartesian grids, regular telescoping, and stretched telescoping grids (Figure 2).
One important aspect of incompressible flow models is the location of primary variables: velocity and pressure (water level). On a staggered grid, the pressure (water level) is located at the center of cells and the u- and v-velocities are located along the faces of cells (Harlow and Welsh 1965; Patankar 1980). On a non-staggered grid, all of the primary variables are located at the center of cells. This can lead to the spatial oscillations referred to as checkerboard oscillations and model instability if the linear interpola-tion between nodes is used to determine the fluxes at cell faces. A staggered grid can more easily eliminate these oscillations when compared to a non-staggered grid; however, a non-staggered grid involves a simpler source code and can minimize the number of coefficients that must be computed and stored during a simulation because many of the terms in the equations are equal. In particular, a staggered grid is more complicated when handling the interface between coarse and fine cells where 5- or 6-face control volumes are used. Therefore, a non-staggered (collocated) grid approach is adopted for CMS-Flow with a Rhie and Chow (1983) momentum interpolation technique used to eliminate the checkerboard oscillations. Figure 3 shows the location of primary variables on the 5- and 7-point stencils (computational molecule).
The data structure for a grid can be approached in three ways: 1) block-structured, 2) hierarchical tree, and 3) unstructured. The block-structured approach divides the domain into multiple blocks, and each block is treated as structured. The block structured approach requires a special treatment between blocks to ensure mass and momentum balance using this approach. The hierarchical tree approach is memory intensive and requires parent-child relationships and a tree traverse to determine mesh connectivity. For the unstructured approach, all cells are numbered in a 1D sequence, and tables are used to determine the connectivity of neighboring cells. Among these three approaches, the unstructured approach is the most simple and is therefore applied in CMS-Flow. Computational cells are numbered in an unstructured manner via a 1D index array. Inactive cells (permanently dry) are not included in the 1D index array to save memory and computational time. All active computational cells are numbered sequentially. It is noted that using an unstructured data approach does not limit the model from using matrix solvers designed for structured grids. For convenience with handling boundary conditions, each boundary cell has a neighboring ghost cell outside of the computational domain.
General Transport Equation
|
(1) |
where:
- = general scalar
- h = total water depth [m]
- = correction factor [-]
- = total flux velocity [m/s]
- = diffusion coefficient for []
- S = source/sink term which includes all remaining terms.
Note that in the case of the continuity and momentum equations, is equal to 1 and respectively. In the case of sediment and salinity transport, is equal to and , respectively. The correction factor (β) is equal to the total-load correction factor and equal to 1 for all other equations.
Spatial Discretization
A control-volume technique is used in which the governing equations are integrated over a control volume to obtain an algebraic equation that can be solved numerically. Integration of Equation (1) over a control volume yields:
|
(2) |
|
(3) |
|
(4) |
where
- = outward unit vector normal to cell face f[-]
- = outward cell face velocity [m/s]
- = value of at the cell centroid
- = total water depth at the cell face centroid [m]
- = interpolated total water depth at cell face f [m]
- = outward normal gradient of at cell face f:
- = interpolated diffusion coefficient for
- = area of cell P [m/s]
- = length of cell face f [m]
- = source/sink term.
In the above equations, the Gauss Divergence Theorem has been used to convert the area integral to a boundary integral. In addition, the area ingegrals have been evaluated assuming variable vary linearly within cells. The cell face velocity, , is calculated using a momentum interpolation method similar to that of Rhie and Chow (1983) and is described in Hydrodynamics of the present Chapter.
Temporal Discretization
The general transport equation is rewritten as
(5) |
where includes all the remaining terms. For stability and efficiency, a fully implicit time-stepping scheme is used in the form
where includes all the remaining terms, such as …. For stability and efficiency, a fully implicit time-stepping scheme is used in the form
(6) |
where is a weighting factor between 0 and 1. For , the scheme reduces to the first-order backward Euler scheme, and with , the scheme reduces to the second-order backward scheme (Ferziger and Peric 1997). The superscripts indicate the time step levels, with n+1 being the next time-step and n being the previous time-step.
Cell-face interpolation operator
The general formula for estimating the cell-face value is given by
(7) |
where is a linear interpolation factor, is the gradient operator in the direction parallel to face f, and is the distance from the cell center to the ghost point (O) parallel to the cell face (f) (see Figure 4).
The subscripts and indicate the components parallel and normal to the cell face. By definition, . Note that for neighboring cells without any refinement, is equal to zero and the above equation is consistent with non-refined cell faces. The linear interpolation factor is defined as
|
(8) |
where is the coordinate of f perpendicular to the face and is the cell dimension perpendicular to the face f.
Cell-face Gradient
A linearly exact second-order approximation for the normal gradient at cell face f is calculated using the auxiliary node concept of Ferziger and Peric (1997):
(9) |
where the subscripts P and N refer to two neighboring cells, is the distance between cells P and N, normal to the cell face (Figure 3-4), and is the gradient operator in the direction parallel to face f. Ham et al. (2002) compared the auxiliary node formulation to the fully-unstructured discretization proposed by Zwart et al. (1998) for the viscous terms and found that the auxiliary node formulation is significantly more stable.
Cell-centered Gradient
The cell-centered gradient operator is calculated using the Gauss’ Divergence Theorem as
(10) |
The equation above is second order and conservative for regular and non-uniform grids.
Reconstruction, Monotonicity, and Slope Limiters
Variables are linearly reconstructed within the cells as
(11) |
where is the cell-average value specified at the cell centroid, is the distance vector from the cell centroid to any location within the cell, and is the cell-centered gradient. The reconstruction is second order and conservative in the sense that . The linear reconstruction is used when interpolating cell-face values (Equation 7) and calculating cell-face gradients (Equation 13). If the reconstruction satisfies the local maximum principle
(12) |
then no new extrema are created within the cell, and the solution is monotonic. Figure 5 shows two examples of linear reconstruction with and without slope limiters to ensure monotonicity.
For non-telescoping grids, the slope limiter is calculated as
(13) |
where . The Hybrid Linear/Parabolic Approximation scheme is second order.
Cell-face gradient operator
A linearly exact second-order approximation for the normal gradient at cell face f is calculated using the auxiliary node concept of Ferziger and Peric (1997)
|
(13) |
where the subscripts P and N refer to two neighboring cells, is the distance between cells P and N, normal to the cell face (see Figure 3.2), and is the gradient operator in the direction par-allel to face f. Ham et al. (2002) compared the auxiliary node formulation to the fully-unstructured discretization proposed by Zwart et al. (1998) for the viscous terms and found that the auxiliary node formulation is significantly more stable.
Cell-centered gradient operator
The cell-centered gradient operator is calculated using the Green-Gauss Theorem as {Equation| |14}}
Equation 3-14 above is second order and conservative for regular and nonuniform grids.
Reconstruction, Monotonicity, and Slope Limiters
Given a conservative average value within a cell, a linear reconstruction of the variable is used within that cell. This can be expressed as
|
(15) |
The reconstruction is conservative in the sense that . If the reconstruction satisfies the local maximum principle
|
(16) |
then no new extrema are created within the cell and the solution is monotonic. Figure x shows two examples of linear reconstruction with and without slope limiters to ensure monotonicity.
then no new extrema are created within the cell and the solution is monotonic. Figure x shows two examples of linear reconstruction with and without slope limiters to ensure monotonicity.
Figure 3.3. Schematics showing examples of non-limited (a) and limited (b) linear reconstructions.
For non-telescoping grids, the slope limiter is calculated as {Equation| |17}}
where r is the ratio between two consecutive slopes
|
(18) |
Here the second-order van Leer (1979) limiter is used because of its smoothness. Figure X shows a comparison of three different common limiters. The slope limiter is applied in each direction separately.
Figure 3.4. Comparison of three different slope limiters.
For joint cells, the standard slope limiters described above are difficult to implement because of the difficulty in defining forward and backward differences. Therefore for joint cells, a variation of the Limited Central Difference (LCD) slope limiting procedure of Hubbard (1999)
where . In the procedure outlined by Hubbard (1999), a scalar limiter is then calculated as . For telescoping grids a directional limiter can be calculated as , which is less dissipative. Look at this again
Source/sink term
The source/sink term is linearized as (Patankar 1980)
- (3-20)
where is the cell area, and is approximated as the cell-average source/sink term. The coefficient is required to be non-positive for stability.
Assembly of Algebraic Equations
Assembly refers to the process of combining terms to create a linear sys-tem of algebraic equations. The algebraic equation for each cell is obtained by first combining or assembling all of the terms. Then, the continuity equation is multiplied by and is subtracted from the transport equation. The resulting discretized equation for cell P is
- (3-21)
where the subscript N refers to the neighboring cell sharing cell face, and are linear coefficients for and . The last term, , con-tains all the remaining terms (such as…name the specific terms here). Applying a similar equation for all of the internal cells of a grid results in a system of algebraic equations. This set of equations are referred to as the discretized governing equations.
Implicit Relaxation
Under-relaxation stabilizes the convergence of the outer non-linear iteration loop by introducing a relaxation parameter in the discretized equations (Patankar 1980) as
- (3-22)
where is an under-relaxation parameter and is the value of from the previous iteration. An effect of under-relaxation is to make the coefficient matrix more diagonally dominant.
Iterative Solvers
The selection of an iterative solver is one key issue concerning the overall per-formance of the model. CMS has three iteration solvers available and they are described in more detail below: 1) GMRES variation, 2) BiCGStab, and 3) Gauss-Seidel. The default iterative solver for CMS is a variation of the GMRES (\underline{G}eneralized \underline{M}inimum \underline{RES}idual) method (Saad 1993) and is used to solve the algebraic equations. The original GMRES method (Saad and Schultz 1986) utilizes the Arnoldi process to reduce the coefficient matrix to the Hessenburg form and minimizes the norm of the residual vector over a Krylov subspace at each iterative step. The variation of the GMRES method recommended by Saad (1993) allows changes in preconditioning at every iteration step. An Incomplete LU Factorization (ILUT; Saad, 1994) is used as the preconditioner to speed-up convergence. The GMRES solver is applicable to symmetric and non-symmetric matrices and leads to the smallest residual for a fixed number of iterations. However, the memory requirements and computational costs become increasingly expensive for larger systems.
The BiCGStab (BiConjugate Gradient Stabilized) iterative solver is also a Krylov subspace solver and is applicable to symmetric and non-symmetrix matrices (Saad 1996). BiCGStab also uses ILUT as a preconditioner (Saad 1994). The BiCGStab method can be viewed as a combination of the standard Biconjugate Gradient solver where each iterative step is followed by a restarted GMRES iterative step. One advantage of the BiCGStab iterative solver is that the memory requirements are constant for each iteration and there are less computational costs when compared to the GMRES method (for GMRES restart numbers larger than 4).
The simplest iterative solver implemented in CMS is the point-implict Gauss-Seidel solver. This method may be applied in CMS with or without Succesive-Over-Relaxation to speed-up convergence (Patankar 1980). Even though the Gauss-Seidel method requires more iterations for convergence, the overall efficiency may be higher than the GMRES and BiCGStab because each itera-tion is computationally inexpensive and the code is parallelized. However, the GMRES and BiCGStab methods are more robust and perform better for large time steps.
Convergence and Time-Stepping
During the iterative solution process, error is calculated and used to de-termine if a solution has converged, diverged, or stalled at an error below a set tolerance threshold. Anestimate of the error in solving the general algebraic equation is given by
- (3-23)
Statistics (such as…) can be defined based on normalized errors. For ex-ample, the -norm is given by
- (3-24)
Since this value depends on the total number of cells, the final statistic (referred to as the residual) that is used for estimating the model convergence is obtained by dividing the norm by the number of cells
- (3-25)
is referred to as the “normalized residual error” and the superscript refers to the iteration number. is calculated for each variable that is solved at each iteration step of the solution process. Each equation has default maximum tolerances for determining if the solution has converged, diverged, or stalled. The maximum number of iterations that is imposed is set equal to M. A minimum of 5 iterations are required for the hydrodynamic equations, and a minimum of M/2 iterations are required for the sediment transport equations. Table 3-1 lists the default criteria to determine whether the iterative solution procedure has converged, diverged, or requires a reduced time step.
Table 3-1. Default criteria to determine whether the iterative solution procedure has converged, diverged, or requires a reduced time step.
Current velocity, m/s |
If Rm < 1x10-7 or | Rm-Rm-2| < 1x10-7 |
If RM > 1.0x10-2 or |Ui| > 10 |
If RM > 1.0x10-3 |
Pressure- correction, m2/s2 |
If RM < 1x10-8 or |RM - RM-2| < 1x10-8 |
If RM > 1.0x10-3 or |p| >50 |
If RM>1.0x10-4 |
Total-load concentration, kg/m |
If RM<1x10-8 or |Rm-Rm-2|<1x10-8 |
If Rm>1.0x10-3 or Ctk<0 |
None |
Salinity, ppt | If Rm<1x10-6 | If S < 0 | None |
For the implicit model, the time steps for the hydrodynamics, sediment and salinity transport are the same in order to avoid mass conservation problems and for simplicity. If any of the time step reduction criteria are met, then the time step is reduced by half and a minimum number of 3 time steps are calculated at the newly reduced time step. If the last time step converged properly, then the time step is increased. The maximum time step allowed is equal to the user-specified initial time step.
Ramp Period
For most coastal applications, the model is initialized from a “cold start”, which means that the water level and current velocities are initially set to zero. The ramp period allows the model to slowly transition from the ini-tial condition without “shocking” the system. In CMS, the ramp function is defined as
- (3-26)
where t is the simulation time and is the ramp duration. The ramp function provides a smooth function for transitioning from the initial condition and is plotted in Figure 3.5.
Figure 3.5. Ramp function used in CMS
The ramp function is applied to the model forcing conditions, including the wave forcing , surface wind , sediment concentration capacity , and significant wave height , by direct multiplication of these parameters by the ramp function at each time step during the ramp period. Boundary conditions in CMS are specified without consideration of this ramp period; therefore, the boundary conditions are also slowly transitioned from the initial condition by direct multiplication of the boundary conditions by the ramp function at each time step during the ramp period.
References
- Buttolph, A. M., C. W. Reed, N. C. Kraus, N. Ono, M. Larson, B. Camenen, H. Hanson, T. Wamsley, and A. K. Zundel. 2006. Two-dimensional depth-averaged circulation model CMS-M2D: Version 3.0, Report 2: Sediment transport and morphology change. ERDC/CHL TR-06-9. Vicksburg, MS: US Army Engineer Research and Development Center.
- Rhie, T. M., and A. Chow. 1983. Numerical study of the turbulent flow past an isolated airfoil with trailing-edge separation. AIAA Journal (21):1525–1532.
- van Doormaal, J. P. and Raithby, G. D. 1984. Enhancements of the SIMPLE method for predicting incompressible fluid flows. Numerical Heat Transfer (7): 147–163.
- Wu, W., A. Sánchez, and M. Zhang. 2011. An implicit 2-D shallow water flow model on an unstructured quadtree rectangular grid. Journal of Coastal Research, Special Issue (59):15–26.