Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reading of [sedtrails] section in .mdu #620

Open
SCLaan opened this issue Mar 19, 2024 · 3 comments
Open

Reading of [sedtrails] section in .mdu #620

SCLaan opened this issue Mar 19, 2024 · 3 comments
Labels
priority: high priority: medium type: compatibility Changes needed to be compatible with the computational core

Comments

@SCLaan
Copy link

SCLaan commented Mar 19, 2024

Describe the bug
HYDROLIB-core 0.7.0 cannot read the default [sedtrails] section in a .mdu, as written in the copy in the .dia:

[sedtrails]
SedtrailsGrid       =             # Grid file for sedtrails output locations on corners
SedtrailsAnalysis   = all         # Sedtrails analysis. Should be all, transport, flowvelocity or soulsby.
SedtrailsInterval   = 3600. 0. 0. # Sedtrails output times (s), interval, starttime, stoptime (s), if starttime, stoptime are left blank, use whole simulation period
SedtrailsOutputFile =             # Sedtrails time-avgd output file

To Reproduce
Steps to reproduce the behavior:

  1. Include the above code in a .mdu
  2. Try to read the .mdu
    from pathlib import Path
    import hydrolib.core.dflowfm as hcdfm
    hcdfm.FMModel(filepath=Path(r'P:/path/to/file.mdu'), recurse=False)
    
  3. See the error (below)

Expected behavior
This section should be read correctly. Alternatively it could be included in a comments field, as is done for the [veg] section.

Screenshots

ValidationError: 1 validation error for FMModel
mwra_hydro_dia.mdu -> sedtrails
  extra fields not permitted (type=value_error.extra)

Version info (please complete the following information):

  • OS: Windows 10
  • Version 0.7.0
@priscavdsluis priscavdsluis added type: compatibility Changes needed to be compatible with the computational core priority: high priority: medium labels Apr 9, 2024
@rhutten rhutten added this to To do in HYDROLIB-core via automation Apr 10, 2024
@MRVermeulenDeltares
Copy link
Contributor

As we understand, the goal for this issue is:

  • Implement sedtrails section
  • Add sedtrails section to FMModel

@veenstrajelmer & @rhutten is this correct?

@tim-vd-aardweg
Copy link
Contributor

I have asked @hrajagers by email what all the keywords are that are supported for the [sedtrails] section. We should wait with picking up this issue until we have a response.

@tim-vd-aardweg
Copy link
Contributor

I got a very elaborate answer, I will post it here (in Dutch):

. De lijst van keywords lijkt op zich compleet.
D-Flow FM ondersteunt de volgende keywords in het [sedtrails] blok:

SedtrailsGrid
Standaard een lege string. Indien dit een lege string is dan is de sedtrails uitvoer niet actief en worden andere keywords niet gelezen.
Indien niet leeg dan moet dit verwijzen naar een netCDF UGRID file met een 2D rooster.

SedtrailsAnalysis
De waarde moet een van de volgende strings zijn: all, flowvelocity, transport of soulsby.
Indien niet gespecificeerd: all.

SedtrailsInterval
Hier worden drie getallen verwacht: interval, start time, end time.
Het eerste getal (interval) wordt in de code begrensd op getallen groter of gelijk aan dt_user.
De default waarden zijn 3600 0 0

SedtrailsOutputFile
Dit is de naam van de extra netCDF UGRID map uitvoer.
Default wordt deze naam gelijk gesteld aan _sedtrails.nc waarbij de naam is van de mdu-file.

De optie maakt het mogelijk om enkele D-Flow FM grootheden weg te schrijven gemiddeld naar de nodes van het gespecificeerde rooster:
• dieptegemiddelde stroomsnelheden (indien flowvelocity of all)
• bodem en zwevende sediment transporten (indien transport of all)
• waterdiepte, bodemschuifspanning, en niet-lineaire snelheidsbijdrage van golven (indien soulsby of all)
Hoewel deze functionaliteit primair is ontwikkeld voor nabewerking met de Sedtrails tool ten behoeve van het opstellen van sedimentbalansen, weet ik dat andere collega’s ook geïnteresseerd zijn in deze optie omdat grootheden hiermee op een ander (kleiner) rooster kan worden weggeschreven hetgeen een vermindering van de dataopslag zou kunnen geven. Ik zie hiervoor op termijn liever een andere oplossing.

@tim-vd-aardweg tim-vd-aardweg moved this from To do to In progress in HYDROLIB-core May 17, 2024
@rhutten rhutten moved this from In progress to To do in HYDROLIB-core May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: high priority: medium type: compatibility Changes needed to be compatible with the computational core
Projects
HYDROLIB-core
  
To do
Development

No branches or pull requests

4 participants