Thanks for the tips/support with the Excel challenge. CoolProp is spectacular as is its interconnectivity.
It's unreasonable to expect developers to test on every update of Excel as they occur ... but eventually I'd bet it gets sorted out.
My long term project involves compressor analysis and CoolProp *greatly* eases the calculational cumbersomeness.
interesting that viscosity output parameters are a bit nuisance >> V for PropsSI() .. and .. M for HumidAir::HAPropsSI()
I'd have recommended "mu" throughout.
Some of the AI generated examples are VERY helpful ... and sometimes just a little glitchy. So to give back a little ...
Here's my "Hello CoolProp" main() and its output >>
#include "CoolProp.h"
#include "CoolPropLib.h"
#include "HumidAirProp.h"
#include <iostream>
#include <cstdio>
int main() {
printf("Hello Newbie To CoolProp\n");
// Example 1: Calculate density of water at 300 K and 101325 Pa
double density = CoolProp::PropsSI("D", "T", 300, "P", 101325, "Water");
printf("\n%s[%d]: Density of Water: %+24.18e kg/m^3\n", __func__, __LINE__, density);
// Example 2: Calculate enthalpy of R134a at 273.15 K and quality 0 (saturated liquid)
double enthalpy = CoolProp::PropsSI("H", "T", 300.0, "Q", 0, "R134a");
printf("\n%s[%d]: Enthalpy of R134a: %+24.18e J/kg\n", __func__, __LINE__, enthalpy);
double T = 298.15; // Temperature in Kelvin (25°C)
double P = 101325; // Pressure in Pascals (1 atm)
double R = 0.5; // Relative humidity (50%)
printf("\n%s[%3d]: The following calcs use >> T = 298.15 K, P = 101325 Pa\n", __func__, __LINE__);
double h_pure_air = CoolProp::PropsSI("H", "T", T, "P", P, "air");
printf("\n%s[%d]: Enthalpy --- h_pure_air: %+24.18e J/kg\n", __func__, __LINE__, h_pure_air);
double D_pure_air = CoolProp::PropsSI("D", "T", T, "P", P, "air");
printf("\n%s[%d]: D_pure_air: %+24.18e kg/m^3 Volume_pure_air: %+24.18e m^3/kg\n", __func__, __LINE__, D_pure_air, 1 / D_pure_air);
double viscosity_pure_air = PropsSI("V", "T", T, "P", P, "air");
printf("\n%s[%d]: Dynamic viscosity_pure_air: %+24.18e Pa*s (Compare to zero relative
humidity below.)\n", __func__, __LINE__, viscosity_pure_air);
printf("\n######################################################################\n");
printf("\n\n%s[%d]: Psychometric Calcs Using >> HumidAir::HAPropsSI() --- Relative Humidity = 0.5\n", __func__, __LINE__);
double h_da = HumidAir::HAPropsSI("Hda", "T", T, "P", P, "R", R);
printf("\n%s[%d]: Enthalpy Dry Air Basis --- h_da: %+24.18e J/kg dry air\n", __func__, __LINE__, h_da);
double h_ha = HumidAir::HAPropsSI("Hha", "T", T, "P", P, "R", R);
printf("\n%s[%d]: Enthalpy Humid Air --- h_ha: %+24.18e J/kg humid air\n", __func__, __LINE__, h_ha);
double V_da = HumidAir::HAPropsSI("Vda", "T", T, "P", P, "R", R);
printf("\n%s[%d]: Volume Dry Air Basis --- V_da: %+24.18e m^3/kg dry air\n", __func__, __LINE__, V_da);
double V_ha = HumidAir::HAPropsSI("Vha", "T", T, "P", P, "R", R);
printf("\n%s[%d]: Volume Humid Air --- V_ha: %+24.18e m^3/kg wet air\n", __func__, __LINE__, V_ha);
double Molar_fraction_H2O_air_humid = HumidAir::HAPropsSI("Y", "T", T, "P", P, "R", R);
printf("\n%s[%d]: Molar_fraction_H2O_air_humid: %+24.18e\n", __func__, __LINE__, Molar_fraction_H2O_air_humid);
double viscosity_air_humid = HumidAir::HAPropsSI("M", "T", T, "P", P, "R", 0.0);
printf("\n%s[%d]: Dynamic viscosity_air_humid: %+24.18e Pa*s at Relative humidity = 0.0\n", __func__, __LINE__, viscosity_air_humid);
viscosity_air_humid = HumidAir::HAPropsSI("M", "T", T, "P", P, "R", R);
printf("\n%s[%d]: Dynamic viscosity_air_humid: %+24.18e Pa*s at Relative humidity = 0.50\n", __func__, __LINE__, viscosity_air_humid);
viscosity_air_humid = HumidAir::HAPropsSI("M", "T", T, "P", P, "R", 1.0);
printf("\n%s[%d]: Dynamic viscosity_air_humid: %+24.18e Pa*s at Relative humidity = 1.0\n", __func__, __LINE__, viscosity_air_humid);
printf("\n%s(%d): program paused ...", __func__, __LINE__); system("pause");
return 0;
}
Output >>
Hello Newbie To CoolProp
main[13]: Density of Water: +9.965569352652021280e+02 kg/m^3
main[17]: Enthalpy of R134a: +2.371891840113258222e+05 J/kg
main[ 23]: The following calcs use >> T = 298.15 K, P = 101325 Pa
main[26]: Enthalpy --- h_pure_air: +4.244360439165021526e+05 J/kg
main[29]: D_pure_air: +1.184318483908966435e+00 kg/m^3 Volume_pure_air: +8.443674683683023430e-01 m^3/kg
main[32]: Dynamic viscosity_pure_air: +1.844808216200202516e-05 Pa*s (Compare to zero relative humidity below.)
######################################################################
main[36]: Psychometric Calcs Using >> HumidAir::HAPropsSI() --- Relative Humidity = 0.5
main[38]: Enthalpy Dry Air Basis --- h_da: +5.042345039075703971e+04 J/kg dry air
main[41]: Enthalpy Humid Air --- h_ha: +4.992787927743897308e+04 J/kg humid air
main[44]: Volume Dry Air Basis --- V_da: +8.577882434265996503e-01 m^3/kg dry air
main[47]: Volume Humid Air --- V_ha: +8.493577399308691600e-01 m^3/kg wet air
main[50]: Molar_fraction_H2O_air_humid: +1.570849649916924995e-02
main[53]: Dynamic viscosity_air_humid: +1.844808216200202516e-05 Pa*s at Relative humidity = 0.0
main[56]: Dynamic viscosity_air_humid: +1.835900052184231623e-05 Pa*s at Relative humidity = 0.50
main[59]: Dynamic viscosity_air_humid: +1.826965930958964786e-05 Pa*s at Relative humidity = 1.0
main(61): program paused ...Press any key to continue . . .