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

Initial condition for nontransportable substance in bottom water layer?

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Hi there,

My understanding is that substances following the S1/S2 approach are nontransportable and confined to the bottom-most water layer (and zero everywhere else).

To recreate this in PLCT, I am wondering how to set the initial condition of similar, nontransportable substances confined to the bottom water layer, so that it is zero everywhere except for the bottom water layer? So far, I've been using the dhkmrk function to make the substance (below called SG_V0) perish very quickly in all cells that don't have a water bottom, which works but is not ideal:

call dhkmrk ( 2, iknmrk(iseg), ibottom)
if ( ( ibottom .eq. 0 ) .or. (ibottom .eq. 3) ) then
! Apply code only to elements that have a "water bottom".
!
SG_V4FLUX = ??? whatever the typical code should be ???
else
SG_V4FLUX = -SG_beta*SG_V0/Depth
! Make SG_V0 perish quickly in elements that don't have a "water bottom".

endif

where SG_beta is a large number. Is there a more elegant way of doing this (e.g. with an spatially-dependent initial condition) that is closer to the pure S1/S2 approach used in DWQ?

Many thanks!
Matthew
RE: Initial condition for nontransportable substance in bottom water layer?
Answer (Unmark)
9/6/16 2:54 PMas a reply to Matthew Adams.
Hi Matthew,

There are multiple options. When you uses the user inteface, you could work with a restart file that has the S1S2 only in the bottom segments, but when you start to edit the inp file there are other options as well. Look into section 8 of the D-Water Quality Input File manual to see how to do it.

In 8.2 there is the following example for section 8 (note that 23 is the number of substances from that model, but you only see the first 6 in the list. You'll need to adapt this to your own situation):

TRANSPOSE
1 ; Input without defaults
23*1.0 ; Scale values
23764*1.00 ; Continuity
23764*24.0 ; Salinity
23764*5.00 ; im1
23764*0.00 ; im2
23764*6.50 ; Oxy
23764*0.15 ; NH4
etc...


If you would want im1 only in the lowest of the presumably 4 layers here (5941 segments per layer), that could be changed to:

TRANSPOSE
1 ; Input without defaults
23*1.0 ; Scale values
23764*1.00 ; Continuity
23764*24.0 ; Salinity
17823*0.0 5941*5.00 ; im1
23764*0.00 ; im2
23764*6.50 ; Oxy
23764*0.15 ; NH4
etc...


Then the first there layers will have an initial im1 concentration of 0.0, en the lowest 5.0.

Michel
RE: Initial condition for nontransportable substance in bottom water layer?
Answer (Unmark)
9/19/16 6:04 AMas a reply to Michelle Jeuken.
Hi Michel,

Thanks - I think this is very close to what I need, but I am having some trouble with the TRANSPOSE function.

If I input your suggested code with the TRANSPOSE line commented out:

; eighth block of model input (initial conditions)
MASS/M2 ; unit for inactive substances
1 ; initial conditions follow
; TRANSPOSE
1 ; input values without defaults
4*1.0 ; scale factors
1115*0.020 ; NH4
1115*9.0 ; NO3
1115*1.0 ; PO4
892*1.0 223*0.0 ; Green
;
;
#8 ; delimiter for the eighth block

then the preprocessor and WAQ simulation (Waq (1) and Waq (2)) complete successfully, but the initial conditions aren't correct because I have commented out the TRANSPOSE line. The corresponding log in the LST file looks like:

Initials for passive substances are in mass/m2

Option selected for initials : 1
Information from the standard input file.
Second option for initials : 1
Constant values without defaults

Scale factors:
1 2 3 4
1.0000E+00 1.0000E+00 1.0000E+00 1.0000E+00
Unscaled values:
1 2.0000E-02 2.0000E-02 2.0000E-02 2.0000E-02
2 2.0000E-02 2.0000E-02 2.0000E-02 2.0000E-02
3 2.0000E-02 2.0000E-02 2.0000E-02 2.0000E-02
4 2.0000E-02 2.0000E-02 2.0000E-02 2.0000E-02
5 2.0000E-02 2.0000E-02 2.0000E-02 2.0000E-02
6 2.0000E-02 2.0000E-02 2.0000E-02 2.0000E-02
7 2.0000E-02 2.0000E-02 2.0000E-02 2.0000E-02
8 2.0000E-02 2.0000E-02 2.0000E-02 2.0000E-02
9 2.0000E-02 2.0000E-02 2.0000E-02 2.0000E-02
10 2.0000E-02 2.0000E-02 2.0000E-02 2.0000E-02
11 2.0000E-02 2.0000E-02 2.0000E-02 2.0000E-02
12 2.0000E-02 2.0000E-02 2.0000E-02 2.0000E-02
13 2.0000E-02 2.0000E-02 2.0000E-02 2.0000E-02
14 2.0000E-02 2.0000E-02 2.0000E-02 2.0000E-02

etc.




However, if I uncomment the TRANSPOSE line, the preprocessor fails with error code 1. Looking into the LST, it looks like this:

Initials for passive substances are in mass/m2

Option selected for initials : 1
Information from the standard input file.

Block of input data is ordered per substance
Second option for initials : 1
Constant values without defaults

Scale factors:
1
1.0000E+00
Unscaled values:
1 1.0000E+00 1.0000E+00 1.0000E+00 2.0000E-02 2.0000E-02 2.0000E-02 2.0000E-02 2.0000E-02 2.0000E-02 2.0000E-02
2 2.0000E-02 2.0000E-02 2.0000E-02 9.0000E+00 9.0000E+00 9.0000E+00 9.0000E+00 9.0000E+00 9.0000E+00 9.0000E+00
3 9.0000E+00 9.0000E+00 9.0000E+00 1.0000E+00 1.0000E+00 1.0000E+00 1.0000E+00 1.0000E+00 1.0000E+00 1.0000E+00
4 1.0000E+00 1.0000E+00 1.0000E+00 1.0000E+00 1.0000E+00 1.0000E+00 1.0000E+00 1.0000E+00 1.0000E+00 1.0000E+00
Scale factors:


Unscaled values:
1 2.0000E-02 2.0000E-02 2.0000E-02 2.0000E-02 2.0000E-02 2.0000E-02 2.0000E-02 2.0000E-02 2.0000E-02 2.0000E-02
2 9.0000E+00 9.0000E+00 9.0000E+00 9.0000E+00 9.0000E+00 9.0000E+00 9.0000E+00 9.0000E+00 9.0000E+00 9.0000E+00
3 1.0000E+00 1.0000E+00 1.0000E+00 1.0000E+00 1.0000E+00 1.0000E+00 1.0000E+00 1.0000E+00 1.0000E+00 1.0000E+00
4 1.0000E+00 1.0000E+00 1.0000E+00 1.0000E+00 1.0000E+00 1.0000E+00 1.0000E+00 1.0000E+00 1.0000E+00 1.0000E+00
Scale factors:

etc.

ERROR. Too many and/or invalid data in block 8 !! Check input file !!


Any idea what's causing this? It seems very close to working.

Thanks,
Matthew
RE: Initial condition for nontransportable substance in bottom water layer?
Answer (Unmark)
9/19/16 4:52 PMas a reply to Matthew Adams.
Hi Matthew,

I must admit I din't test this myself, just copied it from the user manual.

You were very close. I don't directly understand why, but apparently when using the transpose keyword, Delwaq only reads one scaling factor. The onter scaling factrs are seen as the first data values:

Scale factors:
1
1.0000E+00
Unscaled values:
1 1.0000E+00 1.0000E+00 1.0000E+00 2.0000E-02 2.0000E-02

So if you use

1*1.0 ; scale factors

It should work (it did for me now I tested it myself). It is something to look into because the model suggests otherwise.

Michel
RE: Initial condition for nontransportable substance in bottom water layer?
Answer (Unmark)
9/20/16 1:09 AMas a reply to Michelle Jeuken.
Hi Michel,

Many thanks for the speedy response - that worked for me!

Cheers
Matthew