Migration status

  • Home Page: Activity map.

DELWAQ

DELWAQ is the engine of the D-Water Quality and D-Ecology programmes of the Delft3D suite. It is based on a rich library from which relevant substances and processes can be selected to quickly put water and sediment quality models together.

The processes library covers many aspects of water quality and ecology, from basic tracers, dissolved oxygen, nutrients, organic matter, inorganic suspended matter, heavy metals, bacteria and organic micro-pollutants, to complex algae and macrophyte dynamics. High performance solvers enable the simulation of long periods, often required to capture the full cycles of the processes being modelled.

The finite volume approach underlying DELWAQ allows it to be coupled to both the structured grid hydrodynamics of the current Delft3D-FLOW engine and the upcoming D-Flow Flexible Mesh engine (1D-2D-3D) of the Delft3D Flexible Mesh Suite (or even other models such as TELEMAC).

'DELWAQ in open source' is our invitation to all leading experts to collaborate in further development and research in the field of water quality, ecology and morphology using Delft3D. Feel free to post your DELWAQ related questions or comments in this dedicated forum space. If you are new to DELWAQ, the tutorial (in the user manual) is a good place to start. A list of DELWAQ related publications is available here.

** PLEASE TAG YOUR POST! **

 

 

Sub groups
D-Flow Flexible Mesh
DELWAQ

Cohesive sediments & muddy systems

 


Back

How to incorporate a new processes into the library?

YL
Yuanyi Li, modified 12 Days ago.

How to incorporate a new processes into the library?

Youngling Posts: 19 Join Date: 4/18/17 Recent Posts

Hi, every one.

I am trying to create new substance and new processes and incorporate them in to the existing process library. Now I have successfully create the substance and processes with OPLT as the user manual. The compilation of the fortran source code was successful too. I used the install tool in GUI to incorporate the generated proc_def.dat and D3Dwaq_openPL.dll into the existing library. I found the new proc_def.dat was copied to the installation folder. But it did not work for D3Dwaq_openPL.dll and there was no change about this file. In this situation, I would get errors like

 

forrtl: severe (157): Program Exception - access violation
Image              PC                Routine            Line        Source             
delwaq.dll         00007FFE4A1B55C6  Unknown               Unknown  Unknown
delwaq.dll         00007FFE4A31450C  PROCAL                    513  procal.f
delwaq.dll         00007FFE4A2A0159  ONEPRO                   1096  proces.f
delwaq.dll         00007FFE4A29FCA3  PROCES                    688  proces.f
libiomp5md.dll     00007FFE6190419C  Unknown               Unknown  Unknown
libiomp5md.dll     00007FFE618CBDBF  Unknown               Unknown  Unknown
libiomp5md.dll     00007FFE6189F9E9  Unknown               Unknown  Unknown
delwaq.dll         00007FFE4A29DB01  PROCES                    648  proces.f
delwaq.dll         00007FFE4A21A596  DLWQNG                    352  dlwqng.f
delwaq.dll         00007FFE4A1EBA2C  DELWAQ2_mp_DELWQ2         491  delwaq2.f
delwaq.dll         00007FFE4A1D9E5E  Unknown               Unknown  Unknown
delwaq2.exe        00007FF734E11244  MAIN__                     45  dlwq2.f
delwaq2.exe        00007FF734E6F99E  Unknown               Unknown  Unknown
delwaq2.exe        00007FF734E58ACA  Unknown               Unknown  Unknown
KERNEL32.DLL       00007FFEADE77E94  Unknown               Unknown  Unknown
ntdll.dll          00007FFEB0287AD1  Unknown               Unknown  Unknown


 

I think it was due to the main programe did not found the subroutines in the new generated .dll. 

Could anyone told me how to incorporated the new processses into the Delft3D waq in details? Is there any difference from the description in user manual?

 

Best wish

Thank you

AM
Arjen Markus, modified 12 Days ago.

RE: How to incorporate a new processes into the library?

Jedi Knight Posts: 173 Join Date: 1/26/11 Recent Posts

If the program would not be able to find the OpenPLCT library or the library would not contain the required process routine you would have gotten an error message stating the actual cause of the failure. As this is not the case, something else is going on. Could you tell us:

- Which version of Delft3D (or more specifically which version of Delft3D-WAQ)?

- What operating system? (Like Windows 7 or 10, 32 bits or 64 bits)

 

The code to deal with typical errors has been around for many years, but you never know. It is also difficult to reproduce this problem, so we may have to iterate a few times before this is clear.

YL
Yuanyi Li, modified 12 Days ago.

RE: How to incorporate a new processes into the library?

Youngling Posts: 19 Join Date: 4/18/17 Recent Posts

Hi, Ajen

Thank your for you replying.

THe version of DeIft3d-WAQ I am using is 5.06.00.61423M. My operation system is Windows 10 win64. My GUI is Delft3D 4.03.01.

I go through the code of the Delft3D and I find the problem may be caused by call of "ierror = perf_function" at the end of procal.f. Then I search the definition of perf_function in the code. I found it was defined by interface. But I found the interface was defined only in WIN32. Then I add a  definition under WIN64, hoping it will resolve my problem. Unfortunately, it did work. The reason I told you these is that I think it is useful to helping you find the problem.

Below is the code I have changed in f902.cpp

#if defined(WIN32)
#  define OPEN_SHARED_LIBRARY  OPEN_SHARED_LIBRARY
#  define CLOSE_SHARED_LIBRARY CLOSE_SHARED_LIBRARY
#  define PERFORM_FUNCTION PERF_FUNCTION
#  define LOAD____FUNCTION LOAD_FUNCTION
#  define STDCALL /* nothing */
#elif defined(WIN64)
#  define OPEN_SHARED_LIBRARY  OPEN_SHARED_LIBRARY
#  define CLOSE_SHARED_LIBRARY CLOSE_SHARED_LIBRARY
#  define PERFORM_FUNCTION PERF_FUNCTION
#  define LOAD____FUNCTION LOAD_FUNCTION
#  define STDCALL /* nothing */

 

Could you have any suggestion to me?

Thank you 

Yuanyi

YL
Yuanyi Li, modified 12 Days ago.

RE: How to incorporate a new processes into the library?

Youngling Posts: 19 Join Date: 4/18/17 Recent Posts

Now I can make sure the .dat and .dll file have been copied to the proper directory. I attach the two files to you, hoping they are useful.

AM
Arjen Markus, modified 12 Days ago.

RE: How to incorporate a new processes into the library?

Jedi Knight Posts: 173 Join Date: 1/26/11 Recent Posts

Ah, thank you - that ought to be helpful at the very least to try and reproduce the problem.

Hm, the lack of a case for WIN64 is not the problem, as the macro WIN32 is defined even for Windows 64 builds. But it definitely helps zooming in on the problem. We have seen issues with this platform before vis-a-vis the Open PLCT and were so far not able to get the bottom of it, due to a lack of machines running Windows 10 (that is the reason why we did not officially support Windows 10). Now I do have a proper Windows 10 machine and I will see what is going on.

YL
Yuanyi Li, modified 12 Days ago.

RE: How to incorporate a new processes into the library?

Youngling Posts: 19 Join Date: 4/18/17 Recent Posts
Arjen Markus:

Ah, thank you - that ought to be helpful at the very least to try and reproduce the problem.

Hm, the lack of a case for WIN64 is not the problem, as the macro WIN32 is defined even for Windows 64 builds. But it definitely helps zooming in on the problem. We have seen issues with this platform before vis-a-vis the Open PLCT and were so far not able to get the bottom of it, due to a lack of machines running Windows 10 (that is the reason why we did not officially support Windows 10). Now I do have a proper Windows 10 machine and I will see what is going on.

I used to try the most simple case, in which there is only one kind of substance and the process link to the substance is increasing 1.0 every time step. But it still caused the problem I mentioned to you. When include the subtance with the process being ticked off, the programe ran smoothly.

Moreover, I also inserted a special output just front and behind of the call of "ierror = perf_function", I only found the output that is in front of the call. When I inserted the output into the subroutine of the process I created, it never was output. All the fact meat that, I think, the problem should be due to the error when calling the subroutine of process. 

 

 

 

 

AM
Arjen Markus, modified 12 Days ago.

RE: How to incorporate a new processes into the library?

Jedi Knight Posts: 173 Join Date: 1/26/11 Recent Posts

I will do my best. There is something fishy going on, that is for sure,

YL
Yuanyi Li, modified 11 Days ago.

RE: How to incorporate a new processes into the library?

Youngling Posts: 19 Join Date: 4/18/17 Recent Posts

Dear Arjen,

Thank you for your help. I tried tags 9180 with GUI 4.04.0. on my Windows, finding the error contines. I also try my subroutine on Windows 7, finding both the verisons works well and I got the result I want. So I think the problem is caused by different version of Microsoft Windows. Until now, we does not plan to retreat my Windows 10 to 7 and I still hope that you could help me with the problem on Windows 10. Could you help me?

Thanks and best wish.

Yuanyi 

AM
Arjen Markus, modified 11 Days ago.

RE: How to incorporate a new processes into the library?

Jedi Knight Posts: 173 Join Date: 1/26/11 Recent Posts

I am going to try and analyse this. Unfortunately, I have no idea at this moment what might be causing the problem, so I have no idea how long it will take to solve it.

AM
Arjen Markus, modified 11 Days ago.

RE: How to incorporate a new processes into the library?

Jedi Knight Posts: 173 Join Date: 1/26/11 Recent Posts

I have solved it - a small matter of a wrong data type. Apparently that worked fine on Windows 7, but not on Windows 10. Thechange is in revision 62805.

YL
Yuanyi Li, modified 11 Days ago.

RE: How to incorporate a new processes into the library?

Youngling Posts: 19 Join Date: 4/18/17 Recent Posts

Did you mean that it still only works on Windows 7? So I need run it on Windows 7?

AM
Arjen Markus, modified 11 Days ago.

RE: How to incorporate a new processes into the library?

Jedi Knight Posts: 173 Join Date: 1/26/11 Recent Posts

Sorry, I was a bit unclear: with the revision 62805 it will work on Windows 10 as well as Windows 7. You will need to get that revision and then rebuild Delft3D-WAQ (delwaq2 in particular).

YL
Yuanyi Li, modified 11 Days ago.

RE: How to incorporate a new processes into the library?

Youngling Posts: 19 Join Date: 4/18/17 Recent Posts

Dear Arjen,

I am so appreciated for your assistance. Can you told me the modifications you made? I hope to deal with the similar problem by myself in the future.

Best wish

Yuanyi

AM
Arjen Markus, modified 11 Days ago.

RE: How to incorporate a new processes into the library?

Jedi Knight Posts: 173 Join Date: 1/26/11 Recent Posts

The change is in the file "f90toc.cpp" and concerns the data type of the first argument to perform_function(). That used to be a "long *", but should have been a "DllHandle *" - a difference of 4 versus 8 bytes.

YL
Yuanyi Li, modified 11 Days ago.

RE: How to incorporate a new processes into the library?

Youngling Posts: 19 Join Date: 4/18/17 Recent Posts

Dear Arjen

I have run the model successfully. But I do not used the revision 62805 because I have downloaded the latest versions of Delft3D and GUI. Now the version I used is tags 9180 with the modifications you just make. Thank you very much. 

But I have other three questions:

1)when I compile the codes, I must tick off vs and vs_version_number in solution properties page otherwise the compilation will faild down and the workstation .crash. I want to know the functions of the two projects. However, even the two project were not compiled, the programe could run without essential problem. Do you know the reason of  it?  The versions of my IDE is VS2015update3+IFORT2016Update4. 

2)the Open PLCT often crashed when I try to save the modifications. The phenomenon disappered when I try it on a Windows 7 with VMware or a Windows 7 Host. But it sustains on Windows 10 64 bits. Could you give a solution to the problem for Windows 10 64 bits?

3)I try to calculate the spatial differential of concentration in vertical direction using Open PLCT. Therefore, I think I need know the upper and lower neighborhood cell in water quality grid to refer the variables in vertical neighbors. But unfortunately, I did find any explict intruction or example about this problem. Could you give me some suggest on it?  

Have a nice weekend

Yuanyi

Attachments:

Attachment

YL
Yuanyi Li, modified 4 Days ago.

RE: How to incorporate a new processes into the library?

Youngling Posts: 19 Join Date: 4/18/17 Recent Posts

Hi, Arjen

The reversion of code you modified is running smoothly. But there arose another problem. The the flow-wave coupling simulation could not run by your reversion.  I used to well run it using tag 7545 with GUI 4.03.01.   The messages are below

Waiting for communication with Delft3D-FLOW ...
*****************************************************************
*  Start of Delft3D-WAVE ...
  Start loop over SWAN grids, time =     1578240.000 minutes since 20000101.000000
  Allocate input fields
  Allocate and read SWAN depth
  Get flow fields, domain 1 :
    Time     1578240.000 found on com-file, group CURTIM
  Write SWAN depth file
  Write SWAN velocity file
  Write SWAN wind file
  Deallocate input fields
  Write SWAN input
*** MESSAGE: 'wind_bohaisea' is truncated to 'wind_boh' in SWAN input file
<<Run SWAN...
>>...Check file swan_bat.log
>>...End of SWAN run
*** ERROR: file 'norm_end' expected to signal a correct SWAN calculation
 ERROR: *** ERROR: file 'norm_end' expected to signal a correct SWAN calculation
 Wave exited abnormally

forrtl: severe (172): Program Exception - exception code = 0x7363 (29539)
Image              PC                Routine            Line        Source             
KERNELBASE.dll     00007FFB0DF15299  Unknown               Unknown  Unknown
VCRUNTIME140.dll   00007FFB02744572  Unknown               Unknown  Unknown
wave.exe           00007FF664731DC1  Unknown               Unknown  Unknown
wave.exe           00007FF66451BFFA  Unknown               Unknown  Unknown
wave.exe           00007FF66463AFBA  Unknown               Unknown  Unknown
wave.exe           00007FF6644D921A  Unknown               Unknown  Unknown
wave.exe           00007FF66447187F  Unknown               Unknown  Unknown
wave.exe           00007FF664715FFE  Unknown               Unknown  Unknown
wave.exe           00007FF66473E959  Unknown               Unknown  Unknown
KERNEL32.DLL       00007FFB0F197E94  Unknown               Unknown  Unknown
ntdll.dll          00007FFB11E5A251  Unknown               Unknown  Unknown
 

 

could you help me?

Yuanyi

 

AM
Arjen Markus, modified 4 Days ago.

RE: How to incorporate a new processes into the library?

Jedi Knight Posts: 173 Join Date: 1/26/11 Recent Posts

Hm, that looks like a problem with the interfacing between FLOW and WAVE. That is beyond my area of expertise. I will have to ask a colleague to have a look.

AM
Arjen Markus, modified 4 Days ago.

RE: How to incorporate a new processes into the library?

Jedi Knight Posts: 173 Join Date: 1/26/11 Recent Posts

Could you examine the file swan_bat.log? Apparently SWAN has not run or not run to completion.

YL
Yuanyi Li, modified 3 Days ago.

RE: How to incorporate a new processes into the library?

Youngling Posts: 19 Join Date: 4/18/17 Recent Posts

Hi, Arjen

Thank you for you kind assistance. I do not think the SWAN has run, because the file swan_bat.log cannot be found in my directory. It seems that the file norm_end is produced by SWAN.

Thank you again.

Best

Yuanyi Li

 

YL
Yuanyi Li, modified 15 Hours ago.

RE: How to incorporate a new processes into the library?

Youngling Posts: 19 Join Date: 4/18/17 Recent Posts

Hi, Arjen,

I am still struggling with the flow-wave coupling using the Reversion 62805. I think I cannot deal with it by myself. But I have a idea which could make my study continue. Considering that I could run flow-wave coupling simulation using tag 7545 and you know the cause of violate access in water quality model. I wonder if you could tell me how to solve the problem you have solved in  tag 7545. In this way I can continue using tag 7545 to finish my work. 

I have try your modification in tag 7545, but it was failed.

Yuanyi

AM
Arjen Markus, modified 8 Hours ago.

RE: How to incorporate a new processes into the library?

Jedi Knight Posts: 173 Join Date: 1/26/11 Recent Posts

Can you tell me how this failed? The changes I made are quite local, so I do not see how it could fail - it does not depend on any other changes that you might have missed.

YL
Yuanyi Li, modified 8 Hours ago.

RE: How to incorporate a new processes into the library?

Youngling Posts: 19 Join Date: 4/18/17 Recent Posts

I repeat you modifications in Tag 7545 and it successes.  Now I can run my simulation using this version. But the problem of flow-wave simulation with 82805 still exists. I do not think it is related to you modification. It may be caused by the interface between the Delft3D Flow and SWAN

Thank you. You have help me a lot. 

Yuanyi 

AM
Arjen Markus, modified 8 Hours ago.

RE: How to incorporate a new processes into the library?

Jedi Knight Posts: 173 Join Date: 1/26/11 Recent Posts

No, the failing of the interaction between Delft3D-FLOW and Delft3D-WAVE has nothing to do with this. Did you check the log file? According to my colleague it should contain the reason for the failure, most probably that WAVE failed to start properly.