15 const float temp_kelvin = inputs[0];
16 const float temp_celsius = temp_kelvin - 273.15;
17 const float relative_humidity = inputs[1];
18 const float pressure = inputs[2];
21 float saturation_pressure =
22 6.1078 * pow(10, ((7.5 * temp_celsius) / (temp_celsius + 237.3)));
25 const float vapor_pressure_water = relative_humidity * saturation_pressure;
28 const float partial_pressure_dry_air = pressure - vapor_pressure_water;
33 const float molar_mass_dry_air = 0.0289652;
34 const float molar_mass_water_vapor = 0.01801;
35 const float universal_gas_constant = 8.31446;
36 float air_density_humid_air =
37 ((partial_pressure_dry_air * molar_mass_dry_air) +
38 (vapor_pressure_water * molar_mass_water_vapor)) /
39 (universal_gas_constant * temp_kelvin);
41 this->
emit(air_density_humid_air);