Fix units mismatch when calculating water mass #86
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The problem
(Copy/pasted from Issue #87):
When calculating the ice mass uptake from the environment in
APCEMM/Code.v05-00/src/Core/LAGRIDPlumeModel.cpp
Lines 326 to 329 in 95ab976
WV_exhaust_is in g but it is combined withicemasswhich is in kg and then divided by 1e3 (which assumes grams).WV_exhaust_is calculated withEI.getH2O()(see LAGRIDPlumeModel.cpp), which returns the water emissions index in g/kg of fuel (see Emission.cpp)icemassis in kg because it is calculated fromIWC()(see Aerosol.cpp), which is in kg/m3 (see Aerosol.cpp)This leads to
WV_exhaust_being effectively 1e3 higher than theicemass, guaranteeing that water is added to (not subtracted from) the environment.Effectively, the bugfix from PR #59 , which attempted to solve the issue of water being double-counted (see Issue #39) resulted in tiny changes to the contrail properties because the bugged equations reduce to the ones prior to the bugfix.
The fix
This PR solves the units mismatch by dividing
WV_exhaust_by 1e3 instead of the whole expression, solving the units mismatch. The other uses ofWV_exhaust_have been checked and verified to be correct.Effects on initialisation
For cases in which APCEMM controls the early plume, the bugfix barely makes a difference to initialisation conditions:

For cases in which I hijacked the early plume, the bugfix works as intended:

See Issue #88 for more details.
(For interest only) Effect on time evolution (hijacked early plume only)
As it can be seen, the ice number decreases sooner in the time evolution, leading to a reduction in the peak ice mass.
Outcomes
The units bug has been fixed, but a new issue has been identified with the vortex formulation. See Issue #88 for more details.