Name | Description |
---|---|
ConstantEffectiveness | |
HumidifierPrescribed |
Type | Name | Default | Description |
---|---|---|---|
replaceable package Medium_1 | Buildings.Media.PerfectGases... | ||
replaceable package Medium_2 | Buildings.Media.PerfectGases... |
Type | Name | Description |
---|---|---|
replaceable package Medium_1 | ||
replaceable package Medium_2 |
model ConstantEffectiveness import Buildings; package Medium_1 = Buildings.Media.PerfectGases.MoistAir; package Medium_2 = Buildings.Media.PerfectGases.MoistAir; Buildings.Fluids.Sources.PrescribedBoundary_pTX sin_2( redeclare package Medium = Medium_2, T=273.15 + 10); Modelica.Blocks.Sources.Ramp PIn( height=200, duration=60, offset=101330); Buildings.Fluids.Sources.PrescribedBoundary_pTX sou_2( redeclare package Medium = Medium_2, T=273.15 + 5); Modelica.Blocks.Sources.Ramp TWat( height=10, duration=60, offset=273.15 + 30, startTime=60) "Water temperature"; Modelica.Blocks.Sources.Constant TDb(k=293.15) "Drybulb temperature"; Modelica.Blocks.Sources.Constant POut(k=101325); Buildings.Fluids.Sources.PrescribedBoundary_pTX sin_1( redeclare package Medium = Medium_1, p=300000, T=273.15 + 30, X={0.012,1 - 0.012}); Buildings.Fluids.Sources.PrescribedBoundary_pTX sou_1( redeclare package Medium = Medium_1, T=273.15 + 50, p=1E5, X={0.012,1 - 0.012}); Fluids.FixedResistances.FixedResistanceDpM res_2( from_dp=true, m0_flow=5, dp0=10, redeclare package Medium = Medium_2); Fluids.FixedResistances.FixedResistanceDpM res_1( from_dp=true, m0_flow=5, redeclare package Medium = Medium_1, dp0=100); Modelica.Blocks.Sources.Ramp PSin_1( duration=60, startTime=240, height=100, offset=1E5 - 110); Buildings.MassExchangers.ConstantEffectiveness hex(redeclare package Medium_1 = Medium_1, redeclare package Medium_2 = Medium_2); equation connect(PIn.y,sou_2. p_in); connect(POut.y,sin_2. p_in); connect(sin_2.port,res_2. port_b); connect(sin_1.port,res_1. port_b); connect(TDb.y, sou_2.T_in); connect(TWat.y, sou_1.T_in); connect(PSin_1.y, sin_1.p_in); connect(sou_1.port, hex.port_a1); connect(res_2.port_a, hex.port_b2); connect(hex.port_a2, sou_2.port); connect(hex.port_b1, res_1.port_a); end ConstantEffectiveness;
Model that tests the basic class that is used for the humidifier model. It adds and removes water for forward and reverse flow. The top and bottom models should give similar results, although the sign of the humidity difference over the components differ because of the reverse flow. The model uses assert statements that will be triggered if results that are expected to be close to each other differ by more than a prescribed threshold.
Type | Name | Default | Description |
---|---|---|---|
replaceable package Medium | Modelica.Media.Air.MoistAir | ||
MassFlowRate | mWat0_flow | 0.001 | Nominal water mass flow rate [kg/s] |
Type | Name | Description |
---|---|---|
replaceable package Medium |
model HumidifierPrescribed import Buildings; package Medium = Modelica.Media.Air.MoistAir; parameter Modelica.SIunits.MassFlowRate mWat0_flow = 0.001 "Nominal water mass flow rate"; Buildings.MassExchangers.HumidifierPrescribed hea1(redeclare package Medium = Medium, m0_flow=mWat0_flow) "Heater and cooler"; Modelica.Blocks.Sources.Constant TDb(k=293.15) "Drybulb temperature"; Buildings.Fluids.Sources.PrescribedBoundary_pTX sou_1( T=293.15, redeclare package Medium = Medium, p=101335); Buildings.Fluids.FixedResistances.FixedResistanceDpM res_11( from_dp=true, redeclare package Medium = Medium, dp0=5, m0_flow=0.5); Buildings.Fluids.FixedResistances.FixedResistanceDpM res_12( from_dp=true, redeclare package Medium = Medium, dp0=5, m0_flow=0.5); Buildings.Fluids.Sources.PrescribedBoundary_pTX sin_1( redeclare package Medium = Medium, T=288.15); Modelica.Blocks.Sources.Constant POut(k=101325); Modelica.Blocks.Sources.Ramp u( duration=1, startTime=0, height=1, offset=0) "Control signal"; Buildings.MassExchangers.HumidifierPrescribed hea2( redeclare package Medium = Medium, m0_flow=mWat0_flow) "Heater and cooler"; Modelica.Blocks.Math.Gain gain(k=-1); Buildings.MassExchangers.HumidifierPrescribed hea3(redeclare package Medium = Medium, m0_flow=mWat0_flow) "Heater and cooler"; Buildings.Fluids.Sources.PrescribedBoundary_pTX sou_2( T=293.15, redeclare package Medium = Medium, p=101335); Buildings.Fluids.FixedResistances.FixedResistanceDpM res_2( from_dp=true, redeclare package Medium = Medium, dp0=5, m0_flow=0.5); Buildings.Fluids.FixedResistances.FixedResistanceDpM res_3( from_dp=true, redeclare package Medium = Medium, dp0=5, m0_flow=0.5); Buildings.Fluids.Sources.PrescribedBoundary_pTX sin_2( redeclare package Medium = Medium, T=288.15); Buildings.MassExchangers.HumidifierPrescribed hea4( redeclare package Medium = Medium, m0_flow=mWat0_flow) "Heater and cooler"; Buildings.Fluids.FixedResistances.FixedResistanceDpM res_4( from_dp=true, redeclare package Medium = Medium, dp0=5, m0_flow=0.5); Modelica_Fluid.Volumes.MixingVolume mix1(redeclare package Medium = Medium, V= 0.000001); Buildings.Utilities.Controls.AssertEquality ass1(threShold=1E-2, startTime= 0.3); Modelica.Blocks.Sources.RealExpression y1(y=hea2.medium_b.T_degC); Modelica.Blocks.Sources.RealExpression y2(y=hea1.medium_b.T_degC); Buildings.Utilities.Controls.AssertEquality ass2(threShold=1E-2, startTime= 0.3); Modelica.Blocks.Sources.RealExpression y3(y=hea2.medium_a.T_degC); Modelica.Blocks.Sources.RealExpression y4(y=hea1.medium_a.T_degC); Buildings.Utilities.Controls.AssertEquality ass3(threShold=1E-2, startTime= 0.3); Modelica.Blocks.Sources.RealExpression y5(y=hea4.medium_b.T_degC); Modelica.Blocks.Sources.RealExpression y6(y=hea3.medium_b.T_degC); Buildings.Utilities.Controls.AssertEquality ass4(threShold=1E-2, startTime= 0.3); Modelica.Blocks.Sources.RealExpression y7(y=hea4.medium_a.T_degC); Modelica.Blocks.Sources.RealExpression y8(y=hea3.medium_a.T_degC); Buildings.MassExchangers.HumidifierPrescribed hea5(redeclare package Medium = Medium, m0_flow=mWat0_flow) "Heater and cooler"; Modelica.Blocks.Sources.Constant TDb1( k=293.15) "Drybulb temperature"; Buildings.Fluids.Sources.PrescribedBoundary_pTX sou_3( T=293.15, redeclare package Medium = Medium, p=101335); Buildings.Fluids.FixedResistances.FixedResistanceDpM res_1( from_dp=true, redeclare package Medium = Medium, dp0=5, m0_flow=0.5); Buildings.Fluids.FixedResistances.FixedResistanceDpM res_5( from_dp=true, redeclare package Medium = Medium, dp0=5, m0_flow=0.5); Buildings.Fluids.Sources.PrescribedBoundary_pTX sin_3( redeclare package Medium = Medium, T=288.15); Modelica.Blocks.Sources.Constant POut1( k=101325); Buildings.MassExchangers.HumidifierPrescribed hea6( redeclare package Medium = Medium, m0_flow=mWat0_flow) "Heater and cooler"; Buildings.MassExchangers.HumidifierPrescribed hea7(redeclare package Medium = Medium, m0_flow=mWat0_flow) "Heater and cooler"; Buildings.Fluids.Sources.PrescribedBoundary_pTX sou_4( T=293.15, redeclare package Medium = Medium, p=101335); Buildings.Fluids.FixedResistances.FixedResistanceDpM res_6( from_dp=true, redeclare package Medium = Medium, dp0=5, m0_flow=0.5); Buildings.Fluids.FixedResistances.FixedResistanceDpM res_7( from_dp=true, redeclare package Medium = Medium, dp0=5, m0_flow=0.5); Buildings.Fluids.Sources.PrescribedBoundary_pTX sin_4( redeclare package Medium = Medium, T=288.15); Buildings.MassExchangers.HumidifierPrescribed hea8( redeclare package Medium = Medium, m0_flow=mWat0_flow) "Heater and cooler"; Buildings.Fluids.FixedResistances.FixedResistanceDpM res_8( from_dp=true, redeclare package Medium = Medium, dp0=5, m0_flow=0.5); Modelica_Fluid.Volumes.MixingVolume mix2(redeclare package Medium = Medium, V= 0.000001); Buildings.Utilities.Controls.AssertEquality ass5(threShold=1E-2, startTime= 0.3); Modelica.Blocks.Sources.RealExpression y9(y=hea6.medium_b.T_degC); Modelica.Blocks.Sources.RealExpression y10( y=hea5.medium_b.T_degC); Buildings.Utilities.Controls.AssertEquality ass6(threShold=1E-2, startTime= 0.3); Modelica.Blocks.Sources.RealExpression y11( y=hea6.medium_a.T_degC); Modelica.Blocks.Sources.RealExpression y12( y=hea5.medium_a.T_degC); Buildings.Utilities.Controls.AssertEquality ass7(threShold=1E-2, startTime= 0.3); Modelica.Blocks.Sources.RealExpression y13( y=hea8.medium_b.T_degC); Modelica.Blocks.Sources.RealExpression y14( y=hea7.medium_b.T_degC); Buildings.Utilities.Controls.AssertEquality ass8(threShold=1E-2, startTime= 0.3); Modelica.Blocks.Sources.RealExpression y15( y=hea8.medium_a.T_degC); Modelica.Blocks.Sources.RealExpression y16( y=hea7.medium_a.T_degC); Buildings.Utilities.Controls.AssertEquality ass9(threShold=1E-2, startTime= 0.3); Modelica.Blocks.Sources.RealExpression y17(y=hea2.medium_b.T_degC); Modelica.Blocks.Sources.RealExpression y18(y=hea5.medium_b.T_degC); Buildings.Utilities.Controls.AssertEquality ass10(threShold=1E-2, startTime= 0.3); Modelica.Blocks.Sources.RealExpression y19(y=hea4.medium_a.T_degC); Modelica.Blocks.Sources.RealExpression y20(y=hea7.medium_a.T_degC); Buildings.Utilities.Controls.AssertEquality ass11(threShold=1E-2, startTime= 0.3); Modelica.Blocks.Sources.RealExpression y21(y=hea2.medium_b.X[1]); Modelica.Blocks.Sources.RealExpression y22(y=hea1.medium_b.X[1]); Buildings.Utilities.Controls.AssertEquality ass12(threShold=1E-2, startTime= 0.3); Modelica.Blocks.Sources.RealExpression y23( y=hea2.medium_a.X[1]); Modelica.Blocks.Sources.RealExpression y24( y=hea1.medium_a.X[1]); Buildings.Utilities.Controls.AssertEquality ass13(threShold=1E-2, startTime= 0.3); Modelica.Blocks.Sources.RealExpression y25( y=hea4.medium_b.X[1]); Modelica.Blocks.Sources.RealExpression y26( y=hea3.medium_b.X[1]); Buildings.Utilities.Controls.AssertEquality ass14(threShold=1E-2, startTime= 0.3); Modelica.Blocks.Sources.RealExpression y27( y=hea4.medium_a.X[1]); Modelica.Blocks.Sources.RealExpression y28( y=hea3.medium_a.X[1]); Buildings.Utilities.Controls.AssertEquality ass15(threShold=1E-2, startTime= 0.3); Modelica.Blocks.Sources.RealExpression y29( y=hea6.medium_b.X[1]); Modelica.Blocks.Sources.RealExpression y30( y=hea5.medium_b.X[1]); Buildings.Utilities.Controls.AssertEquality ass16(threShold=1E-2, startTime= 0.3); Modelica.Blocks.Sources.RealExpression y31( y=hea6.medium_a.X[1]); Modelica.Blocks.Sources.RealExpression y32( y=hea5.medium_a.X[1]); Buildings.Utilities.Controls.AssertEquality ass17(threShold=1E-2, startTime= 0.3); Modelica.Blocks.Sources.RealExpression y33( y=hea8.medium_b.X[1]); Modelica.Blocks.Sources.RealExpression y34( y=hea7.medium_b.X[1]); Buildings.Utilities.Controls.AssertEquality ass18(threShold=1E-2, startTime= 0.3); Modelica.Blocks.Sources.RealExpression y35( y=hea8.medium_a.X[1]); Modelica.Blocks.Sources.RealExpression y36( y=hea7.medium_a.X[1]); Buildings.Utilities.Controls.AssertEquality ass19(threShold=1E-2, startTime= 0.3); Modelica.Blocks.Sources.RealExpression y37(y=hea2.medium_b.X[1]); Modelica.Blocks.Sources.RealExpression y38(y=hea5.medium_b.X[1]); Buildings.Utilities.Controls.AssertEquality ass20(threShold=1E-2, startTime= 0.3); Modelica.Blocks.Sources.RealExpression y39(y=hea4.medium_a.X[1]); Modelica.Blocks.Sources.RealExpression y40(y=hea7.medium_a.X[1]); equation connect(POut.y,sin_1. p_in); connect(sou_1.port,res_11. port_a); connect(TDb.y,sou_1. T_in); connect(sin_1.port, res_12.port_a); connect(res_11.port_b, hea1.port_a); connect(u.y, hea1.u); connect(gain.y, hea2.u); connect(u.y, gain.u); connect(res_12.port_b, hea2.port_a); connect(POut.y,sin_2. p_in); connect(sou_2.port, res_2.port_a); connect(TDb.y,sou_2. T_in); connect(sin_2.port, res_3.port_a); connect(res_2.port_b, hea3.port_a); connect(u.y, hea3.u); connect(gain.y, hea4.u); connect(hea3.port_b, mix1.port_a); connect(mix1.port_b, res_4.port_a); connect(res_3.port_b, hea4.port_a); connect(hea4.port_b, res_4.port_b); connect(hea1.port_b, hea2.port_b); connect(y1.y, ass1.u1); connect(y2.y, ass1.u2); connect(y3.y, ass2.u1); connect(y4.y, ass2.u2); connect(y5.y, ass3.u1); connect(y6.y, ass3.u2); connect(y7.y, ass4.u1); connect(y8.y, ass4.u2); connect(POut1.y, sin_3.p_in); connect(TDb1.y, sou_3.T_in); connect(res_1.port_b, hea5.port_a); connect(res_5.port_b, hea6.port_a); connect(POut1.y, sin_4.p_in); connect(TDb1.y, sou_4.T_in); connect(res_6.port_b,hea7. port_a); connect(hea7.port_b,mix2. port_a); connect(mix2.port_b,res_8. port_a); connect(res_7.port_b,hea8. port_a); connect(hea8.port_b,res_8. port_b); connect(hea5.port_b,hea6. port_b); connect(y9.y,ass5. u1); connect(y10.y, ass5.u2); connect(y11.y, ass6.u1); connect(y12.y, ass6.u2); connect(y13.y, ass7.u1); connect(y14.y, ass7.u2); connect(y15.y, ass8.u1); connect(y16.y, ass8.u2); connect(sou_3.port, res_5.port_a); connect(sin_3.port, res_1.port_a); connect(sin_4.port, res_6.port_a); connect(sou_4.port, res_7.port_a); connect(y17.y,ass9. u1); connect(y18.y,ass9. u2); connect(y19.y, ass10.u1); connect(y20.y, ass10.u2); connect(u.y, hea6.u); connect(u.y, hea8.u); connect(gain.y, hea5.u); connect(gain.y, hea7.u); connect(y21.y, ass11.u1); connect(y22.y, ass11.u2); connect(y23.y, ass12.u1); connect(y24.y, ass12.u2); connect(y25.y, ass13.u1); connect(y26.y, ass13.u2); connect(y27.y, ass14.u1); connect(y28.y, ass14.u2); connect(y29.y, ass15.u1); connect(y30.y, ass15.u2); connect(y31.y, ass16.u1); connect(y32.y, ass16.u2); connect(y33.y, ass17.u1); connect(y34.y, ass17.u2); connect(y35.y, ass18.u1); connect(y36.y, ass18.u2); connect(y37.y, ass19.u1); connect(y38.y, ass19.u2); connect(y39.y, ass20.u1); connect(y40.y, ass20.u2); end HumidifierPrescribed;