Skip to content

Commit

Permalink
Merge branch 'Psychrometrics_Toolkit-#39-UnitCompliance' of https://g…
Browse files Browse the repository at this point in the history
…ithub.com/BHoM/Psychrometrics_Toolkit into Psychrometrics_Toolkit-#39-UnitCompliance
  • Loading branch information
Tom-Kingstone committed Sep 4, 2023
2 parents 8c9fa30 + 906ca65 commit 41fb92b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Psychrometrics_Engine/Compute/FromHumidityRatio.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
using BH.oM.Base.Attributes;
using BH.oM.Base;
using BH.Engine.Base;
using BH.Engine.Units;

namespace BH.Engine.Psychrometrics
{
Expand All @@ -55,13 +56,18 @@ public static Output<double, double, double, double, double, double> FromHumidit
double humidityRatio,
double pressure = 101325)
{
dryBulbTemperature = BH.Engine.Units.Convert.ToDegreeCelsius(dryBulbTemperature);

double Density = DensityHumidityRatio(dryBulbTemperature, humidityRatio, pressure);
double Enthalpy = EnthalpyHumidityRatio(dryBulbTemperature, humidityRatio);
double DewPoint = DewPointHumidityRatio(dryBulbTemperature, humidityRatio, pressure);
double RelativeHumidity = RelativeHumidityHumidityRatio(dryBulbTemperature, humidityRatio, pressure);
double SpecificVolume = SpecificVolumeHumidityRatio(dryBulbTemperature, humidityRatio, pressure);
double WetBulbTemperature = WetBulbHumidityRatio(dryBulbTemperature, humidityRatio, pressure);

DewPoint = BH.Engine.Units.Convert.FromDegreeCelsius(DewPoint);
WetBulbTemperature = BH.Engine.Units.Convert.FromDegreeCelsius(WetBulbTemperature);

return new Output<double, double, double, double, double, double>
{
Item1 = Density,
Expand Down
6 changes: 6 additions & 0 deletions Psychrometrics_Engine/Compute/FromRelativeHumidity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
using BH.oM.Base.Attributes;
using BH.oM.Base;
using BH.Engine.Base;
using BH.Engine.Units;

namespace BH.Engine.Psychrometrics
{
Expand All @@ -55,13 +56,18 @@ public static Output<double, double, double, double, double, double> FromRelativ
double relativeHumidity,
double pressure = 101325)
{
dryBulbTemperature = BH.Engine.Units.Convert.ToDegreeCelsius(dryBulbTemperature);

double Density = DensityRelativeHumidity(dryBulbTemperature, relativeHumidity, pressure);
double Enthalpy = EnthalpyRelativeHumidity(dryBulbTemperature, relativeHumidity, pressure);
double DewPoint = DewPointRelativeHumidity(dryBulbTemperature, relativeHumidity, pressure);
double HumidityRatio = HumidityRatioRelativeHumidity(dryBulbTemperature, relativeHumidity, pressure);
double SpecificVolume = SpecificVolumeRelativeHumidity(dryBulbTemperature, relativeHumidity, pressure);
double WetBulbTemperature = WetBulbTemperatureRelativeHumidity(dryBulbTemperature, relativeHumidity, pressure);

DewPoint = BH.Engine.Units.Convert.FromDegreeCelsius(DewPoint);
WetBulbTemperature = BH.Engine.Units.Convert.FromDegreeCelsius(WetBulbTemperature);

return new Output<double, double, double, double, double, double>
{
Item1 = Density,
Expand Down
6 changes: 6 additions & 0 deletions Psychrometrics_Engine/Compute/FromWetBulbTemperature.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
using BH.oM.Base.Attributes;
using BH.oM.Base;
using BH.Engine.Base;
using BH.Engine.Units;

namespace BH.Engine.Psychrometrics
{
Expand All @@ -55,13 +56,18 @@ public static Output<double, double, double, double, double, double> FromWetBulb
double wetBulbTemperature,
double pressure = 101325)
{
dryBulbTemperature = BH.Engine.Units.Convert.ToDegreeCelsius(dryBulbTemperature);
wetBulbTemperature = BH.Engine.Units.Convert.ToDegreeCelsius(wetBulbTemperature);

double Density = DensityWetBulbTemperature(dryBulbTemperature, wetBulbTemperature, pressure);
double Enthalpy = EnthalpyWetBulbTemperature(dryBulbTemperature, wetBulbTemperature, pressure);
double DewPoint = DewPointWetBulbTemperature(dryBulbTemperature, wetBulbTemperature, pressure);
double HumidityRatio = HumidityRatioWetBulbTemperature(dryBulbTemperature, wetBulbTemperature, pressure);
double RelativeHumidity = RelativeHumidityWetBulbTemperature(dryBulbTemperature, wetBulbTemperature, pressure);
double SpecificVolume = SpecificVolumeWetBulbTemperature(dryBulbTemperature, wetBulbTemperature, pressure);

DewPoint = BH.Engine.Units.Convert.FromDegreeCelsius(DewPoint);

return new Output<double, double, double, double, double, double>
{
Item1 = Density,
Expand Down

0 comments on commit 41fb92b

Please sign in to comment.