EcohydrologyTeam / ClearWater-riverine

A 2D water quality transporter model to calculate conservative advection and diffusion of constituents from an unstructured grid of flows
MIT License
6 stars 0 forks source link

Mass balance differences #78

Closed jrutyna closed 2 weeks ago

jrutyna commented 3 weeks ago

There are some mass balance differences that I think should be investigated further. I expected the mass_start, US_Flow_mass, PwrPlnt_Flow_mass, and CoriolisColdSringCreek_mass to be exactly the same between the mass balance and mass balance answer function. image

sjordan29 commented 2 weeks ago

Dug into this and found that precision issues (float32 vs float64) were the cause for the difference for Mass_start. That has been fixed in the postprocessing utilities.

For the boundaries, this difference is due to the diffusion coefficient. In the "answer" everything is 100 everywhere, so there is effectively no diffusion. However, due to precision errors inherent to the model due to the precision of HEC-RAS output, our model deviates from 100 everywhere, which means that there is diffusion and so there are differences. I did a test increasing the diffusion coefficient from 0 to 0.001 to 0.01 to 0.1, and you can see those errors increase as the diffusion coefficient increases.

Here are the absolute differences and CV.