LBL logo

Buildings.Fluid.HeatExchangers.Examples

Collection of models that illustrate model use and test models

Information

This package contains examples for the use of models that can be found in Buildings.Fluid.HeatExchangers.

Extends from Modelica.Icons.ExamplesPackage (Icon for packages containing runnable examples).

Package Content

Name Description
Buildings.Fluid.HeatExchangers.Examples.AirHeater_T AirHeater_T Example model for the heater with prescribed outlet temperature and air as the medium
Buildings.Fluid.HeatExchangers.Examples.AirHeater_u AirHeater_u Example model for the heater with prescribed heat input and air as the medium
Buildings.Fluid.HeatExchangers.Examples.DryCoilCounterFlowMassFlow DryCoilCounterFlowMassFlow Model of a cooling coil that tests variable mass flow rates
Buildings.Fluid.HeatExchangers.Examples.DryCoilCounterFlowPControl DryCoilCounterFlowPControl Model that demonstrates use of a heat exchanger without condensation and with feedback control
Buildings.Fluid.HeatExchangers.Examples.DryCoilDiscretized DryCoilDiscretized Model that demonstrates use of a finite volume model of a heat exchanger without condensation
Buildings.Fluid.HeatExchangers.Examples.DryCoilDiscretizedPControl DryCoilDiscretizedPControl Model that demonstrates use of a finite volume model of a heat exchanger without condensation and with feedback control
Buildings.Fluid.HeatExchangers.Examples.DryEffectivenessNTU DryEffectivenessNTU Model that demonstrates use of a heat exchanger without condensation that uses the epsilon-NTU relation
Buildings.Fluid.HeatExchangers.Examples.DryEffectivenessNTUMassFlow DryEffectivenessNTUMassFlow Model of epsilon-NTU dry coil that tests variable mass flow rates
Buildings.Fluid.HeatExchangers.Examples.DryEffectivenessNTUPControl DryEffectivenessNTUPControl Model that demonstrates use of a heat exchanger without condensation that uses the epsilon-NTU relation with feedback control
Buildings.Fluid.HeatExchangers.Examples.WaterHeater_T WaterHeater_T Example model for the heater with prescribed outlet temperature and water as the medium
Buildings.Fluid.HeatExchangers.Examples.WaterHeater_u WaterHeater_u Example model for the heater with prescribed heat input and water as the medium
Buildings.Fluid.HeatExchangers.Examples.WetCoilCounterFlowMassFlow WetCoilCounterFlowMassFlow Model of a cooling coil that tests variable mass flow rates
Buildings.Fluid.HeatExchangers.Examples.WetCoilCounterFlowPControl WetCoilCounterFlowPControl Model that demonstrates use of a heat exchanger with condensation and with feedback control
Buildings.Fluid.HeatExchangers.Examples.WetCoilDiscretizedPControl WetCoilDiscretizedPControl Model that demonstrates use of a finite volume model of a heat exchanger with condensation and feedback control
Buildings.Fluid.HeatExchangers.Examples.BaseClasses BaseClasses Package with base classes for Buildings.Fluid.HeatExchangers.Examples

Buildings.Fluid.HeatExchangers.Examples.AirHeater_T Buildings.Fluid.HeatExchangers.Examples.AirHeater_T

Example model for the heater with prescribed outlet temperature and air as the medium

Buildings.Fluid.HeatExchangers.Examples.AirHeater_T

Information

This example illustrates how to use the heater model that takes as an input the leaving fluid temperature.

The model consist of an air volume with heat loss to the ambient. The set point of the air temperature is different between night and day. The heater tracks the set point temperature, except for the periods in which the air temperature is above the set point.

See Buildings.Fluid.HeatExchangers.Examples.AirHeater_u for a model that takes the heating power as an input.

Extends from Modelica.Icons.Example (Icon for runnable examples), Buildings.Fluid.HeatExchangers.Examples.BaseClasses.Heater (Base class for example model for the heater and cooler).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium model
VolumeV6*6*2.7Volume [m3]
MassFlowRatem_flow_nominalV*1.2*6/3600Nominal mass flow rate [kg/s]
HeatFlowRateQ_flow_nominal30*6*6Nominal heat loss of the room [W]

Connectors

TypeNameDescription
replaceable package MediumMedium model

Modelica definition

model AirHeater_T "Example model for the heater with prescribed outlet temperature and air as the medium" extends Modelica.Icons.Example; extends Buildings.Fluid.HeatExchangers.Examples.BaseClasses.Heater( redeclare package Medium = Buildings.Media.Air, m_flow_nominal=V*1.2*6/3600, Q_flow_nominal=30*6*6, mov(dp_nominal=1200, nominalValuesDefineDefaultPressureCurve=true)); Buildings.Fluid.HeatExchangers.HeaterCooler_T hea( redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, dp_nominal=1000, Q_flow_maxCool=0, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, Q_flow_maxHeat=Q_flow_nominal) "Heater"; Controls.SetPoints.Table tab(table=[0,273.15 + 15; 1,273.15 + 30]); equation connect(hea.port_b, THeaOut.port_a); connect(conPI.y, tab.u); connect(tab.y, hea.TSet); connect(mov.port_b, hea.port_a); end AirHeater_T;

Buildings.Fluid.HeatExchangers.Examples.AirHeater_u Buildings.Fluid.HeatExchangers.Examples.AirHeater_u

Example model for the heater with prescribed heat input and air as the medium

Buildings.Fluid.HeatExchangers.Examples.AirHeater_u

Information

This example illustrates how to use the heater model that takes as an input the heat added to the medium.

The model consist of an air volume with heat loss to the ambient. The set point of the air temperature is different between night and day. The heater tracks the set point temperature, except for the periods in which the air temperature is above the set point.

See Buildings.Fluid.HeatExchangers.Examples.AirHeater_T for a model that takes the leaving air temperature as an input.

Extends from Modelica.Icons.Example (Icon for runnable examples), Buildings.Fluid.HeatExchangers.Examples.BaseClasses.Heater (Base class for example model for the heater and cooler).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium model
VolumeV6*6*2.7Volume [m3]
MassFlowRatem_flow_nominalV*1.2*6/3600Nominal mass flow rate [kg/s]
HeatFlowRateQ_flow_nominal30*6*6Nominal heat loss of the room [W]

Connectors

TypeNameDescription
replaceable package MediumMedium model

Modelica definition

model AirHeater_u "Example model for the heater with prescribed heat input and air as the medium" extends Modelica.Icons.Example; extends Buildings.Fluid.HeatExchangers.Examples.BaseClasses.Heater( redeclare package Medium = Buildings.Media.Air, m_flow_nominal=V*1.2*6/3600, Q_flow_nominal=30*6*6, mov(nominalValuesDefineDefaultPressureCurve=true, dp_nominal=1200)); HeaterCooler_u hea( redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, dp_nominal=1000, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, Q_flow_nominal=Q_flow_nominal) "Heater"; equation connect(hea.port_b, THeaOut.port_a); connect(conPI.y, hea.u); connect(mov.port_b, hea.port_a); end AirHeater_u;

Buildings.Fluid.HeatExchangers.Examples.DryCoilCounterFlowMassFlow Buildings.Fluid.HeatExchangers.Examples.DryCoilCounterFlowMassFlow

Model of a cooling coil that tests variable mass flow rates

Buildings.Fluid.HeatExchangers.Examples.DryCoilCounterFlowMassFlow

Information

This model demonstrates the use of Buildings.Fluid.HeatExchangers.DryCoilCounterFlow for different inlet conditions.

Extends from Modelica.Icons.Example (Icon for runnable examples), Buildings.Fluid.HeatExchangers.Examples.BaseClasses.EffectivenessNTUMassFlow (Partial model of epsilon-NTU coil that tests variable mass flow rates).

Parameters

TypeNameDefaultDescription
TemperatureT_a1_nominal5 + 273.15Nominal water inlet temperature [K]
TemperatureT_b1_nominal10 + 273.15Nominal water outlet temperature [K]
TemperatureT_a2_nominal30 + 273.15Nominal air inlet temperature [K]
TemperatureT_b2_nominal15 + 273.15Nominal air outlet temperature [K]
HeatFlowRateQ_flow_nominalm1_flow_nominal*4200*(T_a1_n...Nominal heat transfer [W]
MassFlowRatem1_flow_nominal0.1Nominal mass flow rate medium 1 [kg/s]
MassFlowRatem2_flow_nominalm1_flow_nominal*4200/1000*(T...Nominal mass flow rate medium 2 [kg/s]

Modelica definition

model DryCoilCounterFlowMassFlow "Model of a cooling coil that tests variable mass flow rates" extends Modelica.Icons.Example; 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, show_T=true, 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), energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial); Sensors.RelativeHumidityTwoPort senRelHum( redeclare package Medium = Medium2, m_flow_nominal=m2_flow_nominal); equation connect(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;

Buildings.Fluid.HeatExchangers.Examples.DryCoilCounterFlowPControl Buildings.Fluid.HeatExchangers.Examples.DryCoilCounterFlowPControl

Model that demonstrates use of a heat exchanger without condensation and with feedback control

Buildings.Fluid.HeatExchangers.Examples.DryCoilCounterFlowPControl

Information

This model demonstrates the use of Buildings.Fluid.HeatExchangers.DryCoilCounterFlow. The valve on the water-side is regulated to track a setpoint temperature for the air outlet.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Parameters

TypeNameDefaultDescription
TemperatureT_a1_nominal5 + 273.15[K]
TemperatureT_b1_nominal10 + 273.15[K]
TemperatureT_a2_nominal30 + 273.15[K]
TemperatureT_b2_nominal15 + 273.15[K]
MassFlowRatem1_flow_nominal0.1Nominal mass flow rate medium 1 [kg/s]
MassFlowRatem2_flow_nominalm1_flow_nominal*4200/1000*(T...Nominal mass flow rate medium 2 [kg/s]

Modelica definition

model DryCoilCounterFlowPControl "Model that demonstrates use of a heat exchanger without condensation and with feedback control" extends Modelica.Icons.Example; package Medium1 = Buildings.Media.Water; package Medium2 = Buildings.Media.Air; 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.TemperatureTwoPort 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, dpValve_nominal=6000) "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), show_T=true, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial); Modelica.Blocks.Sources.Constant const(k=0.8); Buildings.Utilities.Psychrometrics.X_pTphi x_pTphi(use_p_in=false); Modelica.Blocks.Sources.Constant const1(k=T_a2_nominal); Buildings.Controls.Continuous.LimPID con( Td=1, reverseAction=true, yMin=0, controllerType=Modelica.Blocks.Types.SimpleController.PI, k=0.1, Ti=60) "Controller"; 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"; equation 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(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, con.u_s); connect(temSen.T, con.u_m); connect(TWat.y, sou_1.T_in); connect(con.y, val.y); connect(temSen.port_a, hex.port_b2); end DryCoilCounterFlowPControl;

Buildings.Fluid.HeatExchangers.Examples.DryCoilDiscretized Buildings.Fluid.HeatExchangers.Examples.DryCoilDiscretized

Model that demonstrates use of a finite volume model of a heat exchanger without condensation

Buildings.Fluid.HeatExchangers.Examples.DryCoilDiscretized

Information

This model tests Buildings.Fluid.HeatExchangers.DryCoilDiscretized for different inlet conditions.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Parameters

TypeNameDefaultDescription
TemperatureT_a1_nominal60 + 273.15[K]
TemperatureT_b1_nominal40 + 273.15[K]
TemperatureT_a2_nominal5 + 273.15[K]
TemperatureT_b2_nominal20 + 273.15[K]
MassFlowRatem1_flow_nominal5Nominal mass flow rate medium 1 [kg/s]
MassFlowRatem2_flow_nominalm1_flow_nominal*4200/1000*(T...Nominal mass flow rate medium 2 [kg/s]

Modelica definition

model DryCoilDiscretized "Model that demonstrates use of a finite volume model of a heat exchanger without condensation" extends Modelica.Icons.Example; package Medium1 = Buildings.Media.Water; package Medium2 = Buildings.Media.Air; 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, show_T=true, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, from_dp1=true, from_dp2=true); Sources.MassFlowSource_T sin_2( redeclare package Medium = Medium2, nPorts=1, use_m_flow_in=true, T=303.15); 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"; 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); Modelica.Blocks.Sources.Ramp m_flow_2( duration=60, startTime=120, height=28 - 0.124, offset=-28) "Mass flow rate on air side"; 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(sou_2.ports[1], hex.port_a2); connect(sin_2.ports[1], hex.port_b2); connect(hex.port_b1, sin_1.ports[1]); connect(m_flow_2.y, sin_2.m_flow_in); end DryCoilDiscretized;

Buildings.Fluid.HeatExchangers.Examples.DryCoilDiscretizedPControl Buildings.Fluid.HeatExchangers.Examples.DryCoilDiscretizedPControl

Model that demonstrates use of a finite volume model of a heat exchanger without condensation and with feedback control

Buildings.Fluid.HeatExchangers.Examples.DryCoilDiscretizedPControl

Information

This model demonstrates the use of Buildings.Fluid.HeatExchangers.DryCoilDiscretized. The valve on the water-side is regulated to track a setpoint temperature for the air outlet.

Note that between the controller output and the valve is a model of a motor that has hysteresis. The events generated by the motor model can lead to a significantly higher computing time. In most applications, this level of modeling detail is not justified.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Parameters

TypeNameDefaultDescription
TemperatureT_a1_nominal60 + 273.15[K]
TemperatureT_b1_nominal50 + 273.15[K]
TemperatureT_a2_nominal20 + 273.15[K]
TemperatureT_b2_nominal40 + 273.15[K]
MassFlowRatem1_flow_nominal5Nominal mass flow rate medium 1 [kg/s]
MassFlowRatem2_flow_nominalm1_flow_nominal*4200/1000*(T...Nominal mass flow rate medium 2 [kg/s]

Modelica definition

model DryCoilDiscretizedPControl "Model that demonstrates use of a finite volume model of a heat exchanger without condensation and with feedback control" extends Modelica.Icons.Example; package Medium1 = Buildings.Media.Water "Medium model for water"; package Medium2 = Buildings.Media.Air "Medium model for air"; 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"; Sources.MassFlowSource_T sin_2( redeclare package Medium = Medium2, nPorts=1, m_flow=-10.5, 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, use_p_in=true, nPorts=1); Buildings.Fluid.Sources.Boundary_pT sou_1( redeclare package Medium = Medium1, p=300000 + 9000, nPorts=1, use_T_in=false, T=T_a1_nominal); 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, m_flow_nominal=m1_flow_nominal, filteredOpening=false, dpFixed_nominal=2000 + 3000, dpValve_nominal=6000) "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, show_T=true, 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") = 0, dp2_nominal(displayUnit="Pa") = 300, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, from_dp1=true, from_dp2=true); Buildings.Fluid.Actuators.Motors.IdealMotor mot(tOpe=60) "Motor model"; Buildings.Controls.Continuous.LimPID con( k=1, Ti=60, controllerType=Modelica.Blocks.Types.SimpleController.P, Td=60) "Controller"; equation connect(PSin_1.y, sin_1.p_in); connect(val.port_b, hex.port_a1); connect(sou_1.ports[1], val.port_a); connect(sou_2.ports[1], hex.port_a2); connect(mot.y, val.y); connect(hex.port_b2, temSen.port_a); connect(TSet.y, con.u_s); connect(temSen.T, con.u_m); connect(con.y, mot.u); connect(hex.port_b1, sin_1.ports[1]); connect(temSen.port_b, sin_2.ports[1]); end DryCoilDiscretizedPControl;

Buildings.Fluid.HeatExchangers.Examples.DryEffectivenessNTU Buildings.Fluid.HeatExchangers.Examples.DryEffectivenessNTU

Model that demonstrates use of a heat exchanger without condensation that uses the epsilon-NTU relation

Buildings.Fluid.HeatExchangers.Examples.DryEffectivenessNTU

Information

This model tests Buildings.Fluid.HeatExchangers.DryffectivenessNTU for different inlet conditions.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Parameters

TypeNameDefaultDescription
SpecificHeatCapacitycp1Medium1.specificHeatCapacity...Specific heat capacity of medium 2 [J/(kg.K)]
SpecificHeatCapacitycp2Medium2.specificHeatCapacity...Specific heat capacity of medium 2 [J/(kg.K)]
MassFlowRatem1_flow5Nominal mass flow rate medium 1 [kg/s]
MassFlowRatem2_flowm1_flow*cp1/cp2Nominal mass flow rate medium 2 [kg/s]

Modelica definition

model DryEffectivenessNTU "Model that demonstrates use of a heat exchanger without condensation that uses the epsilon-NTU relation" extends Modelica.Icons.Example; package Medium1 = Buildings.Media.Water; package Medium2 = Buildings.Media.Air; 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), configuration=Buildings.Fluid.Types.HeatExchangerConfiguration.ParallelFlow, show_T=true, T_a1_nominal=303.15, T_a2_nominal=293.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), configuration=Buildings.Fluid.Types.HeatExchangerConfiguration.CounterFlow, show_T=true, T_a1_nominal=303.15, T_a2_nominal=293.15); 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), configuration=Buildings.Fluid.Types.HeatExchangerConfiguration.CrossFlowStream1MixedStream2Unmixed, show_T=true, T_a1_nominal=303.15, T_a2_nominal=293.15); 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), configuration=Buildings.Fluid.Types.HeatExchangerConfiguration.CrossFlowStream1UnmixedStream2Mixed, show_T=true, T_a1_nominal=303.15, T_a2_nominal=293.15); 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), configuration=Buildings.Fluid.Types.HeatExchangerConfiguration.CrossFlowUnmixed, show_T=true, T_a1_nominal=303.15, T_a2_nominal=293.15); Modelica.Blocks.Sources.Trapezoid trapezoid( amplitude=5000, rising=10, width=100, falling=10, period=3600, offset=300000); equation connect(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;

Buildings.Fluid.HeatExchangers.Examples.DryEffectivenessNTUMassFlow Buildings.Fluid.HeatExchangers.Examples.DryEffectivenessNTUMassFlow

Model of epsilon-NTU dry coil that tests variable mass flow rates

Buildings.Fluid.HeatExchangers.Examples.DryEffectivenessNTUMassFlow

Information

This model tests Buildings.Fluid.HeatExchangers.DryEffectivenessNTU for different mass flow rates.

Extends from Modelica.Icons.Example (Icon for runnable examples), Buildings.Fluid.HeatExchangers.Examples.BaseClasses.EffectivenessNTUMassFlow (Partial model of epsilon-NTU coil that tests variable mass flow rates).

Parameters

TypeNameDefaultDescription
TemperatureT_a1_nominal5 + 273.15Nominal water inlet temperature [K]
TemperatureT_b1_nominal10 + 273.15Nominal water outlet temperature [K]
TemperatureT_a2_nominal30 + 273.15Nominal air inlet temperature [K]
TemperatureT_b2_nominal15 + 273.15Nominal air outlet temperature [K]
HeatFlowRateQ_flow_nominalm1_flow_nominal*4200*(T_a1_n...Nominal heat transfer [W]
MassFlowRatem1_flow_nominal0.1Nominal mass flow rate medium 1 [kg/s]
MassFlowRatem2_flow_nominalm1_flow_nominal*4200/1000*(T...Nominal mass flow rate medium 2 [kg/s]

Modelica definition

model DryEffectivenessNTUMassFlow "Model of epsilon-NTU dry coil that tests variable mass flow rates" extends Modelica.Icons.Example; 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, show_T=true); Buildings.Fluid.Sensors.RelativeHumidityTwoPort senRelHum( redeclare package Medium = Medium2, m_flow_nominal=m2_flow_nominal, initType=Modelica.Blocks.Types.Init.InitialState); equation connect(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;

Buildings.Fluid.HeatExchangers.Examples.DryEffectivenessNTUPControl Buildings.Fluid.HeatExchangers.Examples.DryEffectivenessNTUPControl

Model that demonstrates use of a heat exchanger without condensation that uses the epsilon-NTU relation with feedback control

Buildings.Fluid.HeatExchangers.Examples.DryEffectivenessNTUPControl

Information

This model demonstrates the use of Buildings.Fluid.HeatExchangers.DryEffectivenessNTU. The valve on the water-side is regulated to track a setpoint temperature for the air outlet.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Parameters

TypeNameDefaultDescription
TemperatureT_a1_nominal60 + 273.15Temperature at nominal conditions as port a1 [K]
TemperatureT_b1_nominal50 + 273.15Temperature at nominal conditions as port b1 [K]
TemperatureT_a2_nominal20 + 273.15Temperature at nominal conditions as port a2 [K]
TemperatureT_b2_nominal40 + 273.15Temperature at nominal conditions as port b2 [K]
MassFlowRatem1_flow_nominal5Nominal mass flow rate medium 1 [kg/s]
MassFlowRatem2_flow_nominalm1_flow_nominal*4200/1000*(T...Nominal mass flow rate medium 2 [kg/s]

Modelica definition

model DryEffectivenessNTUPControl "Model that demonstrates use of a heat exchanger without condensation that uses the epsilon-NTU relation with feedback control" extends Modelica.Icons.Example; package Medium1 = Buildings.Media.Water "Medium model for water"; package Medium2 = Buildings.Media.Air "Medium model for air"; parameter Modelica.SIunits.Temperature T_a1_nominal = 60+273.15 "Temperature at nominal conditions as port a1"; parameter Modelica.SIunits.Temperature T_b1_nominal = 50+273.15 "Temperature at nominal conditions as port b1"; parameter Modelica.SIunits.Temperature T_a2_nominal = 20+273.15 "Temperature at nominal conditions as port a2"; parameter Modelica.SIunits.Temperature T_b2_nominal = 40+273.15 "Temperature at nominal conditions as port b2"; 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(displayUnit="Pa") = 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=false, p(displayUnit="Pa") = 101625, T=T_a2_nominal); Buildings.Fluid.Sources.Boundary_pT sin_1( redeclare package Medium = Medium1, use_p_in=false, p=300000, T=293.15, nPorts=1); Buildings.Fluid.Sources.Boundary_pT sou_1( redeclare package Medium = Medium1, p=300000 + 9000, nPorts=1, use_T_in=false, T=T_a1_nominal); 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, m_flow_nominal=m1_flow_nominal, dpFixed_nominal=2000 + 3000, dpValve_nominal=6000) "Valve model"; Buildings.Controls.Continuous.LimPID P( controllerType=Modelica.Blocks.Types.SimpleController.PI, Ti=30, k=0.1, Td=1); Modelica.Blocks.Sources.Pulse TSet( amplitude=5, period=3600, offset=273.15 + 22) "Setpoint temperature"; Buildings.Fluid.HeatExchangers.DryEffectivenessNTU hex( redeclare package Medium1 = Medium1, redeclare package Medium2 = Medium2, show_T=true, 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") = 200 + 100); equation connect(val.port_b, hex.port_a1); connect(sou_1.ports[1], val.port_a); connect(sou_2.ports[1], hex.port_a2); connect(hex.port_b2, temSen.port_a); connect(TSet.y, P.u_s); connect(temSen.T, P.u_m); connect(P.y, val.y); connect(hex.port_b1, sin_1.ports[1]); connect(temSen.port_b, sin_2.ports[1]); end DryEffectivenessNTUPControl;

Buildings.Fluid.HeatExchangers.Examples.WaterHeater_T Buildings.Fluid.HeatExchangers.Examples.WaterHeater_T

Example model for the heater with prescribed outlet temperature and water as the medium

Buildings.Fluid.HeatExchangers.Examples.WaterHeater_T

Information

This example illustrates how to use the heater model that takes as an input the leaving fluid temperature.

The model consist of a water volume with heat loss to the ambient. The set point of the water temperature is different between night and day. The heater tracks the set point temperature, except for the periods in which the water temperature is above the set point.

See Buildings.Fluid.HeatExchangers.Examples.WaterHeater_u for a model that takes the heating power as an input.

Extends from Modelica.Icons.Example (Icon for runnable examples), Buildings.Fluid.HeatExchangers.Examples.BaseClasses.Heater (Base class for example model for the heater and cooler).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium model
VolumeV6*6*2.7Volume [m3]
MassFlowRatem_flow_nominalV*1000/3600Nominal mass flow rate [kg/s]
HeatFlowRateQ_flow_nominal100Nominal heat loss of the room [W]

Connectors

TypeNameDescription
replaceable package MediumMedium model

Modelica definition

model WaterHeater_T "Example model for the heater with prescribed outlet temperature and water as the medium" extends Modelica.Icons.Example; extends Buildings.Fluid.HeatExchangers.Examples.BaseClasses.Heater( redeclare package Medium = Buildings.Media.Water, m_flow_nominal=V*1000/3600, Q_flow_nominal=100, vol(V=V/1000), mov(nominalValuesDefineDefaultPressureCurve=true)); Buildings.Fluid.HeatExchangers.HeaterCooler_T hea( redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, dp_nominal=1000, Q_flow_maxCool=0, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, Q_flow_maxHeat=Q_flow_nominal) "Heater"; Controls.SetPoints.Table tab(table=[0,273.15 + 10; 1,273.15 + 30]); equation connect(hea.port_b, THeaOut.port_a); connect(conPI.y, tab.u); connect(tab.y, hea.TSet); connect(mov.port_b, hea.port_a); end WaterHeater_T;

Buildings.Fluid.HeatExchangers.Examples.WaterHeater_u Buildings.Fluid.HeatExchangers.Examples.WaterHeater_u

Example model for the heater with prescribed heat input and water as the medium

Buildings.Fluid.HeatExchangers.Examples.WaterHeater_u

Information

This example illustrates how to use the heater model that takes as an input the heat added to the medium.

The model consist of a water volume with heat loss to the ambient. The set point of the water temperature is different between night and day. The heater tracks the set point temperature, except for the periods in which the water temperature is above the set point.

See Buildings.Fluid.HeatExchangers.Examples.WaterHeater_T for a model that takes the leaving water temperature as an input.

Extends from Modelica.Icons.Example (Icon for runnable examples), Buildings.Fluid.HeatExchangers.Examples.BaseClasses.Heater (Base class for example model for the heater and cooler).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium model
VolumeV6*6*2.7Volume [m3]
MassFlowRatem_flow_nominalV*1000/3600Nominal mass flow rate [kg/s]
HeatFlowRateQ_flow_nominal100Nominal heat loss of the room [W]

Connectors

TypeNameDescription
replaceable package MediumMedium model

Modelica definition

model WaterHeater_u "Example model for the heater with prescribed heat input and water as the medium" extends Modelica.Icons.Example; extends Buildings.Fluid.HeatExchangers.Examples.BaseClasses.Heater( redeclare package Medium = Buildings.Media.Water, m_flow_nominal=V*1000/3600, Q_flow_nominal=100, conPI(k=10), vol(V=V/1000), mov(nominalValuesDefineDefaultPressureCurve=true)); HeaterCooler_u hea( redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, dp_nominal=1000, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, Q_flow_nominal=10*Q_flow_nominal) "Heater"; equation connect(hea.port_b, THeaOut.port_a); connect(conPI.y, hea.u); connect(mov.port_b, hea.port_a); end WaterHeater_u;

Buildings.Fluid.HeatExchangers.Examples.WetCoilCounterFlowMassFlow Buildings.Fluid.HeatExchangers.Examples.WetCoilCounterFlowMassFlow

Model of a cooling coil that tests variable mass flow rates

Buildings.Fluid.HeatExchangers.Examples.WetCoilCounterFlowMassFlow

Information

This model demonstrates the use of Buildings.Fluid.HeatExchangers.WetCoilCounterFlow for different inlet conditions.

Extends from Modelica.Icons.Example (Icon for runnable examples), Buildings.Fluid.HeatExchangers.Examples.BaseClasses.EffectivenessNTUMassFlow (Partial model of epsilon-NTU coil that tests variable mass flow rates).

Parameters

TypeNameDefaultDescription
TemperatureT_a1_nominal5 + 273.15Nominal water inlet temperature [K]
TemperatureT_b1_nominal10 + 273.15Nominal water outlet temperature [K]
TemperatureT_a2_nominal30 + 273.15Nominal air inlet temperature [K]
TemperatureT_b2_nominal15 + 273.15Nominal air outlet temperature [K]
HeatFlowRateQ_flow_nominalm1_flow_nominal*4200*(T_a1_n...Nominal heat transfer [W]
MassFlowRatem1_flow_nominal0.1Nominal mass flow rate medium 1 [kg/s]
MassFlowRatem2_flow_nominalm1_flow_nominal*4200/1000*(T...Nominal mass flow rate medium 2 [kg/s]

Modelica definition

model WetCoilCounterFlowMassFlow "Model of a cooling coil that tests variable mass flow rates" extends Modelica.Icons.Example; 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), show_T=true, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial); Sensors.RelativeHumidityTwoPort senRelHum( redeclare package Medium = Medium2, m_flow_nominal=m2_flow_nominal); equation connect(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;

Buildings.Fluid.HeatExchangers.Examples.WetCoilCounterFlowPControl Buildings.Fluid.HeatExchangers.Examples.WetCoilCounterFlowPControl

Model that demonstrates use of a heat exchanger with condensation and with feedback control

Buildings.Fluid.HeatExchangers.Examples.WetCoilCounterFlowPControl

Information

This model demonstrates the use of Buildings.Fluid.HeatExchangers.WetCoilCounterFlow. The valve on the water-side is regulated to track a setpoint temperature for the air outlet.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Parameters

TypeNameDefaultDescription
TemperatureT_a1_nominal5 + 273.15[K]
TemperatureT_b1_nominal10 + 273.15[K]
TemperatureT_a2_nominal30 + 273.15[K]
TemperatureT_b2_nominal15 + 273.15[K]
MassFlowRatem1_flow_nominal0.1Nominal mass flow rate medium 1 [kg/s]
MassFlowRatem2_flow_nominalm1_flow_nominal*4200/1000*(T...Nominal mass flow rate medium 2 [kg/s]

Modelica definition

model WetCoilCounterFlowPControl "Model that demonstrates use of a heat exchanger with condensation and with feedback control" extends Modelica.Icons.Example; package Medium1 = Buildings.Media.Water; package Medium2 = Buildings.Media.Air; //package Medium2 = Buildings.Media.GasesPTDecoupled.MoistAir; //package Medium2 = Buildings.Media.Air; //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.TemperatureTwoPort 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, dpValve_nominal=6000) "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=2*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), show_T=true, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial); Modelica.Blocks.Sources.Constant const(k=0.8); Buildings.Utilities.Psychrometrics.X_pTphi x_pTphi(use_p_in=false); Modelica.Blocks.Sources.Constant const1(k=T_a2_nominal); Buildings.Controls.Continuous.LimPID con( Td=1, reverseAction=true, yMin=0, controllerType=Modelica.Blocks.Types.SimpleController.PI, k=0.1, Ti=60) "Controller"; 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"; equation 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(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, con.u_s); connect(temSen.T, con.u_m); connect(TWat.y, sou_1.T_in); connect(con.y, val.y); end WetCoilCounterFlowPControl;

Buildings.Fluid.HeatExchangers.Examples.WetCoilDiscretizedPControl Buildings.Fluid.HeatExchangers.Examples.WetCoilDiscretizedPControl

Model that demonstrates use of a finite volume model of a heat exchanger with condensation and feedback control

Buildings.Fluid.HeatExchangers.Examples.WetCoilDiscretizedPControl

Information

This model demonstrates the use of Buildings.Fluid.HeatExchangers.DryCoilDiscretized. The valve on the water-side is regulated to track a setpoint temperature for the air outlet.

Note that between the controller output and the valve is a model of a motor that has hysteresis. The events generated by the motor model can lead to a significantly higher computing time. In most applications, this level of modeling detail is not justified.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Parameters

TypeNameDefaultDescription
TemperatureT_a1_nominal5 + 273.15[K]
TemperatureT_b1_nominal10 + 273.15[K]
TemperatureT_a2_nominal30 + 273.15[K]
TemperatureT_b2_nominal10 + 273.15[K]
MassFlowRatem1_flow_nominal5Nominal mass flow rate medium 1 [kg/s]
MassFlowRatem2_flow_nominalm1_flow_nominal*4200/1000*(T...Nominal mass flow rate medium 2 [kg/s]

Modelica definition

model WetCoilDiscretizedPControl "Model that demonstrates use of a finite volume model of a heat exchanger with condensation and feedback control" extends Modelica.Icons.Example; package Medium1 = Buildings.Media.Water; package Medium2 = Buildings.Media.Air; 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, m_flow_nominal=m1_flow_nominal, filteredOpening=false, dpFixed_nominal=2000, dpValve_nominal=5000); 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, show_T=true, 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), dp2_nominal(displayUnit="Pa") = 200, dp1_nominal(displayUnit="Pa") = 0, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial); 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 con( k=1, Ti=60, controllerType=Modelica.Blocks.Types.SimpleController.P, Td=60, reverseAction=true) "Controller"; Buildings.Fluid.Actuators.Motors.IdealMotor mot(tOpe=60) "Motor model"; equation connect(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, con.u_s); connect(temSen.T, con.u_m); connect(con.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;

http://simulationresearch.lbl.gov/modelica