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

Implementing culvert type 'u' with Delft3D flow tagged version 6075

RS
Rinse Swart, modified 4 Years ago.

Implementing culvert type 'u' with Delft3D flow tagged version 6075

Youngling Posts: 3 Join Date: 3/3/16 Recent Posts
Dear all,

I am trying to implement a culvert type ‘u’ in a simple Delft3D-flow model. I do not have much experience in compiling and manipulating Fortran codes, so it might be that I ask stupid questions but any help would be greatly appreciated. I am using Delft3D-flow tagged version 6075 and I have read the sections 10.9.2.6, B.3.4 and B.3.8 from the Delft3D-flow manual. Following the instructions in these sections, I created a *.src, *.dis and *.cul file which I have attached to this message. Apart from that, I have added the line Filcul = #*.cul# to the corresponding mdf file (see attachment). While doing these steps, I came across my first problem.

Question 1) In the manual (section B.3.4.6) it is stated that the key ‘CulvertFile’ can optionally be used to point to an input file with parameter settings for the user routine CulvertFunction. In the manual, the example points to a file called ‘culvert_params.txt’. At first, I did not understand what should be the contents of this file. However, I suspect it is the same input file as is mentioned at the end of section B.3.8 in the manual. Is this correct? For now, I copied the contents of the example input file mentioned at the end of section B.3.8 and added this to the culvert file. I attached the input file (culvert_params.txt) to this message.

Next, I copied the example Fortran code given in section B.3.8 in the manual and created a .dll file from this code using Microsoft Visual Studio 2015 and Intel Fortran Compiler 16.0 Update 3 (same programs and using identical settings when I successfully compiled the source code of Delft3D).

Question 2) While created the dll file, I encountered my second problem which deals with the dll settings. On this page (https://software.intel.com/en-us/node/535308) it says the following: ‘If your DLL exports data, consistently specify the project settings options in the Fortran Data compiler option category for both the DLL and any image that references the DLL's exported data. In the Fortran Data compiler option category, specify the appropriate values for Common Element Alignment (common block data) and Structure Member Alignment (structures in a module). This sets the /align option, which specifies whether padding is needed to ensure that exported data items are naturally aligned.’ Since the dll file should export data to Delft3D-flow, I assumed this instruction applied to me. Since I did not find any common block data in the supplied Fortran code, I set the Common Element Alignment to ‘none’. Regarding the ‘Structure member alignment’, I set this to 8 Bytes, the reason for this that it is stated in the manual that communication with the library occurs in double precision and according to (https://docs.oracle.com/cd/E19957-01/805-4939/z40007365fe9/index.html) double precisison is 8 bytes. Is this the way it should be?

Question 3) With the settings described in the previous paragraphs I tried to run a first simulation. However, when I try to run the model I run into errors. The model starts as it should do, the culvert data is included in the simulation, the correct library is used and the correct function is called. Subsequently, the results for the first time-step are computed and saved in the trih- and trim-files. Immediately after that I receive an error (‘child killed: segmentation violation’) which does not give me much usable information. Can someone enlighten me on what might be a cause of this? I tried the same simulation with a ‘c’ and ‘d’ culvert and they run without errors, suggesting that it should be something related to the ‘u’ culvert type or that a setting in my simulation is wrong. I have attached the relevant files I used for this simulation and the output of the delft3d log and tri-diag files is shown below.

I hope someone here will be able to give a clue about what might go wrong.

Thanks in advance!
Rinse


********************************************************************************
***
*** Deltares, FLOW2D3D Version 6.02.06.6134M, May 16 2016, 11:07:56
*** built from : https://svn.oss.deltares.nl/repos/delft3d/tags/6075
***
*** runid : eerste_model
*** date,time : 2016-11-22, 14:50:44
***
********************************************************************************

*** MESSAGE Executable for 64-bits platform.
*** MESSAGE Double precision computation using reals of kind 8
*** Start of User Defined Model description
-
- test model grid (5x5 km)
- met spoelmeer (1.5x0.9 km)
-
*** End of User Defined Model description

*** MESSAGE Upwind advection scheme only near momentum discharges
*** MESSAGE Using UNESCO density formulation by default
*** MESSAGE Momentum solver cyclic method is specified
*** MESSAGE DRYFLP and DPSOPT both specified in MD-file. Using DPSOPT: MAX
*** WARNING Latitude of your model is 0 degrees, model located at equator

***************************************
*** Culvert data included
***************************************
for discharge Culvert1 :
* culvert of type "U" between (m = 52, n = 29) and (m = 54, n = 29)
* Library used : Dll6.dll
* Function called : TABLE

Creating new trih-eerste_model.dat
Creating new trih-eerste_model.def
Creating new trim-eerste_model.dat
Creating new trim-eerste_model.def






--------------------------------------------------------------------------------

Command: run Delft3D-FLOW
Starting Delft3D-FLOW computation ...
--------------------------------------------------------------------------------
Deltares, FLOW2D3D Version 6.02.06.6134M, May 16 2016, 11:07:56
flow2d3d.dll entry Flow2D3D::Run
--------------------------------------------------------------------------------

Part I - Initialisation Time Dep. Data module...
runid : eerste_model
Part II - Creating intermediate files...
Part III - Initialisation of the Execution module...
Part IV - Reading complete MD-file...
Part V - Initialisation & checking input...
Part VI - Initialisation & checking second part...
Part VII - Initialisation output...
Part VIII - Start Simulation...

Time to finish 0s, 0.0% completed, time steps left 14400

child killed: segmentation violation
Qinghua Ye, modified 4 Years ago.

RE: Implementing culvert type 'u' with Delft3D flow tagged version 6075 (Answer)

Jedi Council Member Posts: 610 Join Date: 3/2/11 Recent Posts
Hi Rinse,

It seems to me there is sth wrong in the dll, either the interface or the internal functions inside the dll. For Culvert type C and D the internal functions are used, thus it doesn't mean your dll is correct.

You might need to debug the dll as well to track what exactly goes wrong.

Greetings,

Qinghua
RS
Rinse Swart, modified 4 Years ago.

RE: Implementing culvert type 'u' with Delft3D flow tagged version 6075

Youngling Posts: 3 Join Date: 3/3/16 Recent Posts
Dear Qinghua Ye,

Thanks for poiting this out, at least this tells me what likely causes the problem. I will try to experiment a bit more with the dll settings and see if that helps. However, the Delft3D-Flow manual does not describe in detail the required settings for generating the dll. It does say that the same settings should be used that were used when compiling the source code (in my case Microsoft Visual Studio 2015 with Intel Fortran Compiler 16.0 Update 3, x64 and 'release' version) but that's about it. Especially when using Microsoft Visual studio, there are a lot of settings available when generating a dll. Can you provide some additional info on how to generate the dll in the correct way? I already googled extensively but this does not turn up much useable info...

Thanks in advance!

Regards,
Rinse
Qinghua Ye, modified 4 Years ago.

RE: Implementing culvert type 'u' with Delft3D flow tagged version 6075 (Answer)

Jedi Council Member Posts: 610 Join Date: 3/2/11 Recent Posts
Hi Rinse,

Indeed the dll approach is a bit annoying sometimes.

I would suggest you start to try to use the d type and change the hard coded coef in the code. This might be easier to start and to test if you are busy with a consultancy project. If you really want to test the dll function approach, contact with Deltares support.

Greetings,

Qinghua
RS
Rinse Swart, modified 4 Years ago.

RE: Implementing culvert type 'u' with Delft3D flow tagged version 6075

Youngling Posts: 3 Join Date: 3/3/16 Recent Posts
Hi Qinghua Ye,

Thanks for your answer. Until now, I did not succeed in producing a correct dll. Therefore, I think I will try to contact Deltares support.

Regards,
Rinse
AA
Andi Afif, modified 1 Year ago.

RE: Implementing culvert type 'u' with Delft3D flow tagged version 6075

Youngling Posts: 7 Join Date: 3/23/18 Recent Posts
Hi Rinse,

I was trying to use and implement culvert type 'u' in my simple Delft-3D model. Unfortunately, it wasn't going well. Did you already succeed to implement the culvert type 'u'? Your help will be fully appreciated.

Regards,
Andi