Skip to content

Commit

Permalink
Merge pull request #387 from nens/381-create-set-up-for-wq-documentation
Browse files Browse the repository at this point in the history
381 create set up for wq documentation
  • Loading branch information
leendertvanwolfswinkel authored Feb 2, 2024
2 parents 567d584 + bc75a6a commit b002efd
Show file tree
Hide file tree
Showing 8 changed files with 115 additions and 2 deletions.
1 change: 1 addition & 0 deletions source/a_how_to.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ If want to become familiar with the basics of working with 3Di and its common wo
a_howto_convert_to_1d2d
a_howto_use_inflow
a_howto_combine_0d_rain
a_howto_use_water_quality
d_vegetation_howto
41 changes: 41 additions & 0 deletions source/a_howto_use_water_quality.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
.. _howto_use_water_quality:

Use water quality
=================

3Di can be used in water quality assessments. More specifically, you can introduce concentrations of substances to the simulation, and compute how these substances spread through the water system due to advective forces and (numerical) diffusion. See :ref:`water_quality`.

Running water quality simulations
---------------------------------

Simulations with water quality can be run with any 3Di model. You do not need to make any changes to the model schematisation.

It involves the following steps:

- Define one or more substances that you want to use in the simulation, e.g. "Benzene hexachloride", "Biological Oxygen Demand (BOD)", or "Contaminant".

.. note:
All substances must be defined at the start of the simulation (the substances themselves, not their concentrations). You cannot define new substances while the simulation is already running.
- If the simulation includes initial water (in the 1D and/or 2D domain), you may set an initial concentration of the substance(s) you have defined in the initial water.

- If the simulation includes forcings, such as rain, boundary conditions, or laterals, you may add a concentration of the substance(s) you have defined to these forcings. Each forcing can contain concentrations of multiple substances at the same time.

.. note::
The way substance concentrations are defined, mirrors the way that the initials or forcings are defined. I.e., 2D initial water levels are supplied as a raster, so 2D initial substance concentrations are also supplied as a raster; substance concentrations in time series rain is also provided as a time series; et cetera.

- Run the simulation in the same way as you are used to

- Currently, there is not yet a graphical user interface for adding substances to simulations. Use the :ref:`a_api` to use this functionality.

Viewing and analysing water quality results
-------------------------------------------

The results of a water quality simulation are the concentrations of each substance at each node, for each output time step. These values are written to a :ref:`separate NetCDF file<wq_netcdf>`.

You can visualise these concentrations by plotting a graph of the concentration of a substance at specific locations over time. Or you can generate a map of the substance concentrations at a specific moment in time, e.g. by scaling the color of the nodes or cells by their concentration.

Currently, there is not yet a graphical user interface for visualising water quality results. Use :ref:`threedigrid` to do this.

A summary of the water quality calculations is available in the simulation logging. This :ref:`log file<wq_logging>` includes a substance summary, similar to the flow summary.
11 changes: 10 additions & 1 deletion source/h_logging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,21 @@ Log files
Flow summary
------------

File name: flow_summary.log
File name: flow_summary.json

This file provides a full water balance of the entire model domain for the entire simulation duration. It is recommended to always check this file after the simulation has finished.

The maximum volume error is also included in the volume balance; large volume errors are an indication that there may be something wrong with the schematisation. What constitutes a large volume error depends on the size of the model and the type of forcing that is used. By frequently inspecting the flow summary, an expert judgement can be trained to judge wether the volume error is normal. In very general terms, volume errors above 10 m³ are somewhat large; if the volume error is more than 1.000 m³, there is almost certainly something wrong with the schematisation.

.. _wq_logging:

Water quality substance summary
-------------------------------

File name: water_quality_substance_summary.json

This file provides the substance balance when water quality is used in a simulation. It is recommended to check this file for any inconsistencies in the substance balance.

Iteration
---------

Expand Down
1 change: 1 addition & 0 deletions source/h_outputs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ Outputs
:maxdepth: 1

h_results
h_water_quality_results
h_aggregate_results
h_logging
2 changes: 1 addition & 1 deletion source/h_results.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The results of a simulation are written to a `NetCDF <https://en.wikipedia.org/w

The file size is determined by the output time step, the size of the model (number of nodes and flowlines), and the duration of the simulation.

In addition to these snap shots, 3Di can generate aggregated results. More about this can be found in :ref:`aggregationnetcdf`.
In addition to these snap shots, 3Di can generate aggregated results. More about this can be found in :ref:`aggregationnetcdf`. More about the results of the water quality can be found :ref:`wq_netcdf`


Flow results are split between node and line variables. Node variables include volumes, water levels and all the source and sink terms. Flowline variables include velocities, discharges and wet cross-section areas. A full overview is given below.
Expand Down
17 changes: 17 additions & 0 deletions source/h_water_quality.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.. _water_quality:

Water quality
-------------

3Di has a module that can be used for water quality calculations. More specifically, you can introduce concentrations of substances to the simulation, and compute how these substances spread through the water system due to advective forces and (numerical) diffusion.

- Substances can enter the model domain as concentrations in initial water, boundary conditions, laterals, rain, leakage, surface sources and sinks. This applies to the entire model domain (1D, 2D, and groundwater).

- Each forcing can contain concentrations of multiple substances at the same time

- The :ref:`output of water quality simulations<wq_netcdf>` is in NetCDF format; the file has the same structure as hydrodynamic results (results_3di.nc).

.. warning::

You cannot add multiple laterals to a single node or cell if they have different substance concentrations

43 changes: 43 additions & 0 deletions source/h_water_quality_results.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
.. _wq_netcdf:

Water quality results 3Di
=========================

The water quality results of a simulation are written to a `NetCDF <https://en.wikipedia.org/wiki/NetCDF>`_ file called *water_quality_results_3di.nc*, which follows the `CF Conventions <http://cfconventions.org/>`_ . The CF convention stipulates that the 2D and 1D mesh data are stored in separate parts of the file. The *water_quality_results_3di.nc* file contains snapshots of concentrations at nodes (1D and 2D). The output timestep, i.e. the interval at which these snapshot values are written to the NetCDF file, is set at the start of the simulation.

Water quality results can be retrieved from the nodes in the 1D and 2D. The amount of variables in the netcdf depends on the amount of added substances in the model. An overview of the configuration of the variables is given below.

**Water quality Variables 2D**.

Mesh2D_substance_1_2D: Concentration of substance 1 at the specified node.

- Name: substance_1_2D
- Unit: substance per m3

Mesh2D_substance_2_2D: Concentration of substance 2 at the specified node.

- Name: substance_2_2D
- Unit: substance per m3

Mesh2D_substance_*n*_2D: Concentration of substance *n* at the specified node.

- Name: substance_*n*_2D
- Unit: substance per m3


**Water quality Variables 1D**.

Mesh2D_substance_1_2D: Concentration of substance 1 at the specified node.

- Name: substance_1_1D
- Unit: substance per m3

Mesh2D_substance_2_2D: Concentration of substance 2 at the specified node.

- Name: substance_1_1D
- Unit: substance per m3

Mesh2D_substance_*n*_2D: Concentration of substance *n* at the specified node.

- Name: substance_*n*_1D
- Unit: substance per m3
1 change: 1 addition & 0 deletions source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ Table of contents
h_grid
h_flow
h_simulation_settings
h_water_quality
h_outputs


Expand Down

0 comments on commit b002efd

Please sign in to comment.