Section 2 Hydrodynamic Engine Updates and Enhancements

2.1 BC Headers

Within a BC block users can now specify boundary condition headers, scale and offset commands independently for hydrodynamics, sediment, tracers and water quality. This decouples the previous single line ordering required for specification of these quantities across modules. This effective subdivision of a previous single BC block’s commands is:

  • Hydrodynamics
    • BC Header ==
    • BC Scale ==
    • BC Offset ==
    • BC Default ==
  • Sediment
    • Sed Header ==
    • Sed Scale ==
    • Sed Offset ==
    • Sed Default ==
  • Tracer
    • Trace Header ==
    • Trace Scale ==
    • Trace Offset ==
    • Trace Default ==
  • Water Quality
    • WQ Header ==
    • WQ Scale ==
    • WQ Offset ==
    • WQ Default ==

For example, if a model uses the QC boundary condition type, with salinity, temperature, one sediment fraction, one tracer, and one water quality constituent included, the legacy BC block would be written as shown in the below example.

BC == QC, STP_Outfall, ..\bc_dbase_MGL_HIGH_FLOW.csv
! Headers: Q, Salinity, Temperature, Sediment, Tracer, WQ
    BC Header == Time,STP_HIGH_FLOW,S,T,CLAY,Tracer_1,HIGH_DO
    BC Scale == 1.1,1.2,1.2,1.2,1.2,1.2
    BC Offset == 0.1,0.1,2.0,1.5,1.5,1.5
    BC Default == 0.0,0.0,22.0,15.0,50.0,10.0
End BC

As of TUFLOW FV 2025.0.0, this can be rewritten as follows.

BC == QC, STP_Outfall, ..\bc_dbase_MGL_HIGH_FLOW.csv
! Headers: Q, Salinity, Temperature
    BC Header == Time,STP_HIGH_FLOW,S,T
    BC Scale == 1.1,1.2,1.2
    BC Offset == 0.1,0.1,2.0
    BC Default == 0.0,0.0,22.0
! Sediment header/scale/offset
    Sed Header == CLAY
    Sed Scale == 1.2
    Sed Offset == 1.5
    Sed Default == 15.0
! Tracer header/scale/offset
    Trace Header == Tracer_1
    Trace Scale == 1.2
    Trace Offset == 1.5
    Trace Default == 50.0
! WQ header/scale/offset
    WQ Header == HIGH_DO
    WQ Scale == 1.2
    WQ Offset == 1.5
    WQ Default == 10.0
End BC

This new approach means that, for example, an additional sediment fraction can be added to the simulation and added to the QC BC block without impacting the subsequent tracer or water quality BC commands.

Notes:

  • If users specify headers/scale/offset/default in both the BC Header == , BC Scale == , BC Offset == , and BC Default == commands and any of the subsequent sediment, tracer, or WQ BC commands within a BC block, the values defined in the subsequent sediment/tracer/WQ specification commands will overwrite the BC Header == , BC Scale == , BC Offset == , and BC Default == commands
  • It is recommended to use the BC header/scale/offset/default commands for hydrodynamic, salinity, and temperature headers/scale/offset/default only, while using the sediment, tracer, and WQ-specific commands for their respective variables
  • Reference to the boundary condition time variable should only be specified by the BC Header == command. Time should not be repeated for any of the Sed Header == , Trace Header == , or WQ Header == commands
  • When salinity or temperature functionality is disabled (e.g., Include Salinity == 0, 0), the BC Header == line should be updated accordingly to remove salinity. If this is not undertaken then the undeleted salinity entries will be interpreted as temperature entries
  • Users should always check the log file to verify that the BC variable names match the expected headers in the BC file

2.2 GIS Integration Enhancements

2.2.1 TIN Bathymetry Assignment

Cell centre elevations can now be set using a triangulated irregular network (TIN) using the Read TIN Zpts command. Currently the command supports Aquaveo SMS .tin format to set cell centre elevations within the TIN extent.

Read TIN Zpts adopts TUFLOW FV’s layering approach and can be used in combination with the following common elevation commands:

  • Set Zpts ==
  • Read GRID Zpts ==
  • Read GIS Z Line ==
  • Cell Elevation File ==

The below example shows the use of Read TIN Zpts to update mesh elevations for a proposed development. The SMS .tin file is shown in Figures 2.1 and 2.2.

Design TIN Layout

Figure 2.1: Design TIN Layout

Oblique View of Design Mesh Topoography

Figure 2.2: Oblique View of Design Mesh Topoography

To ‘stamp’ the development elevations onto the mesh, the TIN is specified at a position in the .fvc below the assignment of the existing topography as follows.

!_________________________________________________________________
! GEOMETRY
Geometry 2D == ..\model\geo\Floodplain_001.2dm

! Topography
Set Zpts == 90.
Read Grid Zpts == ..\model\geo\dem_m01.asc
Read GIS Z Line == ..\model\gis\2d_zln_M03_thalweg_001_L.shp | ..\model\gis\2d_zln_M03_thalweg_001_P.shp
Read GIS Z Line == ..\model\gis\2d_zln_M03_Rd_Crest_001_L.shp | ..\model\gis\2d_zln_M03_Rd_Crest_001_P.shp
Read GIS Z Line == ..\model\gis\2d_zln_Invert_Correction_001_R.shp ! Enforce mesh Zb to surveyed culvert invert levels

! New Development Design Earthworks
Read TIN Zpts == ..\model\geo\Development_Design.tin

If the Write Check Files command is enabled, the resulting model elevations can be reviewed within the mesh check file.

2.3 Hydraulic Structure Updates

2.3.1 Default Culvert Height And Width Contraction Coefficients

Culvert width contraction (Width_Cont) and height contraction (Height_Cont) coefficients have been updated to default to 1.0. Previously if the Width_Cont and Height_Cont were not explicitly set in the culvert database file, TUFLOW FV would default to 0.0 resulting in no flow through the structure.

Note:

  • The height contraction coefficient Height_Cont for box culverts is usually 0.6 for square edged entrances to 0.8 for rounded edges. This factor is not used and is ignored for circular culverts

  • The width contraction coefficient Width_Cont for box culverts typically varies from 0.9 for sharp edges to 1.0 for rounded edges. This factor is normally set to 1.0 for circular culverts.

2.3.2 Default Culvert Entry and Exit Loss Coefficients

Culvert entry loss (Entry_Loss) and exit loss (Exit_Loss) coefficients have been updated to default to 0.5 and 1.0, respectively. Previously if these parameters were set to zero in the culvert database file, TUFLOW FV would default both to 0.0. Setting these to zero now results in these new defaults being applied.

Note:

  • If 0.0 is required for either of these coefficients then this can be effectively achieved by setting very small numbers in the culvert database file. Any number greater than 10\(^{-6}\) will serve this purpose.

2.3.3 Improved Culvert Invert Checking

An error message is now output if 1D culvert inverts are specified below the minimum ground elevation of connected nodestrings or zones. The default error behaviour can be set to a warning using the global .fvc command Culvert Invert Check == WARNING.

The error/warning message is output to the TUFLOW FV log file (.log) and the GIS messages layer (located within the log directory) if GIS integration is enabled.

An example of the error message is provided below.

Downstream culvert invert elevation is 36.50000
Downstream ground elevation (minimum) is 37.50000

ERROR: Culvert downstream invert is less than ground elevation, ID 1

This warning message is provided to highlight areas where the 1D/2D connection may need improvement, or mesh elevations at the inlet or outlet of a culvert structure may need to be amended to reflect surveyed culvert invert levels.

2.3.4 Weir Structure User Defined Width

An additional user-defined weir flow width property has been added for the WEIR flux function. This argument, denoted ‘B’ is the seventh argument of the structure block Properties command.

For example:

Stucture == Linked Nodestrings, Road_US, Road_DS
    Flux Function == Weir
    Properties == 2.5, 1.705, 1.5, 8.55, 0.556, 0.7, 12.6
    ! H, C, Ex, a, b, Csf_min, B (set the weir available flow width to 12.6 meters)
End Structure

User-defined flow width is supported for linked nodestring and linked zones structure types. It is not supported for single nodestring structure types.

If the user-defined width ‘B’ is not specified, the weir width is set either via:

  • The Max Open Width command for linked zones structure types
  • The average of the upstream and downstream nodestring lengths for linked nodestrings structure types
  • The nodestring length for nodestring structure types

2.3.5 Weir Adjust Memory Allocation Fix

A fix has been included that addresses a memory allocation issue when using the WEIR_ADJUST, and WEIR_DZ_ADJUST flux function types.

2.3.6 Target Rule Structure Control Fix

A fix has been implemented for structures using the Target Rule control type. The value being returned by the control block sample parameter was being incorrectly set to a NaN resulting in zero structure flow.

2.3.7 Control Block Trigger Rule Fix

An issue has been resolved with parameter sampling when using the trigger control type. In some models, this caused out-of-bounds memory access, leading to memory corruption and premature model termination.

2.3.8 Porous Structure Linked Structure Fixes

The following improvements have been made to the porous flux function for models using linked nodestring or linked zone structure types.

  1. A memory allocation issue affecting linked zones has been resolved.
  2. The assignment of upstream and downstream water levels for head differential calculation for both linked nodestrings and linked zones has been corrected.

Single nodestring structures were not affected.

2.4 Mass Balance

Users can now specify an additional output type massbalance that generates a suite of csv files that report timeseries of all time-accumulated volume and mass fluxes within a model domain, as related to all simulated quantities, other than temperature. One csv file is generated for each simulated quantity’s volume or mass balance, and so is intentionally self contained. This allows users to complete their own mass balance analyses on a per-simulated-quantity basis, without additional post processing or reference to any other output files.

Each output csv file is named <fvc_name>_MASSBALANCE_<quantity_name>.csv. For example the csv file for the salinity mass balance of simulation River_001.fvc would be named River_001_MASSBALANCE_SALINITY.csv, and written to the nominated results folder. Each csv file has several columns, each reporting a timeseries of mass or accumulated flux, and these columns vary between simulated quantities. The following columns are reported as the first five columns for all simulated quantities:

  1. Time
  2. Total instantaneous volume or mass of quantity, as computed from TUFLOW FV state variables (which is the same as the mass output)
  3. Accumulated fluxes across all QC and QC_POLY boundaries, summed to a single timeseries
  4. Accumulated fluxes across all Q boundaries, summed to a single timeseries. This does not include internal nodestring fluxes
  5. Accumulated fluxes across all WL, QN and WLS boundaries, summed to a single timeseries. This does not include internal nodestring fluxes

Following these columns, a series of bespoke accumulated fluxes are reported, and these depend on the quantity reported. After these bespoke accumulated fluxes, the following four columns are reported for all simulated quantities:

  • Summed accumulated fluxes for the reported quantity, including boundary (columns 3 - 5 above) and all bespoke fluxes, with sign (direction) preserved
  • Instantaneous flux-based volume or mass at time \(t\), as computed from summing the volume or mass at time \(t-1\) and time \(t\) fluxes. This provides an alternative estimate of instantaneous volume or mass that is then compared with the volume or mass reported in column 2. This comparison is reported in the next column
  • Percentage error between the instantaneous volume or mass reported in column 2 and the corresponding flux-based estimate reported in the previous column. For further information on the percentage error calculation refer to the TUFLOW FV Water Quality User Manual mass balance model appendix
  • The number of times the quantity reported has been ‘turned over’ since the beginning of the simulation. This is computed by summing the accumulated absolute values of all fluxes and dividing that sum by the original volume or mass. It is not intended to be an exact quantity to be used for flushing or similar analyses, but rather, to be interpreted as a quantity that provides an indication of the rapidity at which a quantity is cycled through the model domain. For example, a turnover value of 300 for VOLUME at the end of a one month simulation indicates that the modelled domain is dynamic and that water is cycled relatively quickly through the system. Conversely, a turnover value of 0.3 indicates the reverse - the simulated quantity is relatively stable and potentially stagnant.

Column headers in each csv file for hydrodynamic simulated quantities are presented in Table 2.1. Acronyms within column headers include:

  • V = Volumetric quantity
  • A = Areal quantity
  • MF = Mass flux
  • FV = TUFLOW FV output or computed from same
  • NS = Nodestring, encompassing WL, WLS and QN boundary types
  • WQ = Water Quality output or computed from same
  • Q = Q boundary type
  • QC = QC or QC_POLY boundary types
  • PCT = Percent
Table 2.1: Volume and Mass Flux Headers
Column Header Description Units
Volume <fvc_name>_MASSBALANCE_VOLUME.csv
TIME ISODATE Time
FV_VOL Instantaneous volume computed from TUFLOW FV state variables. Always a positive quantity. m\(^3\)
FV_MF_QC Accumulated volume fluxes across all QC and QC_POLY boundaries, summed to a single timeseries. Can be a positive or negative quantity. m\(^3\)
FV_MF_Q Accumulated volume fluxes across all Q boundaries, summed to a single timeseries. Can be a positive or negative quantity. m\(^3\)
FV_MF_NS Accumulated volume fluxes across all WL, WLS and QN boundaries, summed to a single timeseries. Can be a positive or negative quantity. m\(^3\)
FV_MF_EVAP Accumulated evaporative flux. Always a negative quantity. m\(^3\)
FV_MF_PREC Accumulated precipitation flux. Always a positive quantity. m\(^3\)
FV_MF_TOTAL Total of accumulated volume fluxes, with individual signs preserved. Can be a positive or negative quantity. m\(^3\)
MF_VOLUME Estimate of total volume computed from summing previous timestep volume and current timestep volume fluxes. Always a positive quantity. m\(^3\)
MF_PCT_ERROR The percentage error of the different between FV_VOL and MF_VOL. Can be a positive or negative quantity. %
MF_TURNOVERS See explanatory text (Section 2.4). Always a positive quantity. No units

Mass balance outputs are triggered by issuing a massbalance type output block. As for the previously available mass and flux types, the only parameter to be specified for massbalance is the output interval, in seconds.

Output == massbalance
    Output Interval == 900.0
End Output

An example of a mass balance output for volume is presented in Figure 2.3. The quantities in the legend are as per Table 2.1. The figure shows total volume in the top panel and fluxes in the bottom. The water volume balance between catchment inflows and tidal outflows is clear, and the volume of the system considered has turned over approximate 160 times in the period considered.

**Mass balance output: Volume**

Figure 2.3: Mass balance output: Volume

2.5 Minor Enhancements and Fixes

2.5.1 External Turbulence Scaling

When using Vertical Mixing Model == External, the computed eddy viscosity and scalar diffusivity can be optionally scaled through the Vertical Mixing Parameters command. This command requires two parameters: Eddy viscosity scale factor and Scalar diffusivity scale factor. The final (modelled) eddy viscosity and scalar diffusivity are determined as follows.

Eddy viscosity = Computed eddy viscosity x Eddy viscosity scale factor
Scalar diffusivity = Computed scalar diffusivity x Scalar diffusivity scale factor

For example:

Vertical Mixing Model == External
Vertical Mixing Parameters == 1.0, 1.0  ! {1.0} Eddy viscosity scale factor, {1.0} Scalar diffusivity scale factor

2.5.2 Depth Velocity Product Output Parameter

The product of depth and velocity is now available by invoking the map or point output parameter ‘z0’ noting:

  • The 0 in z0 is a zero, not the letter O
  • 2D or 3D map output is supported for NetCDF output format
  • 2D output is calculated by multiplying the water depth by the depth averaged velocity
  • 3D output is calculated by multiplying the water depth by the surface 3D layer velocity
  • Maximum and minimum statistics tracking is supported via the Output Statistics output block command
  • Depth averaged map output is available via XMDF and DATV output formats
  • Point output is supported

The following two examples show the output of z0 for NetCDF and Point outputs respectively.

Output == NetCDF
  Output Parameters == h, v, d, zb, z0
  Output Interval == 300.
  Output Statistics == max
  Output Statistics dt == 1
End Output

Output == Points
  Read GIS PO == ..\3d_po_Output_Points_001_P.shp
  Output Parameters == h, v, d, rhow, z0
  Output Interval == 300.
End Output

2.5.3 Additional Point Output Parameters Supported

The output parameters outlined in Table 2.2 are now available for point time series output. Each can be specified using the Output Parameters output block command as follows.

Output == Points
   Read GIS PO == ..\3d_po_Output_Points_001_P.shp
   Output Parameters == h, v, rhow ! water level, vel, density
   Output Interval == 900.
End Output

Table 2.2: Newly Supported Point Output Parameters
Point Output Parameter Description Units
BEDLOAD_SED_X Bedload for a specific sediment fraction X g/m/s
PAR Photsynthetically active radiation - Z-face W/m\(^2\)
PAR_CC Photsynthetically active radiation - Cell-centered W/m\(^2\)
RHOW Water density kg/m\(^3\)
SEDLOAD_SED_X Sediment load for a specific sediment fraction X g/m/s
SUSPLOAD_SED_X Suspload for a specific sediment fraction X g/m/s
TURBZ Turbulence Output Parameter which includes each of the following TURBZ_ outputs. NA
TURBZ_BVFSQ Cell z-face buoyancy production (BRUNT-VAISALA) frequency squared /s\(^2\)
TURBZ_EPS Cell z-face turbulence dissipation m\(^2\)/s\(^3\)
TURBZ_L Cell z-face turbulence length-scale m
TURBZ_NUH Cell z-face vertical temperature diffusivity m\(^2\)/s
TURBZ_NUM Cell z-face vertical eddy viscosity m\(^2\)/s
TURBZ_NUS Cell z-face vertical salinity diffusivity m\(^2\)/s
TURBZ_SPFSQ Cell z-face shear production frequency squared /s\(^2\)
TURBZ_TKE Cell z-face turbulent kinetic energy m\(^2\)/s\(^2\)
VMAG Velocity magnitude m/s
W Vertical velocity m/s
WVPERBOT Wave near-bed orbital motion period s
WVUBOT Wave near-bed orbital motion amplitude m/s

2.5.4 Improved Boundary Nodestring Overlap Checking

TUFLOW FV will now return an error and stop a run if it detects overlap between two or more open boundary nodestrings specified across .2dm and 2d_ns GIS files.

If the model has GIS integration enabled, an entry will be added to the GIS messages layer output to the log directory. This can be reviewed in GIS (refer Figure 2.4).

Nodestring Overlap Check

Figure 2.4: Nodestring Overlap Check

2.5.5 GPU 3D Drying Z Layer Message Fix

This fix concerns an incorrect error message for models using z or z-hybrid 3D layering on GPU hardware. CPU runs are not affected.

During simulation, if the top z-layer dried out TUFLOW FV was incorrectly reporting a water level and/or velocity magnitude exceedance message as follows.

ERROR: Water Surface and/or Velocity Magntitude has exceeded limits in cell 20

The z-layer drying error message has been fixed and the correct error is now reported. For example:

ERROR: Water Surface is less than 0.001m above top zlayer at cell 20

2.5.6 Duplicate Flux File Fix

A fix has been added to allow the output of multiple flux output blocks. As shown in the example below, after one flux output block has been specified, subsequent flux output blocks can be added, provided they contain the Suffix command.

! Multiple Flux Outputs
Output == flux
  Output Interval == 300. ! 5mins
End Output

Output == flux
  Output Interval == 60.
  Suffix == HR ! 1min HR (high resolution)
End Output

2.5.7 Turbulence Map Output Fix

Vertical averaging of the ‘TURBZ’ map output parameter has been added for NetCDF format. Previously TUFLOW FV would exit prematurely.

The 2D output of 3D variables is achieved via the Vertical Averaging map output block command. For example:

! Average the results 6 to 12m below the water surface and output as 2D
Output == netcdf
  Output Parameters == TURBZ ! Cell face turbulence outputs
  Output Interval == 900. ! 15mins
  Vertical Averaging == depth-range, 6, 12 ! 3D to 2D averaging command
End Output

2.5.8 Flux Output Header Fix

Flux output csv files have been updated to ensure ‘NS’ is prefixed on all flux file headings. This now supports integer and string nodestring names and provides backward compatibility for existing post-processing scripts such as MATLAB and Python time series extraction.

Flux Header Fix

Figure 2.5: Flux Header Fix

2.5.9 Structured Mesh Check File Fix

The coordinate field width for the .2dm check file when using regular meshes has been increased to ensure coordinates are written correctly for both spherical and cartesian models. Previously, x and y coordinates were not being correctly delimited for cartesian models, leading to .2dm read errors in supporting GIS software.

2.5.10 Log Directory Command Fix

Fixes an issue with log file creation when a tab character follows the Log Dir command. If a tab was present following the Log Dir command TUFLOW FV would previously exit with the error:

ERROR: Could not create directory:

2.5.11 Changes to Cell Face Map Outputs

For consistency with other map output parameters, the following output and parameters are now cell-centred whereas they were previously output on z-faces.

  • PAR
  • TURBZ (TURBZ_TKE, TURBZ_EPS, TURBZ_L, TURBZ_SPFSQ, TURBZ_BVFSQ, TURBZ_NUM, TURBZ_NUH, TURBZ_NUS)

2.5.12 GPU 3D Memory Error Fix

A memory allocation fix has been included that affected a small subset of 3D models running on GPU. Model set-ups subject to the issue would crash in the first iteration with the error: “NaN value detected in cell”. This issue did not affect simulations run on CPU hardware.

2.5.13 Improved Stability Limit Messages

Error messages have been improved for water surface elevation or velocity magnitude limit exceedances when using the Stability Limits == command as described in the below sub-sections.

2.5.13.1 Messages On CPU Hardware

Water Level

If the model exceeds the water level stability limit:

Previously:

  • Water Surface has gone above … m at cell … layer …

Now:

  • Imperial Units: Water surface has exceeded stability limit …. ft at 2D cell …
  • Metric Units: Water surface has exceeded stability limit …. m at 2D cell …

Velocity If the model exceeds the velocity stability limit:

Previously:

Velocity has gone above …. m/s at cell …. layer … depth is …

Now:

  • Imperial Units 2D Model: Velocity has exceeded stability limit …. ft/s at 2D cell …
  • Imperial Units 3D Model: Velocity has exceeded stability limit …. ft/s at 2D cell … (3D cell … - vertical layer …)
  • Metric Units 2D Model: Velocity has exceeded stability limit …. m/s at 2D cell …
  • Metric Units 3D Model: Velocity has exceeded stability limit …. m/s at 2D cell … (3D cell … - vertical layer …)

2.5.13.2 Messages On GPU Hardware

Water Level And Velocity

Previously:

  • Water Surface and/or Velocity Magnitude has exceeded limits in cell id …

Now:

  • Water surface and/or velocity magnitude has exceeded limits in 2D cell id …

2.5.14 Unstructured Mesh Unused Nodes Check

A check has been added to identify and report unused nodes in the unstructured mesh when reading a .2dm file via the Geometry 2D command. If unused nodes are found, TUFLOW FV will terminate with an error. For example:

2 unused .2dm nodes found - remove disjoint nodes in mesh.

The following information is reported:

  • Unused node IDs are printed to the console.
  • Unused node IDs and their location are written to the model messages GIS layer in the log folder.

Unused nodes can be readily removed in Aquaveo SMS via the ‘Select Disjoint’ tool in the 2D Mesh Nodes menu.