Skip to content

Commit

Permalink
feat: Add/move more mdu keywords (#654)
Browse files Browse the repository at this point in the history
refs: #648
  • Loading branch information
tim-vd-aardweg authored Jul 5, 2024
1 parent cd6e4db commit 5963745
Show file tree
Hide file tree
Showing 8 changed files with 117 additions and 87 deletions.
57 changes: 54 additions & 3 deletions hydrolib/core/dflowfm/mdu/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ class Comments(INIBasedModel.Comments):
"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",
alias="pathsRelativeToParent",
)
guiversion: Optional[str] = Field(
"DeltaShell FM suite version.", alias="guiVersion"
)

comments: Comments = Comments()
_header: Literal["General"] = "General"
Expand All @@ -71,6 +74,7 @@ class Comments(INIBasedModel.Comments):
fileversion: str = Field("1.09", alias="fileVersion")
autostart: Optional[AutoStartOption] = Field(AutoStartOption.no, alias="autoStart")
pathsrelativetoparent: bool = Field(False, alias="pathsRelativeToParent")
guiversion: Optional[str] = Field(None, alias="guiVersion")


class Numerics(INIBasedModel):
Expand Down Expand Up @@ -305,6 +309,14 @@ class Comments(INIBasedModel.Comments):
fixedweirtalud: Optional[str] = Field(
"Uniform talud slope of fixed weirs.", alias="fixedWeirTalud"
)
lateral_fixedweir_umin: Optional[str] = Field(
"Minimal velocity threshold for weir losses in iterative lateral 1d2d weir coupling.",
alias="lateral_fixedweir_umin",
)
jasfer3d: Optional[str] = Field(
"Corrections for spherical coordinates (0: no, 1: yes).",
alias="jasfer3D",
)

comments: Comments = Comments()

Expand Down Expand Up @@ -368,6 +380,8 @@ class Comments(INIBasedModel.Comments):
velocitywarn: float = Field(0.0, alias="velocityWarn")
adveccorrection1d2d: int = Field(0, alias="advecCorrection1D2D")
fixedweirtalud: float = Field(4.0, alias="fixedWeirTalud")
lateral_fixedweir_umin: float = Field(0.0, alias="lateral_fixedweir_umin")
jasfer3d: bool = Field(False, alias="jasfer3D")


class VolumeTables(INIBasedModel):
Expand All @@ -382,7 +396,7 @@ class VolumeTables(INIBasedModel):

class Comments(INIBasedModel.Comments):
usevolumetables: Optional[str] = Field(
"Use volume tables for 1D grid cells (1: yes, 0 = no).",
"Use 1D volume tables (0: no, 1: yes).",
alias="useVolumeTables",
)
increment: Optional[str] = Field(
Expand Down Expand Up @@ -804,6 +818,9 @@ class Comments(INIBasedModel.Comments):
"Update interval for time dependent roughness parameters [s].",
alias="updateRoughnessInterval",
)
dtfacmax: Optional[str] = Field(
"Max timestep increase factor in successive time steps.", alias="Dtfacmax"
)

comments: Comments = Comments()

Expand All @@ -823,6 +840,7 @@ class Comments(INIBasedModel.Comments):
startdatetime: Optional[str] = Field(None, alias="startDateTime")
stopdatetime: Optional[str] = Field(None, alias="stopDateTime")
updateroughnessinterval: float = Field(86400.0, alias="updateRoughnessInterval")
dtfacmax: float = Field(1.1, alias="Dtfacmax")

@validator("startdatetime", "stopdatetime")
def _validate_datetime(cls, value, field):
Expand Down Expand Up @@ -1306,6 +1324,16 @@ class Comments(INIBasedModel.Comments):
"Write air density rates to map file (1: yes, 0: no)",
alias="wrimap_airdensity",
)
wrimap_calibration: Optional[str] = Field(
"Write roughness calibration factors to map file.",
alias="wrimap_calibration",
)
wrimap_salinity: Optional[str] = Field(
"Write salinity to map file.", alias="wrimap_salinity"
)
wrimap_temperature: Optional[str] = Field(
"Write temperature to map file.", alias="wrimap_temperature"
)
writek_cdwind: Optional[str] = Field(
"Write wind friction coefficients to tek file (1: yes, 0: no).",
alias="writek_CdWind",
Expand Down Expand Up @@ -1402,7 +1430,7 @@ class Comments(INIBasedModel.Comments):
)
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",
alias="wrimap_every_dt",
)
wrimap_input_roughness: Optional[str] = Field(
"Write chezy input roughness on flow links to map file, (1: yes, 0: no).",
Expand Down Expand Up @@ -1473,6 +1501,18 @@ class Comments(INIBasedModel.Comments):
"Write chezy roughness on flow links to map file, (1: yes, 0: no)",
alias="wrimap_chezy_on_flow_links",
)
writepart_domain: Optional[str] = Field(
"Write partition domain info. for postprocessing (0: no, 1: yes).",
alias="writepart_domain",
)
velocitydirectionclassesinterval: Optional[str] = Field(
"Class map's step size of class values for velocity direction.",
alias="VelocityDirectionClassesInterval",
)
velocitymagnitudeclasses: Optional[str] = Field(
"Class map's list of class values for velocity magnitudes.",
alias="VelocityMagnitudeClasses",
)

comments: Comments = Comments()

Expand Down Expand Up @@ -1594,6 +1634,9 @@ class Comments(INIBasedModel.Comments):
wrimap_wind: bool = Field(True, alias="wrimap_wind")
wrimap_windstress: bool = Field(False, alias="wrimap_windstress")
wrimap_airdensity: bool = Field(False, alias="wrimap_airdensity")
wrimap_calibration: bool = Field(True, alias="wrimap_calibration")
wrimap_salinity: bool = Field(True, alias="wrimap_salinity")
wrimap_temperature: bool = Field(True, alias="wrimap_temperature")
writek_cdwind: bool = Field(False, alias="writek_CdWind")
wrimap_heat_fluxes: bool = Field(False, alias="wrimap_heat_fluxes")
wrimap_wet_waterdepth_threshold: float = Field(
Expand Down Expand Up @@ -1637,7 +1680,7 @@ 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_every_dt: bool = Field(False, alias="wrimap_every_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")
Expand All @@ -1661,6 +1704,13 @@ class Comments(INIBasedModel.Comments):
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")
writepart_domain: bool = Field(True, alias="writepart_domain")
velocitydirectionclassesinterval: float = Field(
0.0, alias="VelocityDirectionClassesInterval"
)
velocitymagnitudeclasses: List[float] = Field(
[0.0], alias="VelocityMagnitudeClasses"
)

_split_to_list = get_split_string_on_delimiter_validator(
"waterlevelclasses",
Expand All @@ -1675,6 +1725,7 @@ class Comments(INIBasedModel.Comments):
"waqinterval",
"statsinterval",
"timingsinterval",
"velocitymagnitudeclasses",
)

def is_intermediate_link(self) -> bool:
Expand Down
Loading

0 comments on commit 5963745

Please sign in to comment.