2D Flow Options

Options for controlling the 2D computations during the run are available from the same editor that contains the 1D Computational Options and Settings.  From the Unsteady Flow Analysis window, select the Options | Calculation Options and Tolerances menu item to invoke the window shown in Figure 5-7.  The HEC-RAS Unsteady Computation Options and Tolerances editor now contains five tabs.  The General tab is the original 1D Unsteady-flow calculation options.  The 2D Flow Options tab, contains the calculation options and tolerances for the 2D computational module; this tab contains new 2D flow options which were added in HEC-RAS Version X.X which is the focus of this section.  The 1D/2D Options tab, contains options for controlling iterations between 1D and 2D hydraulic connections.  The Advanced Time Step Control tab contains options for using the variable time step capability.  The 1D Mixed Flow Options tab, is for controlling the mixed flow regime capabilities used with the original 1D Finite Difference solution scheme; however, the 1D mixed flow options are not needed for the new 1D Finite Volume solution scheme.


 Figure 5-7. 2D Flow Area Calculation Options and Tolerances.

The 2D Flow Options tab (Figure 5-7), contains several new computational options and tolerances added in HEC-RAS Version 6.0 that can be set for the 2D module.  These options are discussed below.

            Use Coriolis Effects: Only used if the Shallow Water Equations (SWE) are turned on (Full Momentum)

This option allows the user to turn on the effects of the Earth’s rotation on the solution (Coriolis Effect).  When this option is turned on, the user must enter the latitude of the center of the 2D flow area in degrees (this is the field labeled Latitude for Coriolis (-90 to 90) in the table).  A latitude with a value greater than zero is considered to be in the northern hemisphere and a value less than zero is considered in the southern hemisphere.

            Theta (0.6 – 1.0):       1.0 (default)

This is the implicit weighting factor that is used to weight spatial derivatives between the current solution time and the previously computed time.  Theta of 1.0 (default), uses only the currently solved time for the spatial derivatives.  This default setting provides for the most stable solution, but possibly at the loss of some accuracy.  Theta of 0.6, provides for the most accurate solution of the equations, but tends to be less stable.  In general, it has been found that in most applications of real-world flood runoff events in rivers, a Theta of 1.0 will give about the same answers as a Theta of 0.6.  However, this should be tested for each model due to site specific geometry and flood propagation, which may make a difference in the results. 

            Theta Warmup  (0.6 – 1.0):              1.0 (default)

This is the value of Theta (see description above) that is used during the model warm up and ramp up periods.  The Theta warm up is only used if the user has turned on the unsteady flow warm up option or the Boundary Condition Ramp up option for 2D areas.

            Water Surface Tolerance [max=0.2] (ft):   0.01 (default)

This is the 2D water surface solution tolerance for the iteration scheme.  If the solution of the equations gives a numerical answer that has less numerical error than the set tolerance, then the solver moves to the next time step.  If the maximum error is greater than the set tolerance, then the program will iterate to get a better answer.  The program will only iterate up to the maximum number of iterations set by the user.  The default is set to 0.01 ft based on experience in using the model for a range of applications.

            Volume Tolerance (ft):         0.01 (default)

This is the 2D water volume solution tolerance for the iteration scheme.  The volume error is converted to feet (ft) of error by taking the currently solved for water surface elevation into the elevation-volume curve for the cell, then calculating the change in water surface elevation based on the current volume error at that point on the curve.  If the solution of the equations gives a numerical answer that has less volume error than the set tolerance (in terms of ft), then the solver is done with that time step.  If the maximum error is greater than the set tolerance, then HEC-RAS will iterate to get a better answer.  The software will only iterate up to the maximum number of iterations set by the user.  The default is set to 0.01 ft based on experience in using the model for a range of applications.

            Maximum (Number of) Iterations (0 – 40):            20 (default)

This is the maximum number of iterations that the solver will use while attempting to solve the equations (to get an answer that has a numerical error less than the user specified tolerance at all locations in the 2D computational mesh domain).  The default is set to 20 iterations. However, the user can change the maximum number of iterations to a value from 0 to 40.  It is not recommended to change the default value unless the user is certain that changing the value will either improve the chances that the model will converge (i.e., increasing the value) or speed up the computations without causing any significant errors.

            Equation Set: Diffusion Wave (default); SWE-ELM (original/faster); and SWE-EM (stricter momentum).

The HEC-RAS two-dimensional computational module has the option of running the following equation sets: 2D Diffusion Wave equations; Shallow Water Equations (SWE-ELM) with a Eulerian-Lagrangian approach to solving for advection; or a new Shallow Water Equation solver (SWE-EM) that uses an Eulerian approach for advection.  The new SWE solution method is more momentum conservative but may require smaller time steps and produce longer run times.  The default is the 2D Diffusion Wave equation set.  In general, many flood applications will work fine with the 2D Diffusion Wave equations.  The Diffusion Wave equation set will run faster and is inherently more stable.  However, there are applications where the 2D SWE should be used for greater accuracy.  Users can try the multiple equation sets and efficiently compare the answers by selecting the equation set to use and running the simulation.  It is suggested that users first create a new Plan file and then use a different equation set in order to easily compare the results. 

The new SWE solver (SWE-EM) is an explicit solution scheme that is based on a more conservative form of the momentum equation.  This solver requires time steps to be selected to ensure the Courant number will be less than 1.0, in general (not always).  This solver produces les numerical diffusion than the original SWE solver.  However, in general, this new solver is only needed when users are interested in taking a very close look at changes in water surfaces and velocities at and around hydraulic structures, piers/abutments, and tight contractions and expansions.  The original SWE solver is more than adequate for most problems requiring the full momentum equation based solution scheme.

            Initial Conditions Ramp up Time (hrs):     (blank by default, not used)

This option by default is not used but can be used to ramp up the water surface from a dry condition to a wet condition within a 2D area (or from a flat water surface if an initial water surface elevation was entered).  When external boundary conditions, such as flow and stage hydrographs (or 1D reaches), are connected to a 2D area the first value of the connected flow or stage may be too high (i.e., a very large flow or a stage that is much higher than the attached cell’s elevation).  If the model were to start this way, such a high discontinuity could cause model instability.  This option allows the user to specify a time (in hours) to run the computations for the 2D flow area while slowly transitioning the flow boundaries from zero to their initial value and the stage boundaries from a dry elevation up to their initial wet elevation.  The user specifies the total Initial Conditions Ramp up Time in this field (10 hours, for example).  The user must also specify a fraction of this time for Ramping up the boundary conditions.  A value of 0.1 means that 10% of the Initial Conditions time will be used to Ramp Up the boundary conditions to their initial values; the remaining time will be used to hold the boundary conditions constant but allow the flow to propagate through the 2D flow area, thus giving it enough time to stabilize to a good initial condition throughout the entire 2D flow area.  The Ramp up time for the boundary conditions is entered in the next row, which is labeled Boundary Condition Ramp up Fraction.

            Boundary Condition Ramp up Fraction (0 to 1.0):           0.1 (default)

This field goes along with the previous Initial Conditions Ramp up Time (hrs) field.  This field is used to enter the fraction of the Initial Conditions Ramp up Time that will be used to ramp up the 2D flow area boundary conditions from their initial flow or stage.  Users can enter a value between 0.0 and 1.0, representing the decimal fraction of the Initial Conditions Ramp up Time.

            Number of Time Slices (Integer Value):     1 (default)

This option allows the user to set a computational time step for a 2D flow area that is a fraction of the overall unsteady flow computation interval.  For example, if the user has set the unsteady flow overall computation interval to 10 minutes, then setting a value of 5 in this field (for a specific 2D area) means that the computation interval for that 2D area will be 1/5 of the overall computation interval, which for this example would be 2 minutes (e.g., 10/5 = 2).  Different values can be set for each 2D flow area.  The default is 1, which means the 2D flow area will use the same computational time step as the overall unsteady flow solution (computation interval is entered by the user on the unsteady flow analysis window).

Turbulent Mixing Coefficients

The modeler has the option to include the effects of turbulent mixing and dispersion in the 2D flow field.  HEC-RAS has two different formulations for turbulence modeling: a non-conservative formulation and a fully conservative formulation. 

Turbulent mixing is the transfer of momentum due to the chaotic motion of the fluid.  Dispersive mixing is the transfer of momentum due to subgrid variations in the time-averaged velocity field, both vertically and horizontally.  The sum of horizontal molecular and turbulent mixing and dispersion are referred to simply as mixing here and are simulated as a Fickian diffusive process with a diffusion coefficient represented by the eddy viscosity.  The default in HEC-RAS is to have all of the mixing coefficients empty, meaning turbulence is turned off.  The numerical scheme in HEC-RAS provides some numerical diffusion.  The larger the computational cell size and time step the larger the numerical diffusion.  Therefore, when utilizing relatively fine computational cells with small time steps, it may be necessary to turn on mixing in order to obtain accurate results.  To turn on horizontal mixing, enter a value for at least one of the mixing coefficients.  These are the Longitudinal Mixing Coefficient, the Transverse Mixing Coefficient, and the Smagorinsky Coefficient.  In previous versions of HEC-RAS, the longitudinal and transverse mixing coefficients were assumed to be equal.  However, in HEC-RAS Version 6.0 these coefficients can now be specified separately.  An additional parameter, the Smagorinsky Coefficient has also been added.  Simple guidance is provided for initial values for these parameters.  Nonetheless, these coefficients should be calibrated using spatially distributed velocity measurements.  For the details on the Turbulence modeling approaches in HEC-RAS, please review the 2D modeling section of Chapter 2 in the HEC-RAS Hydraulic Reference Manual.

Turbulence Model:   None (default), Conservative, and Non-Conservative (original).

            The Turbulence model choices are None (no turbulence modeling will be performed), Conservative (a conservative formulation that ensures little to no momentum loss when turbulence is turned on), and a Non-Conservative formulation (this formulation has some numerical diffusion, however it is very small when the cell size is small and the time step is small).

Longitudinal Mixing Coefficient:    (blank by default, not used)

In general, the turbulence intensity and dispersion are not the same in all directions.  The Longitudinal Mixing Coefficient is utilized to compute the contribution of the eddy viscosity from the turbulence and dispersion in the longitudinal direction (i.e., the direction of flow).  In practice, this coefficient can differ by several orders of magnitude, depending on the flow.  Table 5-1 lists some values for the Longitudinal Mixing Coefficient (DL) that have been found to be appropriate under certain conditions.



Table 5 1. Longitudinal Coefficients.

DL

Mixing Intensity

Geometry and surface

0.1 to 0.3

Little longitudinal mixing

Straight channel
Smooth surface

0.3 to 1

Moderate longitudinal mixing

Gentle meanders
Moderate surface irregularities

1 to 3

Strong longitudinal mixing

Strong meanders
Rough surface


Transverse Mixing Coefficient:       (blank by default, not used)

The Transverse Mixing Coefficient is utilized to compute the contribution of the eddy viscosity from the turbulence and dispersion in the transverse direction (i.e., perpendicular to the flow direction).  In practice, this coefficient can differ by several orders of magnitude, depending on the flow.  Table 5-2 lists some values for the Transverse Mixing Coefficient (DT) that have been found to be appropriate under certain conditions.



Table 5 2. Transverse Mixing Coefficients.

DT

Mixing Intensity

Geometry and surface

0.05 to 0.1

Little transversal mixing

Straight channel
Smooth surface

0.1 to 0.3

Moderate transversal mixing

Gentle meanders
Moderate surface irregularities

0.3 to 1

Strong transversal mixing

Strong meanders
Rough surface


Smagorinsky Coefficient:        (blank by default, not used)

The Smagorinksy component of the eddy viscosity represents the turbulence intensity produced by flow shear and assumes that the energy production and dissipation are equal at subgrid scales.  The component is expressed as a function of length scale defined by the local grid resolution, the flow strain (magnitude of the depth-averaged current velocity gradients), and the dimensionless Smagorinsky Coefficient.  The Smagorinksy eddy viscosity component requires computing four current velocity gradients for the flow strain and therefore it is relatively computationally expensive and should only be used (and is only necessary) when simulating high-resolution flows.  This Smagorinksy eddy viscosity is important in regions close to solid boundaries or obstacles in the flow.  The Smagorinsky Coefficient value is typically in the range of 0.05 to 0.2.  However, it is best to calibrate this and other mixing parameters using spatially distributed current velocity measurements.  Since the eddy viscosity is computed as the sum of the various components, their values must be calibrated together.

            Boundary Condition Volume Check:         (checkbox to enable, unchecked by default)

When this option is turned on (by checking the  checkbox), the software will check 2D to 1D boundary connections to ensure that there is enough water in a 2D cell over the time step to actually satisfy the computed flow exchange.  If there is not, the computed flow exchange will be reduced for the first guess of the flow rate for that time step.

            Latitude for Coriolis (-90 to 90):     (blank by default, not used)

If the user checks the  checkbox to turn on the “Use Coriolis Effects (not used with Diffusion Wave equation)” option, then a latitude for the centroid of the project should be entered in this field.

            Solver Cores:             (by default all available CPU cores are used)

The Solver Cores parameter refers to the number of CPU cores that will be used in solving the 2D Flow Area solution.  The HEC-RAS 2D computational module was developed with parallel processing in mind.  The HEC-RAS 2D computations will use as many CPU cores as there are available on the user’s machine (which is the default mode for running).  However, HEC-RAS provides the option to set the number of cores to use for the 2D computations.  In general, it is recommended to use the default of “All Available”.  However, the user may want to experiment with this for a specific data set to see if it will either speed up or slow down computations based on a specific number of cores.  The ideal number of cores for a given problem is size (i.e., number of cells) and shape dependent (i.e., shape of the 2D Flow Area).  As more cores are used, the problem is split into smaller pieces, but there is overhead in the communications between the pieces.  So, it is not necessarily true that a given problem will always run faster with more cores.  Smaller data sets (2D areas with fewer cells) may actually run faster with fewer cores.  Large data sets (2D Areas with lots of cells, i.e., > 100,000 cells) will almost always run faster with more cores, so use all that is available.

Shown below in Table 5-3 and Figure 5-8 are the results of testing a few data sets by running them with different numbers of Solver Cores.  Each model was run several times with the number of solver cores set to: 1, 2, 4, 8, and 16 (Figure 5-8).  As Figure 5-8 illustrates, four of the data sets displayed an improvement in computation speed with the number of cores set from 1 up to 8 but ran slower with 16 cores.  These four data sets ranged in size from 10,000 to 80,000 cells.  However, one data set displayed speed improvements all the way up to 16 cores.  This was the largest data set with 250,000 cells.  Further runs were done to find the optimal number of cores for each data set, these results are shown in Table 5-3.

NOTE:  HEC-RAS uses a parallelization process called OpenMP, within the Intel Fortran compiler.  Intel states in their Fortran manual, that exact duplication of math cannot be guaranteed when using multiple cores to solve a problem.  In practical application we have seen that if a model iterates a lot, and has some instabilities, the computed results can change a small amount when even running the same model on the same machine.  However, if a model is stable, in general we have not seen any significant differences in results, even when running on different machines.  If a user uses a single core, results are consistently reproducible, however, the model will take significantly longer to run.


Table 5 3. Optimal No. of CPU Cores versus Number of 2D Cells

Data Set Name

Time Window

Time Step

Number of Cells

Optimal No. of Cores

Computation Time

Saint Paul 1D/2D

16 days

30 sec

2,251

6

48 sec

EU Test No 5 2D

1 day 6 hrs

10 sec

7,460

8

36 sec

Ohio/Miss 1D/2D

49 days

5 min

23,087

8

3 min 37 sec

EU Test No 4 2D

5 hrs

20 sec

80,000

10

41sec

400 sq mi Watershed 2D

2 days

2 min

250,000

16

23 min 23 sec


Figure 5-8. Number of processor cores vs. computational speed.

Matrix Solver:           PARDISO (default)

This option allows the user to select one of several sparse matrix solvers.  There are two types of solvers available: direct and iterative. PARDISO is the only direct solver available.  Direct solvers compute the final solution within a finite number of steps and do not require an initial guess. Since direct solvers produce very accurate solutions, they are very robust.  For this reason, PARDISO is the default matrix solver in HEC-RAS.  One other advantage of the PARDISO solver is that it does not require any user-specified parameters.  The second type of matrix solvers in HEC-RAS are iterative solvers.  Iterative solvers generally require less memory because, unlike direct solvers, the structure of the matrix does not change during the iteration process.  In addition, iterative solvers utilize matrix-vector multiplications which can be efficiently parallelized.  The main drawback of iterative solvers is that the rate of convergence depends greatly on the condition number of the coefficient matrix.  For poorly conditioned matrices, the iterative solver may not converge at all.  Therefore, the efficiency of iterative solvers greatly depends on the size and condition number of the coefficient matrix.

HEC-RAS Version 6.0 and newer also have the option to select one of two iterative solvers.  The iterative solvers can be faster under certain conditions.  The iterative solvers available are: SOR (Successive Over-Relaxation) and FGMRES-SOR (Flexible Generalized Minimal Residual with SOR preconditioner).  The SOR method is used both as an iterative solver and as a preconditioner for FGMRES.  The SOR solver works well for small (~5000 to 10000 cells) to medium (~30000 to 50000 cells) size 2D areas.  Generally, the larger the mesh, the more iterations are required for convergence.

Convergence Tolerance:                   (blank by default, this is an optional parameter)

This option allows the user to specify the convergence tolerance for the iterative solver.  The tolerance is compared to the root-mean-squared of the normalized residuals.  If not specified, the tolerance is set to 1x10-4 times the water surface tolerance.  Decreasing the tolerance will increase the number of solver iterations and decrease the speed of the simulation and vice-versa. If the tolerance is too small, it is possible the iterative solver will take a large amount of iterations to reach the tolerance or never reach it at all. Conversely, if the tolerance is set too large, the solution errors will produce water volume errors.  Therefore, the user must be careful when setting this parameter.


Minimum Number of Iterations:                 None (Optional)

This option allows the user to specify the minimum number of iterations.  The iterative solver will continue to iterate even if the convergence criteria is satisfied until the minimum number of iterations.  The minimum number of iterations avoids solution creep or divergence in cases where the solution is changing slowly, or the convergence tolerance is set too high.  The default minimum number of iterations is computed internally based on the number of cells and the matrix solver. The SOR solver generally requires fewer iterations than the FGMRES-SOR solver. 


Maximum Number of Iterations:    None (Optional)

This option allows the user to specify the maximum number of iterations.  The maximum number of iterations keeps the solver from iterating too many times past the point of diminishing returns.  Generally, iterative solvers will reach a point at which the improvement in the solution for each iteration is relatively small and the computational cost of each iteration does not outweigh the benefit of continuing to iterate.  The default maximum number of iterations is computed internally based on the number of cells and the matrix solver.  The SOR solver generally requires fewer iterations than the FGMRES-SOR solver. 


Relaxation Coefficient:         1.3 (default)

This option allows the user to specify the relaxation coefficient for the SOR solver. The optimal relaxation value of the relaxation coefficient is generally between 1.1 and 1.5. However, if the value is too large the solver may diverge. Therefore, it is best to utilize a conservative value which will be relatively fast and not have divergence problems.

Restart Iterations:     10 (default)

This option allows the user to specify the restart iterations used in the FGMRES solver.  Because the amount of storage and computational work required by FGMRES increases with each iteration, the method is typically restarted.  The group of iterations between successive restarts is referred to as a cycle.  When a cycle is completed the results’ approximate solution is used as an initial guess for a new cycle of iterations.  Generally, the restart iterations is between 8 and 20.

SOR Preconditioner Iterations:       10 (default)

The SOR method is used both as a solver and as a preconditioner for the FGMRES solver in HEC-RAS.  When SOR is used as a preconditioner, the SOR method is applied for a fixed number of iterations which is specified as the SOR Preconditioner Iterations.  This eliminates the need to specify separate convergence criteria for the auxiliary system of equations for which the SOR method is applied.  It also eliminates the need to compute convergence parameters during the SOR iterations.  The optimum number of iterations will be problem specific.  However, in general, the larger the mesh, the more iterations that will be necessary. 

1D/2D Options Tab.

From the HEC-RAS Unsteady Computation Options and Tolerances editor (Figure 5-7), from the 1D/2D Options tab.  There are also some options for controlling 1D/2D iterations, which can be used to improve the computations of flow passing from a 1D element (reach or storage area) to a 2D Flow Area.  By default, this option is turned off, and most 1D to 2D connections will not need iterations.  However, when the1D/2D hydraulic conditions become highly submerged, or there are flow reversals or tidally influenced stages or flows, then iterating between the 1D solution and 2D solution may be necessary to get an accurate and stable solution.  To turn on the 1D/2D iterations option, from the HEC-RAS Unsteady Computation Options and Tolerances editor (Figure 5-7), select the 1D/2D Options tab.  Then set the Maximum iterations between 1D and 2D, as well as tolerances for controlling the convergence criteria.  The maximum iterations can be set from 0 to 20, with zero meaning that the compute will not perform extra iterations (this is the default).  In general, only use this option if there is a stability problem at a 1D/2D hydraulic connection.  Set the number of 1D/2D iterations to as low a value as possible in order to get a stable answer between a 1D and 2D connection that is having stability problems.  The number of 1D/2D iterations will cause the entire solution to be calculated multiple times for each time step in order to get the desired convergence.  NOTE:  Increasing the maximum number of iterations could dramatically lengthen run times.  If the user turns this option on, it is suggested to start with a low value, such as 3 or 4.  If the stability problem still exists with that number of iterations, then increase the value until a stable solution is achieved.

The convergence criteria for 1D/2D iterations consists of a Water Surface Tolerance, Flow Tolerance (%), and a Minimum Flow Tolerance.  The water surface tolerance is currently only used when an upstream 1D reach is connected to a downstream 2D Flow Area.  In this situation, the 1D region is computed, then the 2D region.  The assumed water surface elevation at the boundary is re-evaluated.  If the water surface has changed more than the Water Surface Tolerance, then the program will iterate.  When the water surface elevation at the boundary has changed less than the tolerance, the solution stops iterating and moves on to the next time step. 

The Flow Tolerance (%) is utilized for the following 1D/2D connections: Lateral Structure; SA/2D Hydraulic Connection (SA to 2D, or 2D to 2D); and 2D Flow Area to 1D Reach connection.  The default value for the Flow Tolerance (%) is 0.1.  If 1D/2D iterations are turned on, then the flow between these types of 1D/2D connections gets recomputed after each trial to see if it has changed more than the user defined Flow Tolerance (%).  If it has changed more than the flow tolerance, then the program iterates.  A companion tolerance to the Flow Tolerance is the Minimum Flow Tolerance (cfs).  The purpose of this tolerance is to prevent the program from iterating when the flow passed between a 1D and 2D element is very small and not significant to the solution.  For example, there may be a connection from a 1D reach to a 2D Flow Area via a Lateral Structure in which the flow under certain conditions is very low.  As such, the actual change in the flow from one iteration to the next could be very small (but the percent error is very high).  Such a small flow may not add significance to the solution, so iterating the entire solution to improve this small flow between the 1D and 2D elements is not recommended and may unnecessarily increase the computational time.  In general, it can be beneficial to set a minimum flow when turning on 1D/2D iterations.  The default value is 1 cfs, however, this parameter is model specific.