HA_PROPS_SI

Overview

Excel Usage

=HA_PROPS_SI(ha_psi_out, ha_psi_name_one, value_one, ha_psi_name_two, value_two, ha_psi_name_three, value_three)
  • ha_psi_out (str, required): Desired property code (e.g., ‘H’, ‘W’, ‘Vda’).
  • ha_psi_name_one (str, required): Name of first input (e.g., ‘T’).
  • value_one (float, required): Value of first input.
  • ha_psi_name_two (str, required): Name of second input (e.g., ‘P’).
  • value_two (float, required): Value of second input.
  • ha_psi_name_three (str, required): Name of third input (e.g., ‘R’, ‘W’).
  • value_three (float, required): Value of third input.

Returns (float): Calculated property value in SI units.

Examples

Example 1: Enthalpy of standard air (25C, 1atm, 50% RH)

Inputs:

ha_psi_out ha_psi_name_one value_one ha_psi_name_two value_two ha_psi_name_three value_three
H T 298.15 P 101325 R 0.5

Excel formula:

=HA_PROPS_SI("H", "T", 298.15, "P", 101325, "R", 0.5)

Expected output:

50423.45

Example 2: Humidity Ratio (W)

Inputs:

ha_psi_out ha_psi_name_one value_one ha_psi_name_two value_two ha_psi_name_three value_three
W T 298.15 P 101325 R 0.5

Excel formula:

=HA_PROPS_SI("W", "T", 298.15, "P", 101325, "R", 0.5)

Expected output:

0.0099

Example 3: Dew Point Temperature

Inputs:

ha_psi_out ha_psi_name_one value_one ha_psi_name_two value_two ha_psi_name_three value_three
Tdp T 298.15 P 101325 R 0.5

Excel formula:

=HA_PROPS_SI("Tdp", "T", 298.15, "P", 101325, "R", 0.5)

Expected output:

287

Example 4: Volume per unit dry air

Inputs:

ha_psi_out ha_psi_name_one value_one ha_psi_name_two value_two ha_psi_name_three value_three
Vda T 303.15 P 101325 R 0.8

Excel formula:

=HA_PROPS_SI("Vda", "T", 303.15, "P", 101325, "R", 0.8)

Expected output:

0.887

Python Code

import CoolProp.CoolProp as CP

def ha_props_si(ha_psi_out, ha_psi_name_one, value_one, ha_psi_name_two, value_two, ha_psi_name_three, value_three):
    """
    Calculate humid air properties using CoolProp psychrometrics.

    See: https://coolprop.org/coolprop/HighLevelAPI.html#hapropssi-function

    This example function is provided as-is without any representation of accuracy.

    Args:
        ha_psi_out (str): Desired property code (e.g., 'H', 'W', 'Vda'). Valid options: Temperature (T), Pressure (P), Humidity Ratio (W), Relative Humidity (R), Dew Point (Tdp), Wet Bulb (Twb), Enthalpy (H), Entropy (S), Mixture Volume (V), Dry Air Volume (Vda), Viscosity (M), Conductivity (K).
        ha_psi_name_one (str): Name of first input (e.g., 'T'). Valid options: Temperature (T), Pressure (P), Humidity Ratio (W), Relative Humidity (R), Dew Point (Tdp), Wet Bulb (Twb), Enthalpy (H).
        value_one (float): Value of first input.
        ha_psi_name_two (str): Name of second input (e.g., 'P'). Valid options: Temperature (T), Pressure (P), Humidity Ratio (W), Relative Humidity (R), Dew Point (Tdp), Wet Bulb (Twb).
        value_two (float): Value of second input.
        ha_psi_name_three (str): Name of third input (e.g., 'R', 'W'). Valid options: Temperature (T), Pressure (P), Humidity Ratio (W), Relative Humidity (R), Dew Point (Tdp), Wet Bulb (Twb).
        value_three (float): Value of third input.

    Returns:
        float: Calculated property value in SI units.
    """
    try:
        # CoolProp.HAPropsSI(Output, Name1, Prop1, Name2, Prop2, Name3, Prop3)
        result = CP.HAPropsSI(ha_psi_out, ha_psi_name_one, value_one, ha_psi_name_two, value_two, ha_psi_name_three, value_three)
        return float(result)
    except Exception as e:
        return f"Error: {str(e)}"

Online Calculator