From d614343cf8ba83190d86566cba0874d7a8188ba9 Mon Sep 17 00:00:00 2001 From: Tim van den Aardweg <71257004+tim-vd-aardweg@users.noreply.github.com> Date: Thu, 25 Apr 2024 09:19:34 +0200 Subject: [PATCH 1/4] Ensure only floats check for Fortran scientific notation when parsing (#626) refs: #559 --- hydrolib/core/dflowfm/ini/models.py | 22 ++++++ hydrolib/core/dflowfm/ini/parser.py | 20 ----- tests/dflowfm/ini/test_ini.py | 7 -- tests/dflowfm/ini/test_models.py | 111 +++++++++++++++++++++++++++- tests/dflowfm/test_storagenode.py | 36 +++++++++ 5 files changed, 168 insertions(+), 28 deletions(-) diff --git a/hydrolib/core/dflowfm/ini/models.py b/hydrolib/core/dflowfm/ini/models.py index 484ad755e..1459df78c 100644 --- a/hydrolib/core/dflowfm/ini/models.py +++ b/hydrolib/core/dflowfm/ini/models.py @@ -2,6 +2,7 @@ from abc import ABC from enum import Enum from math import isnan +from re import compile from typing import Any, Callable, List, Literal, Optional, Set, Type, Union from pydantic.v1 import Extra, Field, root_validator @@ -46,6 +47,9 @@ class INIBasedModel(BaseModel, ABC): _header: str _file_path_style_converter = FilePathStyleConverter() + _scientific_notation_regex = compile( + r"([\d.]+)([dD])([+-]?\d{1,3})" + ) # matches a float: 1d9, 1D-3, 1.D+4, etc. class Config: extra = Extra.ignore @@ -123,6 +127,24 @@ def comments_matches_has_comments(cls, v): v = None return v + @validator("*", pre=True, allow_reuse=True) + def replace_fortran_scientific_notation_for_floats(cls, value, field): + if field.type_ != float: + return value + + return cls._replace_fortran_scientific_notation(value) + + @classmethod + def _replace_fortran_scientific_notation(cls, value): + if isinstance(value, str): + return cls._scientific_notation_regex.sub(r"\1e\3", value) + if isinstance(value, list): + for i, v in enumerate(value): + if isinstance(v, str): + value[i] = cls._scientific_notation_regex.sub(r"\1e\3", v) + + return value + @classmethod def validate(cls: Type["INIBasedModel"], value: Any) -> "INIBasedModel": if isinstance(value, Section): diff --git a/hydrolib/core/dflowfm/ini/parser.py b/hydrolib/core/dflowfm/ini/parser.py index 36d5d8811..981637cde 100644 --- a/hydrolib/core/dflowfm/ini/parser.py +++ b/hydrolib/core/dflowfm/ini/parser.py @@ -1,4 +1,3 @@ -import re from enum import IntEnum from pathlib import Path from typing import Callable, Dict, List, Optional, Tuple, Union @@ -372,27 +371,8 @@ def parse(cls, filepath: Path, config: ParserConfig = None) -> Document: config = ParserConfig() parser = cls(config) - progline = re.compile( - r"^([^#]*=\s*)([^#]*)(#.*)?" - ) # matches whole line: "Field = Value Maybe more # optional comment" - progfloat = re.compile( - r"([\d.]+)([dD])([+\-]?\d{1,3})" - ) # matches a float value: 1d9, 1D-3, 1.D+4, etc. - with filepath.open(encoding="utf8") as f: for line in f: - # Replace Fortran scientific notation for doubles - # Match number d/D +/- number (e.g. 1d-05 or 1.23D+01 or 1.d-4) - match = progline.match(line) - if match: # Only process value - line = ( - match.group(1) - + progfloat.sub(r"\1e\3", match.group(2)) - + str(match.group(3) or "") - ) - else: # Process full line - line = progfloat.sub(r"\1e\3", line) - parser.feed_line(line) return parser.finalize() diff --git a/tests/dflowfm/ini/test_ini.py b/tests/dflowfm/ini/test_ini.py index 9784909cc..679cfb7c1 100644 --- a/tests/dflowfm/ini/test_ini.py +++ b/tests/dflowfm/ini/test_ini.py @@ -13,7 +13,6 @@ Property, Section, ) -from hydrolib.core.dflowfm.ini.models import INIBasedModel from hydrolib.core.dflowfm.ini.parser import ( Parser, ParserConfig, @@ -379,12 +378,6 @@ def test_is_datarow(self, line: str, config: ParserConfig, expected_result: bool [ ("someParam = 1.0 # comment text", "someparam", "1.0"), ("someParam = 1.0", "someparam", "1.0"), - ("someParam = 1d0 # comment text", "someparam", "1e0"), - ("someParam = 1d-2", "someparam", "1e-2"), - ("someParam = 1d+2", "someparam", "1e+2"), - ("someParam = 1.d+2", "someparam", "1.e+2"), - ("someParam = -1.d-2", "someparam", "-1.e-2"), - ("someParam1D2D = -1.d-2", "someparam1d2d", "-1.e-2"), ], ) def test_float_values( diff --git a/tests/dflowfm/ini/test_models.py b/tests/dflowfm/ini/test_models.py index 750a6960d..cc7a794c7 100644 --- a/tests/dflowfm/ini/test_models.py +++ b/tests/dflowfm/ini/test_models.py @@ -1,9 +1,10 @@ from math import nan +from typing import List import pytest from pydantic.v1.error_wrappers import ValidationError -from hydrolib.core.dflowfm.ini.models import DataBlockINIBasedModel +from hydrolib.core.dflowfm.ini.models import DataBlockINIBasedModel, INIBasedModel from ...utils import error_occurs_only_once @@ -39,3 +40,111 @@ def test_datablock_with_multiple_nans_should_only_give_error_once(self): expected_message = "NaN is not supported in datablocks." assert error_occurs_only_once(expected_message, str(error.value)) + + +class TestINIBasedModel: + class INIBasedModelTest(INIBasedModel): + id: str + float_value: float + float_values: List[float] + + _random_string: str = "randomString" + _random_float: float = 123.456 + _random_list_of_floats: List[float] = [12.34, 56.78] + + @pytest.mark.parametrize("string_value", ["1d0", "1d-2", "1d+2", "1.d+2", "-1.d-2"]) + def test_scientific_notation_for_string_field_is_parsed_as_string( + self, string_value: str + ): + + test_model = self.INIBasedModelTest( + id=string_value, + float_value=self._random_float, + float_values=self._random_list_of_floats, + ) + + assert test_model.id == string_value + assert test_model.float_value == pytest.approx(self._random_float) + assert test_model.float_values == pytest.approx(self._random_list_of_floats) + + @pytest.mark.parametrize( + "float_as_string, expected_value", + [ + ("1d0", 1e0), + ("1d-2", 1e-2), + ("1d+2", 1e2), + ("1.d+2", 1.0e2), + ("-1.d-2", -1.0e-2), + ], + ) + def test_scientific_notation_for_float_field_is_parsed_as_float( + self, float_as_string: str, expected_value: float + ): + test_model = self.INIBasedModelTest( + id=self._random_string, + float_value=float_as_string, + float_values=self._random_list_of_floats, + ) + + assert test_model.id == self._random_string + assert test_model.float_value == pytest.approx(expected_value) + assert test_model.float_values == pytest.approx(self._random_list_of_floats) + + @pytest.mark.parametrize( + "floats_as_strings, expected_values", + [ + (["1d0", "1d-2"], [1e0, 1e-2]), + (["1d+2", "1.d+2", "-1.d-2"], [1e2, 1.0e2, -1.0e-2]), + ], + ) + def test_scientific_notation_for_list_of_float_field_is_parsed_as_list_of_floats( + self, floats_as_strings: List[str], expected_values: List[float] + ): + test_model = self.INIBasedModelTest( + id=self._random_string, + float_value=self._random_float, + float_values=floats_as_strings, + ) + + assert test_model.id == self._random_string + assert test_model.float_value == pytest.approx(self._random_float) + assert test_model.float_values == pytest.approx(expected_values) + + def test_setting_string_attribute_with_scientific_notation_correctly_parses_value( + self, + ): + test_model = self.INIBasedModelTest( + id=self._random_string, + float_value=self._random_float, + float_values=self._random_list_of_floats, + ) + + test_model.id = "1d1" + + assert test_model.id == "1d1" + + def test_setting_float_attribute_with_scientific_notation_correctly_parses_value( + self, + ): + test_model = self.INIBasedModelTest( + id=self._random_string, + float_value=self._random_float, + float_values=self._random_list_of_floats, + ) + + test_model.float_value = "1d1" + + assert test_model.float_value == pytest.approx(1e1) + + def test_setting_list_of_floats_attribute_with_scientific_notation_correctly_parses_values( + self, + ): + test_model = self.INIBasedModelTest( + id=self._random_string, + float_value=self._random_float, + float_values=self._random_list_of_floats, + ) + + test_model.float_values = ["1d1", "2d-1"] + + assert test_model.float_values == pytest.approx([1e1, 2e-1]) diff --git a/tests/dflowfm/test_storagenode.py b/tests/dflowfm/test_storagenode.py index 378449d47..0918abb0a 100644 --- a/tests/dflowfm/test_storagenode.py +++ b/tests/dflowfm/test_storagenode.py @@ -162,3 +162,39 @@ def _create_required_storage_node_values(usetable: bool) -> dict: ) return values + + +def test_scientific_notation_in_ini_file_are_correctly_parsed_for_strings_and_floats( + tmp_path, +): + + file_data = """ +[General] + fileVersion = 2.00 + fileType = storageNodes + useStreetStorage = 1 + +[StorageNode] + id = 0D05252 + name = 0D05252 + nodeId = Compartment002 + ManholeId = Manhole002 + bedLevel = -2e0 + area = 0.4096000 + streetLevel = 0.000 + storageType = Reservoir + streetStorageArea = 1d2 + CompartmentShape = Unknown + useTable = False + """ + + temporary_file_path_node_file = tmp_path / "nodeFile.ini" + temporary_file_path_node_file.write_text(file_data) + + storage_node_model = StorageNodeModel(temporary_file_path_node_file) + + storage_node = storage_node_model.storagenode[0] + assert storage_node.id == "0D05252" + assert storage_node.name == "0D05252" + assert storage_node.bedlevel == pytest.approx(-2e0) + assert storage_node.streetstoragearea == pytest.approx(1e2) From d080e9875b78e0581ff4cdda63f4205b64c3e922 Mon Sep 17 00:00:00 2001 From: veenstrajelmer <60435591+veenstrajelmer@users.noreply.github.com> Date: Fri, 26 Apr 2024 12:23:27 +0200 Subject: [PATCH 2/4] fixed codecov, fixes #633 --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 764499eb2..25c7fe72a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,4 +54,6 @@ jobs: git checkout $GITHUB_HEAD_REF git commit -am "autoformat: isort & black" && git push || true - - uses: codecov/codecov-action@v1 \ No newline at end of file + - uses: codecov/codecov-action@v4 + env: + CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}} \ No newline at end of file From 60a2cd592ed9478c7c501e466e9faf75f168771b Mon Sep 17 00:00:00 2001 From: veenstrajelmer <60435591+veenstrajelmer@users.noreply.github.com> Date: Mon, 29 Apr 2024 12:16:03 +0200 Subject: [PATCH 3/4] 444 investigate failing tests on linux and macos when upgrading meshkernel to 200 (#636) * update setup python version from v1 to v4 * Add macos-13 to ci.yml --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 25c7fe72a..a9752279e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ jobs: fail-fast: false matrix: python-version: ["3.8", "3.9", "3.10", "3.11"] - os: [ubuntu-latest, windows-latest] + os: [ubuntu-latest, windows-latest, macos-13] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 @@ -16,7 +16,7 @@ jobs: fetch-depth: 0 - name: Set up Python - uses: actions/setup-python@v1 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} @@ -56,4 +56,4 @@ jobs: - uses: codecov/codecov-action@v4 env: - CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}} \ No newline at end of file + CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}} From 7648b010d6c10cc125ba79eae58093aa252951da Mon Sep 17 00:00:00 2001 From: Tim van den Aardweg <71257004+tim-vd-aardweg@users.noreply.github.com> Date: Thu, 2 May 2024 10:43:44 +0200 Subject: [PATCH 4/4] feat: Add missing mdu keywords (#628) refs: #571 --- hydrolib/core/dflowfm/mdu/models.py | 312 ++++++++++++++++++ .../data/reference/fm/special_3d_settings.mdu | 238 ++++++++----- 2 files changed, 462 insertions(+), 88 deletions(-) diff --git a/hydrolib/core/dflowfm/mdu/models.py b/hydrolib/core/dflowfm/mdu/models.py index d7caadd29..e6d620ed9 100644 --- a/hydrolib/core/dflowfm/mdu/models.py +++ b/hydrolib/core/dflowfm/mdu/models.py @@ -200,6 +200,111 @@ class Comments(INIBasedModel.Comments): epshu: Optional[str] = Field( "Threshold water depth for wetting and drying [m].", alias="epsHu" ) + fixedweirrelaxationcoef: Optional[str] = Field( + "Fixed weir relaxation coefficient for computation of energy loss.", + alias="fixedWeirRelaxationCoef", + ) + implicitdiffusion2d: Optional[str] = Field( + "Implicit diffusion in 2D (0: no, 1:yes).", alias="implicitDiffusion2D" + ) + vertadvtyptem: Optional[str] = Field( + "Vertical advection type for temperature (0: none, 4: Theta implicit, 6: higher order explicit, no Forester filter).", + alias="vertAdvTypTem", + ) + velmagnwarn: Optional[str] = Field( + "Warning level unitbrackets{m/s} on velocity magnitude (<= 0: no check).", + alias="velMagnWarn", + ) + transportautotimestepdiff: Optional[str] = Field( + "Auto Timestepdiff in Transport, (0 : lim diff, no lim Dt, 1: no lim diff, lim Dt, 2: no lim diff, no lim Dt, 3: implicit (only 2D)).", + alias="transportAutoTimestepDiff", + ) + sethorizontalbobsfor1d2d: Optional[str] = Field( + "Bobs are set to 2D bedlevel, to prevent incorrect storage in sewer system (0: no, 1:yes).", + alias="setHorizontalBobsFor1D2D", + ) + diagnostictransport: Optional[str] = Field( + "No update of transport quantities, also known as diagnostic transport (0: no, 1: yes).", + alias="diagnosticTransport", + ) + vertadvtypsal: Optional[str] = Field( + "Vertical advection type for salinity (0: none, 4: Theta implicit, 6: higher order explicit, no Forester filter).", + alias="vertAdvTypSal", + ) + zerozbndinflowadvection: Optional[str] = Field( + "Switch for advection at open boundary (0: Neumann, 1=zero at inflow, 2=zero at inflow and outflow).", + alias="zeroZBndInflowAdvection", + ) + pure1d: Optional[str] = Field( + "Purely 1D advection (0: original advection using velocity vector, 1: pure 1D using flow volume vol1_f, 2: pure 1D using volume vol1)", + alias="pure1D", + ) + testdryingflooding: Optional[str] = Field( + "Drying flooding algorithm (0: D-Flow FM, 1: Delft3DFLOW, 2: Similar to 0, and volume limitation in the transport solver based on Epshu).", + alias="testDryingFlooding", + ) + logsolverconvergence: Optional[str] = Field( + "Print time step, number of solver iterations and solver residual to diagnostic output (0: no, 1: yes).", + alias="logSolverConvergence", + ) + fixedweirscheme1d2d: Optional[str] = Field( + "Fixed weir scheme for 1d2d links (0: same as fixedweirscheme, 1: lateral iterative fixed weir scheme).", + alias="fixedWeirScheme1D2D", + ) + horizontalmomentumfilter: Optional[str] = Field( + "Filter for reduction of checkerboarding; 0=No, 1=yes.", + alias="horizontalMomentumFilter", + ) + maxnonlineariterations: Optional[str] = Field( + "Maximal iterations in non-linear iteration loop before a time step reduction is applied", + alias="maxNonLinearIterations", + ) + maxvelocity: Optional[str] = Field( + "Upper bound [m/s] on velocity (<= 0: no bounds). Run will abort when violated.", + alias="maxVelocity", + ) + waterlevelwarn: Optional[str] = Field( + "Warning level [m AD] on water level (<= 0: no check).", + alias="waterLevelWarn", + ) + tspinupturblogprof: Optional[str] = Field( + "Spin up time [s] when starting with a parabolic viscosity profile in whole model domain.", + alias="tSpinUpTurbLogProf", + ) + fixedweirtopfrictcoef: Optional[Optional[str]] = Field( + "Uniform friction coefficient of the groyne part of fixed weirs [the unit depends on frictiontype].", + alias="fixedWeirTopFrictCoef", + ) + fixedweir1d2d_dx: Optional[str] = Field( + "Extra delta x for lateral 1d2d fixed weirs.", alias="fixedWeir1D2D_dx" + ) + junction1d: Optional[str] = Field( + "Advection at 1D junctions: (0: original 1D advection using velocity vector, 1 = same as along 1D channels using Pure1D=1).", + alias="junction1D", + ) + fixedweirtopwidth: Optional[str] = Field( + "Uniform width of the groyne part of fixed weirs [m].", + alias="fixedWeirTopWidth", + ) + vertadvtypmom: Optional[str] = Field( + "Vertical advection type in momentum equation; 3: Upwind implicit, 6: centerbased upwind explicit.", + alias="vertAdvTypMom", + ) + checkerboardmonitor: Optional[str] = Field( + "Flag for checkerboarding output on history file (only for sigma layers yet); 0=No, 1=yes.", + alias="checkerboardMonitor", + ) + velocitywarn: Optional[str] = Field( + "Warning level [m/s] on normal velocity(<= 0: no check).", + alias="velocityWarn", + ) + adveccorrection1d2d: Optional[str] = Field( + "Advection correction of 1D2D link volume (0: regular advection, 1: link volume au*dx, 2: advection on 1D2D switched off.)", + alias="advecCorrection1D2D", + ) + fixedweirtalud: Optional[str] = Field( + "Uniform talud slope of fixed weirs.", alias="fixedWeirTalud" + ) comments: Comments = Comments() @@ -236,6 +341,33 @@ class Comments(INIBasedModel.Comments): maxvelocitydiff: float = Field(0.0, alias="maxVelocityDiff") mintimestepbreak: float = Field(0.0, alias="minTimestepBreak") epshu: float = Field(0.0001, alias="epsHu") + fixedweirrelaxationcoef: float = Field(0.6, alias="fixedWeirRelaxationCoef") + implicitdiffusion2d: bool = Field(False, alias="implicitDiffusion2D") + vertadvtyptem: int = Field(6, alias="vertAdvTypTem") + velmagnwarn: float = Field(0.0, alias="velMagnWarn") + transportautotimestepdiff: int = Field(0, alias="transportAutoTimestepDiff") + sethorizontalbobsfor1d2d: bool = Field(False, alias="setHorizontalBobsFor1D2D") + diagnostictransport: bool = Field(False, alias="diagnosticTransport") + vertadvtypsal: int = Field(6, alias="vertAdvTypSal") + zerozbndinflowadvection: int = Field(0, alias="zeroZBndInflowAdvection") + pure1d: int = Field(0, alias="pure1D") + testdryingflooding: int = Field(0, alias="testDryingFlooding") + logsolverconvergence: bool = Field(False, alias="logSolverConvergence") + fixedweirscheme1d2d: int = Field(0, alias="fixedWeirScheme1D2D") + horizontalmomentumfilter: bool = Field(False, alias="horizontalMomentumFilter") + maxnonlineariterations: int = Field(100, alias="maxNonLinearIterations") + maxvelocity: float = Field(0.0, alias="maxVelocity") + waterlevelwarn: float = Field(0.0, alias="waterLevelWarn") + tspinupturblogprof: float = Field(0.0, alias="tSpinUpTurbLogProf") + fixedweirtopfrictcoef: Optional[float] = Field(None, alias="fixedWeirTopFrictCoef") + fixedweir1d2d_dx: float = Field(50.0, alias="fixedWeir1D2D_dx") + junction1d: int = Field(0, alias="junction1D") + fixedweirtopwidth: float = Field(3.0, alias="fixedWeirTopWidth") + vertadvtypmom: int = Field(6, alias="vertAdvTypMom") + checkerboardmonitor: bool = Field(False, alias="checkerboardMonitor") + velocitywarn: float = Field(0.0, alias="velocityWarn") + adveccorrection1d2d: int = Field(0, alias="advecCorrection1D2D") + fixedweirtalud: float = Field(4.0, alias="fixedWeirTalud") class VolumeTables(INIBasedModel): @@ -553,6 +685,10 @@ class Comments(INIBasedModel.Comments): computedairdensity: Optional[str] = Field( "Compute air density yes/no (), 1/0, default 0.", alias="computedAirdensity" ) + stresstowind: Optional[str] = Field( + "Switch between Wind speed (=0) and wind stress (=1) approach for wind forcing.", + alias="stressToWind", + ) comments: Comments = Comments() @@ -568,6 +704,7 @@ class Comments(INIBasedModel.Comments): pavbnd: float = Field(0.0, alias="pavBnd") pavini: float = Field(0.0, alias="pavIni") computedairdensity: bool = Field(False, alias="computedAirdensity") + stresstowind: bool = Field(False, alias="stressToWind") @classmethod def list_delimiter(cls) -> str: @@ -1263,6 +1400,79 @@ class Comments(INIBasedModel.Comments): richardsononoutput: Optional[str] = Field( "Write Richardson number, (1: yes, 0: no).", alias="richardsonOnOutput" ) + wrimap_every_dt: Optional[str] = Field( + "Write output to map file every computational timestep, between start and stop time from MapInterval, (1: yes, 0: no).", + alias="wrimap_input_dt", + ) + wrimap_input_roughness: Optional[str] = Field( + "Write chezy input roughness on flow links to map file, (1: yes, 0: no).", + alias="wrimap_input_roughness", + ) + wrimap_flowarea_au: Optional[str] = Field( + "Write flow areas au to map file (1: yes, 0: no).", + alias="wrimap_flowarea_au", + ) + wrihis_airdensity: Optional[str] = Field( + "Write air density to his file (1: yes, 0: no).", alias="wrihis_airdensity" + ) + wrimap_flow_flux_q1_main: Optional[str] = Field( + "Write flow flux in main channel to map file (1: yes, 0: no).", + alias="wrimap_flow_flux_q1_main", + ) + wrimap_windstress: Optional[str] = Field( + "Write wind stress to map file (1: yes, 0: no).", alias="wrimap_windstress" + ) + wrishp_genstruc: Optional[str] = Field( + "Writing general structures to shape file (0=no, 1=yes).", + alias="wrishp_genstruc", + ) + wrimap_qin: Optional[str] = Field( + "Write sum of all influxes to map file (1: yes, 0: no).", alias="wrimap_qin" + ) + wrimap_dtcell: Optional[str] = Field( + "Write time step per cell based on CFL (1: yes, 0: no).", + alias="wrimap_dtcell", + ) + wrimap_velocity_vectorq: Optional[str] = Field( + "Write cell-center velocity vectors (discharge-based) to map file (1: yes, 0: no).", + alias="wrimap_velocity_vectorq", + ) + wrimap_bnd: Optional[str] = Field( + "Write boundary points to map file (1: yes, 0: no).", alias="wrimap_bnd" + ) + wrishp_dambreak: Optional[str] = Field( + "Writing dambreaks to shape file (0=no, 1=yes).", alias="wrishp_dambreak" + ) + wrimap_waterdepth_hu: Optional[str] = Field( + "Write water depths on u-points to map file (1: yes, 0: no).", + alias="wrimap_waterdepth_hu", + ) + ncmapdataprecision: Optional[str] = Field( + "Precision for NetCDF data in map files (double or single).", + alias="ncMapDataPrecision", + ) + nchisdataprecision: Optional[str] = Field( + "Precision for NetCDF data in his files (double or single).", + alias="ncHisDataPrecision", + ) + wrimap_interception: Optional[str] = Field( + "Write interception to map file (1: yes, 0: no).", + alias="wrimap_interception", + ) + wrimap_airdensity: Optional[str] = Field( + "Write air density to map file, (1:yes, 0:no).", alias="wrimap_airdensity" + ) + wrimap_volume1: Optional[str] = Field( + "Write volumes to map file (1: yes, 0: no).", alias="wrimap_volume1" + ) + wrimap_ancillary_variables: Optional[str] = Field( + "Write ancillary variables attributes to map file (1: yes, 0: no).", + alias="wrimap_ancillary_variables", + ) + wrimap_chezy_on_flow_links: Optional[str] = Field( + "Write chezy roughness on flow links to map file, (1: yes, 0: no)", + alias="wrimap_chezy_on_flow_links", + ) comments: Comments = Comments() @@ -1427,6 +1637,30 @@ class Comments(INIBasedModel.Comments): statsinterval: List[float] = Field([-60.0], alias="statsInterval") timingsinterval: List[float] = Field([0.0], alias="timingsInterval") richardsononoutput: bool = Field(False, alias="richardsonOnOutput") + wrimap_every_dt: bool = Field(False, alias="wrimap_input_dt") + wrimap_input_roughness: bool = Field(False, alias="wrimap_input_roughness") + wrimap_flowarea_au: bool = Field(False, alias="wrimap_flowarea_au") + wrihis_airdensity: bool = Field(False, alias="wrihis_airdensity") + wrimap_flow_flux_q1_main: bool = Field(False, alias="wrimap_flow_flux_q1_main") + wrimap_windstress: bool = Field(False, alias="wrimap_windstress") + wrishp_genstruc: bool = Field(False, alias="wrishp_genstruc") + wrimap_qin: bool = Field(False, alias="wrimap_qin") + wrimap_dtcell: bool = Field(False, alias="wrimap_dtcell") + wrimap_velocity_vectorq: bool = Field(False, alias="wrimap_velocity_vectorq") + wrimap_bnd: bool = Field(False, alias="wrimap_bnd") + wrishp_dambreak: bool = Field(False, alias="wrishp_dambreak") + wrimap_waterdepth_hu: bool = Field(False, alias="wrimap_waterdepth_hu") + ncmapdataprecision: Literal["single", "double"] = Field( + "double", alias="ncMapDataPrecision" + ) + nchisdataprecision: Literal["single", "double"] = Field( + "double", alias="ncHisDataPrecision" + ) + wrimap_interception: bool = Field(False, alias="wrimap_interception") + wrimap_airdensity: bool = Field(False, alias="wrimap_airdensity") + wrimap_volume1: bool = Field(False, alias="wrimap_volume1") + wrimap_ancillary_variables: bool = Field(False, alias="wrimap_ancillary_variables") + wrimap_chezy_on_flow_links: bool = Field(False, alias="wrimap_chezy_on_flow_links") _split_to_list = get_split_string_on_delimiter_validator( "waterlevelclasses", @@ -1642,6 +1876,63 @@ class Comments(INIBasedModel.Comments): "Change the structure dimensions in case these are inconsistent with the channel dimensions.", alias="changeStructureDimensions", ) + gridenclosurefile: Optional[str] = Field( + "Enclosure file <*.pol> to clip outer parts from the grid.", + alias="gridEnclosureFile", + ) + allowbndatbifurcation: Optional[str] = Field( + "Allow 1d boundary node when connectin branch leads to bifurcation (1: yes, 0: no).", + alias="allowBndAtBifurcation", + ) + slotw1d: Optional[str] = Field("Minimum slotwidth 1D [m].", alias="slotw1D") + slotw2d: Optional[str] = Field("Minimum slotwidth 2D [m].", alias="slotw2D") + uniformheight1droofgutterpipes: Optional[str] = Field( + "Uniform height for roof gutter pipes [m].", + alias="uniformHeight1DRoofGutterPipes", + ) + dxmin1d: Optional[str] = Field("Minimum 1D link length [m].", alias="dxmin1D") + uniformtyp1dstreetinlets: Optional[str] = Field( + "Uniform cross section type for street inlets (1: circle, 2: rectangle, -2: closed rectangle).", + alias="uniformTyp1DStreetInlets", + ) + stretchtype: Optional[str] = Field( + "Stretching type for non-uniform layers, 1=user defined, 2=exponential, otherwise=uniform.", + alias="stretchType", + ) + zlaybot: Optional[str] = Field( + "if specified, first z-layer starts from zlaybot [ ], if not, it starts from the lowest bed point.", + alias="zlayBot", + ) + zlaytop: Optional[str] = Field( + "if specified, highest z-layer ends at zlaytop [ ], if not, it ends at the initial water level.", + alias="zlayTop", + ) + uniformheight1d: Optional[str] = Field( + "Uniform height for 1D profiles and 1d2d internal links [m].", + alias="uniformHeight1D", + ) + roofsfile: Optional[str] = Field( + "Polyline file <*_roof.pliz>, containing roofgutter heights x, y, z level.", + alias="roofsFile", + ) + gulliesfile: Optional[str] = Field( + "Polyline file <*_gul.pliz>, containing lowest bed level along talweg x, y, z level.", + alias="gulliesFile", + ) + uniformwidth1dstreetinlets: Optional[str] = Field( + "Uniform width for street inlets [m].", alias="uniformWidth1DStreetInlets" + ) + uniformheight1dstreetinlets: Optional[str] = Field( + "Uniform height for street inlets [m]", alias="uniformHeight1DStreetInlets" + ) + uniformtyp1droofgutterpipes: Optional[str] = Field( + "Uniform cross section type for type roof gutter pipes (1: circle, 2: rectangle, -2: closed rectangle).", + alias="uniformTyp1DRoofGutterPipes", + ) + uniformwidth1droofgutterpipes: Optional[str] = Field( + "Uniform width for roof gutter pipes [m].", + alias="uniformWidth1DRoofGutterPipes", + ) comments: Comments = Comments() @@ -1725,6 +2016,27 @@ class Comments(INIBasedModel.Comments): dxdoubleat1dendnodes: bool = Field(True, alias="dxDoubleAt1DEndNodes") changevelocityatstructures: bool = Field(False, alias="changeVelocityAtStructures") changestructuredimensions: bool = Field(True, alias="changeStructureDimensions") + gridenclosurefile: Optional[PolyFile] = Field(None, alias="gridEnclosureFile") + allowbndatbifurcation: bool = Field(False, alias="allowBndAtBifurcation") + slotw1d: float = Field(0.001, alias="slotw1D") + slotw2d: float = Field(0.001, alias="slotw2D") + uniformheight1droofgutterpipes: float = Field( + 0.1, alias="uniformHeight1DRoofGutterPipes" + ) + dxmin1d: float = Field(0.001, alias="dxmin1D") + uniformtyp1dstreetinlets: int = Field(-2, alias="uniformTyp1DStreetInlets") + stretchtype: int = Field(1, alias="stretchType") + zlaybot: float = Field(-999.0, alias="zlayBot") + zlaytop: float = Field(-999.0, alias="zlayTop") + uniformheight1d: float = Field(3.0, alias="uniformHeight1D") + roofsfile: Optional[PolyFile] = Field(None, alias="roofsFile") + gulliesfile: Optional[PolyFile] = Field(None, alias="gulliesFile") + uniformwidth1dstreetinlets: float = Field(0.2, alias="uniformWidth1DStreetInlets") + uniformheight1dstreetinlets: float = Field(0.1, alias="uniformHeight1DStreetInlets") + uniformtyp1droofgutterpipes: int = Field(-2, alias="uniformTyp1DRoofGutterPipes") + uniformwidth1droofgutterpipes: float = Field( + 0.1, alias="uniformWidth1DRoofGutterPipes" + ) _split_to_list = get_split_string_on_delimiter_validator( "frictfile", diff --git a/tests/data/reference/fm/special_3d_settings.mdu b/tests/data/reference/fm/special_3d_settings.mdu index 5740b7ebb..2ab0bfda7 100644 --- a/tests/data/reference/fm/special_3d_settings.mdu +++ b/tests/data/reference/fm/special_3d_settings.mdu @@ -1,4 +1,4 @@ -# written by HYDROLIB-core 0.4.1 +# written by HYDROLIB-core 0.7.0 [General] fileVersion = 1.09 # File format version (do not edit this) @@ -9,59 +9,76 @@ autoStart = 0 # Autostart simulation after loading MDU o pathsRelativeToParent = 0 # Default: 0. Whether or not (1/0) to resolve file names (e.g. inside the *.ext file) relative to their direct parent, instead of to the toplevel MDU working dir. [Geometry] -netFile = SEA_coarse_net.nc # Unstructured grid file *_net.nc -bathymetryFile = # Removed since March 2022. See [geometry] keyword BedLevelFile. -dryPointsFile = # Dry points file *.xyz (third column dummy z values), or dry areas polygon file *.pol (third column 1/-1: inside/outside) -structureFile = # Hydraulic structure file (*.ini) -iniFieldFile = # Initial and parameter field file <*.ini>. -waterLevIniFile = # Initial water levels sample file <*.xyz>. -landBoundaryFile = # Only for plotting. -thinDamFile = # Polyline file *_thd.pli, containing thin dams -fixedWeirFile = # Polyline file *_fxw.pliz, containing fixed weirs with rows x, y, crest level, left ground level, right ground level -pillarFile = # <*_pillar.pliz>, Polyline file containing four colums with x, y, diameter and Cd coefficient for bridge pillars. -useCaching = 0 # Use caching for geometrical/network-related items (0: no, 1: yes) -vertPlizFile = # <*_vlay.pliz>), = pliz with x, y, Z, first Z = nr of layers, second Z = laytyp. -frictFile = # Location of the files with roughness data for 1D. -crossDefFile = # Cross section definitions for all cross section shapes. -crossLocFile = # Location definitions of the cross sections on a 1D network. -storageNodeFile = # File containing the specification of storage nodes and/or manholes to add extra storage to 1D models. -1d2dLinkFile = # File containing the custom parameterization of 1D-2D links. -profLocFile = # <*_proflocation.xyz>) x, y, z, z = profile refnumber. -profDefFile = # <*_profdefinition.def>) definition for all profile nrs. -profDefXyzFile = # <*_profdefinition.def>) definition for all profile nrs. -manholeFile = # File containing manholes (e.g. <*.dat>). -partitionFile = # <*_part.pol>, polyline(s) x, y. -uniformWidth1D = 2.0 -dxWuiMin2D = 0.1 # Smallest fraction dx/wu , set dx > Dxwuimin2D*wu, Default = 0.1 -waterLevIni = 0.0 # Initial water level at missing s0 values -bedLevUni = 5.0 # Uniform bed level used at missing z values if BedlevType > 2 -bedSlope = 0.0 # Bed slope inclination, sets zk = bedlevuni + x*bedslope ans sets zbndz = xbndz*bedslope. -bedLevType = 3 # Bathymetry specification [-] (3: at nodes, face levels mean of node values) -blMeanBelow = -999.0 # if not -999d0, below this level [m] the cell centre bedlevel is the mean of surrouding netnodes. -blMinAbove = -999.0 # if not -999d0, above this level [m] the cell centre bedlevel is the min of surrouding netnodes. -angLat = 0.0 # Angle of latitude S-N (deg), 0: no Coriolis -angLon = 0.0 # Angle of longitude E-W (deg), 0: Greenwich, used in solar heat flux computation -conveyance2D = -1 # -1: R=HU,0: R=H, 1: R=A/P, 2: K=analytic-1D conv, 3: K=analytic-2D conv -nonlin1D = 1 # Non-linear 1D volumes, applicable for models with closed cross sections. 1=treat closed sections as partially open by using a Preissmann slot, 2=Nested Newton approach, 3=Partial Nested Newton approach. -nonlin2D = 0 # Non-linear 2D volumes, only i.c.m. ibedlevtype = 3 and Conveyance2D>=1. -sillHeightMin = 0.0 # Weir treatment only if both sills larger than this value (m) -makeOrthoCenters = 0 # (1: yes, 0: no) switch from circumcentres to orthocentres in geominit. -dCenterInside = 1.0 # limit cell center; 1.0:in cell <-> 0.0:on c/g. -baMin = 1e-06 # Minimum grid cell area [m2], i.c.m. cutcells. -openBoundaryTolerance = 0.1 # Search tolerance factor between boundary polyline and grid cells, in cell size units -renumberFlowNodes = 1 # Renumber the flow nodes (1: yes, 0: no) -kmx = 53 # Maximum number of vertical layers -layerType = 1 # Vertical layer type (1: all sigma, 2: all z, 3: use VertplizFile) -numTopSig = 20 # Number of sigma layers in top of z-layer model -numTopSigUniform = 1 # Number of sigma layers in top of z-layer model -sigmaGrowthFactor = 1.19 # Layer thickness growth factor from bed up -dzTop = 5.0 # Z-layer thickness of layers above level Dztopuniabovez -floorLevTopLay = -5.0 # Floor level of top layer -dzTopUniAboveZ = -100.0 # Above level Dztopuniabovez layers will have uniform Dztop, SigmaGrowthFactor below this level -keepZLayeringAtBed = 2 # bedlayerthickness = zlayerthickness at bed 0 or 1 -dxDoubleAt1DEndNodes = 1 # Whether a 1D grid cell at the end of a network has to be extended with 0.5Δx. -changeVelocityAtStructures = 0 # Ignore structure dimensions for the velocity at hydraulic structures, when calculating the surrounding cell centered flow velocities. -changeStructureDimensions = 1 # Change the structure dimensions in case these are inconsistent with the channel dimensions. +netFile = SEA_coarse_net.nc # Unstructured grid file *_net.nc +bathymetryFile = # Removed since March 2022. See [geometry] keyword BedLevelFile. +dryPointsFile = # Dry points file *.xyz (third column dummy z values), or dry areas polygon file *.pol (third column 1/-1: inside/outside) +structureFile = # Hydraulic structure file (*.ini) +iniFieldFile = # Initial and parameter field file <*.ini>. +waterLevIniFile = # Initial water levels sample file <*.xyz>. +landBoundaryFile = # Only for plotting. +thinDamFile = # Polyline file *_thd.pli, containing thin dams +fixedWeirFile = # Polyline file *_fxw.pliz, containing fixed weirs with rows x, y, crest level, left ground level, right ground level +pillarFile = # <*_pillar.pliz>, Polyline file containing four colums with x, y, diameter and Cd coefficient for bridge pillars. +useCaching = 0 # Use caching for geometrical/network-related items (0: no, 1: yes) +vertPlizFile = # <*_vlay.pliz>), = pliz with x, y, Z, first Z = nr of layers, second Z = laytyp. +frictFile = # Location of the files with roughness data for 1D. +crossDefFile = # Cross section definitions for all cross section shapes. +crossLocFile = # Location definitions of the cross sections on a 1D network. +storageNodeFile = # File containing the specification of storage nodes and/or manholes to add extra storage to 1D models. +1d2dLinkFile = # File containing the custom parameterization of 1D-2D links. +profLocFile = # <*_proflocation.xyz>) x, y, z, z = profile refnumber. +profDefFile = # <*_profdefinition.def>) definition for all profile nrs. +profDefXyzFile = # <*_profdefinition.def>) definition for all profile nrs. +manholeFile = # File containing manholes (e.g. <*.dat>). +partitionFile = # <*_part.pol>, polyline(s) x, y. +uniformWidth1D = 2.0 +dxWuiMin2D = 0.1 # Smallest fraction dx/wu , set dx > Dxwuimin2D*wu, Default = 0.1 +waterLevIni = 0.0 # Initial water level at missing s0 values +bedLevUni = 5.0 # Uniform bed level used at missing z values if BedlevType > 2 +bedSlope = 0.0 # Bed slope inclination, sets zk = bedlevuni + x*bedslope ans sets zbndz = xbndz*bedslope. +bedLevType = 3 # Bathymetry specification [-] (3: at nodes, face levels mean of node values) +blMeanBelow = -999.0 # if not -999d0, below this level [m] the cell centre bedlevel is the mean of surrouding netnodes. +blMinAbove = -999.0 # if not -999d0, above this level [m] the cell centre bedlevel is the min of surrouding netnodes. +angLat = 0.0 # Angle of latitude S-N (deg), 0: no Coriolis +angLon = 0.0 # Angle of longitude E-W (deg), 0: Greenwich, used in solar heat flux computation +conveyance2D = -1 # -1: R=HU,0: R=H, 1: R=A/P, 2: K=analytic-1D conv, 3: K=analytic-2D conv +nonlin1D = 1 # Non-linear 1D volumes, applicable for models with closed cross sections. 1=treat closed sections as partially open by using a Preissmann slot, 2=Nested Newton approach, 3=Partial Nested Newton approach. +nonlin2D = 0 # Non-linear 2D volumes, only i.c.m. ibedlevtype = 3 and Conveyance2D>=1. +sillHeightMin = 0.0 # Weir treatment only if both sills larger than this value (m) +makeOrthoCenters = 0 # (1: yes, 0: no) switch from circumcentres to orthocentres in geominit. +dCenterInside = 1.0 # limit cell center; 1.0:in cell <-> 0.0:on c/g. +baMin = 1e-06 # Minimum grid cell area [m2], i.c.m. cutcells. +openBoundaryTolerance = 0.1 # Search tolerance factor between boundary polyline and grid cells, in cell size units +renumberFlowNodes = 1 # Renumber the flow nodes (1: yes, 0: no) +kmx = 53 # Maximum number of vertical layers +layerType = 1 # Vertical layer type (1: all sigma, 2: all z, 3: use VertplizFile) +numTopSig = 20 # Number of sigma layers in top of z-layer model +numTopSigUniform = 1 # Number of sigma layers in top of z-layer model +sigmaGrowthFactor = 1.19 # Layer thickness growth factor from bed up +dzTop = 5.0 # Z-layer thickness of layers above level Dztopuniabovez +floorLevTopLay = -5.0 # Floor level of top layer +dzTopUniAboveZ = -100.0 # Above level Dztopuniabovez layers will have uniform Dztop, SigmaGrowthFactor below this level +keepZLayeringAtBed = 2 # bedlayerthickness = zlayerthickness at bed 0 or 1 +dxDoubleAt1DEndNodes = 1 # Whether a 1D grid cell at the end of a network has to be extended with 0.5Δx. +changeVelocityAtStructures = 0 # Ignore structure dimensions for the velocity at hydraulic structures, when calculating the surrounding cell centered flow velocities. +changeStructureDimensions = 1 # Change the structure dimensions in case these are inconsistent with the channel dimensions. +gridEnclosureFile = # Enclosure file to clip outer parts from the grid *.pol +allowBndAtBifurcation = 0 # Allow 1d boundary node when connectin branch leads to bifurcation (1: yes, 0: no). +slotw1D = 0.001 # Minimum slotwidth 1D [m]. +slotw2D = 0.001 # Minimum slotwidth 2D [m]. +uniformHeight1DRoofGutterPipes = 0.1 # Uniform height for roof gutter pipes [m]. +dxmin1D = 0.001 # Minimum 1D link length [m]. +uniformTyp1DStreetInlets = -2 # Uniform cross section type for street inlets (1: circle, 2: rectangle, -2: closed rectangle). +stretchType = 1 # Stretching type for non-uniform layers, 1=user defined, 2=exponential, otherwise=uniform. +zlayBot = -999.0 # if specified, first z-layer starts from zlaybot [ ], if not, it starts from the lowest bed point. +zlayTop = -999.0 # if specified, highest z-layer ends at zlaytop [ ], if not, it ends at the initial water level. +uniformHeight1D = 3.0 # Uniform height for 1D profiles and 1d2d internal links [m]. +roofsFile = # Polyline file <*_roof.pliz>, containing roofgutter heights x, y, z level. +gulliesFile = # Polyline file <*_gul.pliz>, containing lowest bed level along talweg x, y, z level. +uniformWidth1DStreetInlets = 0.2 # Uniform width for street inlets [m]. +uniformHeight1DStreetInlets = 0.1 # Uniform height for street inlets [m] +uniformTyp1DRoofGutterPipes = -2 # Uniform cross section type for type roof gutter pipes (1: circle, 2: rectangle, -2: closed rectangle). +uniformWidth1DRoofGutterPipes = 0.1 # Uniform width for roof gutter pipes [m]. [VolumeTables] useVolumeTables = 0 # Use volume tables for 1D grid cells (1: yes, 0 = no). @@ -69,38 +86,65 @@ increment = 0.2 # The height increment for the volume tables [m]. useVolumeTableFile = 0 # Read and write the volume table from/to file (1: yes, 0= no). [Numerics] -CFLMax = 0.7 # Maximum Courant number -EpsMaxlev = 1e-08 # Stop criterium for non linear iteration -EpsMaxlevM = 1e-08 # Stop criterium for Nested Newton loop in non linear iteration -advecType = 33 # Advection type (0: none, 1: Wenneker, 2: Wenneker q(uio-u), 3: Perot q(uio-u), 4: Perot q(ui-u), 5: Perot q(ui-u) without itself) -timeStepType = 2 # 0=only transport, 1=transport + velocity update, 2=full implicit step_reduce, 3=step_jacobi, 4=explicit. -limTypHu = 0 # Limiter type for waterdepth in continuity eqn. (0: none, 1: minmod, 2: van Leer, 3: Kooren, 4: monotone central) -limTypMom = 4 # Limiter type for cell center advection velocity (0: none, 1: minmod, 2: van Leer, 3: Kooren, 4: monotone central) -limTypSa = 4 # Limiter type for salinity transport (0: none, 1: minmod, 2: van Leer, 3: Kooren, 4: monotone central) -icgSolver = 4 # Solver type (1: sobekGS_OMP, 2: sobekGS_OMPthreadsafe, 3: sobekGS, 4: sobekGS + Saadilud, 5: parallel/global Saad, 6: parallel/Petsc, 7: parallel/GS) -maxDegree = 6 # Maximum degree in Gauss elimination -fixedWeirScheme = 9 # Fixed weir scheme (0: none, 1: compact stencil, 2: whole tile lifted, full subgrid weir + factor) -fixedWeirContraction = 1.0 # flow width = flow width*fixedWeirContraction. -izBndPos = 1 # Position of z boundary (0: D3Dflow, 1: on net boundary, 2: on specified polyline) -tlfSmo = 86400.0 # Fourier smoothing time (s) on water level boundaries -keepSTBndOnOutflow = 1 # Keep sal and tem signals on bnd also at outflow, 1=yes, 0=no=default=copy inside value on outflow -slopeDrop2D = 0.0 # Apply droplosses only if local bottom slope > Slopedrop2D, <=0 =no droplosses. -drop1D = 0 # Limit the downstream water level in the momentum equation to the downstream invert level, BOBdown (ζ*down = max(BOBdown, ζdown)). -chkAdvd = 0.1 # Check advection terms if depth < chkadvdp. -teta0 = 0.55 # Theta of time integration (0.5 < theta < 1) -qhRelax = 0.01 -cstBnd = 0 # Delft3D-FLOW type velocity treatment near boundaries for small coastal models (1) or not (0). -maxitVerticalForesterSal = 0 # Forester iterations for salinity (0: no vertical filter for salinity, > 0: max nr of iterations). -maxitVerticalForesterTem = 0 # Forester iterations for temperature (0: no vertical filter for temperature, > 0: max nr of iterations). -turbulenceModel = 3 # Turbulence model (0: none, 1: constant, 2: algebraic, 3: k-epsilon, 4: k-tau) -turbulenceAdvection = 3 # Turbulence advection (0: none, 3: horizontally explicit and vertically implicit) -antiCreep = 0 # Include anti-creep calculation (0: no, 1: yes) -barocZLayBed = 0 # Use fix in baroclinic pressure for zlaybed (1: yes, 0: no) -barocPOnBnd = 1 -maxWaterLevelDiff = 0.0 # Upper bound [m] on water level changes, (<= 0: no bounds). Run will abort when violated. -maxVelocityDiff = 0.0 # Upper bound [m/s] on velocity changes, (<= 0: no bounds). Run will abort when violated. -minTimestepBreak = 0.1 # smallest allowed timestep (in s), checked on a sliding average of several timesteps. Run will abort when violated. -epsHu = 0.0001 # Threshold water depth for wet and dry cells +CFLMax = 0.7 # Maximum Courant number +EpsMaxlev = 1e-08 # Stop criterium for non linear iteration +EpsMaxlevM = 1e-08 # Stop criterium for Nested Newton loop in non linear iteration +advecType = 33 # Advection type (0: none, 1: Wenneker, 2: Wenneker q(uio-u), 3: Perot q(uio-u), 4: Perot q(ui-u), 5: Perot q(ui-u) without itself) +timeStepType = 2 # 0=only transport, 1=transport + velocity update, 2=full implicit step_reduce, 3=step_jacobi, 4=explicit. +limTypHu = 0 # Limiter type for waterdepth in continuity eqn. (0: none, 1: minmod, 2: van Leer, 3: Kooren, 4: monotone central) +limTypMom = 4 # Limiter type for cell center advection velocity (0: none, 1: minmod, 2: van Leer, 3: Kooren, 4: monotone central) +limTypSa = 4 # Limiter type for salinity transport (0: none, 1: minmod, 2: van Leer, 3: Kooren, 4: monotone central) +icgSolver = 4 # Solver type (1: sobekGS_OMP, 2: sobekGS_OMPthreadsafe, 3: sobekGS, 4: sobekGS + Saadilud, 5: parallel/global Saad, 6: parallel/Petsc, 7: parallel/GS) +maxDegree = 6 # Maximum degree in Gauss elimination +fixedWeirScheme = 9 # Fixed weir scheme (0: none, 1: compact stencil, 2: whole tile lifted, full subgrid weir + factor) +fixedWeirContraction = 1.0 # flow width = flow width*fixedWeirContraction. +izBndPos = 1 # Position of z boundary (0: D3Dflow, 1: on net boundary, 2: on specified polyline) +tlfSmo = 86400.0 # Fourier smoothing time (s) on water level boundaries +keepSTBndOnOutflow = 1 # Keep sal and tem signals on bnd also at outflow, 1=yes, 0=no=default=copy inside value on outflow +slopeDrop2D = 0.0 # Apply droplosses only if local bottom slope > Slopedrop2D, <=0 =no droplosses. +drop1D = 0 # Limit the downstream water level in the momentum equation to the downstream invert level, BOBdown (ζ*down = max(BOBdown, ζdown)). +chkAdvd = 0.1 # Check advection terms if depth < chkadvdp. +teta0 = 0.55 # Theta of time integration (0.5 < theta < 1) +qhRelax = 0.01 +cstBnd = 0 # Delft3D-FLOW type velocity treatment near boundaries for small coastal models (1) or not (0). +maxitVerticalForesterSal = 0 # Forester iterations for salinity (0: no vertical filter for salinity, > 0: max nr of iterations). +maxitVerticalForesterTem = 0 # Forester iterations for temperature (0: no vertical filter for temperature, > 0: max nr of iterations). +turbulenceModel = 3 # Turbulence model (0: none, 1: constant, 2: algebraic, 3: k-epsilon, 4: k-tau) +turbulenceAdvection = 3 # Turbulence advection (0: none, 3: horizontally explicit and vertically implicit) +antiCreep = 0 # Include anti-creep calculation (0: no, 1: yes) +barocZLayBed = 0 # Use fix in baroclinic pressure for zlaybed (1: yes, 0: no) +barocPOnBnd = 1 +maxWaterLevelDiff = 0.0 # Upper bound [m] on water level changes, (<= 0: no bounds). Run will abort when violated. +maxVelocityDiff = 0.0 # Upper bound [m/s] on velocity changes, (<= 0: no bounds). Run will abort when violated. +minTimestepBreak = 0.1 # smallest allowed timestep (in s), checked on a sliding average of several timesteps. Run will abort when violated. +epsHu = 0.0001 # Threshold water depth for wet and dry cells +fixedWeirRelaxationCoef = 0.6 # Fixed weir relaxation coefficient for computation of energy loss. +implicitDiffusion2D = 0 # Implicit diffusion in 2D (0: no, 1:yes). +vertAdvTypTem = 6 # Vertical advection type for temperature (0: none, 1: upwind explicit, 2: central explicit, 3: upwind implicit, 4: central implicit, 5: central implicit but upwind for neg. stratif., 6: higher order explicit, no Forester) +velMagnWarn = 0.0 # Warning level unitbrackets{m/s} on velocity magnitude (<= 0: no check). +transportAutoTimestepDiff = 0 # Auto Timestepdiff in Transport, (0 : lim diff, no lim Dt, 1: no lim diff, lim Dt, 2: no lim diff, no lim Dt, 3: implicit (only 2D)). +setHorizontalBobsFor1D2D = 0 # Bobs are set to 2D bedlevel, to prevent incorrect storage in sewer system (0: no, 1:yes). +diagnosticTransport = 0 # No update of transport quantities, also known as diagnostic transport (0: no, 1: yes). +vertAdvTypSal = 6 # Vertical advection type for salinity (0: none, 1: upwind explicit, 2: central explicit, 3: upwind implicit, 4: central implicit, 5: central implicit but upwind for neg. stratif., 6: higher order explicit, no Forester) +zeroZBndInflowAdvection = 1 # On waterlevel boundaries set incoming advection velocity to zero (0=no, 1=on inflow, 2=also on outflow) +pure1D = 0 # Purely 1D advection (0: original advection using velocity vector, 1: pure 1D using flow volume vol1_f, 2: pure 1D using volume vol1) +testDryingFlooding = 0 # Drying flooding algorithm (0: D-Flow FM, 1: Delft3DFLOW, 2: Similar to 0, and volume limitation in the transport solver based on Epshu). +logSolverConvergence = 0 # Print time step, number of solver iterations and solver residual to diagnostic output (0: no, 1: yes). +fixedWeirScheme1D2D = 0 # Fixed weir scheme for 1d2d links (0: same as fixedweirscheme, 1: lateral iterative fixed weir scheme). +horizontalMomentumFilter = 0 # Filter for reduction of checkerboarding; 0=No, 1=yes. +maxNonLinearIterations = 100 # Maximal iterations in non-linear iteration loop before a time step reduction is applied +maxVelocity = 0.0 # Upper bound [m/s] on velocity (<= 0: no bounds). Run will abort when violated. +waterLevelWarn = 0.0 # Warning level [m AD] on water level (<= 0: no check). +tSpinUpTurbLogProf = 0.0 # Spin up time [s] when starting with a parabolic viscosity profile in whole model domain. +fixedWeirTopFrictCoef = -999.0 # Uniform friction coefficient of the groyne part of fixed weirs +fixedWeir1D2D_dx = 50.0 # Extra delta x for lateral 1d2d fixed weirs. +junction1D = 0 # Advection at 1D junctions: (0: original 1D advection using velocity vector, 1 = same as along 1D channels using Pure1D=1). +fixedWeirTopWidth = 3.0 # Uniform width of the groyne part of fixed weirs +vertAdvTypMom = 6 # Vertical advection type for u1: 0: No, 3: Upwind implicit, 4: Central implicit, 5: QUICKEST implicit., 6: centerbased upwind expl +checkerboardMonitor = 0 # Flag for checkerboarding output on history file (only for sigma layers yet); 0=No, 1=yes. +velocityWarn = 0.0 # Warning level [m/s] on normal velocity(<= 0: no check). +advecCorrection1D2D = 0 # Advection correction of 1D2D link volume (0: regular advection, 1: link volume au*dx, 2: advection on 1D2D switched off.) +fixedWeirTalud = 4.0 # Uniform talud slope of fixed weirs. [Physics] unifFrictCoef = 0.028 # Uniform friction coefficient (0: no friction) @@ -164,6 +208,7 @@ windPartialDry = 1 # Reduce windstress on water if link partially pavBnd = 101330.0 # Average air pressure on open boundaries (N/m2) (only applied if > 0) pavIni = 0.0 # Initial air pressure [N/m2], only applied if value > 0. computedAirdensity = 0 # Compute air density yes/no (), 1/0, default 0. +stressToWind = 0 # Switch between Wind speed (=0) and wind stress (=1) approach for wind forcing. [Time] refDate = 19971222 # Reference date (yyyymmdd) @@ -250,7 +295,7 @@ wrihis_structure_uniWeir = 0 wrihis_structure_compound = 0 # compound structure parameters wrihis_turbulence = 1 # k, eps and vicww wrihis_wind = 1 # wind velocities -wrihis_airdensity = 0 # Write air density to his file (1: yes, 0: no) +wrihis_airdensity = 0 # Write air density to his file (1: yes, 0: no). wrihis_rain = 1 # precipitation wrihis_infiltration = 1 # Write infiltration to his file (1: yes, 0: no)' wrihis_temperature = 1 # temperature @@ -291,7 +336,7 @@ wrimap_turbulence = 1 wrimap_rain = 1 # Write rainfall rates to map file (1: yes, 0: no) wrimap_wind = 1 # Write wind velocities to map file (1: yes, 0: no) wrimap_windstress = 0 # Write wind stress to map file (1: yes, 0: no) -wrimap_airdensity = 0 # Write air density rates to map file (1: yes, 0: no) +wrimap_airdensity = 0 # Write air density to map file, (1:yes, 0:no). writek_CdWind = 0 # Write wind friction coeffs to tek file (1: yes, 0: no) wrimap_heat_fluxes = 1 # Write heat fluxes to map file (1: yes, 0: no) wrimap_wet_waterDepth_threshold = 2e-05 # Waterdepth threshold above which a grid point counts as 'wet'. Defaults to 0.2·Epshu. It is used for Wrimap_time_water_on_ground, Wrimap_waterdepth_on_ground and Wrimap_volume_on_ground. @@ -317,6 +362,23 @@ waqInterval = 0.0 statsInterval = 3600.0 # Screen step output interval in seconds simulation time, if negative in seconds wall clock time timingsInterval = 0.0 # Timings statistics output interval richardsonOnOutput = 0 # Write Richardson number, (1: yes, 0: no). +wrimap_input_dt = 0 # Write output to map file every computational timestep, between start and stop time from MapInterval, (1: yes, 0: no). +wrimap_input_roughness = 0 # Write chezy input roughness on flow links to map file, (1: yes, 0: no). +wrimap_flowarea_au = 1 # Write flow areas au to map file (1: yes, 0: no) +wrimap_flow_flux_q1_main = 1 # Write flow flux in main channel to map file (1: yes, 0: no) +wrishp_genstruc = 0 # general structures +wrimap_qin = 0 # Write sum of all influxes to map file (1: yes, 0: no). +wrimap_dtcell = 1 # Write time step per cell based on CFL (1: yes, 0: no) +wrimap_velocity_vectorq = 1 # Write cell-center velocity vectors (discharge-based) to map file (1: yes, 0: no) +wrimap_bnd = 0 # Write boundary points to map file (1: yes, 0: no). +wrishp_dambreak = 0 # Writing dambreaks to shape file (0=no, 1=yes). +wrimap_waterdepth_hu = 1 # Write water depths on u-points to map file (1: yes, 0: no) +ncMapDataPrecision = double # Precision for NetCDF data in map files (double or single). +ncHisDataPrecision = double # Precision for NetCDF data in his files (double or single). +wrimap_interception = 1 # Write interception to map file (1: yes, 0: no) +wrimap_volume1 = 1 # Write volumes to map file (1: yes, 0: no) +wrimap_ancillary_variables = 1 # Write ancillary_variables attributes to map file (1: yes, 0: no) +wrimap_chezy_on_flow_links = 0 # Write chezy roughness on flow links to map file, (1: yes, 0: no) [Calibration] UseCalibration = 0 # Activate calibration factor friction multiplier (1 = yes, 0 = no)