null

Message Boards

Defining your own processes and parameters

Martin Schueder, modified 5 Years ago.

Defining your own processes and parameters

Padawan Posts: 52 Join Date: 10/8/13 Recent Posts
Hello,

I am trying to add in an additional process to WAQ that would influence the pH in a currently unaccounted for way, The WAQ user manual states:

"Apart from the pre-defined water quality processes and parameters you can define your own processes and parameters. Select from the Far-field water quality window for
instance General, and next Tools. The Open PLCT button allows you to set up or edit your own processes library, and to configure Delft3D to use it. See the separate User Manual on how to use the Open PLCT."

I do this and VB opens up D3DWAQ_PL which seems pretty empty to me where I might have expected a vast library of code containing the mathematics behind all of the chemical and biological processes. Is there a user manual on how to code processes in visual basic and add them to the process library?

Any guidance on defining your own processes would be very helpful thank you!

Martin
Christophe Thiange, modified 5 Years ago.

RE: Defining your own processes and parameters (Answer)

Jedi Knight Posts: 125 Join Date: 11/15/12 Recent Posts
Hi Martin,

All Delwaq processes are coded in Fortran. You need a Visual Studio environment with a Fortran compiler to add your own.
It seems you have some Visual Basic environment installed on your machine which gets fired up by the Delwaq GUI. That's not the idea but is probably happening because you don't have a VS/Fortran environment.

In case you didn't find it, this manual covers the Open PLCT.

You can also have look in the source tree and check existing processes for more examples: src\engines_gpl\waq\packages\waq_kernel\src\waq_process\

Hope this helps.

Christophe
Martin Schueder, modified 5 Years ago.

RE: Defining your own processes and parameters

Padawan Posts: 52 Join Date: 10/8/13 Recent Posts
Hi Christophe,

Thank you very much for your reply and it looks like this manual may be of great help.

About your comment on the Visual Studio/Fortran Compiler Environment:

I have Visual studio 2010 installed along with Intel Parallel studio 2013 on my computer. I am not sure if I in fact have the VS/Fortran environment necessary to accomplish what I am trying to do but I was able to build the executables to run FLOW in the past. I am wondering if I should expect something else to happen when I select "Build" from the "open PLCT" part of the GUI. I have attached an image of my VS/Fortran Environment after opening up D3Dwaq_OpenPL.sln in hopes you might be able to diagnose whether or not I have the necessary components installed to edit processes.

Many thanks,

Martin
Michel Jeuken, modified 5 Years ago.

RE: Defining your own processes and parameters (Answer)

Jedi Knight Posts: 156 Join Date: 1/21/13 Recent Posts
Hi Martin,

I think you have everything you need there. A little lower in the code screen you will see room to add your own equations. Then you should build the DLL in the Visual Studio environment. After that you can pick up this dll using the openPLCT part of the GUI.

Good luck,
Michel

P.S.: feel free to ask more questions, but it would also be nice to hear if you managed to get it running!
Martin Schueder, modified 5 Years ago.

RE: Defining your own processes and parameters

Padawan Posts: 52 Join Date: 10/8/13 Recent Posts
Hi Michel,

Thank you for your help! After some struggle finding where the PLCT extracted the VB solution and proc_def.dat from (I had multiple copies of each on my computer and my directories were much different than those described in the manuals), I was able to add my own process (described in the tutorial) to the process library and make it an active process within the WAQ environment. The main factor to succeeding here was that I was able to continually and transparently rewrite the proc_def.dat file and the .dll file produced in the VB build every time I added a new substance/process script. It was important I knew exactly where these files were being written so that I would have easy access to them for installation in the GUI.

My simple test model has failed to converge after one attempt but I think the issue lies outside the scope of my previous question and should be a quick fix after I look into it (I think decay coefficients were too high and state variable went to negative before reaching end of the wetland). Looks like I just might be on my way to defining even more complex processes in no time. I will update if anything else comes up.

Thanks,

Martin