MCPcopy Create free account
hub / github.com/CoolProp/CoolProp / RelativeHumidity

Function RelativeHumidity

src/HumidAirProp.cpp:1591–1608  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1589}
1590
1591double RelativeHumidity(double T, double p, double psi_w) {
1592 double p_ws = NAN, f = NAN, p_s = NAN;
1593 if (T >= 273.16) {
1594 // Saturation pressure [Pa]
1595 p_ws = IF97::psat97(T);
1596 } else {
1597 // sublimation pressure [Pa]
1598 p_ws = psub_Ice(T);
1599 }
1600 // Enhancement Factor [-]
1601 f = f_factor(T, p);
1602
1603 // Saturation pressure [Pa]
1604 p_s = f * p_ws;
1605
1606 // Calculate the relative humidity
1607 return psi_w * p / p_s;
1608}
1609
1610void convert_to_SI(const std::string& Name, double& val) {
1611 switch (Name2Type(Name)) {

Callers 1

_HAPropsSI_outputsFunction · 0.85

Calls 2

psub_IceFunction · 0.85
f_factorFunction · 0.85

Tested by

no test coverage detected