AquaticEcoDynamics / libaed-water

Code for the AED water quality model
GNU General Public License v3.0
6 stars 6 forks source link

NCS bed mass units #56

Closed MichaelBarryBMT closed 2 years ago

MichaelBarryBMT commented 2 years ago

H Matt

Two related things:

1) I think the units might need looking at for the calculation of sediment bed mass in one location (the change in this pull request). It seems to be missing the 1e3 conversion factor that is needed to get rho(i) in the right units (g/m3) to have an output of g/m2. The 1e3 conversion is applied elsewhere for the same equation (e.g. lines 297, 406 and 521 - see example below). It doesn't affect what I am doing now because a file is being used to set the sed mass ICs, and the equation that does this reset does include the *1e3 factor, but it might be affecting others.

2) I think "porosity" is defined as air space volume/total volume, or at least I am pretty sure this is how it is thoiught of in industry. A porosity of 0.6 means that 60% of the volume of the soil is air. The way the mass calculations of NCS are implemented is

mass = porosity frac depth * rho

If porosity was set to 0.99 (which would be assumed to be meaning lots of air in the soil), then the bed mass would actually give almost the maximum mass available under this calculation. I think this is reverse of what industry expects. Should the mass calculation be

(1-porosity) frac depth * rho ?

Ta MB

Correct code: (I think) image

matthipsey commented 2 years ago

Thanks MB for picking these up These are done. Plus I made a few other improvements logging sedimentation