private void InitializeStreams() { currentStream.Temperature.Value = 298.15; currentStream.Specify(currentStream.MoistureContentDryBase, 0.009); inputStream.Temperature.Value = 363.15; inputStream.MoistureContentDryBase.Value = 0.009; outputStream.Temperature.Value = 323.15; HasBeenModified(true); }
public ErrorMessage SetState(DryingGasStream gasStream, PointF pt) { double p = pressure.Value; double temperature = (double)pt.X; double humidity = (double)pt.Y; double wetBulb; double dewPoint; double relativeHumidity; HumidGasCalculator humidGasCalculator = GetHumidGasCalculator(); Hashtable varAndValueTable = new Hashtable(); if (gasStream.Temperature.IsSpecified) { if (gasStream.Humidity.IsSpecified) { varAndValueTable.Add(gasStream.MoistureContentDryBase, humidity); } else if (gasStream.WetBulbTemperature.IsSpecified) { wetBulb = humidGasCalculator.GetWetBulbFromDryBulbHumidityAndPressure(temperature, humidity, p); varAndValueTable.Add(gasStream.WetBulbTemperature, wetBulb); } else if (gasStream.DewPoint.IsSpecified) { dewPoint = humidGasCalculator.GetDewPointFromHumidityAndPressure(humidity, p); varAndValueTable.Add(gasStream.DewPoint, dewPoint); } else if (gasStream.RelativeHumidity.IsSpecified) { relativeHumidity = humidGasCalculator.GetRelativeHumidityFromDryBulbHumidityAndPressure(temperature, humidity, p); varAndValueTable.Add(gasStream.RelativeHumidity, relativeHumidity); } varAndValueTable.Add(gasStream.Temperature, temperature); } else if (gasStream.WetBulbTemperature.IsSpecified) { if (outputStream.DewPoint.IsSpecified) { dewPoint = humidGasCalculator.GetDewPointFromHumidityAndPressure(humidity, p); varAndValueTable.Add(gasStream.DewPoint, dewPoint); } else if (gasStream.RelativeHumidity.IsSpecified) { relativeHumidity = humidGasCalculator.GetRelativeHumidityFromDryBulbHumidityAndPressure(temperature, humidity, p); varAndValueTable.Add(currentStream.RelativeHumidity, relativeHumidity); } wetBulb = humidGasCalculator.GetWetBulbFromDryBulbHumidityAndPressure(temperature, humidity, p); varAndValueTable.Add(gasStream.WetBulbTemperature, wetBulb); } else if (gasStream.DewPoint.IsSpecified) { if (gasStream.RelativeHumidity.IsSpecified) { relativeHumidity = humidGasCalculator.GetRelativeHumidityFromDryBulbHumidityAndPressure(temperature, humidity, pressure.Value); varAndValueTable.Add(outputStream.RelativeHumidity, relativeHumidity); } dewPoint = humidGasCalculator.GetDewPointFromHumidityAndPressure(humidity, pressure.Value); varAndValueTable.Add(gasStream.DewPoint, dewPoint); } return(gasStream.Specify(varAndValueTable)); }