OpenPLCT processes - why are my fluxes depth dependent?OpenPLCT processes - why are my fluxes depth dependent?https://oss.deltares.nl/c/message_boards/find_thread?p_l_id=1806675&threadId=4597552021-03-05T22:46:28Z2021-03-05T22:46:28ZRE: OpenPLCT processes - why are my fluxes depth dependent?David Plewhttps://oss.deltares.nl/c/message_boards/find_message?p_l_id=1806675&messageId=4627352014-07-30T00:43:45Z2014-07-30T00:43:25ZMany thanks for clearing that up Chris. Now I understand why the fluxes for inactive/non-transportable substances need to be divided by depth<br /><br />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.<br /><br />Regards<br />DavidDavid Plew2014-07-30T00:43:25ZRE: OpenPLCT processes - why are my fluxes depth dependent?Anonymous Anonymoushttps://oss.deltares.nl/c/message_boards/find_message?p_l_id=1806675&messageId=4625592014-07-29T14:00:17Z2014-07-29T13:58:31ZHi David,<br /><br />My mistake.<br /><br />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, <u>even if the substance is inactive</u>. Hence you should indeed define you flux as k / depth.<br /><br />The masses are converted back to concentrations by division by volume and area for active and inacative substances respectively.<br /><br />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.<br /><br />Regards,<br />ChrisAnonymous Anonymous2014-07-29T13:58:31ZRE: OpenPLCT processes - why are my fluxes depth dependent?David Plewhttps://oss.deltares.nl/c/message_boards/find_message?p_l_id=1806675&messageId=4617262014-07-28T10:00:13Z2014-07-28T10:00:13ZHi Chris,<br /><br />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.<br /><br />If non-transportable substances are assumed to be on the bed (i.e. mass/area) and their fluxes are mass/area/time: <br /><br />X = substance concentration on the bed per unit area (g/m2)<br />V = segment volume (m3)<br />A = segment area (m2)<br />F = flux (g/m2/s) (= k in my example)<br /><br />The total mass of substance in the segment is M = X*A<br /><br />Multiplying the flux (mass/area/time) by area gives rate of change of mass per unit time in the segment<br /><br />dM/dt = F*A (g/s)<br /><br />How does DELWAQ then calculate X in the next time step?<br /><br />I was expecting<br />dX/dt = F*A/A = F (g/m2/s)<br /><br />But the model output seem to be giving<br />dX/dt = F*V/A = F*D (g/m/s)<br /><br />Requiring me to divide by depth to get the result I was expecting. Am I missing something here?<br /><br />Regards<br />DavidDavid Plew2014-07-28T10:00:13ZRE: OpenPLCT processes - why are my fluxes depth dependent?Anonymous Anonymoushttps://oss.deltares.nl/c/message_boards/find_message?p_l_id=1806675&messageId=4616702014-07-28T07:18:13Z2014-07-28T07:17:38ZHi David,<br /><br />The units you choose for a substance have no impact on the calculations. They are just here to help the user to be consistent.<br /><br />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.<br />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.<br /><br />Regards,<br />ChrisAnonymous Anonymous2014-07-28T07:17:38ZRE: OpenPLCT processes - why are my fluxes depth dependent?David Plewhttps://oss.deltares.nl/c/message_boards/find_message?p_l_id=1806675&messageId=4615922014-07-28T02:09:50Z2014-07-28T02:09:50ZHi Mathieu<br /><br />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. <br /><br />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. <br /><br />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:<br /><br />For transportable substances dC/dt = k<br />For non-transportable substances, dC/dt = k/h<br /><br />Why would a non-transportable substance require the flux to be divided by depth? This is confusing me. <br /><br /><br />Regards<br />DavidDavid Plew2014-07-28T02:09:50ZRE: OpenPLCT processes - why are my fluxes depth dependent?Anonymous Anonymoushttps://oss.deltares.nl/c/message_boards/find_message?p_l_id=1806675&messageId=4607242014-07-25T17:53:25Z2014-07-25T17:51:16ZDear David,<br />Could you tell us more about how you concluded that depth was interfering in the calculation of your flux?<br /><br />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:<br /><br /><div class="lfr-code"><table><tbody><tr><td class="line-numbers" data-line-number="1"></td><td class="lines"><div class="line">TIME STEP 1</div></td></tr><tr><td class="line-numbers" data-line-number="2"></td><td class="lines"><div class="line">CONCENTRATION </div></td></tr><tr><td class="line-numbers" data-line-number="3"></td><td class="lines"><div class="line"> The cell 1.4500E+00</div></td></tr><tr><td class="line-numbers" data-line-number="4"></td><td class="lines"><div class="line"> MASS </div></td></tr><tr><td class="line-numbers" data-line-number="5"></td><td class="lines"><div class="line"> The cell 5.9450E+00</div></td></tr><tr><td class="line-numbers" data-line-number="6"></td><td class="lines"><div class="line"> PROCESSES </div></td></tr><tr><td class="line-numbers" data-line-number="7"></td><td class="lines"><div class="line"> The cell 0.0000E+00</div></td></tr><tr><td class="line-numbers" data-line-number="8"></td><td class="lines"><div class="line"><br /></div></td></tr><tr><td class="line-numbers" data-line-number="9"></td><td class="lines"><div class="line">TIME STEP 2</div></td></tr><tr><td class="line-numbers" data-line-number="10"></td><td class="lines"><div class="line"> CONCENTRATION </div></td></tr><tr><td class="line-numbers" data-line-number="11"></td><td class="lines"><div class="line"> The cell 2.0100E+00</div></td></tr><tr><td class="line-numbers" data-line-number="12"></td><td class="lines"><div class="line"> MASS </div></td></tr><tr><td class="line-numbers" data-line-number="13"></td><td class="lines"><div class="line"> The cell 8.2410E+00</div></td></tr><tr><td class="line-numbers" data-line-number="14"></td><td class="lines"><div class="line"> PROCESSES </div></td></tr><tr><td class="line-numbers" data-line-number="15"></td><td class="lines"><div class="line"> The cell 2.2960E+00</div></td></tr></tbody></table></div><br /><br />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.<br />Therefore dSTUFF/dt = k.<br /><br />Regards,<br />-Mathieu.Anonymous Anonymous2014-07-25T17:51:16ZOpenPLCT processes - why are my fluxes depth dependent?David Plewhttps://oss.deltares.nl/c/message_boards/find_message?p_l_id=1806675&messageId=4597542014-07-24T06:10:11Z2014-07-24T06:05:00ZI'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.<br /><br />The user manuals tell me that <br /> - Substances are concentrations or density (Pg 6 of the OPL user manual).<br /> - 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.<br /><br />All good and logical so far...<br /><br />But, to illustrate with a very simple example:<br /><br />Using OpenPLCT I create a new substance called STUFF. I give STUFF units of g/m3 because it is a concentration.<br /><br />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<br /> STUFF_flux = K<br /><br />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<br /><br />What I find is that in each grid cell, the rate of change of STUFF is proportional to the total water depth, i.e:<br /> dSTUFF/dt = k*d<br />where d = total water depth. <br /><br />Is this depth dependence supposed to happen? Where does it come from?<br /><br />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.<br /><br />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.<br /><br />Regards<br />DavidDavid Plew2014-07-24T06:05:00Z