| 170 | } |
| 171 | |
| 172 | AirState::AirState() |
| 173 | : // Set parameters |
| 174 | m_drybulb(20.0), |
| 175 | m_pressure(101325.0), |
| 176 | m_psat(psat(m_drybulb)), |
| 177 | m_phi(0.5) { |
| 178 | // Compute moist air properties, eqns from ASHRAE Fundamentals 2009 Ch. 1, should probably just set all of these |
| 179 | // Water vapor saturation pressure (uses eqns 5 and 6) |
| 180 | double pw = m_phi * m_psat; // Relative humidity, eqn 24 |
| 181 | m_W = 0.621945 * pw / (m_pressure - pw); // Humidity ratio, eqn 22 |
| 182 | // TODO: Use the function above |
| 183 | m_h = 1.006 * m_drybulb + m_W * (2501 + 1.86 * m_drybulb); // Moist air specific enthalpy, eqn 32 |
| 184 | m_v = 0.287042 * (m_drybulb + 273.15) * (1 + 1.607858 * m_W) / m_pressure; // Specific volume, eqn 28 |
| 185 | // Compute the dew point temperature here |
| 186 | boost::optional<double> dewpoint = solveForDewPoint(m_drybulb, pw, 1e-4, 100); |
| 187 | OS_ASSERT(dewpoint); |
| 188 | m_dewpoint = dewpoint.get(); |
| 189 | // Compute the wet bulb temperature here |
| 190 | boost::optional<double> wetbulb = solveForWetBulb(m_drybulb, m_pressure, m_W, 1e-4, 100); |
| 191 | OS_ASSERT(wetbulb); |
| 192 | m_wetbulb = wetbulb.get(); |
| 193 | } |
| 194 | |
| 195 | boost::optional<AirState> AirState::fromDryBulbDewPointPressure(double drybulb, double dewpoint, double pressure) { |
| 196 | AirState state; |
nothing calls this directly
no test coverage detected