Extends from Buildings.BaseClasses.BaseIconExamples (Icon for Examples packages).
Name | Description |
---|---|
DewPointTemperature | Unit test for dew point temperature calculation |
HumidityRatioPressure | Unit test for humidity ratio model |
TotalAirDryAir | Unit test for conversion of humidity per total air and dry air mass |
WetBulbTemperature |
model DewPointTemperature "Unit test for dew point temperature calculation" package Medium = Buildings.Media.PerfectGases.MoistAir "Medium model"; Buildings.Utilities.Psychrometrics.DewPointTemperature_pWat watVapPre; Modelica.Blocks.Sources.Ramp XHum( duration=1, height=(0.01 - 0.1), offset=0.1) "Humidity concentration"; VaporPressure_X humRat(use_p_in=false); VaporPressure_TDP TDewPoi; equation connect(XHum.y, humRat.XWat); connect(humRat.p_w, TDewPoi.p_w); connect(TDewPoi.T, watVapPre.T); end DewPointTemperature;
model HumidityRatioPressure "Unit test for humidity ratio model" package Medium = Buildings.Media.PerfectGases.MoistAir "Medium model"; VaporPressure_X vapPre(use_p_in=true) "Model for humidity ratio"; Modelica.Blocks.Sources.Ramp XHumDryAir( duration=1, height=(0.0133 - 0.2), offset=0.2) "Humidity concentration in [kg/kg dry air]"; Modelica.Blocks.Sources.Constant p(k=101325) "Pressure"; HumidityRatio_pWat humRat(use_p_in=true); Diagnostics.AssertEquality assertEquality(threShold=1E-5) "Checks that model and its inverse implementation are correct"; ToTotalAir toTotalAir; equation connect(vapPre.p_w, humRat.p_w); connect(humRat.XWat, assertEquality.u1); connect(p.y, humRat.p_in); connect(p.y, vapPre.p_in); connect(XHumDryAir.y, toTotalAir.XiDry); connect(toTotalAir.XiTotalAir, vapPre.XWat); connect(toTotalAir.XiTotalAir, assertEquality.u2); end HumidityRatioPressure;
model TotalAirDryAir "Unit test for conversion of humidity per total air and dry air mass" package Medium = Buildings.Media.PerfectGases.MoistAir "Medium model"; Modelica.Blocks.Sources.Ramp XHum( duration=1, height=(0.01 - 0.1), offset=0.1) "Humidity concentration"; ToTotalAir toTotalAir; ToDryAir toDryAir; Diagnostics.AssertEquality assertEquality(threShold=1E-5) "Checks that model and its inverse implementation are correct"; equation connect(toTotalAir.XiDry, XHum.y); connect(toTotalAir.XiTotalAir, toDryAir.XiTotalAir); connect(toDryAir.XiDry, assertEquality.u1); connect(assertEquality.u2, XHum.y); end TotalAirDryAir;
model WetBulbTemperature package Medium = Buildings.Media.PerfectGases.MoistAir "Medium model"; Modelica.Blocks.Sources.Ramp TDB( height=10, duration=1, offset=273.15 + 30) "Dry bulb temperature"; Buildings.Utilities.Diagnostics.AssertEquality assertEquality(startTime=0, threShold=0.05); Modelica.Blocks.Sources.Constant TWBExp(k=273.15 + 25) "Expected wet bulb temperature"; Buildings.Utilities.Psychrometrics.WetBulbTemperature wetBul(redeclare package Medium = Medium) "Model for wet bulb temperature"; Modelica.Blocks.Sources.Constant p(k=101325) "Pressure"; Modelica.Blocks.Sources.Ramp XHum( duration=1, height=(0.0133 - 0.0175), offset=0.0175) "Humidity concentration"; equation connect(TWBExp.y, assertEquality.u2); connect(TDB.y, wetBul.TDryBul); connect(p.y, wetBul.p); connect(wetBul.TWetBul, assertEquality.u1); connect(XHum.y, wetBul.Xi[1]); end WetBulbTemperature;