MCPcopy Create free account
hub / github.com/NatLabRockies/OpenStudio / psat

Function psat

src/utilities/filetypes/EpwFile.cpp:21–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19namespace openstudio {
20
21static double psat(double T) {
22 // Compute water vapor saturation pressure, eqns 5 and 6 from ASHRAE Fundamentals 2009 Ch. 1
23 // This version takes T in C rather than Kelvin since most of the other eqns use C
24 T += 273.15;
25 constexpr double C1 = -5.6745359e+03;
26 constexpr double C2 = 6.3925247e+00;
27 constexpr double C3 = -9.6778430e-03;
28 constexpr double C4 = 6.2215701e-07;
29 constexpr double C5 = 2.0747825e-09;
30 constexpr double C6 = -9.4840240e-13;
31 constexpr double C7 = 4.1635019e+00;
32 constexpr double C8 = -5.8002206e+03;
33 constexpr double C9 = 1.3914993e+00;
34 constexpr double C10 = -4.8640239e-02;
35 constexpr double C11 = 4.1764768e-05;
36 constexpr double C12 = -1.4452093e-08;
37 constexpr double C13 = 6.5459673e+00;
38 double rhs = 0.0;
39 if (T < 273.15) {
40 rhs = C1 / T + C2 + T * (C3 + T * (C4 + T * (C5 + T * C6))) + C7 * std::log(T);
41 } else {
42 rhs = C8 / T + C9 + T * (C10 + T * (C11 + T * C12)) + C13 * std::log(T);
43 }
44 return exp(rhs);
45}
46
47static double psatp(double T, double psat) {
48 // Compute the derivative of the water vapor saturation pressure function (eqns 5 and 6 from

Callers 9

enthalpyFunction · 0.85
enthalpyFromDewPointFunction · 0.85
solveForWetBulbFunction · 0.85
solveForDewPointFunction · 0.85
AirStateMethod · 0.85
toWthStringMethod · 0.85
saturationPressureMethod · 0.85

Calls 1

logFunction · 0.50

Tested by

no test coverage detected