Extends from Buildings.BaseClasses.BaseIconExamples (Icon for Examples packages).
Name | Description |
---|---|
ConstantEffectiveness | |
DryCoilDiscretized | |
DryCoilDiscretizedPControl | |
HeaterCoolerPrescribed | |
HexElement | |
WetCoilDiscretized | |
WetCoilDiscretizedPControl |
model ConstantEffectiveness import Buildings; package Medium1 = Buildings.Media.ConstantPropertyLiquidWater; //package Medium2 = Modelica.Media.Air.MoistAir; package Medium2 = Buildings.Media.PerfectGases.MoistAir; Modelica_Fluid.Sources.Boundary_pT sin_2( redeclare package Medium = Medium2, T=273.15 + 10, use_p_in=true, nPorts=1); Modelica.Blocks.Sources.Ramp PIn( offset=101325, height=200, duration=60); Modelica_Fluid.Sources.Boundary_pT sou_2( redeclare package Medium = Medium2, T=273.15 + 5, use_p_in=true, use_T_in=true, nPorts=1); 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); Modelica_Fluid.Sources.Boundary_pT sin_1( redeclare package Medium = Medium1, T=273.15 + 30, use_p_in=true, p=300000, nPorts=1); Modelica_Fluid.Sources.Boundary_pT sou_1( redeclare package Medium = Medium1, p=300000 + 5000, T=273.15 + 50, use_T_in=true, nPorts=1); Modelica.Blocks.Sources.Ramp PSin_1( duration=60, offset=300000, startTime=240, height=10000); Buildings.Fluids.HeatExchangers.ConstantEffectiveness hex(redeclare package Medium1 = Medium1, redeclare package Medium2 = Medium2, m1_flow_nominal=5, m2_flow_nominal=5, dp1_nominal=500, dp2_nominal=10); inner Modelica_Fluid.System system( p_ambient=300000, T_ambient=313.15); equation connect(PIn.y,sou_2. p_in); 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.ports[1], hex.port_a1); connect(hex.port_a2, sou_2.ports[1]); connect(POut.y, sin_2.p_in); connect(hex.port_b1, sin_1.ports[1]); connect(sin_2.ports[1], hex.port_b2); end ConstantEffectiveness;
Type | Name | Default | Description |
---|---|---|---|
Temperature | T_a1_nominal | 60 + 273.15 | [K] |
Temperature | T_b1_nominal | 40 + 273.15 | [K] |
Temperature | T_a2_nominal | 5 + 273.15 | [K] |
Temperature | T_b2_nominal | 20 + 273.15 | [K] |
MassFlowRate | m1_flow_nominal | 5 | Nominal mass flow rate medium 1 [kg/s] |
MassFlowRate | m2_flow_nominal | m1_flow_nominal*4200/1000*(T... | Nominal mass flow rate medium 2 [kg/s] |
model DryCoilDiscretized package Medium1 = Buildings.Media.ConstantPropertyLiquidWater; //package Medium2 = Buildings.Media.PerfectGases.MoistAir; //package Medium2 = Buildings.Media.GasesPTDecoupled.SimpleAir; package Medium2 = Buildings.Media.GasesPTDecoupled.MoistAir; //package Medium2 = Buildings.Media.GasesPTDecoupled.MoistAirNoLiquid; //package Medium2 = Buildings.Media.IdealGases.SimpleAir; parameter Modelica.SIunits.Temperature T_a1_nominal = 60+273.15; parameter Modelica.SIunits.Temperature T_b1_nominal = 40+273.15; parameter Modelica.SIunits.Temperature T_a2_nominal = 5+273.15; parameter Modelica.SIunits.Temperature T_b2_nominal = 20+273.15; parameter Modelica.SIunits.MassFlowRate m1_flow_nominal = 5 "Nominal mass flow rate medium 1"; parameter Modelica.SIunits.MassFlowRate m2_flow_nominal = m1_flow_nominal*4200/1000*(T_a1_nominal-T_b1_nominal)/(T_b2_nominal-T_a2_nominal) "Nominal mass flow rate medium 2"; Buildings.Fluids.HeatExchangers.DryCoilDiscretized hex( redeclare package Medium1 = Medium1, redeclare package Medium2 = Medium2, nPipPar=1, nPipSeg=3, nReg=2, m1_flow_nominal=m1_flow_nominal, m2_flow_nominal=m2_flow_nominal, Q_flow_nominal=m1_flow_nominal*4200*(T_a1_nominal-T_b1_nominal), dT_nominal=((T_a1_nominal - T_b2_nominal) - (T_b1_nominal - T_a2_nominal))/Modelica.Math.log((T_a1_nominal - T_b2_nominal)/(T_b1_nominal - T_a2_nominal)), dp1_nominal=2000, dp2_nominal=200); Modelica_Fluid.Sources.Boundary_pT sin_2( redeclare package Medium = Medium2, T=303.15, use_p_in=true, nPorts=1); Modelica.Blocks.Sources.Ramp PIn( offset=101525, height=-199, duration=60, startTime=120); Modelica_Fluid.Sources.Boundary_pT sou_2( redeclare package Medium = Medium2, use_p_in=true, use_T_in=true, T=283.15, nPorts=1); Modelica.Blocks.Sources.Ramp TWat( duration=60, startTime=60, height=5, offset=273.15 + 60) "Water temperature"; Modelica.Blocks.Sources.Constant TDb(k=273.15 + 5) "Drybulb temperature"; Modelica.Blocks.Sources.Constant POut(k=101325); Modelica_Fluid.Sources.Boundary_pT sin_1( redeclare package Medium = Medium1, p=300000, T=293.15, use_p_in=true, nPorts=1); Modelica_Fluid.Sources.Boundary_pT sou_1( redeclare package Medium = Medium1, p=300000 + 5000, use_T_in=true, T=293.15, nPorts=1); Fluids.FixedResistances.FixedResistanceDpM res_2( from_dp=true, redeclare package Medium = Medium2, m_flow_nominal=m2_flow_nominal, dp_nominal=200); Fluids.FixedResistances.FixedResistanceDpM res_1( from_dp=true, redeclare package Medium = Medium1, m_flow_nominal=m1_flow_nominal, dp_nominal=5000); Modelica.Blocks.Sources.Ramp PSin_1( startTime=240, offset=300000, height=4990, duration=60); inner Modelica_Fluid.System system; equation connect(PIn.y,sou_2. p_in); connect(res_2.port_a, hex.port_b2); connect(hex.port_b1, res_1.port_a); 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.ports[1], hex.port_a1); connect(sin_2.ports[1], res_2.port_b); connect(sin_1.ports[1], res_1.port_b); connect(sou_2.ports[1], hex.port_a2); connect(POut.y, sin_2.p_in); end DryCoilDiscretized;
Type | Name | Default | Description |
---|---|---|---|
Temperature | T_a1_nominal | 60 + 273.15 | [K] |
Temperature | T_b1_nominal | 50 + 273.15 | [K] |
Temperature | T_a2_nominal | 20 + 273.15 | [K] |
Temperature | T_b2_nominal | 40 + 273.15 | [K] |
MassFlowRate | m1_flow_nominal | 5 | Nominal mass flow rate medium 1 [kg/s] |
MassFlowRate | m2_flow_nominal | m1_flow_nominal*4200/1000*(T... | Nominal mass flow rate medium 2 [kg/s] |
model DryCoilDiscretizedPControl import Buildings; package Medium1 = Buildings.Media.ConstantPropertyLiquidWater; //package Medium2 = Buildings.Media.PerfectGases.MoistAir; //package Medium2 = Buildings.Media.GasesPTDecoupled.MoistAir; // package Medium2 = Buildings.Media.GasesPTDecoupled.MoistAirNoLiquid; package Medium2 = Buildings.Media.GasesPTDecoupled.SimpleAir; parameter Modelica.SIunits.Temperature T_a1_nominal = 60+273.15; parameter Modelica.SIunits.Temperature T_b1_nominal = 50+273.15; parameter Modelica.SIunits.Temperature T_a2_nominal = 20+273.15; parameter Modelica.SIunits.Temperature T_b2_nominal = 40+273.15; parameter Modelica.SIunits.MassFlowRate m1_flow_nominal = 5 "Nominal mass flow rate medium 1"; parameter Modelica.SIunits.MassFlowRate m2_flow_nominal = m1_flow_nominal*4200/1000*(T_a1_nominal-T_b1_nominal)/(T_b2_nominal-T_a2_nominal) "Nominal mass flow rate medium 2"; Modelica_Fluid.Sources.Boundary_pT sin_2( redeclare package Medium = Medium2, nPorts=1, use_p_in=false, p(displayUnit="Pa") = 101325, T=303.15); Modelica_Fluid.Sources.Boundary_pT sou_2( redeclare package Medium = Medium2, nPorts=1, use_p_in=false, use_T_in=false, p(displayUnit="Pa") = 101625, T=T_a2_nominal); Modelica_Fluid.Sources.Boundary_pT sin_1( redeclare package Medium = Medium1, p=300000, T=293.15, nPorts=1, use_p_in=true); Modelica_Fluid.Sources.Boundary_pT sou_1( redeclare package Medium = Medium1, p=300000 + 9000, nPorts=1, use_T_in=false, T=T_a1_nominal); Fluids.FixedResistances.FixedResistanceDpM res_2( from_dp=true, redeclare package Medium = Medium2, dp_nominal=100, m_flow_nominal=m2_flow_nominal); Fluids.FixedResistances.FixedResistanceDpM res_1( from_dp=true, redeclare package Medium = Medium1, m_flow_nominal=5, dp_nominal=3000); Modelica.Blocks.Sources.Ramp PSin_1( duration=60, height=5000, startTime=240, offset=300000); Modelica_Fluid.Sensors.TemperatureTwoPort temSen(redeclare package Medium = Medium2); Buildings.Fluids.Actuators.Valves.TwoWayEqualPercentage val( redeclare package Medium = Medium1, l=0.005, Kv_SI=5/sqrt(4000), m_flow_nominal=m1_flow_nominal) "Valve model"; Modelica.Blocks.Math.Gain P(k=1); Modelica.Blocks.Math.Feedback fedBac(u1(displayUnit="degC"), u2(displayUnit="degC")); Modelica.Blocks.Sources.TimeTable TSet(table=[0,298.15; 600,298.15; 600, 303.15; 1200,303.15; 1800,298.15; 2400,298.15; 2400,304.15]) "Setpoint temperature"; Buildings.Fluids.HeatExchangers.DryCoilDiscretized hex( redeclare package Medium1 = Medium1, redeclare package Medium2 = Medium2, nPipPar=1, nPipSeg=3, nReg=4, m1_flow_nominal=m1_flow_nominal, m2_flow_nominal=m2_flow_nominal, Q_flow_nominal=m1_flow_nominal*4200*(T_a1_nominal-T_b1_nominal), dT_nominal=((T_a1_nominal - T_b2_nominal) - (T_b1_nominal - T_a2_nominal))/Modelica.Math.log((T_a1_nominal - T_b2_nominal)/(T_b1_nominal - T_a2_nominal)), dp1_nominal(displayUnit="Pa") = 2000, dp2_nominal(displayUnit="Pa") = 200); Buildings.Fluids.Actuators.Motors.IdealMotor mot(tOpe=60) "Motor model"; inner Modelica_Fluid.System system; equation connect(PSin_1.y, sin_1.p_in); connect(P.u, fedBac.y); connect(temSen.T, fedBac.u2); connect(hex.port_b1, res_1.port_a); connect(val.port_b, hex.port_a1); connect(P.y, mot.u); connect(sou_1.ports[1], val.port_a); connect(sin_1.ports[1], res_1.port_b); connect(sin_2.ports[1], res_2.port_b); connect(sou_2.ports[1], hex.port_a2); connect(TSet.y, fedBac.u1); connect(mot.y, val.y); connect(hex.port_b2, temSen.port_a); connect(temSen.port_b, res_2.port_a); end DryCoilDiscretizedPControl;
Model that tests the basic class that is used for the heater models. It adds and removes heat for forward and reverse flow. The top and bottom models should give similar results, although the sign of the temperature 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.
model HeaterCoolerPrescribed import Buildings; package Medium = Buildings.Media.ConstantPropertyLiquidWater; //package Medium = Modelica.Media.Air.MoistAir; //package Medium = Modelica.Media.Air.SimpleAir; Buildings.Fluids.HeatExchangers.HeaterCoolerPrescribed hea1( redeclare package Medium = Medium, Q_flow_nominal=5000, m_flow_nominal=0.5, dp_nominal=200) "Heater and cooler"; Modelica.Blocks.Sources.Constant TDb(k=293.15) "Drybulb temperature"; Modelica_Fluid.Sources.Boundary_pT sou_1( redeclare package Medium = Medium, use_T_in=true, nPorts=4, p(displayUnit="Pa") = 101735, T=293.15); Buildings.Fluids.FixedResistances.FixedResistanceDpM res_11( from_dp=true, redeclare package Medium = Medium, dp_nominal=5, m_flow_nominal=0.5); Buildings.Fluids.FixedResistances.FixedResistanceDpM res_12( from_dp=true, redeclare package Medium = Medium, dp_nominal=5, m_flow_nominal=0.5); Modelica_Fluid.Sources.Boundary_pT sin_1( redeclare package Medium = Medium, use_p_in=true, T=288.15, nPorts=4); Modelica.Blocks.Sources.Constant POut(k=101325); Modelica.Blocks.Sources.Ramp u( height=2, duration=1, offset=-1, startTime=0) "Control signal"; Buildings.Fluids.HeatExchangers.HeaterCoolerPrescribed hea2( redeclare package Medium = Medium, Q_flow_nominal=5000, m_flow_nominal=0.5, dp_nominal=200) "Heater and cooler"; Modelica.Blocks.Math.Gain gain(k=-1); Buildings.Fluids.HeatExchangers.HeaterCoolerPrescribed hea3( redeclare package Medium = Medium, Q_flow_nominal=5000, m_flow_nominal=0.5, dp_nominal=200) "Heater and cooler"; Buildings.Fluids.FixedResistances.FixedResistanceDpM res_2( from_dp=true, redeclare package Medium = Medium, dp_nominal=5, m_flow_nominal=0.5); Buildings.Fluids.FixedResistances.FixedResistanceDpM res_3( from_dp=true, redeclare package Medium = Medium, dp_nominal=5, m_flow_nominal=0.5); Buildings.Fluids.HeatExchangers.HeaterCoolerPrescribed hea4( redeclare package Medium = Medium, Q_flow_nominal=5000, m_flow_nominal=0.5, dp_nominal=200) "Heater and cooler"; Buildings.Fluids.FixedResistances.FixedResistanceDpM res_4( from_dp=true, redeclare package Medium = Medium, dp_nominal=5, m_flow_nominal=0.5); Buildings.Fluids.MixingVolumes.MixingVolume mix1( redeclare package Medium = Medium, V= 0.000001, nPorts=2); Buildings.Utilities.Diagnostics.AssertEquality ass1(startTime=0.2, threShold= 0.05); Buildings.Utilities.Diagnostics.AssertEquality ass2(startTime=0.2, threShold= 0.05); Buildings.Fluids.HeatExchangers.HeaterCoolerPrescribed hea5( redeclare package Medium = Medium, Q_flow_nominal=5000, m_flow_nominal=0.5, dp_nominal=200) "Heater and cooler"; Buildings.Fluids.FixedResistances.FixedResistanceDpM res_1( from_dp=true, redeclare package Medium = Medium, dp_nominal=5, m_flow_nominal=0.5); Buildings.Fluids.FixedResistances.FixedResistanceDpM res_5( from_dp=true, redeclare package Medium = Medium, dp_nominal=5, m_flow_nominal=0.5); Buildings.Fluids.HeatExchangers.HeaterCoolerPrescribed hea6( redeclare package Medium = Medium, Q_flow_nominal=5000, m_flow_nominal=0.5, dp_nominal=200) "Heater and cooler"; Buildings.Fluids.HeatExchangers.HeaterCoolerPrescribed hea7( redeclare package Medium = Medium, Q_flow_nominal=5000, m_flow_nominal=0.5, dp_nominal=200) "Heater and cooler"; Buildings.Fluids.FixedResistances.FixedResistanceDpM res_6( from_dp=true, redeclare package Medium = Medium, dp_nominal=5, m_flow_nominal=0.5); Buildings.Fluids.FixedResistances.FixedResistanceDpM res_7( from_dp=true, redeclare package Medium = Medium, dp_nominal=5, m_flow_nominal=0.5); Buildings.Fluids.HeatExchangers.HeaterCoolerPrescribed hea8( redeclare package Medium = Medium, Q_flow_nominal=5000, m_flow_nominal=0.5, dp_nominal=200) "Heater and cooler"; Buildings.Fluids.FixedResistances.FixedResistanceDpM res_8( from_dp=true, redeclare package Medium = Medium, dp_nominal=5, m_flow_nominal=0.5); Buildings.Fluids.MixingVolumes.MixingVolume mix2( redeclare package Medium = Medium, V= 0.000001, nPorts=2); Buildings.Utilities.Diagnostics.AssertEquality ass9( startTime= 0.3, threShold=0.05); Buildings.Utilities.Diagnostics.AssertEquality ass10( startTime= 0.3, threShold=0.05); inner Modelica_Fluid.System system(m_flow_start=0); Modelica_Fluid.Sensors.Temperature senTem2a(redeclare package Medium = Medium) "Temperature sensor"; Modelica_Fluid.Sensors.Temperature senTem2b(redeclare package Medium = Medium) "Temperature sensor"; Modelica_Fluid.Sensors.Temperature senTem1a(redeclare package Medium = Medium) "Temperature sensor"; Modelica_Fluid.Sensors.Temperature senTem1b(redeclare package Medium = Medium) "Temperature sensor"; Modelica_Fluid.Sensors.Temperature senTem3a(redeclare package Medium = Medium) "Temperature sensor"; Modelica_Fluid.Sensors.Temperature senTem3b(redeclare package Medium = Medium) "Temperature sensor"; Modelica_Fluid.Sensors.Temperature senTem4a(redeclare package Medium = Medium) "Temperature sensor"; Modelica_Fluid.Sensors.Temperature senTem4b(redeclare package Medium = Medium) "Temperature sensor"; Buildings.Utilities.Diagnostics.AssertEquality ass3(startTime=0.2, threShold= 0.05); Buildings.Utilities.Diagnostics.AssertEquality ass4(startTime=0.2, threShold= 0.05); Buildings.Utilities.Diagnostics.AssertEquality ass5(startTime=0.2, threShold= 0.05); Buildings.Utilities.Diagnostics.AssertEquality ass6(startTime=0.2, threShold= 0.05); Modelica_Fluid.Sensors.Temperature senTem6b(redeclare package Medium = Medium) "Temperature sensor"; Modelica_Fluid.Sensors.Temperature senTem6a(redeclare package Medium = Medium) "Temperature sensor"; Modelica_Fluid.Sensors.Temperature senTem5b(redeclare package Medium = Medium) "Temperature sensor"; Modelica_Fluid.Sensors.Temperature senTem5a(redeclare package Medium = Medium) "Temperature sensor"; Buildings.Utilities.Diagnostics.AssertEquality ass7(startTime=0.2, threShold= 0.05); Buildings.Utilities.Diagnostics.AssertEquality ass8(startTime=0.2, threShold= 0.05); Modelica_Fluid.Sensors.Temperature senTem8b(redeclare package Medium = Medium) "Temperature sensor"; Modelica_Fluid.Sensors.Temperature senTem8a(redeclare package Medium = Medium) "Temperature sensor"; Modelica_Fluid.Sensors.Temperature senTem7b(redeclare package Medium = Medium) "Temperature sensor"; Modelica_Fluid.Sensors.Temperature senTem7a(redeclare package Medium = Medium) "Temperature sensor"; equation connect(POut.y,sin_1. p_in); connect(TDb.y,sou_1. T_in); 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(res_2.port_b, hea3.port_a); connect(u.y, hea3.u); connect(gain.y, hea4.u); connect(res_3.port_b, hea4.port_a); connect(hea4.port_b, res_4.port_b); connect(hea1.port_b, hea2.port_b); connect(res_1.port_b, hea5.port_a); connect(res_5.port_b, hea6.port_a); connect(res_6.port_b,hea7. 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(u.y, hea6.u); connect(u.y, hea8.u); connect(gain.y, hea5.u); connect(gain.y, hea7.u); connect(sin_1.ports[1], res_12.port_a); connect(sin_1.ports[2], res_3.port_a); connect(sou_1.ports[1], res_11.port_a); connect(sou_1.ports[2], res_2.port_a); connect(sin_1.ports[3], res_1.port_a); connect(sin_1.ports[4], res_6.port_a); connect(sou_1.ports[3], res_5.port_a); connect(sou_1.ports[4], res_7.port_a); connect(hea3.port_b, mix1.ports[1]); connect(mix1.ports[2], res_4.port_a); connect(hea7.port_b, mix2.ports[1]); connect(mix2.ports[2], res_8.port_a); connect(hea2.port_a, senTem2a.port); connect(hea2.port_b, senTem2b.port); connect(hea1.port_a, senTem1a.port); connect(hea1.port_b, senTem1b.port); connect(senTem1a.T, ass1.u1); connect(senTem2a.T, ass1.u2); connect(senTem1b.T, ass2.u2); connect(senTem2b.T, ass2.u1); connect(senTem4a.T, ass4.u2); connect(senTem3a.T, ass4.u1); connect(senTem4b.T, ass3.u1); connect(senTem3b.T, ass3.u2); connect(hea3.port_a, senTem3a.port); connect(hea3.port_b, senTem3b.port); connect(hea4.port_a, senTem4a.port); connect(hea4.port_b, senTem4b.port); connect(senTem6a.T, ass6.u2); connect(senTem5a.T, ass6.u1); connect(senTem6b.T, ass5.u1); connect(senTem5b.T, ass5.u2); connect(hea6.port_a, senTem6a.port); connect(hea6.port_b, senTem6b.port); connect(hea5.port_a, senTem5a.port); connect(hea5.port_b, senTem5b.port); connect(senTem8a.T, ass8.u2); connect(senTem7a.T, ass8.u1); connect(senTem8b.T, ass7.u1); connect(senTem7b.T, ass7.u2); connect(hea8.port_a, senTem8a.port); connect(hea8.port_b, senTem8b.port); connect(hea7.port_a, senTem7a.port); connect(hea7.port_b, senTem7b.port); connect(senTem3a.T, ass10.u1); connect(senTem7a.T, ass10.u2); connect(senTem2b.T, ass9.u1); connect(senTem5b.T, ass9.u2); end HeaterCoolerPrescribed;
model HexElement import Buildings; package Medium_W = Buildings.Media.ConstantPropertyLiquidWater; // package Medium_W = Modelica.Media.Air.SimpleAir; // package Medium_A = Buildings.Media.GasesPTDecoupled.SimpleAir; // package Medium_A = Modelica.Media.Air.SimpleAir; // package Medium_A = Modelica.Media.Air.SimpleAir; // package Medium_A = Buildings.Media.PerfectGases.MoistAirNonsaturated; package Medium_A = Buildings.Media.PerfectGases.MoistAir; Modelica_Fluid.Sources.Boundary_pT sin_2( redeclare package Medium = Medium_A, use_p_in=true, use_T_in=true, T=288.15, nPorts=1); Modelica.Blocks.Sources.Ramp PIn( height=20, duration=300, startTime=300, offset=101325); Modelica_Fluid.Sources.Boundary_pT sou_2( redeclare package Medium = Medium_A, use_p_in=true, use_T_in=true, T=283.15, nPorts=1); Modelica.Blocks.Sources.Ramp TWat( startTime=1, height=4, duration=300, offset=303.15) "Water temperature"; Modelica.Blocks.Sources.Constant TDb(k=278.15) "Drybulb temperature"; Modelica.Blocks.Sources.Constant POut(k=101325); Modelica_Fluid.Sources.Boundary_pT sin_1( redeclare package Medium = Medium_W, use_p_in=true, T=288.15, nPorts=1); Modelica_Fluid.Sources.Boundary_pT sou_1( redeclare package Medium = Medium_W, use_T_in=true, nPorts=1, p=101340, T=293.15); Fluids.FixedResistances.FixedResistanceDpM res_22( from_dp=true, m_flow_nominal=5, dp_nominal=5, redeclare package Medium = Medium_A); Fluids.FixedResistances.FixedResistanceDpM res_12( from_dp=true, m_flow_nominal=5, dp_nominal=5, redeclare package Medium = Medium_W); Buildings.Fluids.HeatExchangers.BaseClasses.HexElement hex( m1_flow_nominal=5, m2_flow_nominal=5, UA_nominal=9999, redeclare package Medium1 = Medium_W, redeclare package Medium2 = Medium_A, allowCondensation=false, dp1_nominal=5, dp2_nominal=5); Modelica.Blocks.Sources.Constant TDb1(k=303.15) "Drybulb temperature"; Fluids.FixedResistances.FixedResistanceDpM res_11( from_dp=true, m_flow_nominal=5, dp_nominal=5, redeclare package Medium = Medium_W); Fluids.FixedResistances.FixedResistanceDpM res_21( from_dp=true, m_flow_nominal=5, dp_nominal=5, redeclare package Medium = Medium_A); Modelica.Blocks.Sources.Constant hACon(k=10000) "Convective heat transfer"; inner Modelica_Fluid.System system; equation connect(TDb.y, sou_1.T_in); connect(POut.y, sin_1.p_in); connect(PIn.y, sou_2.p_in); connect(TWat.y, sou_2.T_in); connect(POut.y, sin_2.p_in); connect(hex.port_b1, res_12.port_a); connect(res_22.port_a, hex.port_b2); connect(TDb1.y, sin_2.T_in); connect(res_11.port_b, hex.port_a1); connect(hex.port_a2, res_21.port_b); connect(hACon.y, hex.Gc_1); connect(hACon.y, hex.Gc_2); connect(sou_2.ports[1], res_21.port_a); connect(sin_1.ports[1], res_12.port_b); connect(sou_1.ports[1], res_11.port_a); connect(sin_2.ports[1], res_22.port_b); end HexElement;
Type | Name | Default | Description |
---|---|---|---|
Temperature | T_a1_nominal | 5 + 273.15 | [K] |
Temperature | T_b1_nominal | 10 + 273.15 | [K] |
Temperature | T_a2_nominal | 30 + 273.15 | [K] |
Temperature | T_b2_nominal | 10 + 273.15 | [K] |
MassFlowRate | m1_flow_nominal | 5 | Nominal mass flow rate medium 1 [kg/s] |
MassFlowRate | m2_flow_nominal | m1_flow_nominal*4200/1000*(T... | Nominal mass flow rate medium 2 [kg/s] |
model WetCoilDiscretized import Buildings; package Medium1 = Buildings.Media.ConstantPropertyLiquidWater; //package Medium2 = Buildings.Media.PerfectGases.MoistAir; //package Medium2 = Buildings.Media.GasesPTDecoupled.MoistAir; package Medium2 = Buildings.Media.GasesPTDecoupled.MoistAirNoLiquid; //package Medium2 = Buildings.Media.PerfectGases.MoistAirNonsaturated; parameter Modelica.SIunits.Temperature T_a1_nominal = 5+273.15; parameter Modelica.SIunits.Temperature T_b1_nominal = 10+273.15; parameter Modelica.SIunits.Temperature T_a2_nominal = 30+273.15; parameter Modelica.SIunits.Temperature T_b2_nominal = 10+273.15; parameter Modelica.SIunits.MassFlowRate m1_flow_nominal = 5 "Nominal mass flow rate medium 1"; parameter Modelica.SIunits.MassFlowRate m2_flow_nominal = m1_flow_nominal*4200/1000*(T_a1_nominal-T_b1_nominal)/(T_b2_nominal-T_a2_nominal) "Nominal mass flow rate medium 2"; Buildings.Fluids.HeatExchangers.WetCoilDiscretized hex( redeclare package Medium1 = Medium1, redeclare package Medium2 = Medium2, m1_flow_nominal=m1_flow_nominal, m2_flow_nominal=m2_flow_nominal, Q_flow_nominal=m1_flow_nominal*4200*(T_b1_nominal-T_a1_nominal), dT_nominal=((T_a2_nominal - T_b1_nominal) - (T_b2_nominal - T_a1_nominal))/Modelica.Math.log((T_a2_nominal - T_b1_nominal)/( T_b2_nominal - T_a1_nominal)), dp2_nominal(displayUnit="Pa") = 200, nPipPar=1, nPipSeg=3, nReg=2, dp1_nominal(displayUnit="Pa") = 3000); Modelica_Fluid.Sources.Boundary_pT sin_2( redeclare package Medium = Medium2, nPorts=1, use_p_in=false, p=101325, T=303.15); Modelica.Blocks.Sources.Ramp PIn( duration=60, height=-200, offset=101725, startTime=120); Modelica_Fluid.Sources.Boundary_pT sou_2( redeclare package Medium = Medium2, use_p_in=true, nPorts=1, use_T_in=false, T=293.15); Modelica.Blocks.Sources.Ramp TWat( duration=60, height=15, offset=273.15 + 5, startTime=120) "Water temperature"; Modelica_Fluid.Sources.Boundary_pT sin_1( redeclare package Medium = Medium1, p=300000, T=293.15, use_p_in=true, nPorts=1); Modelica_Fluid.Sources.Boundary_pT sou_1( redeclare package Medium = Medium1, p=300000 + 5000, use_T_in=true, T=293.15, nPorts=1); Fluids.FixedResistances.FixedResistanceDpM res_2( from_dp=true, redeclare package Medium = Medium2, m_flow_nominal=m2_flow_nominal, dp_nominal=200); Fluids.FixedResistances.FixedResistanceDpM res_1( from_dp=true, redeclare package Medium = Medium1, m_flow_nominal=m1_flow_nominal, dp_nominal=2000); Modelica.Blocks.Sources.Ramp PSin_1( duration=60, height=5000, startTime=240, offset=300000); inner Modelica_Fluid.System system; equation connect(res_2.port_a, hex.port_b2); connect(TWat.y, sou_1.T_in); connect(PSin_1.y, sin_1.p_in); connect(sou_1.ports[1], hex.port_a1); connect(res_1.port_b, sin_1.ports[1]); connect(sin_2.ports[1], res_2.port_b); connect(sou_2.ports[1], hex.port_a2); connect(PIn.y, sou_2.p_in); connect(hex.port_b1, res_1.port_a); end WetCoilDiscretized;
Type | Name | Default | Description |
---|---|---|---|
Temperature | T_a1_nominal | 5 + 273.15 | [K] |
Temperature | T_b1_nominal | 10 + 273.15 | [K] |
Temperature | T_a2_nominal | 30 + 273.15 | [K] |
Temperature | T_b2_nominal | 10 + 273.15 | [K] |
MassFlowRate | m1_flow_nominal | 5 | Nominal mass flow rate medium 1 [kg/s] |
MassFlowRate | m2_flow_nominal | m1_flow_nominal*4200/1000*(T... | Nominal mass flow rate medium 2 [kg/s] |
model WetCoilDiscretizedPControl import Buildings; package Medium1 = Buildings.Media.ConstantPropertyLiquidWater; //package Medium2 = Buildings.Media.PerfectGases.MoistAir; package Medium2 = Modelica.Media.Air.MoistAir; //package Medium2 = Buildings.Media.GasesPTDecoupled.MoistAir; // package Medium2 = Buildings.Media.PerfectGases.MoistAirNonsaturated; //package Medium2 = Buildings.Media.PerfectGases.MoistAir; parameter Modelica.SIunits.Temperature T_a1_nominal = 5+273.15; parameter Modelica.SIunits.Temperature T_b1_nominal = 10+273.15; parameter Modelica.SIunits.Temperature T_a2_nominal = 30+273.15; parameter Modelica.SIunits.Temperature T_b2_nominal = 10+273.15; parameter Modelica.SIunits.MassFlowRate m1_flow_nominal = 5 "Nominal mass flow rate medium 1"; parameter Modelica.SIunits.MassFlowRate m2_flow_nominal = m1_flow_nominal*4200/1000*(T_a1_nominal-T_b1_nominal)/(T_b2_nominal-T_a2_nominal) "Nominal mass flow rate medium 2"; Modelica_Fluid.Sources.Boundary_pT sin_2( redeclare package Medium = Medium2, nPorts=1, use_p_in=false, p=101325, T=303.15); Modelica_Fluid.Sources.Boundary_pT sou_2( redeclare package Medium = Medium2, nPorts=1, use_p_in=false, use_T_in=true, p(displayUnit="Pa") = 101725, T=293.15); Modelica_Fluid.Sources.Boundary_pT sin_1( redeclare package Medium = Medium1, p=300000, T=293.15, use_p_in=true, nPorts=1); Modelica_Fluid.Sources.Boundary_pT sou_1( redeclare package Medium = Medium1, p=300000 + 9000, nPorts=1, use_T_in=true, T=278.15); Fluids.FixedResistances.FixedResistanceDpM res_2( from_dp=true, redeclare package Medium = Medium2, dp_nominal=200, m_flow_nominal=m2_flow_nominal); Fluids.FixedResistances.FixedResistanceDpM res_1( from_dp=true, redeclare package Medium = Medium1, dp_nominal=2000, m_flow_nominal=m1_flow_nominal); Modelica.Blocks.Sources.Ramp PSin( duration=60, height=5000, startTime=240, offset=300000); Modelica_Fluid.Sensors.TemperatureTwoPort temSen(redeclare package Medium = Medium2); Buildings.Fluids.Actuators.Valves.TwoWayLinear val( redeclare package Medium = Medium1, Kv_SI=m1_flow_nominal/sqrt(5000), m_flow_nominal=m1_flow_nominal); Modelica.Blocks.Math.Gain P(k=-10); Modelica.Blocks.Math.Feedback fedBac(u1(displayUnit="degC"), u2(displayUnit="degC")); Modelica.Blocks.Sources.TimeTable TSet(table=[0,293.15; 600,293.15; 600, 288.15; 1200,288.15; 1800,288.15; 2400,295.15; 2400,295.15]) "Setpoint temperature"; Modelica.Blocks.Nonlinear.Limiter limiter(uMin=0); Buildings.Fluids.HeatExchangers.WetCoilDiscretized hex( redeclare package Medium1 = Medium1, redeclare package Medium2 = Medium2, nPipPar=1, nPipSeg=3, nReg=4, m1_flow_nominal=m1_flow_nominal, m2_flow_nominal=m2_flow_nominal, Q_flow_nominal=m1_flow_nominal*4200*(T_b1_nominal-T_a1_nominal), dT_nominal=((T_a2_nominal - T_b1_nominal) - (T_b2_nominal - T_a1_nominal))/Modelica.Math.log((T_a2_nominal - T_b1_nominal)/( T_b2_nominal - T_a1_nominal)), dp1_nominal(displayUnit="Pa") = 2000, dp2_nominal(displayUnit="Pa") = 200); inner Modelica_Fluid.System system; Modelica.Blocks.Sources.Step TSou_2( startTime=3000, offset=T_a2_nominal, height=-3); Modelica.Blocks.Sources.Step TSou_1( startTime=3000, height=10, offset=T_a1_nominal); equation connect(PSin.y, sin_1.p_in); connect(P.u, fedBac.y); connect(temSen.T, fedBac.u2); connect(P.y, limiter.u); connect(hex.port_b1, res_1.port_a); connect(sin_2.ports[1], res_2.port_b); connect(sin_1.ports[1], res_1.port_b); connect(sou_2.ports[1], hex.port_a2); connect(hex.port_b2, temSen.port_a); connect(temSen.port_b, res_2.port_a); connect(val.port_b, hex.port_a1); connect(TSet.y, fedBac.u1); connect(sou_1.ports[1], val.port_a); connect(TSou_2.y, sou_2.T_in); connect(TSou_1.y, sou_1.T_in); connect(limiter.y, val.y); end WetCoilDiscretizedPControl;