Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Optimization

A numerical model calibration should yield a computationally functional, and physically, at least a reasonably accurate model. Model calibration has already been covered in the results analysis section of the steady Telemac2d tutorial. This chapter first provides more tips to increase the physical correctness of a model, especially regarding the conservation of mass, which can sometimes be challenging in Telemac. Additionally, advanced calibration methods that use supervised machine learning to improve physical model accuracy are presented.

Computing Time

Some of the keywords in TELEMAC’s steering (*.cas) file affect computation speed.

Moreover, Telemac2d provides a way to stop a simulation (step) when fluxes stabilize. To enable this feature, add the following block in the steering (*.cas) file:

/ steady state stop criteria in steering.cas
STOP IF A STEADY STATE IS REACHED : YES / default is NO
STOP CRITERIA : 1.E-3;1.E-3;1.E-3 / use list of three values - defaults are 1.E-4

However, stop criteria are not functional for non-stationary flows (e.g., Von Karmàn (1930) vortex street downstream of bridge piers). Read more about the convergence stop criteria in the Telemac2d manual (section 5.1).

Stability & Physical Correctness

Accuracy

When the accuracy keywords are improperly defined, TELEMAC may not be able to end the simulation. In this case, make sure to comment out the accuracy keywords and let TELEMAC use its default values:

/ SOLVER ACCURACY : 1.E-4
/ ACCURACY FOR DIFFUSION OF TRACERS : 1.E-4
/ ACCURACY OF K : 1.E-6
/ ACCURACY OF EPSILON : 1.E-6
/ ACCURACY OF SPALART-ALLMARAS : 1.E-6

Variable Time-Steps and CFL Condition

Unstable simulations may occur when the CFL condition is insufficiently fulfilled. To ensure that the CFL condition is respected, enable variable timestep calculation and use the DESIRED COURANT NUMBER keyword (default value 1), for example:

TIME STEP : 5
VARIABLE TIME-STEP : YES
DURATION : 5000
DESIRED COURANT NUMBER : 0.9

Note that the TIME STEP is still required because the GRAPHIC PRINTOUT PERIOD is a multiple of the defined TIME STEP.

Implicitation

To increase model stability, modify the following variables or make sure that the variables are within reasonable ranges in the CAS file:

Surface Oscillations (Wiggles)

When physically non-meaningful gradients or oscillations occur at the water surface or the bathymetry has steep slopes, the following keyword settings may help:

Residual Mass Errors

To reduce residual mass errors use in the steering file:

CONTINUITY CORRECTION : YES

Divergence

To limit divergence issues, use the CONTROL OF LIMITS and LIMIT VALUES keywords. The LIMIT VALUES keyword is a list of 8 integers for minimum and maximum values for H, U, V, and T (tracers). The implementation in the steering file looks like this:

CONTROL OF LIMITS : YES / default is NO
LIMIT VALUES : -1000;9000;-1000;1000;-1000;1000;-1000;1000 / default mins and max for H, U, V, tracer

Tidal Flats

Wetting and drying of grid cells, for instance, during a simulation of dam breaks or flood hydrographs, may lead to model instability. While the Tidal Flats section in the Telemac2d steady modeling tutorial suggests physically and computationally meaningful keyword option combinations, section 16.5 in the Telemac2d manual recommends using the following settings in the steering file as conservative choices from the BAW’s Wesel example.

VELOCITY PROFILES : 4;0
TURBULENCE MODEL : 1
VELOCITY DIFFUSIVITY : 2.
TIDAL FLATS : YES
OPTION FOR THE TREATMENT OF TIDAL FLATS : 1
TREATMENT OF NEGATIVE DEPTHS : 2
FREE SURFACE GRADIENT COMPATIBILITY : 0.9
H CLIPPING : NO
TYPE OF ADVECTION : 1;5
SUPG OPTION : 0;0
TREATMENT OF THE LINEAR SYSTEM : 2
SOLVER : 2
PRECONDITIONING : 2
SOLVER ACCURACY : 1.E-5
CONTINUITY CORRECTION : YES

Discretization Scheme

The default setting of DISCRETIZATIONS IN SPACE : 11;11 assigns a linear discretization for velocity and water depth, which is computationally fast but potentially unstable (read more in the section on general Telemac2d parameters). To overcome stability issues related to the discretization scheme, consider using DISCRETIZATIONS IN SPACE : 12;11. In addition, setting FREE SURFACE GRADIENT COMPATIBILITY : 0.01 (i.e., close to zero) may aid in troubleshooting stability issues related to the discretization of velocity and depth.

Exceeding Maximum Iterations

This section is co-authored by Federica Scolari.

A simulation may print EXCEEDING MAXIMUM ITERATIONS warnings in the Terminal:

GRACJG (BIEF) : EXCEEDING MAXIMUM ITERATIONS:    50 RELATIVE PRECISION:  0.7234532E-01
GRACJG (BIEF) : EXCEEDING MAXIMUM ITERATIONS:    50 RELATIVE PRECISION:  NaN
GRACJG (BIEF) : EXCEEDING MAXIMUM ITERATIONS:    50 RELATIVE PRECISION:  NaN
GRACJG (BIEF) : EXCEEDING MAXIMUM ITERATIONS:    50 RELATIVE PRECISION:  NaN
GRACJG (BIEF) : EXCEEDING MAXIMUM ITERATIONS:    50 RELATIVE PRECISION:  NaN
GRACJG (BIEF) : EXCEEDING MAXIMUM ITERATIONS:    50 RELATIVE PRECISION:  NaN
GRACJG (BIEF) : EXCEEDING MAXIMUM ITERATIONS:    50 RELATIVE PRECISION:  NaN

EXCEEDING MAXIMUM ITERATIONS warnings may occur when using SCHEME FOR ADVECTION OF [...] keywords with the values 3, 4, 5, 13, or 14. The reason is that these schemes yield CFL conditions of less than 1 by triggering iterative, adaptive timestepping. To troubleshoot EXCEEDING MAXIMUM ITERATIONS warnings, try the following options:

Bayesian Calibration

References
  1. Von Karmàn, T. (1930). Mechanische Ähnlichkeit und Turbulenz [Mechanical similarity and turbulence]. In Third International Congress for Applied Mechanics (Vol. 1, pp. 79–93). Stockholm.
  2. Mouris, K., Acuna Espinoza, E., Schwindt, S., Mohammadi, F., Haun, S., Wieprecht, S., & Oladyshkin, S. (2023). Stability Criteria for Bayesian Calibration of Reservoir Sedimentation Models. Modeling Earth Systems and Environment, 1–19. 10.1007/s40808-023-01712-7
  3. Schwindt, S., Callau Medrano, S., Mouris, K., Beckers, F., Haun, S., Nowak, W., Wieprecht, S., & Oladyshkin, S. (2023). Bayesian Calibration Points to Misconceptions in Three-Dimensional Hydrodynamic Reservoir Modeling. Water Resources Research, 59(3), e2022WR033660. 10.1029/2022WR033660
  4. Mohammadi, F., Kopmann, R., Guthke, A., Oladyshkin, S., & Nowak, W. (2018). Bayesian selection of hydro-morphodynamic models under computational time constraints. Advances in Water Resources, 117, 53–64. https://doi.org/10.1016/j.advwatres.2018.05.007
  5. Oladyshkin, S., Mohammadi, F., Kroeker, I., & Nowak, W. (2020). Bayesian3 Active Learning for the Gaussian Process Emulator Using Information Theory. Entropy, 22(8), 890. 10.3390/e22080890