Closed Mahendhar1021 closed 6 months ago
I agree that this is a typo! Thanks for bringing it to our attention.
I think the best thing to do is implement the calculation as constants.c_pd * (1.0 - q) + constants.c_pv * q
. That's equivalent to what you derived but makes the physics (specific heat capacities weighted by mass fractions) much more obvious.
I'll patch this (unless you're interested in contributing, in which case feel free to open a PR!).
Current : return constants.c_pd (1.0 + (constants.c_pv / constants.c_pd + 1.0) q)
Proposed modification : return constants.c_pd (1.0 + (constants.c_pv / constants.c_pd - 1.0) q)
Reason: When q(specific humidity) is 0, c_pm = c_pd but when q=1, c_pm should be equal to c_pv, which is not the case.