| 1589 | } |
| 1590 | |
| 1591 | double 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 | |
| 1610 | void convert_to_SI(const std::string& Name, double& val) { |
| 1611 | switch (Name2Type(Name)) { |
no test coverage detected