Extends from Buildings.BaseClasses.BaseIconExamples (Icon for Examples packages).
Name | Description |
---|---|
ConstantEffectiveness | Model that demonstrates use of a heat exchanger with constant effectiveness |
HeaterCoolerPrescribed | Model that tests a heat exchanger model with reverse flow |
DryEffectivenessNTU | Model that demonstrates use of a heat exchanger without condensation that uses the epsilon-NTU relation |
DryEffectivenessNTUMassFlow | Model of epsilon-NTU dry coil that tests variable mass flow rates |
DryEffectivenessNTUPControl | Model that demonstrates use of a heat exchanger without condensation that uses the epsilon-NTU relation with feedback control |
DryCoilCounterFlowMassFlow | Model of a cooling coil that tests variable mass flow rates |
WetCoilCounterFlowMassFlow | Model of a cooling coil that tests variable mass flow rates |
DryCoilCounterFlowPControl | Model that demonstrates use of a heat exchanger without condensation and with feedback control |
WetCoilCounterFlowPControl | Model that demonstrates use of a heat exchanger with condensation and with feedback control |
DryCoilDiscretized | Model that demonstrates use of a finite volume model of a heat exchanger without condensation |
WetCoilDiscretized | Model that demonstrates use of a finite volume model of a heat exchanger with condensation |
DryCoilDiscretizedPControl | Model that demonstrates use of a finite volume model of a heat exchanger without condensation and with feedback control |
WetCoilDiscretizedPControl | Model that demonstrates use of a finite volume model of a heat exchanger with condensation and feedback control |
BaseClasses | Package with base classes for example models |
model ConstantEffectiveness "Model that demonstrates use of a heat exchanger with constant effectiveness" import Buildings; package Medium1 = Buildings.Media.ConstantPropertyLiquidWater; //package Medium2 = Modelica.Media.Air.MoistAir; // package Medium2 = Buildings.Media.PerfectGases.MoistAir; //package Medium2 = Buildings.Media.PerfectGases.MoistAirUnsaturated; //package Medium2 = Buildings.Media.GasesPTDecoupled.MoistAir; package Medium2 = Buildings.Media.GasesPTDecoupled.MoistAirUnsaturated;Buildings.Fluid.Sources.Boundary_pT sin_2( redeclare package Medium = Medium2, use_p_in=true, nPorts=1, T=273.15 + 10, X={0.001,0.999}); Modelica.Blocks.Sources.Ramp PIn( height=200, duration=60, offset=101325, startTime=50); Buildings.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); Buildings.Fluid.Sources.Boundary_pT sin_1( redeclare package Medium = Medium1, use_p_in=true, nPorts=1, p=300000, T=273.15 + 25); Buildings.Fluid.Sources.Boundary_pT sou_1( redeclare package Medium = Medium1, p=300000 + 5000, T=273.15 + 50, use_T_in=true, nPorts=1); Buildings.Fluid.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); Modelica.Blocks.Sources.Trapezoid trapezoid( amplitude=5000, rising=10, width=100, falling=10, period=3600, offset=300000); equationconnect(PIn.y,sou_2. p_in); connect(TDb.y, sou_2.T_in); connect(TWat.y, sou_1.T_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); connect(trapezoid.y, sin_1.p_in); end ConstantEffectiveness;
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 "Model that tests a heat exchanger model with reverse flow" import Buildings; package Medium = Buildings.Media.ConstantPropertyLiquidWater; //package Medium = Modelica.Media.Air.MoistAir; //package Medium = Modelica.Media.Air.SimpleAir;Buildings.Fluid.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"; Buildings.Fluid.Sources.Boundary_pT sou_1( redeclare package Medium = Medium, use_T_in=true, nPorts=4, p(displayUnit="Pa") = 101735, T=293.15); Buildings.Fluid.FixedResistances.FixedResistanceDpM res_11( redeclare package Medium = Medium, dp_nominal=5, m_flow_nominal=0.5); Buildings.Fluid.FixedResistances.FixedResistanceDpM res_12( redeclare package Medium = Medium, dp_nominal=5, m_flow_nominal=0.5); Buildings.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.Fluid.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.Fluid.HeatExchangers.HeaterCoolerPrescribed hea3( redeclare package Medium = Medium, Q_flow_nominal=5000, m_flow_nominal=0.5, dp_nominal=200) "Heater and cooler"; Buildings.Fluid.FixedResistances.FixedResistanceDpM res_2( redeclare package Medium = Medium, dp_nominal=5, m_flow_nominal=0.5); Buildings.Fluid.FixedResistances.FixedResistanceDpM res_3( redeclare package Medium = Medium, dp_nominal=5, m_flow_nominal=0.5); Buildings.Fluid.HeatExchangers.HeaterCoolerPrescribed hea4( redeclare package Medium = Medium, Q_flow_nominal=5000, m_flow_nominal=0.5, dp_nominal=200) "Heater and cooler"; Buildings.Fluid.FixedResistances.FixedResistanceDpM res_4( redeclare package Medium = Medium, dp_nominal=5, m_flow_nominal=0.5); Buildings.Fluid.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.Fluid.HeatExchangers.HeaterCoolerPrescribed hea5( redeclare package Medium = Medium, Q_flow_nominal=5000, m_flow_nominal=0.5, dp_nominal=200) "Heater and cooler"; Buildings.Fluid.FixedResistances.FixedResistanceDpM res_1( redeclare package Medium = Medium, dp_nominal=5, m_flow_nominal=0.5); Buildings.Fluid.FixedResistances.FixedResistanceDpM res_5( redeclare package Medium = Medium, dp_nominal=5, m_flow_nominal=0.5); Buildings.Fluid.HeatExchangers.HeaterCoolerPrescribed hea6( redeclare package Medium = Medium, Q_flow_nominal=5000, m_flow_nominal=0.5, dp_nominal=200) "Heater and cooler"; Buildings.Fluid.HeatExchangers.HeaterCoolerPrescribed hea7( redeclare package Medium = Medium, Q_flow_nominal=5000, m_flow_nominal=0.5, dp_nominal=200) "Heater and cooler"; Buildings.Fluid.FixedResistances.FixedResistanceDpM res_6( redeclare package Medium = Medium, dp_nominal=5, m_flow_nominal=0.5); Buildings.Fluid.FixedResistances.FixedResistanceDpM res_7( redeclare package Medium = Medium, dp_nominal=5, m_flow_nominal=0.5); Buildings.Fluid.HeatExchangers.HeaterCoolerPrescribed hea8( redeclare package Medium = Medium, Q_flow_nominal=5000, m_flow_nominal=0.5, dp_nominal=200) "Heater and cooler"; Buildings.Fluid.FixedResistances.FixedResistanceDpM res_8( redeclare package Medium = Medium, dp_nominal=5, m_flow_nominal=0.5); Buildings.Fluid.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); Buildings.Fluid.Sensors.Temperature senTem2a(redeclare package Medium = Medium) "Temperature sensor"; Buildings.Fluid.Sensors.Temperature senTem2b(redeclare package Medium = Medium) "Temperature sensor"; Buildings.Fluid.Sensors.Temperature senTem1a(redeclare package Medium = Medium) "Temperature sensor"; Buildings.Fluid.Sensors.Temperature senTem1b(redeclare package Medium = Medium) "Temperature sensor"; Buildings.Fluid.Sensors.Temperature senTem3a(redeclare package Medium = Medium) "Temperature sensor"; Buildings.Fluid.Sensors.Temperature senTem3b(redeclare package Medium = Medium) "Temperature sensor"; Buildings.Fluid.Sensors.Temperature senTem4a(redeclare package Medium = Medium) "Temperature sensor"; Buildings.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); Buildings.Fluid.Sensors.Temperature senTem6b(redeclare package Medium = Medium) "Temperature sensor"; Buildings.Fluid.Sensors.Temperature senTem6a(redeclare package Medium = Medium) "Temperature sensor"; Buildings.Fluid.Sensors.Temperature senTem5b(redeclare package Medium = Medium) "Temperature sensor"; Buildings.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); Buildings.Fluid.Sensors.Temperature senTem8b(redeclare package Medium = Medium) "Temperature sensor"; Buildings.Fluid.Sensors.Temperature senTem8a(redeclare package Medium = Medium) "Temperature sensor"; Buildings.Fluid.Sensors.Temperature senTem7b(redeclare package Medium = Medium) "Temperature sensor"; Buildings.Fluid.Sensors.Temperature senTem7a(redeclare package Medium = Medium) "Temperature sensor"; equationconnect(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;
Type | Name | Default | Description |
---|---|---|---|
SpecificHeatCapacity | cp1 | Medium1.specificHeatCapacity... | Specific heat capacity of medium 2 [J/(kg.K)] |
SpecificHeatCapacity | cp2 | Medium2.specificHeatCapacity... | Specific heat capacity of medium 2 [J/(kg.K)] |
MassFlowRate | m1_flow | 5 | Nominal mass flow rate medium 1 [kg/s] |
MassFlowRate | m2_flow | m1_flow*cp1/cp2 | Nominal mass flow rate medium 2 [kg/s] |
model DryEffectivenessNTU "Model that demonstrates use of a heat exchanger without condensation that uses the epsilon-NTU relation" import Buildings; package Medium1 = Buildings.Media.ConstantPropertyLiquidWater; //package Medium2 = Modelica.Media.Air.MoistAir; // package Medium2 = Buildings.Media.PerfectGases.MoistAir; //package Medium2 = Buildings.Media.PerfectGases.MoistAirUnsaturated; //package Medium2 = Buildings.Media.GasesPTDecoupled.MoistAir; // package Medium2 = Buildings.Media.GasesPTDecoupled.MoistAirUnsaturated; package Medium2 = Buildings.Media.IdealGases.SimpleAir; //package Medium2 = Medium1; parameter Modelica.SIunits.SpecificHeatCapacity cp1= Medium1.specificHeatCapacityCp( Medium1.setState_pTX(Medium1.p_default, Medium1.T_default, Medium1.X_default)) "Specific heat capacity of medium 2"; parameter Modelica.SIunits.SpecificHeatCapacity cp2= Medium2.specificHeatCapacityCp( Medium2.setState_pTX(Medium2.p_default, Medium2.T_default, Medium2.X_default)) "Specific heat capacity of medium 2"; parameter Modelica.SIunits.MassFlowRate m1_flow = 5 "Nominal mass flow rate medium 1"; parameter Modelica.SIunits.MassFlowRate m2_flow = m1_flow*cp1/ cp2 "Nominal mass flow rate medium 2";Buildings.Fluid.Sources.Boundary_pT sin_2( redeclare package Medium = Medium2, use_p_in=true, nPorts=5, T=273.15 + 10); Modelica.Blocks.Sources.Ramp PIn( height=200, duration=60, offset=101325, startTime=100); Buildings.Fluid.Sources.Boundary_pT sou_2( redeclare package Medium = Medium2, T=273.15 + 5, use_p_in=true, use_T_in=true, nPorts=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.Fluid.Sources.Boundary_pT sin_1( redeclare package Medium = Medium1, use_p_in=true, nPorts=5, p=300000, T=273.15 + 25); Buildings.Fluid.Sources.Boundary_pT sou_1( redeclare package Medium = Medium1, p=300000 + 5000, T=273.15 + 50, use_T_in=true, nPorts=5); Buildings.Fluid.HeatExchangers.DryEffectivenessNTU hexPar( redeclare package Medium1 = Medium1, redeclare package Medium2 = Medium2, dp1_nominal=500, dp2_nominal=10, m1_flow_nominal=m1_flow, m2_flow_nominal=m2_flow, Q_flow_nominal=m2_flow*cp2*(24 - 20), T_a1_nominal=303.15, T_a2_nominal=293.15, configuration=Buildings.Fluid.Types.HeatExchangerConfiguration.ParallelFlow); inner Modelica.Fluid.System system( p_ambient=300000, T_ambient=313.15); Buildings.Fluid.HeatExchangers.DryEffectivenessNTU hexCou( redeclare package Medium1 = Medium1, redeclare package Medium2 = Medium2, dp1_nominal=500, dp2_nominal=10, m1_flow_nominal=m1_flow, m2_flow_nominal=m2_flow, Q_flow_nominal=m2_flow*cp2*(24 - 20), T_a1_nominal=303.15, T_a2_nominal=293.15, configuration=Buildings.Fluid.Types.HeatExchangerConfiguration.CounterFlow); Buildings.Fluid.HeatExchangers.DryEffectivenessNTU hexCroC1Mix( redeclare package Medium1 = Medium1, redeclare package Medium2 = Medium2, dp1_nominal=500, dp2_nominal=10, m1_flow_nominal=m1_flow, m2_flow_nominal=m2_flow, Q_flow_nominal=m2_flow*cp2*(24 - 20), T_a1_nominal=303.15, T_a2_nominal=293.15, configuration=Buildings.Fluid.Types.HeatExchangerConfiguration.CrossFlowStream1MixedStream2Unmixed); Buildings.Fluid.HeatExchangers.DryEffectivenessNTU hexCroC1Unm( redeclare package Medium1 = Medium1, redeclare package Medium2 = Medium2, dp1_nominal=500, dp2_nominal=10, m1_flow_nominal=m1_flow, m2_flow_nominal=m2_flow, Q_flow_nominal=m2_flow*cp2*(24 - 20), T_a1_nominal=303.15, T_a2_nominal=293.15, configuration=Buildings.Fluid.Types.HeatExchangerConfiguration.CrossFlowStream1UnmixedStream2Mixed); Buildings.Fluid.HeatExchangers.DryEffectivenessNTU hexCroUnm( redeclare package Medium1 = Medium1, redeclare package Medium2 = Medium2, dp1_nominal=500, dp2_nominal=10, m1_flow_nominal=m1_flow, m2_flow_nominal=m2_flow, Q_flow_nominal=m2_flow*cp2*(24 - 20), T_a1_nominal=303.15, T_a2_nominal=293.15, configuration=Buildings.Fluid.Types.HeatExchangerConfiguration.CrossFlowUnmixed); Modelica.Blocks.Sources.Trapezoid trapezoid( amplitude=5000, rising=10, width=100, falling=10, period=3600, offset=300000); equationconnect(PIn.y,sou_2. p_in); connect(TDb.y, sou_2.T_in); connect(TWat.y, sou_1.T_in); connect(sou_1.ports[1], hexPar.port_a1); connect(hexPar.port_a2, sou_2.ports[1]); connect(POut.y, sin_2.p_in); connect(hexPar.port_b1, sin_1.ports[1]); connect(sin_2.ports[1], hexPar.port_b2); connect(hexCou.port_a1, sou_1.ports[2]); connect(hexCroC1Mix.port_a1, sou_1.ports[3]); connect(hexCroC1Unm.port_a1, sou_1.ports[4]); connect(hexCou.port_b2, sin_2.ports[2]); connect(hexCroC1Mix.port_b2, sin_2.ports[3]); connect(hexCroC1Unm.port_b2, sin_2.ports[4]); connect(hexCou.port_b1, sin_1.ports[2]); connect(hexCroC1Mix.port_b1, sin_1.ports[3]); connect(hexCroC1Unm.port_b1, sin_1.ports[4]); connect(hexCou.port_a2, sou_2.ports[2]); connect(hexCroC1Mix.port_a2, sou_2.ports[3]); connect(hexCroC1Unm.port_a2, sou_2.ports[4]); connect(hexCroUnm.port_a1, sou_1.ports[5]); connect(hexCroUnm.port_b2, sin_2.ports[5]); connect(hexCroUnm.port_b1, sin_1.ports[5]); connect(hexCroUnm.port_a2, sou_2.ports[5]); connect(trapezoid.y, sin_1.p_in); end DryEffectivenessNTU;
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 | 15 + 273.15 | [K] |
HeatFlowRate | Q_flow_nominal | m1_flow_nominal*4200*(T_a1_n... | Nominal heat transfer [W] |
MassFlowRate | m1_flow_nominal | 0.1 | 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 DryEffectivenessNTUMassFlow "Model of epsilon-NTU dry coil that tests variable mass flow rates" import Buildings; extends Buildings.Fluid.HeatExchangers.Examples.BaseClasses.EffectivenessNTUMassFlow ( sou_1(nPorts=1), sin_1(nPorts=1), sou_2(nPorts=1), sin_2(nPorts=1));Buildings.Fluid.HeatExchangers.DryEffectivenessNTU hex( redeclare package Medium1 = Medium1, redeclare package Medium2 = Medium2, m1_flow_nominal=m1_flow_nominal, m2_flow_nominal=m2_flow_nominal, dp2_nominal(displayUnit="Pa") = 200, configuration=Buildings.Fluid.Types.HeatExchangerConfiguration.CounterFlow, allowFlowReversal1=true, allowFlowReversal2=true, dp1_nominal(displayUnit="Pa") = 3000, Q_flow_nominal=Q_flow_nominal, T_a1_nominal=T_a1_nominal, T_a2_nominal=T_a2_nominal); Buildings.Fluid.Sensors.RelativeHumidityTwoPort senRelHum( redeclare package Medium = Medium2, m_flow_nominal=m2_flow_nominal); equationconnect(sou_1.ports[1], hex.port_a1); connect(hex.port_b1, sin_1.ports[1]); connect(hex.port_a2, sou_2.ports[1]); connect(senRelHum.port_a, hex.port_b2); connect(senRelHum.port_b, sin_2.ports[1]); end DryEffectivenessNTUMassFlow;
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 DryEffectivenessNTUPControl "Model that demonstrates use of a heat exchanger without condensation that uses the epsilon-NTU relation with feedback control" import Buildings; package Medium1 = Buildings.Media.ConstantPropertyLiquidWater; //package Medium2 = Buildings.Media.PerfectGases.MoistAir; //package Medium2 = Buildings.Media.GasesPTDecoupled.MoistAir; // package Medium2 = Buildings.Media.GasesPTDecoupled.MoistAirUnsaturated; 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";Buildings.Fluid.Sources.Boundary_pT sin_2( redeclare package Medium = Medium2, nPorts=1, use_p_in=false, p(displayUnit="Pa") = 101325, T=303.15); Buildings.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); Buildings.Fluid.Sources.Boundary_pT sin_1( redeclare package Medium = Medium1, p=300000, T=293.15, nPorts=1, use_p_in=true); Buildings.Fluid.Sources.Boundary_pT sou_1( redeclare package Medium = Medium1, p=300000 + 9000, nPorts=1, use_T_in=false, T=T_a1_nominal); Fluid.FixedResistances.FixedResistanceDpM res_2( from_dp=true, redeclare package Medium = Medium2, m_flow_nominal=m2_flow_nominal, dp_nominal=200 + 100); Fluid.FixedResistances.FixedResistanceDpM res_1( from_dp=true, redeclare package Medium = Medium1, m_flow_nominal=5, dp_nominal=2000 + 3000); Modelica.Blocks.Sources.Ramp PSin_1( duration=60, height=5000, startTime=240, offset=300000); Buildings.Fluid.Sensors.TemperatureTwoPort temSen(redeclare package Medium = Medium2, m_flow_nominal=m2_flow_nominal); Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage val( redeclare package Medium = Medium1, l=0.005, Kv_SI=5/sqrt(4000), m_flow_nominal=m1_flow_nominal) "Valve model"; Buildings.Controls.Continuous.LimPID P( k=1, Ti=60, controllerType=Modelica.Blocks.Types.SimpleController.P); Modelica.Blocks.Sources.TimeTable TSet(table=[0,330.15; 600,298.15; 600, 303.15; 1200,303.15; 1800,298.15; 2400,298.15; 2400,304.15]) "Setpoint temperature"; Buildings.Fluid.HeatExchangers.DryEffectivenessNTU 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_a1_nominal-T_b1_nominal), configuration=Buildings.Fluid.Types.HeatExchangerConfiguration.CounterFlow, T_a1_nominal=T_a1_nominal, T_a2_nominal=T_a2_nominal, dp1_nominal(displayUnit="Pa") = 0, dp2_nominal(displayUnit="Pa") = 0); Buildings.Fluid.Actuators.Motors.IdealMotor mot(tOpe=60) "Motor model"; inner Modelica.Fluid.System system; equationconnect(PSin_1.y, sin_1.p_in); connect(hex.port_b1, res_1.port_a); connect(val.port_b, hex.port_a1); 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(hex.port_b2, temSen.port_a); connect(temSen.port_b, res_2.port_a); connect(TSet.y, P.u_s); connect(temSen.T, P.u_m); connect(mot.y, val.y); connect(P.y, mot.u); end DryEffectivenessNTUPControl;
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 | 15 + 273.15 | [K] |
HeatFlowRate | Q_flow_nominal | m1_flow_nominal*4200*(T_a1_n... | Nominal heat transfer [W] |
MassFlowRate | m1_flow_nominal | 0.1 | 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 DryCoilCounterFlowMassFlow "Model of a cooling coil that tests variable mass flow rates" extends Buildings.Fluid.HeatExchangers.Examples.BaseClasses.EffectivenessNTUMassFlow ( sou_1(nPorts=1), sin_1(nPorts=1), sou_2(nPorts=1), sin_2(nPorts=1));DryCoilCounterFlow hex( redeclare package Medium1 = Medium1, redeclare package Medium2 = Medium2, m1_flow_nominal=m1_flow_nominal, m2_flow_nominal=m2_flow_nominal, dp2_nominal(displayUnit="Pa") = 200, allowFlowReversal1=true, allowFlowReversal2=true, dp1_nominal(displayUnit="Pa") = 3000, UA_nominal=Q_flow_nominal/Buildings.Fluid.HeatExchangers.BaseClasses.lmtd( T_a1_nominal, T_b1_nominal, T_a2_nominal, T_b2_nominal)); inner Modelica.Fluid.System system; Sensors.RelativeHumidityTwoPort senRelHum( redeclare package Medium = Medium2, m_flow_nominal=m2_flow_nominal); equationconnect(sou_1.ports[1], hex.port_a1); connect(hex.port_b1, sin_1.ports[1]); connect(hex.port_a2, sou_2.ports[1]); connect(senRelHum.port_a, hex.port_b2); connect(senRelHum.port_b, sin_2.ports[1]); end DryCoilCounterFlowMassFlow;
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 | 15 + 273.15 | [K] |
HeatFlowRate | Q_flow_nominal | m1_flow_nominal*4200*(T_a1_n... | Nominal heat transfer [W] |
MassFlowRate | m1_flow_nominal | 0.1 | 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 WetCoilCounterFlowMassFlow "Model of a cooling coil that tests variable mass flow rates" extends Buildings.Fluid.HeatExchangers.Examples.BaseClasses.EffectivenessNTUMassFlow ( sou_1(nPorts=1), sin_1(nPorts=1), sou_2(nPorts=1), sin_2(nPorts=1));WetCoilCounterFlow hex( redeclare package Medium1 = Medium1, redeclare package Medium2 = Medium2, m1_flow_nominal=m1_flow_nominal, m2_flow_nominal=m2_flow_nominal, dp2_nominal(displayUnit="Pa") = 200, allowFlowReversal1=true, allowFlowReversal2=true, dp1_nominal(displayUnit="Pa") = 3000, UA_nominal=Q_flow_nominal/Buildings.Fluid.HeatExchangers.BaseClasses.lmtd( T_a1_nominal, T_b1_nominal, T_a2_nominal, T_b2_nominal)); inner Modelica.Fluid.System system; Sensors.RelativeHumidityTwoPort senRelHum( redeclare package Medium = Medium2, m_flow_nominal=m2_flow_nominal); equationconnect(sou_1.ports[1], hex.port_a1); connect(hex.port_b1, sin_1.ports[1]); connect(hex.port_a2, sou_2.ports[1]); connect(hex.port_b2, senRelHum.port_a); connect(senRelHum.port_b, sin_2.ports[1]); end WetCoilCounterFlowMassFlow;
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 | 15 + 273.15 | [K] |
MassFlowRate | m1_flow_nominal | 0.1 | 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 DryCoilCounterFlowPControl "Model that demonstrates use of a heat exchanger without condensation and with feedback control" import Buildings; package Medium1 = Buildings.Media.ConstantPropertyLiquidWater; package Medium2 = Buildings.Media.PerfectGases.MoistAirUnsaturated; //package Medium2 = Buildings.Media.GasesPTDecoupled.MoistAir; //package Medium2 = Buildings.Media.GasesPTDecoupled.MoistAirUnsaturated; //package Medium2 = Buildings.Media.GasesConstantDensity.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=15 + 273.15; parameter Modelica.SIunits.MassFlowRate m1_flow_nominal=0.1 "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.Fluid.Sources.Boundary_pT sin_2( redeclare package Medium = Medium2, nPorts=1, use_p_in=false, p(displayUnit="Pa") = 101325, T=303.15); Buildings.Fluid.Sources.Boundary_pT sou_2( redeclare package Medium = Medium2, nPorts=1, T=T_a2_nominal, X={0.02,1 - 0.02}, use_T_in=true, use_X_in=true, p(displayUnit="Pa") = 101325 + 300); Buildings.Fluid.Sources.Boundary_pT sin_1( redeclare package Medium = Medium1, nPorts=1, use_p_in=false, p=300000, T=293.15); Buildings.Fluid.Sources.Boundary_pT sou_1( redeclare package Medium = Medium1, nPorts=1, use_T_in=true, p=300000 + 12000); Fluid.FixedResistances.FixedResistanceDpM res_2( from_dp=true, redeclare package Medium = Medium2, dp_nominal=100, m_flow_nominal=m2_flow_nominal); Fluid.FixedResistances.FixedResistanceDpM res_1( from_dp=true, redeclare package Medium = Medium1, dp_nominal=3000, m_flow_nominal=m1_flow_nominal); Buildings.Fluid.Sensors.TemperatureDynamicTwoPort temSen(redeclare package Medium = Medium2, m_flow_nominal=m2_flow_nominal); Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage val( redeclare package Medium = Medium1, m_flow_nominal=m1_flow_nominal) "Valve model"; Modelica.Blocks.Sources.TimeTable TSet(table=[0,288.15; 600,288.15; 600, 298.15; 1200,298.15; 1800,283.15; 2400,283.15; 2400,288.15]) "Setpoint temperature"; Buildings.Fluid.HeatExchangers.DryCoilCounterFlow hex( redeclare package Medium1 = Medium1, redeclare package Medium2 = Medium2, m1_flow_nominal=m1_flow_nominal, m2_flow_nominal=m2_flow_nominal, dp2_nominal(displayUnit="Pa") = 200, allowFlowReversal1=true, allowFlowReversal2=true, dp1_nominal(displayUnit="Pa") = 3000, UA_nominal=m1_flow_nominal*4200*(T_a1_nominal - T_b1_nominal)/ Buildings.Fluid.HeatExchangers.BaseClasses.lmtd( T_a1_nominal, T_b1_nominal, T_a2_nominal, T_b2_nominal)); inner Modelica.Fluid.System system; Modelica.Blocks.Sources.Constant const(k=0.8); Buildings.Utilities.Psychrometrics.X_pTphi x_pTphi(use_p_in=false, redeclare package Medium = Medium2); Modelica.Blocks.Sources.Constant const1(k=T_a2_nominal); Buildings.Controls.Continuous.LimPID limPID( Td=1, reverseAction=true, yMin=0, controllerType=Modelica.Blocks.Types.SimpleController.PI, Ti=60); Buildings.Fluid.Sensors.RelativeHumidityTwoPort senRelHum( redeclare package Medium = Medium2, m_flow_nominal=m2_flow_nominal); Modelica.Blocks.Sources.Ramp TWat( height=30, offset=T_a1_nominal, startTime=300, duration=2000) "Water temperature, raised to high value at t=3000 s"; equationconnect(hex.port_b1, res_1.port_a); connect(val.port_b, hex.port_a1); 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(temSen.port_b, res_2.port_a); connect(x_pTphi.X, sou_2.X_in); connect(const.y, x_pTphi.phi); connect(const1.y, x_pTphi.T); connect(const1.y, sou_2.T_in); connect(TSet.y, limPID.u_s); connect(temSen.T, limPID.u_m); connect(TWat.y, sou_1.T_in); connect(limPID.y, val.y); connect(hex.port_b2, senRelHum.port_a); connect(senRelHum.port_b, temSen.port_a); end DryCoilCounterFlowPControl;
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 | 15 + 273.15 | [K] |
MassFlowRate | m1_flow_nominal | 0.1 | 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 WetCoilCounterFlowPControl "Model that demonstrates use of a heat exchanger with condensation and with feedback control" import Buildings; package Medium1 = Buildings.Media.ConstantPropertyLiquidWater; package Medium2 = Buildings.Media.PerfectGases.MoistAirUnsaturated; //package Medium2 = Buildings.Media.GasesPTDecoupled.MoistAir; //package Medium2 = Buildings.Media.GasesPTDecoupled.MoistAirUnsaturated; //package Medium2 = Buildings.Media.GasesConstantDensity.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=15 + 273.15; parameter Modelica.SIunits.MassFlowRate m1_flow_nominal=0.1 "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.Fluid.Sources.Boundary_pT sin_2( redeclare package Medium = Medium2, nPorts=1, use_p_in=false, p(displayUnit="Pa") = 101325, T=303.15); Buildings.Fluid.Sources.Boundary_pT sou_2( redeclare package Medium = Medium2, nPorts=1, T=T_a2_nominal, X={0.02,1 - 0.02}, use_T_in=true, use_X_in=true, p(displayUnit="Pa") = 101325 + 300); Buildings.Fluid.Sources.Boundary_pT sin_1( redeclare package Medium = Medium1, nPorts=1, use_p_in=false, p=300000, T=293.15); Buildings.Fluid.Sources.Boundary_pT sou_1( redeclare package Medium = Medium1, nPorts=1, use_T_in=true, p=300000 + 12000); Fluid.FixedResistances.FixedResistanceDpM res_2( from_dp=true, redeclare package Medium = Medium2, dp_nominal=100, m_flow_nominal=m2_flow_nominal); Fluid.FixedResistances.FixedResistanceDpM res_1( from_dp=true, redeclare package Medium = Medium1, dp_nominal=3000, m_flow_nominal=m1_flow_nominal); Buildings.Fluid.Sensors.TemperatureDynamicTwoPort temSen(redeclare package Medium = Medium2, m_flow_nominal=m2_flow_nominal); Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage val( redeclare package Medium = Medium1, m_flow_nominal=m1_flow_nominal) "Valve model"; Modelica.Blocks.Sources.TimeTable TSet(table=[0,288.15; 600,288.15; 600, 298.15; 1200,298.15; 1800,283.15; 2400,283.15; 2400,288.15]) "Setpoint temperature"; Buildings.Fluid.HeatExchangers.WetCoilCounterFlow hex( redeclare package Medium1 = Medium1, redeclare package Medium2 = Medium2, m1_flow_nominal=m1_flow_nominal, m2_flow_nominal=m2_flow_nominal, dp2_nominal(displayUnit="Pa") = 200, allowFlowReversal1=true, allowFlowReversal2=true, dp1_nominal(displayUnit="Pa") = 3000, UA_nominal=m1_flow_nominal*4200*(T_a1_nominal - T_b1_nominal)/ Buildings.Fluid.HeatExchangers.BaseClasses.lmtd( T_a1_nominal, T_b1_nominal, T_a2_nominal, T_b2_nominal)); inner Modelica.Fluid.System system; Modelica.Blocks.Sources.Constant const(k=0.8); Buildings.Utilities.Psychrometrics.X_pTphi x_pTphi(use_p_in=false, redeclare package Medium = Medium2); Modelica.Blocks.Sources.Constant const1(k=T_a2_nominal); Buildings.Controls.Continuous.LimPID limPID( Ti=1, Td=1, reverseAction=true, yMin=0, controllerType=Modelica.Blocks.Types.SimpleController.PI); Buildings.Fluid.Sensors.RelativeHumidity senRelHum(redeclare package Medium = Medium2); Modelica.Blocks.Sources.Ramp TWat( height=30, offset=T_a1_nominal, startTime=300, duration=2000) "Water temperature, raised to high value at t=3000 s"; equationconnect(hex.port_b1, res_1.port_a); connect(val.port_b, hex.port_a1); 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(hex.port_b2, temSen.port_a); connect(temSen.port_b, res_2.port_a); connect(x_pTphi.X, sou_2.X_in); connect(const.y, x_pTphi.phi); connect(const1.y, x_pTphi.T); connect(const1.y, sou_2.T_in); connect(TSet.y, limPID.u_s); connect(temSen.T, limPID.u_m); connect(senRelHum.port, hex.port_b2); connect(TWat.y, sou_1.T_in); connect(limPID.y, val.y); end WetCoilCounterFlowPControl;
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 "Model that demonstrates use of a finite volume model of a heat exchanger without condensation" package Medium1 = Buildings.Media.ConstantPropertyLiquidWater; package Medium2 = Buildings.Media.GasesPTDecoupled.MoistAirUnsaturated; 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.Fluid.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, UA_nominal=m1_flow_nominal*4200*(T_a1_nominal-T_b1_nominal)/ Buildings.Fluid.HeatExchangers.BaseClasses.lmtd( T_a1_nominal, T_b1_nominal, T_a2_nominal, T_b2_nominal), dp2_nominal=200, dp1_nominal=5000); Buildings.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); Buildings.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); Buildings.Fluid.Sources.Boundary_pT sin_1( redeclare package Medium = Medium1, p=300000, T=293.15, use_p_in=true, nPorts=1); Buildings.Fluid.Sources.Boundary_pT sou_1( redeclare package Medium = Medium1, p=300000 + 5000, use_T_in=true, T=293.15, nPorts=1); Modelica.Blocks.Sources.Ramp PSin_1( startTime=240, offset=300000, height=4990, duration=60); inner Modelica.Fluid.System system; equationconnect(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(sou_2.ports[1], hex.port_a2); connect(POut.y, sin_2.p_in); connect(sin_2.ports[1], hex.port_b2); connect(hex.port_b1, sin_1.ports[1]); end DryCoilDiscretized;
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 "Model that demonstrates use of a finite volume model of a heat exchanger with condensation" import Buildings; package Medium1 = Buildings.Media.ConstantPropertyLiquidWater; // package Medium2 = Buildings.Media.PerfectGases.MoistAir; // package Medium2 = Buildings.Media.PerfectGases.MoistAirUnsaturated; // package Medium2 = Buildings.Media.GasesPTDecoupled.MoistAir; package Medium2 = Buildings.Media.GasesPTDecoupled.MoistAirUnsaturated; 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.Fluid.HeatExchangers.WetCoilDiscretized hex( redeclare package Medium1 = Medium1, redeclare package Medium2 = Medium2, m1_flow_nominal=m1_flow_nominal, m2_flow_nominal=m2_flow_nominal, dp2_nominal(displayUnit="Pa") = 200, nPipPar=1, nPipSeg=3, nReg=2, dp1_nominal(displayUnit="Pa") = 5000, UA_nominal=m1_flow_nominal*4200*(T_a1_nominal - T_b1_nominal)/ Buildings.Fluid.HeatExchangers.BaseClasses.lmtd( T_a1_nominal, T_b1_nominal, T_a2_nominal, T_b2_nominal)); Buildings.Fluid.Sources.Boundary_pT sin_2( redeclare package Medium = Medium2, use_p_in=false, p=101325, T=303.15, nPorts=1); Modelica.Blocks.Sources.Ramp PIn( duration=60, height=-200, startTime=120, offset=101525); Buildings.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"; Buildings.Fluid.Sources.Boundary_pT sin_1( redeclare package Medium = Medium1, p=300000, T=293.15, use_p_in=true, nPorts=1); Buildings.Fluid.Sources.Boundary_pT sou_1( redeclare package Medium = Medium1, p=300000 + 5000, use_T_in=true, T=293.15, nPorts=1); Modelica.Blocks.Sources.Ramp PSin_1( duration=60, height=5000, startTime=240, offset=300000); inner Modelica.Fluid.System system; equationconnect(TWat.y, sou_1.T_in); connect(PSin_1.y, sin_1.p_in); connect(sou_1.ports[1], hex.port_a1); connect(sou_2.ports[1], hex.port_a2); connect(PIn.y, sou_2.p_in); connect(hex.port_b1, sin_1.ports[1]); connect(hex.port_b2, sin_2.ports[1]); end WetCoilDiscretized;
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 "Model that demonstrates use of a finite volume model of a heat exchanger without condensation and with feedback control" import Buildings; package Medium1 = Buildings.Media.ConstantPropertyLiquidWater; //package Medium2 = Buildings.Media.PerfectGases.MoistAir; //package Medium2 = Buildings.Media.GasesPTDecoupled.MoistAir; // package Medium2 = Buildings.Media.GasesPTDecoupled.MoistAirUnsaturated; 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";Buildings.Fluid.Sources.Boundary_pT sin_2( redeclare package Medium = Medium2, nPorts=1, use_p_in=false, p(displayUnit="Pa") = 101325, T=303.15); Buildings.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); Buildings.Fluid.Sources.Boundary_pT sin_1( redeclare package Medium = Medium1, p=300000, T=293.15, nPorts=1, use_p_in=true); Buildings.Fluid.Sources.Boundary_pT sou_1( redeclare package Medium = Medium1, p=300000 + 9000, nPorts=1, use_T_in=false, T=T_a1_nominal); Fluid.FixedResistances.FixedResistanceDpM res_2( from_dp=true, redeclare package Medium = Medium2, dp_nominal=100, m_flow_nominal=m2_flow_nominal); Fluid.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); Buildings.Fluid.Sensors.TemperatureTwoPort temSen(redeclare package Medium = Medium2, m_flow_nominal=m2_flow_nominal); Buildings.Fluid.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.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.Fluid.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, UA_nominal=m1_flow_nominal*4200*(T_a1_nominal-T_b1_nominal)/ Buildings.Fluid.HeatExchangers.BaseClasses.lmtd( T_a1_nominal, T_b1_nominal, T_a2_nominal, T_b2_nominal), dp1_nominal(displayUnit="Pa") = 2000, dp2_nominal(displayUnit="Pa") = 200); Buildings.Fluid.Actuators.Motors.IdealMotor mot(tOpe=60) "Motor model"; inner Modelica.Fluid.System system; Buildings.Controls.Continuous.LimPID P( k=1, Ti=60, controllerType=Modelica.Blocks.Types.SimpleController.P, Td=60); equationconnect(PSin_1.y, sin_1.p_in); connect(hex.port_b1, res_1.port_a); connect(val.port_b, hex.port_a1); 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(mot.y, val.y); connect(hex.port_b2, temSen.port_a); connect(temSen.port_b, res_2.port_a); connect(TSet.y, P.u_s); connect(temSen.T, P.u_m); connect(P.y, mot.u); end DryCoilDiscretizedPControl;
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 "Model that demonstrates use of a finite volume model of a heat exchanger with condensation and feedback control" 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.MoistAirUnsaturated; //package Medium2 = Buildings.Media.PerfectGases.MoistAir; package Medium2 = Buildings.Media.GasesConstantDensity.MoistAirUnsaturated; 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.Fluid.Sources.Boundary_pT sin_2( redeclare package Medium = Medium2, use_p_in=false, p=101325, T=303.15, nPorts=1); Buildings.Fluid.Sources.Boundary_pT sou_2( redeclare package Medium = Medium2, nPorts=1, use_p_in=false, use_T_in=true, p(displayUnit="Pa") = 101525, T=293.15); Buildings.Fluid.Sources.Boundary_pT sin_1( redeclare package Medium = Medium1, p=300000, T=293.15, use_p_in=true, nPorts=1); Buildings.Fluid.Sources.Boundary_pT sou_1( redeclare package Medium = Medium1, nPorts=1, use_T_in=true, p=300000 + 7000, T=278.15); Modelica.Blocks.Sources.Ramp PSin( duration=60, height=5000, startTime=240, offset=300000); Buildings.Fluid.Sensors.TemperatureTwoPort temSen(redeclare package Medium = Medium2, m_flow_nominal=m2_flow_nominal); Buildings.Fluid.Actuators.Valves.TwoWayLinear val( redeclare package Medium = Medium1, Kv_SI=m1_flow_nominal/sqrt(5000), m_flow_nominal=m1_flow_nominal); 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"; Buildings.Fluid.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, UA_nominal=m1_flow_nominal*4200*(T_a1_nominal-T_b1_nominal)/ Buildings.Fluid.HeatExchangers.BaseClasses.lmtd( T_a1_nominal, T_b1_nominal, T_a2_nominal, T_b2_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); Buildings.Controls.Continuous.LimPID P1( k=1, Ti=60, controllerType=Modelica.Blocks.Types.SimpleController.P, Td=60, reverseAction=true); Buildings.Fluid.Actuators.Motors.IdealMotor mot(tOpe=60) "Motor model"; equationconnect(PSin.y, sin_1.p_in); connect(sou_2.ports[1], hex.port_a2); connect(hex.port_b2, temSen.port_a); connect(val.port_b, hex.port_a1); 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(TSet.y, P1.u_s); connect(temSen.T, P1.u_m); connect(P1.y, mot.u); connect(mot.y, val.y); connect(sin_2.ports[1], temSen.port_b); connect(hex.port_b1, sin_1.ports[1]); end WetCoilDiscretizedPControl;