Message Boards

Back

OpenPLCT processes - why are my fluxes depth dependent?

DP
David Plew, modified 4 Years ago.

OpenPLCT processes - why are my fluxes depth dependent?

Youngling Posts: 4 Join Date: 10/14/13 Recent Posts
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
delwaq - water quality
Mathieu Chatelain, modified 4 Years ago.

RE: OpenPLCT processes - why are my fluxes depth dependent?

Padawan Posts: 28 Join Date: 12/13/12 Recent Posts
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 MON-file or in the PRN-file (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 MON-file of a single-cell 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 4 Years ago.

RE: OpenPLCT processes - why are my fluxes depth dependent?

Youngling Posts: 4 Join Date: 10/14/13 Recent Posts
Hi Mathieu

Thanks for your reply. After some more experimenting, I find that this depth-effect happens only if I define a non-transported substance - one that is not advected (un-ticking 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 non-transportable 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 non-transported substances, I need to divide the flux by the depth (h) to get the expected growth rate:

For transportable substances dC/dt = k
For non-transportable substances, dC/dt = k/h

Why would a non-transportable substance require the flux to be divided by depth? This is confusing me.


Regards
David
Christophe Thiange, modified 4 Years ago.

RE: OpenPLCT processes - why are my fluxes depth dependent?

Jedi Knight Posts: 125 Join Date: 11/15/12 Recent Posts
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
DP
David Plew, modified 4 Years ago.

RE: OpenPLCT processes - why are my fluxes depth dependent?

Youngling Posts: 4 Join Date: 10/14/13 Recent Posts
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 non-transportable substances.

If non-transportable 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
Christophe Thiange, modified 4 Years ago.

RE: OpenPLCT processes - why are my fluxes depth dependent?

Jedi Knight Posts: 125 Join Date: 11/15/12 Recent Posts
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
DP
David Plew, modified 4 Years ago.

RE: OpenPLCT processes - why are my fluxes depth dependent? (Answer)

Youngling Posts: 4 Join Date: 10/14/13 Recent Posts
Many thanks for clearing that up Chris. Now I understand why the fluxes for inactive/non-transportable 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