You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to be consistent with 2D/3D requirements and in line with the effort in moving reading/writing into hydrolib-coreDeltares/HYDROLIB-core#553, The use of 2d boundary needs to be adapted.
This involves mainly the writing of 2D boundary. For now in hydromt-delft3dfm, during setup, we set a hydromt forcing object (xarray.DataArray) with all data fields required by the hydrolin-core.ForcingModel as attributes. We need an extra step to convert that into a new xarray.DataArray with attributes that conforms the dflowfm convention. Then one could easily write the 2D boundary into .nc instead of .bc.
What needs to be adapted?
use xarray.DataArray: we already do that but the format is different (refer to the next point)
How does the hydromt forcing object for 2D boundary looks like?
data
A 3D array holding the values of the DataArray. It is created from the 2D da data ("index", "time"), but expanded to a 3D shape to store support points on lines "numcoordinates".
dims:
These are the names of the three dimensions:
index: Refers to the individual linestring geometry.
time: Represents the time steps from the original da DataArray.
numcoordinates: Refers to the individual coordinates within each linestring.
coords:
These are the actual coordinates that label the data along each dimension.
index: The original index from the GeoDataFrame.
time: The standardized time steps processed by _standardize_forcing_timeindexes.
numcoordinates: Represents the position of each coordinate within a linestring.
x: The x-coordinates of each linestring, structured to match the index and numcoordinates dimensions.
y: Similarly, the y-coordinates of each linestring.
attrs:
This dictionary holds metadata or attributes that provide additional context to the DataArray.
function: Indicates the data represents a time series.
timeInterpolation: Specifies the interpolation method used with the time data.
quantity: Represents the type of forcing, either 'dischargebnd' or 'waterlevelbnd'.
units: Specifies the unit for the forcing data, either 'm3/s' or 'm'.
time_unit: A string denoting the time unit, structured to indicate a starting point (like "hours since YYYY-MM-DD HH:MM:SS").
How does the 'Delft3D FM' netcdf convention looks like?
For each bndid, write all support points into {bndid}.pli file.
For each bndid, write one timeseries for the first support point into {bndid}.nc file.
Use a xarray.Dataset internally for {bndid}.nc
Use quantity (e.g. "waterlevelbnd") in the xarray.Dataset as data variable to store the timeseries.
Use location (e.g. "polylin_0001") in the xarray.Dataset as data variable; because location label and quantity name uniquely identify the timeseries.
Use "strlen", "node" and "time" as dimensions, e.g. location(node, strlen); waterlevelbnd(time, node)
Additional Context
Use line geometry in geodataset is done in this issue below:
(#6)
Discussion of whether 2D boundary in 1D2D and 2D3D shares enough similarities yields the renaming of setup_2dboundary to setup_2dboundary_from_lines. So that it is clearer to the user that they are applying 2D boundary as lines, and each line accepts one timeseries - more common for 1D2D models.
Question
The fileformat required by 1D2D seems different from 2D3D as reported in Deltares/dfm_tools#527.
The text was updated successfully, but these errors were encountered:
Something to discuss: for 1D2D urban type of models, it is rarely seen that the 2D boundary is as complex as 2D3D coastal models. If we enforce the 2D3D model, that might leads to large model files.
Why for 1D2D the 2D boundary is less complex? that is because in 1D2D urban applications, the 2D is mainly used for model overland flow. The water on the surface either come from overflow of underground sewer network, or overtopping from the river. for the former, we do not need to use 2D boundary while for the latter, often 1D2D links are used to simulate that. Besides that, one scenario is that we use 2D boundary to simulate the water flowing out of the domain instead of being bounded in the 2D mesh. Therefore, the initial condition and the boundary is often dry, or far less complex.
Kind of request
Changing existing functionality
Enhancement Description
In order to be consistent with 2D/3D requirements and in line with the effort in moving reading/writing into
hydrolib-core
Deltares/HYDROLIB-core#553, The use of 2d boundary needs to be adapted.This involves mainly the writing of 2D boundary. For now in
hydromt-delft3dfm
, during setup, we set a hydromt forcing object (xarray.DataArray
) with all data fields required by thehydrolin-core.ForcingModel
as attributes. We need an extra step to convert that into a newxarray.DataArray
with attributes that conforms the dflowfm convention. Then one could easily write the 2D boundary into .nc instead of .bc.What needs to be adapted?
xarray.DataArray
: we already do that but the format is different (refer to the next point)What followups needed?
hydromt_delft3dfm.utils._write_ncdicts
How does the
hydromt
forcing object for 2D boundary looks like?How does the 'Delft3D FM' netcdf convention looks like?
Steps for
hydromt_delft3dfm.utils._write_ncdicts
bndid
is used for .pli, .nc and .ext.bndid
, write all support points into {bndid}.pli file.bndid
, write one timeseries for the first support point into {bndid}.nc file.xarray.Dataset
internally for {bndid}.ncxarray.Dataset
as data variable to store the timeseries.xarray.Dataset
as data variable; because location label and quantity name uniquely identify the timeseries.Additional Context
Use line geometry in geodataset is done in this issue below:
(#6)
Discussion of whether 2D boundary in 1D2D and 2D3D shares enough similarities yields the renaming of
setup_2dboundary
tosetup_2dboundary_from_lines
. So that it is clearer to the user that they are applying 2D boundary as lines, and each line accepts one timeseries - more common for 1D2D models.Question
The fileformat required by 1D2D seems different from 2D3D as reported in Deltares/dfm_tools#527.
The text was updated successfully, but these errors were encountered: