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

Calculate absolute humidity from temperature and relative humidity #3

Open
vrs01 opened this issue Jul 18, 2017 · 7 comments
Open

Calculate absolute humidity from temperature and relative humidity #3

vrs01 opened this issue Jul 18, 2017 · 7 comments

Comments

@vrs01
Copy link

vrs01 commented Jul 18, 2017

Hi!

I got a bit lost in all of these formulas. Could someone tell what would be the most elegant way to calculate the absolute humidity from a given temperature and a relative humidity value?

Best, vrs01

@mcgibbon
Copy link
Contributor

You can calculate AH from density (rho, in kg/m^3), pressure (p, in Pa), relative humidity (RH, in percent), and temperature (T, in degK) using the following sequence of formulas:

es = 611.2*exp(17.67*(T-273.15)/(T-29.65))
rvs = 0.622*es/(p - es)
rv = RH/100. * rvs
qv = rv/(1 + rv)
AH = qv*rho

You can also use p = rho * Rd * T to calculate one of the three required quantities from the other two.

@vrs01
Copy link
Author

vrs01 commented Jul 18, 2017

can I use the FluidSolver for this?

@mcgibbon
Copy link
Contributor

Yes, using debug=True. Though it should be simpler to use calculate. Specifically:

from atmos import calculate
print(calculate('AH', RH=50., p=1e5, T=300., debug=True)

The second returned value should be a list of functions, and you can look at their docstrings or at their equation property (e.g. rv_from_e_es.equation).

@iamz33
Copy link

iamz33 commented Nov 15, 2019

Hey there, Thanks for the simple sequence of formulas. Its really convenient. Can you please provide reference from where you got the formulas? I want to add them in my report for reference. Many thanks.

@mcgibbon
Copy link
Contributor

@iamz33 when writing I put references down in the docstrings for equations, using an automatic documentation thing I wrote in the equations module. The dictionary ref at the top contains all the references, and for each equation you can see which references it uses in the references argument for @autodoc.

@mcgibbon
Copy link
Contributor

Ah, cool. You can also access the references of the equations using e.g. rv_from_e_es.references.

@iamz33
Copy link

iamz33 commented Nov 18, 2019

Perfect!! Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants