intro story D-Flow FM

 

D-Flow Flexible Mesh

D-Flow Flexible Mesh (D-Flow FM) is the new software engine for hydrodynamical simulations on unstructured grids in 1D-2D-3D. Together with the familiar curvilinear meshes from Delft3D 4, the unstructured grid can consist of triangles, pentagons (etc.) and 1D channel networks, all in one single mesh. It combines proven technology from the hydrodynamic engines of Delft3D 4 and SOBEK 2 and adds flexible administration, resulting in:

  • Easier 1D-2D-3D model coupling, intuitive setup of boundary conditions and meteorological forcings (amongst others).
  • More flexible 2D gridding in delta regions, river junctions, harbours, intertidal flats and more.
  • High performance by smart use of multicore architectures, and grid computing clusters.
An overview of the current developments can be found here.
 
The D-Flow FM - team would be delighted if you would participate in discussions on the generation of meshes, the specification of boundary conditions, the running of computations, and all kinds of other relevant topics. Feel free to share your smart questions and/or brilliant solutions! 

 

=======================================================
We have launched a new website (still under construction so expect continuous improvements) and a new forum dedicated to Delft3D Flexible Mesh.

Please follow this link to the new forum: 
/web/delft3dfm/forum

Post your questions, issues, suggestions, difficulties related to our Delft3D Flexible Mesh Suite on the new forum.

=======================================================

** PLEASE TAG YOUR POST! **

 

 

Sub groups
D-Flow Flexible Mesh
DELWAQ
Cohesive sediments & muddy systems

 


Message Boards

Max water level/depth in 'trim-runid' file

NB
Nophi Biton, modified 6 Years ago.

Max water level/depth in 'trim-runid' file

Padawan Posts: 38 Join Date: 8/1/13 Recent Posts
Hello Everyone,

I would like to ask if there is an existing code/tool in Delft3d (or OpenEarthTools) which gets the maximum water level or depth in a delft3d output map file (trim file)? Or is there another way to get the max water level for the entire simulation time.

Nophi
MS
Mihael Souza, modified 6 Years ago.

RE: Max water level/depth in 'trim-runid' file (Answer)

Padawan Posts: 65 Join Date: 10/11/12 Recent Posts
Hi Nophi,

Don't know if there is a built-in tool to do that in Delft3D.
If you have MATLAB though, it should be relatively easy, albeit not too fast depending on the size of your model.

You can try:

trimF = qpfopen('your_trim_file.dat'); % Open your tri-m file into MATLAB
data = qpread(trimF, 1, 'water level', 'data', 0, 0, 0); % Get water level for all MxN cells and modeled times
% This should give you a structure in MATLAB
water_lvl = data.Val; % This should give you a 3-D matrix (Time, M, N) of water levels;
max_spatial_wl = squeeze(nanmax(nanmax(water_lvl,2),3)); % Result is a vector of length Times
% with maximum water level at every time step
max_wl = nanmax(max_spatial_wl); % This will give you your overall maximum water level throughout the simulation

Keep in mind that you do need the OpenEarth matlab tools, available from the same repository that you downloaded the Delft3D code.
The part that can get slow is reading in the data from the structure, in case your model is too big or your simulation too long. The same
procedure can be used to get maximum water depths, just change the 'water level' on second line for 'water depth'.

Hope this helps.
Kind regards,

Mihael
NB
Nophi Biton, modified 6 Years ago.

RE: Max water level/depth in 'trim-runid' file

Padawan Posts: 38 Join Date: 8/1/13 Recent Posts
Thanks for the reply, I used it and it works though what I really want is the maximum level of the entire domain (and not a single maximum water level). now I modified a bit your code to get the max for the entire domain. Now what I want is to convert this .mat file (max waterlevels) into an ARCview shape. The problem is when I import the max waterlevels (in .mat file) into QuickPlot, QP does not take it (error in reading the file). SO now I want to find the matlab code the QP uses to convert the matlab file into shape file? do you have any idea what function it is? i already tried finding it in OET.
MS
Mihael Souza, modified 6 Years ago.

RE: Max water level/depth in 'trim-runid' file (Answer)

Padawan Posts: 65 Join Date: 10/11/12 Recent Posts
Hi Nophi,

Glad it was helpful to you them.
I don't know which function QuickPlot uses to output data to a shapefile, but have a look at the "shapewrite" function. You can look at it at MATLAB's documentation or Google. Maybe it can do what you want. Never used this function before, so I can't help you further in this regard.
If you want to output it as a shapefile to load into a GIS software, there is always the option of exporting the data as an .xyz file, and interpolating inside the GIS using a suitable interpolator (nearest neighbor or a linear/spline interpolation is always a good first choice). You can get Lat/Long or X/Y coordinates from the grid file, and append a third column of water levels.

Kind regards,

Mihael