See the organized scripts and clean notebooks here: pyDelft3D-FLOW
Some sane tools for my thesis too ease the pain of having to work with Deltares' Delft3D-FLOW's insane file formats and to automate the tedious manual labor involved in setting up multiple succesive simulations. Also processes NetCDF for plotting with Holoviews and PyVista.
The folder JulesD3D contains some scripts to
- Write or read grid (
.grd
), depth (.dep
), enclosure (.enc
) - Read and write discharge boundary condition (
.bcc
,.bct
) records declaratively. - Declaratively generate a DELFT3D-FLOW4 bathymetry model (depth, grid, enclosure) with a smoothened slope break (DepthModel.py)
- Prepare subsequent models for restarting from previous simulation (multipleruns.py)
- Process netCDF files for plotting with xarray, HoloView/hvPlot and PyVista
- See this on how to visualize Delft3D-Flow netCDF with PyVista
Furthermore there are some notebooks to
-
Visualize Delft3D-FLOW netCDF output
-
Manually change values in a netCDF outputfile and write it to disk\
- Reset hydrodynamic properties
- Reset transport layer
See the folder 'output_material' for more images and videos.
This is very much a work in progress so it's all still very messy and hacky: ¯_(ツ)_/¯. I use this to visualise the results of modelling turbidity currents and their deposits in Delft3D. If you're looking for tools to visualize Delft3D ocean or river modelling I'd suggest to look at one of these libraries.
- Use pandas for file reading and writing D3D files
- Has nice display views too
- Finish Overarching d3d class
- HTML repr strings
- Option to use h5py instead of netCDF4
- Better plotting of underlayers
- Subtract from depth?
- Add time dependent, multi-dimensional coords following DP_BEDLYR for interactive plotting with hvPlot
- Filter early with xarray.where() for 3d PyVista (timeslider) plots, instead of opacity hack or thresholding with pyvista
- Clean poetry.lock and pyproject.toml of unused deps
- Make use of Unit-based arrays with Pint and xarray
- Better documentation
- Convert functionality in
GenerateBCRecords.ipynb
to a seperate .py file - Script for reading and writing Morphology files (especially underlayers)
- Rename sediments (constituents) dimensions in dataset for labeled selection.
- Notebook showing overview of MDF file
- Use Panel for better & cleaner widgets, both for hvPlot and for PyVista
- Properly structure JulesD3D folder as package
- Use ufuncs to increase performance in process
- Add depth
- Vector sums (velocity, bottom stress, sediments etc)
- Move notebooks to separate folders
- Check location of values on staggered grid (face vs edge etc) maybe use parts of Gridded for this
- Improve code quality and clean notebooks. Less hardcoded variables, more functions
- Read up on Python OOP/classes
- Find a way to add coordinates to the whole dataset, for vertical cross-sections.
- Deltares OpenEarthTools (abandoned)
- spmls' Pydelft
- NOAA's Gridded
- PyVista