Humidity Ratio Calculator: Water-Vapour Mass Fraction in Humid Air

When modelling HVAC systems, condensation, drying processes or any other application involving moist air, most CFD solvers require the water-vapour content to be specified as a mass fraction. This page explains the relationship between relative humidity, specific humidity and mass fraction, provides a saturation pressure lookup table and includes a calculator that converts temperature, relative humidity and pressure into the mass fractions of H2O, O2 and N2.

Specific Humidity (Humidity Ratio)

Specific humidity (also called the humidity ratio) is the mass of water vapour per unit mass of dry air. It is an absolute measure of the moisture content, independent of temperature or pressure. Mathematically:

$$\omega = \frac{m_v}{m_a} \quad \left(\text{kg of water vapour per kg of dry air}\right)$$

where \(m_v\) is the mass of water vapour and \(m_a\) is the mass of dry air. In terms of partial pressures, the same quantity can be expressed as:

$$\omega = \frac{0.622 \, P_v}{P - P_v}$$

Here \(P_v\) is the partial pressure of water vapour and \(P\) is the total (atmospheric) pressure. The constant 0.622 is the ratio of the molar mass of water (18.015 g/mol) to the effective molar mass of dry air (28.964 g/mol).

Relative Humidity

While specific humidity gives an absolute measure, relative humidity (\(\phi\)) expresses how close the air is to saturation at the current temperature:

$$\phi = \frac{P_v}{P_g}$$

where \(P_g\) is the saturation pressure of water at the given temperature. Relative humidity ranges from 0 % (completely dry) to 100 % (saturated). Because warm air can hold more moisture than cold air, the same specific humidity corresponds to a lower relative humidity at higher temperatures. The saturation pressure \(P_g\) for temperatures between 0 °C and 100 °C can be found in Table 1 below.

Calculating the Water-Vapour Mass Fraction

To determine the mass fractions needed for a CFD simulation, the partial pressure of water vapour is first calculated from the known relative humidity and saturation pressure:

$$P_v = \phi \times P_g$$

The specific humidity then follows from the formula for \(\omega\) given above. Finally, the mass fractions of the three species in simplified moist air are:

$$\text{mf}_{H_2O} = \frac{\omega}{1 + \omega}$$

$$\text{mf}_{O_2} = (1 - \text{mf}_{H_2O}) \times 0.23$$

$$\text{mf}_{N_2} = (1 - \text{mf}_{H_2O}) \times 0.77$$

Worked example

Consider a room at 25 °C, 65 % relative humidity and 101 325 Pa total pressure. From Table 1, the saturation pressure at 25 °C is \(P_g\) = 3.1697 kPa. The partial pressure of water vapour becomes:

$$P_v = 0.65 \times 3.1697 = 2.060 \; \text{kPa}$$

The specific humidity is then:

$$\omega = \frac{0.622 \times 2.060}{101.325 - 2.060} = 0.01290 \; \text{kg/kg}$$

In other words, every kilogram of dry air contains 12.9 g of water vapour. The corresponding mass fraction for the CFD input is mfH₂O = 0.01274.

Saturation Pressure of Water (Pg)

Table 1. Saturation pressure of water as a function of temperature.
Temperature [°C] Saturation Pressure Pg [kPa]
0.000.6112
0.010.6117
5.000.8726
10.001.2282
15.001.7057
20.002.3392
25.003.1697
30.004.2467
35.005.6286
40.007.3844
45.009.5944
50.0012.351
55.0015.761
60.0019.946
65.0025.041
70.0031.201
75.0038.595
80.0047.415
85.0057.867
90.0070.182
95.0084.609
100.00101.42

Humidity Ratio Calculator

Calculate the mass fractions of H2O, O2 and N2 in humid air for a given temperature and relative humidity. The calculation is valid for temperatures between 0 and 100 °C.

Input
Output

Disclaimer: The tools, calculators and formulas provided on this website are intended for educational and informational purposes only. While we strive to ensure accuracy, we cannot guarantee that the results will be applicable to your specific circumstances. Users are encouraged to verify results independently and consult a qualified professional if necessary. By using these tools, you acknowledge that the use of any information obtained from this site is at your own risk.

For projects involving complex moisture transport, condensation modelling or multi-zone HVAC simulations, our CFD team can set up and run the full analysis. Thermal comfort in the occupied zone can then be evaluated using the PMV and PPD method. To learn more about the fundamentals, see our course Introduction to Computational Fluid Dynamics.

Frequently asked questions

Common questions about humidity and moisture content in air.

Specific humidity (the humidity ratio) is an absolute measure: it tells you how many grams of water vapour are present per kilogram of dry air, regardless of temperature. Relative humidity is a ratio: it tells you how close the air is to saturation at the current temperature. The same specific humidity corresponds to different relative humidity values depending on temperature, because warmer air can hold more moisture before reaching saturation.

Dry air is approximately 23 % O₂ and 77 % N₂ by mass, with trace amounts of argon, CO₂ and other gases making up less than 1.3 %. For most CFD and HVAC applications, the simplified three-species model is sufficiently accurate. If your application involves combustion, chemical reactions or very precise gas property calculations, a more complete composition should be used.

Most CFD solvers that support multiphase or species-transport models (e.g. ANSYS Fluent, OpenFOAM, STAR-CCM+) accept mass fractions as boundary conditions for inlets and initial conditions. Enter the H₂O mass fraction from this calculator as the water-vapour species fraction; the solver will typically compute the remaining species (O₂, N₂) from the constraint that all mass fractions sum to one. Check your solver's documentation for the exact input format, as some codes work with mole fractions or humidity ratio directly.