Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NaN returned from Span-Wagner function vapor_pressure #33

Open
hflesche opened this issue Oct 31, 2023 · 0 comments
Open

NaN returned from Span-Wagner function vapor_pressure #33

hflesche opened this issue Oct 31, 2023 · 0 comments
Labels
christmas-review Issues and PRs for Christmas review

Comments

@hflesche
Copy link
Contributor

In the span-wagner CO2 function vapor_pressure a runtime warning is encountered for valid values of temperature and pressure:
RuntimeWarning: invalid value encountered in power
inner = _a1 * _t1.0 + _a2 * _t1.5 + _a3 * _t2.0 + _a4 * _t4.0
but the results of the density and velocity is in accordance with the original publication.

The only input to the function is temperature, and it is normalised against CO2_CRITICAL_TEMPERATURE = 304.1282. The variable _t becomes negative for temperatures above the critical temperature, so the function can generate NaN. This is not caught in the calling function below_vapor_pressure = pressure < vapor_pressure(absolute_temperature)

@eivindjahren eivindjahren added the christmas-review Issues and PRs for Christmas review label Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
christmas-review Issues and PRs for Christmas review
Projects
None yet
Development

No branches or pull requests

2 participants