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 to DELWAQ

read and write *.flo file for PART

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
read and write *.flo file for PART
part larval transport
Answer (Unmark)
4/14/17 10:35 PM
I am a newbie to the delft3D open source community, and trying to use the particle tracking module (PART) to simulate larval transport behavior. Currently PART can only model "passive" particles. However, I am trying to model two extra larvae behaviors:

1. diurnal migration - larvae only move during daytime hours.
2. selective tidal stream transport - larvae only move during flood tide

I am thinking to modify the flow results in *.flo files created from the hydrodynamic runs to simulate these two larvae behaviors. However, I could not figure out how to read and write the *.flo file. Does anyone have experience with i/o of this file? I know "ddcouple.exe" is used for post-processing the hydro com files to create input files for PART. Where can I find the source codes for ddcouple from the repository?

Thanks,
Jonathan
RE: read and write *.flo file for PART
Answer (Unmark)
4/18/17 12:24 PMas a reply to Zhanxian Wang.
You can try to change the flows, but you could also try to have a look at part10.f where the actual movement of particles is calculated.

If you what to know how the files are build up, this is briefly described in:

http://content.oss.deltares.nl/delft3d/manuals/D-Water_Quality_Input_File_Description.pdf

11.4 Binary file that are directly read by D-Water Quality

The flo-file is a flows file:

flows • ’time’ integer*4, NOQT real*4 values
• same for next time step(s)
• · · ·

And to know how these flows are defined (from which segment to what segment), you can read the flow pointers from the poi-file:

exchange pointer • 4 integer*4 ifrom, ito, ifrom-1, ito+1
• the same for all other NOQT = NOQ1+NOQ2+NOQ3 exchanges
• · · ·

The code of ddcouple is not (yet) available to open source, but the flo-files per domain are written in D3D FLOW in this routine:

https://svn.oss.deltares.nl/repos/delft3d/trunk/src/engines_gpl/flow2d3d/packages/io/src/output/wrwaqflo.f90
RE: read and write *.flo file for PART
particle tracking
Answer (Unmark)
4/19/17 3:30 PMas a reply to Michelle Jeuken.
Michel,

Thanks for your response!

If DDCOUPLE is not available as open source as you said, then how could I combine the com files from a MPI hydrodynamic run on a cluster in order to run a PART simulation? Do I have to copy them to a Windows machine and combine them there?

Jonathan
RE: read and write *.flo file for PART
particle tracking
Answer (Unmark)
4/19/17 4:09 PMas a reply to Michelle Jeuken.
Michel,

To me, wrwaqflo subroutine is to write the com_*.are (area) file instead of flow file com_*.flo.

Do you think you can provide me the part of codes in DDCOUPLE to read and write flo files?

Thanks,
Jonathan
RE: read and write *.flo file for PART
Answer (Unmark)
4/24/17 11:10 AMas a reply to Zhanxian Wang.
You are right, qag is used for both aggregted area and flow. The aggregated flows are only calcualted here in this routine, but are written in wrwaqfil

write ( lunflo ) itim , qag (1:noq)

currently at line 622. The statement of writing again to lunflo on line 631 is only executed at the last step to add a dummy record.

The statements from the code that you would need are:

open(flo_unit_nr,file=flo_name,form='UNFORMATTED', access='STREAM',iostat=io_error)
open(flo_new_unit_nr,file=flo_name,form='UNFORMATTED', access='STREAM',iostat=io_error)

do

read(flo_unit_nr,end=100) itime,(flow(i),i=1,noq)

new_flow(i) = something(flow(i))

write (flo_new_unit_nr) itime , (new_flow(i),i=1,noq)

end do

100 continue
RE: read and write *.flo file for PART
Answer (Unmark)
4/24/17 11:13 AMas a reply to Zhanxian Wang.
We have the ability to access files on our Linux cluster from windows machines to do the coupling, but I guess you don't have that possibility. I've attached a Linux version of ddcouple to this post
Attachments: ddcouple_1.02.00.47707_lnx64.zip (6,070.6k)