OpenPLCT processes  why are my fluxes depth dependent?  Coast/Estuary  Delft3D
intro story Coast / Estuary
Coast / EstuaryCoastal systems are among the most dynamic physical systems on earth and are subject to a large variety of forces. The morphodynamic changes occurring to coastlines worldwide are of great interest and importance. These changes occur as a result of the erosion of sediments, its subsequent transport as bed load or suspended load, and eventual deposition. Estuaries are partly enclosed water bodies that have an open connection to the coast. Estuaries generally have one or more branching channels, intertidal mudflats and/or salt marshes. Intertidal areas are of high ecological importance and trap sediments (sands, silts, clays and organic matter). Within the Delft3D modelling package a large variation of coastal and estuarine physical and chemical processes can be simulated. These include waves, tidal propagation, wind or waveinduced water level setup, flow induced by salinity or temperature gradients, sand and mud transport, water quality and changing bathymetry (morphology). Delft3D can also be used operationally e.g. storm, surge and algal bloom forecasting. On this discussion page you can post questions, research discussions or just share your experience about modelling coastal and/or estuarine systems with Delft3D FM. ** PLEASE TAG YOUR POST! **  Sub groups

Message Boards
OpenPLCT processes  why are my fluxes depth dependent?
DP
David Plew, modified 6 Years ago.
OpenPLCT processes  why are my fluxes depth dependent?
Youngling Posts: 4 Join Date: 10/14/13 Recent Posts 00
I'm using the OpenPLCT learning how to add substances and processes. After following the tutorial in the manual and then getting all adventurous and writing my own simple processes I've become a bit confused as to why the output fluxes appear to be depth dependent in my model.
The user manuals tell me that
 Substances are concentrations or density (Pg 6 of the OPL user manual).
 A Flux is a change of mass per unit of time and volume (Pg 5 Water Quality and Aquatic Ecology manual), i.e. a rate of change of concentration.
All good and logical so far...
But, to illustrate with a very simple example:
Using OpenPLCT I create a new substance called STUFF. I give STUFF units of g/m3 because it is a concentration.
I now make a new Output Flux for STUFF. To make this real easy I simply make STUFF increase at a constant rate of K g/m3/d. The fortran code looks like
STUFF_flux = K
If I give K a value of 1 g/m3/d then I'd expect STUFF to increase linearly at a rate of 1 g/m3/d, i.e. dSTUFF/dt = k
What I find is that in each grid cell, the rate of change of STUFF is proportional to the total water depth, i.e:
dSTUFF/dt = k*d
where d = total water depth.
Is this depth dependence supposed to happen? Where does it come from?
I am running a 2D model with variable depth (2x2m horizontal resolution), but the same thing happens if I run this as a 2 layer 3D model.
While I could divide by depth to get the rate of change I am expecting, I'll then need to apply some limit if the depth becomes very small (or zero) to avoid errors.
Regards
David
The user manuals tell me that
 Substances are concentrations or density (Pg 6 of the OPL user manual).
 A Flux is a change of mass per unit of time and volume (Pg 5 Water Quality and Aquatic Ecology manual), i.e. a rate of change of concentration.
All good and logical so far...
But, to illustrate with a very simple example:
Using OpenPLCT I create a new substance called STUFF. I give STUFF units of g/m3 because it is a concentration.
I now make a new Output Flux for STUFF. To make this real easy I simply make STUFF increase at a constant rate of K g/m3/d. The fortran code looks like
STUFF_flux = K
If I give K a value of 1 g/m3/d then I'd expect STUFF to increase linearly at a rate of 1 g/m3/d, i.e. dSTUFF/dt = k
What I find is that in each grid cell, the rate of change of STUFF is proportional to the total water depth, i.e:
dSTUFF/dt = k*d
where d = total water depth.
Is this depth dependence supposed to happen? Where does it come from?
I am running a 2D model with variable depth (2x2m horizontal resolution), but the same thing happens if I run this as a 2 layer 3D model.
While I could divide by depth to get the rate of change I am expecting, I'll then need to apply some limit if the depth becomes very small (or zero) to avoid errors.
Regards
David
AA
Anonymous Anonymous, modified 6 Years ago.
RE: OpenPLCT processes  why are my fluxes depth dependent?
Jedi Master Posts: 333 Join Date: 7/30/20 Recent Posts 00
Dear David,
Could you tell us more about how you concluded that depth was interfering in the calculation of your flux?
I can only assume that you used what is reported in the MONfile or in the PRNfile (that's how I check). So I created a dummy flux the same way you explained it. And I tested it with random numbers: Initial concentration is 1.45 g/m3, flux is 0.56 g/m3/d, depth is 4.1 m, time step is 1 d. The MONfile of a singlecell run states the following:
As you can see, concentration in "The cell" is indeed increasing at 0.56 g/m3/d (from 1.45 g/m3 to 2.01 g/m3 over a 1 d time step), i.e. exactly the way I prescribed it in the process.
Therefore dSTUFF/dt = k.
Regards,
Mathieu.
Could you tell us more about how you concluded that depth was interfering in the calculation of your flux?
I can only assume that you used what is reported in the MONfile or in the PRNfile (that's how I check). So I created a dummy flux the same way you explained it. And I tested it with random numbers: Initial concentration is 1.45 g/m3, flux is 0.56 g/m3/d, depth is 4.1 m, time step is 1 d. The MONfile of a singlecell run states the following:
TIME STEP 1  
CONCENTRATION  
The cell 1.4500E+00  
MASS  
The cell 5.9450E+00  
PROCESSES  
The cell 0.0000E+00  
TIME STEP 2  
CONCENTRATION  
The cell 2.0100E+00  
MASS  
The cell 8.2410E+00  
PROCESSES  
The cell 2.2960E+00 
As you can see, concentration in "The cell" is indeed increasing at 0.56 g/m3/d (from 1.45 g/m3 to 2.01 g/m3 over a 1 d time step), i.e. exactly the way I prescribed it in the process.
Therefore dSTUFF/dt = k.
Regards,
Mathieu.
DP
David Plew, modified 6 Years ago.
RE: OpenPLCT processes  why are my fluxes depth dependent?
Youngling Posts: 4 Join Date: 10/14/13 Recent Posts 00
Hi Mathieu
Thanks for your reply. After some more experimenting, I find that this deptheffect happens only if I define a nontransported substance  one that is not advected (unticking the transportable option when defining the substance). If I make the substance transportable, then it behaves the same as as your example and as I expected.
I made the substance nontransportable firstly to simplify as much as I could so I could see what the code does, and also as ultimately I want to model benthic processes.
So it appears to me that for nontransported substances, I need to divide the flux by the depth (h) to get the expected growth rate:
For transportable substances dC/dt = k
For nontransportable substances, dC/dt = k/h
Why would a nontransportable substance require the flux to be divided by depth? This is confusing me.
Regards
David
Thanks for your reply. After some more experimenting, I find that this deptheffect happens only if I define a nontransported substance  one that is not advected (unticking the transportable option when defining the substance). If I make the substance transportable, then it behaves the same as as your example and as I expected.
I made the substance nontransportable firstly to simplify as much as I could so I could see what the code does, and also as ultimately I want to model benthic processes.
So it appears to me that for nontransported substances, I need to divide the flux by the depth (h) to get the expected growth rate:
For transportable substances dC/dt = k
For nontransportable substances, dC/dt = k/h
Why would a nontransportable substance require the flux to be divided by depth? This is confusing me.
Regards
David
AA
Anonymous Anonymous, modified 6 Years ago.
RE: OpenPLCT processes  why are my fluxes depth dependent?
Jedi Master Posts: 333 Join Date: 7/30/20 Recent Posts 00
Hi David,
The units you choose for a substance have no impact on the calculations. They are just here to help the user to be consistent.
For active substances the flux to a particular segment is obtained by multiplying your computed flux (mass/volume/time) by the segment's volume, giving mass/segment/time.
For inactive substances the computed flux is assumed in mass/area/time and multiplied by a segment's horizontal surface (i.e. volume/depth) to obtain mass/segment/time again.
Regards,
Chris
The units you choose for a substance have no impact on the calculations. They are just here to help the user to be consistent.
For active substances the flux to a particular segment is obtained by multiplying your computed flux (mass/volume/time) by the segment's volume, giving mass/segment/time.
For inactive substances the computed flux is assumed in mass/area/time and multiplied by a segment's horizontal surface (i.e. volume/depth) to obtain mass/segment/time again.
Regards,
Chris
DP
David Plew, modified 6 Years ago.
RE: OpenPLCT processes  why are my fluxes depth dependent?
Youngling Posts: 4 Join Date: 10/14/13 Recent Posts 00
Hi Chris,
I understand that the units are only there to guide, not affecting the model. But I'm still not understanding dimensionally how the model is adding flux to nontransportable substances.
If nontransportable substances are assumed to be on the bed (i.e. mass/area) and their fluxes are mass/area/time:
X = substance concentration on the bed per unit area (g/m2)
V = segment volume (m3)
A = segment area (m2)
F = flux (g/m2/s) (= k in my example)
The total mass of substance in the segment is M = X*A
Multiplying the flux (mass/area/time) by area gives rate of change of mass per unit time in the segment
dM/dt = F*A (g/s)
How does DELWAQ then calculate X in the next time step?
I was expecting
dX/dt = F*A/A = F (g/m2/s)
But the model output seem to be giving
dX/dt = F*V/A = F*D (g/m/s)
Requiring me to divide by depth to get the result I was expecting. Am I missing something here?
Regards
David
I understand that the units are only there to guide, not affecting the model. But I'm still not understanding dimensionally how the model is adding flux to nontransportable substances.
If nontransportable substances are assumed to be on the bed (i.e. mass/area) and their fluxes are mass/area/time:
X = substance concentration on the bed per unit area (g/m2)
V = segment volume (m3)
A = segment area (m2)
F = flux (g/m2/s) (= k in my example)
The total mass of substance in the segment is M = X*A
Multiplying the flux (mass/area/time) by area gives rate of change of mass per unit time in the segment
dM/dt = F*A (g/s)
How does DELWAQ then calculate X in the next time step?
I was expecting
dX/dt = F*A/A = F (g/m2/s)
But the model output seem to be giving
dX/dt = F*V/A = F*D (g/m/s)
Requiring me to divide by depth to get the result I was expecting. Am I missing something here?
Regards
David
AA
Anonymous Anonymous, modified 6 Years ago.
RE: OpenPLCT processes  why are my fluxes depth dependent?
Jedi Master Posts: 333 Join Date: 7/30/20 Recent Posts 00
Hi David,
My mistake.
Internally all substances are stored as mass per segment. The process contributions are added to those masses as mass/time derivatives. Those derivatives come from the fluxes your process computes by multiplying it with the segment volumes, even if the substance is inactive. Hence you should indeed define you flux as k / depth.
The masses are converted back to concentrations by division by volume and area for active and inacative substances respectively.
Remember that if you plan to use your processes in 3D models you should make sure your benthic processes only take place in segments with a bottom interface. Have a look at section 2.4 of the OPLCT manual if you haven't already.
Regards,
Chris
My mistake.
Internally all substances are stored as mass per segment. The process contributions are added to those masses as mass/time derivatives. Those derivatives come from the fluxes your process computes by multiplying it with the segment volumes, even if the substance is inactive. Hence you should indeed define you flux as k / depth.
The masses are converted back to concentrations by division by volume and area for active and inacative substances respectively.
Remember that if you plan to use your processes in 3D models you should make sure your benthic processes only take place in segments with a bottom interface. Have a look at section 2.4 of the OPLCT manual if you haven't already.
Regards,
Chris
DP
David Plew, modified 6 Years ago.
RE: OpenPLCT processes  why are my fluxes depth dependent? (Answer)
Youngling Posts: 4 Join Date: 10/14/13 Recent Posts 00
Many thanks for clearing that up Chris. Now I understand why the fluxes for inactive/nontransportable substances need to be divided by depth
By the way, if anyone else is looking for it, try section 5.4 (rather than 2.4) of the Open Processes Library Users Manual describes how to determine which segments have a surface and/or bed boundary.
Regards
David
By the way, if anyone else is looking for it, try section 5.4 (rather than 2.4) of the Open Processes Library Users Manual describes how to determine which segments have a surface and/or bed boundary.
Regards
David