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.DryCoilEffectivenessNTUMassFlow DryCoilEffectivenessNTUMassFlow Model of epsilon-NTU dry coil that tests variable mass flow rates
Buildings.Fluid.HeatExchangers.Examples.DryCoilEffectivenessNTUPControl DryCoilEffectivenessNTUPControl Model that demonstrates use of a heat exchanger without condensation that uses the epsilon-NTU relation with feedback control
Buildings.Fluid.HeatExchangers.Examples.PlateHeatExchangerEffectivenessNTUPControl PlateHeatExchangerEffectivenessNTUPControl Model that demonstrates use of a plate heat exchanger without condensation that uses the epsilon-NTU relation with feedback control
Buildings.Fluid.HeatExchangers.Examples.WaterCooler_T WaterCooler_T Example model for the sensible cooler with prescribed outlet temperature and water as the medium
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.WetCoilDiscretizedMassFlow WetCoilDiscretizedMassFlow Model of a cooling coil that tests variable mass flow rates
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.WetCoilEffectivenessNTUMassFlow WetCoilEffectivenessNTUMassFlow Model that tests the wet coil effectiveness-NTU model with variable mass flow rates
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)); Heater_T hea( redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, dp_nominal=1000, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, QMax_flow=Q_flow_nominal) "Heater"; Controls.SetPoints.Table tab(table=[0,273.15 + 15; 1,273.15 + 30]) "Temperature set point"; 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.Units.SI.Temperature T_a1_nominal=5 + 273.15; parameter Modelica.Units.SI.Temperature T_b1_nominal=10 + 273.15; parameter Modelica.Units.SI.Temperature T_a2_nominal=30 + 273.15; parameter Modelica.Units.SI.Temperature T_b2_nominal=15 + 273.15; parameter Modelica.Units.SI.MassFlowRate m1_flow_nominal=0.1 "Nominal mass flow rate medium 1"; parameter Modelica.Units.SI.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); Buildings.Fluid.FixedResistances.PressureDrop res_2( from_dp=true, redeclare package Medium = Medium2, dp_nominal=100, m_flow_nominal=m2_flow_nominal); Buildings.Fluid.FixedResistances.PressureDrop 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, reverseActing=false, yMin=0, 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.Units.SI.Temperature T_a1_nominal=60 + 273.15; parameter Modelica.Units.SI.Temperature T_b1_nominal=40 + 273.15; parameter Modelica.Units.SI.Temperature T_a2_nominal=5 + 273.15; parameter Modelica.Units.SI.Temperature T_b2_nominal=20 + 273.15; parameter Modelica.Units.SI.MassFlowRate m1_flow_nominal=5 "Nominal mass flow rate medium 1"; parameter Modelica.Units.SI.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.Units.SI.Temperature T_a1_nominal=60 + 273.15; parameter Modelica.Units.SI.Temperature T_b1_nominal=50 + 273.15; parameter Modelica.Units.SI.Temperature T_a2_nominal=20 + 273.15; parameter Modelica.Units.SI.Temperature T_b2_nominal=40 + 273.15; parameter Modelica.Units.SI.MassFlowRate m1_flow_nominal=5 "Nominal mass flow rate medium 1"; parameter Modelica.Units.SI.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, use_inputFilter=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.DryCoilEffectivenessNTUMassFlow Buildings.Fluid.HeatExchangers.Examples.DryCoilEffectivenessNTUMassFlow

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

Buildings.Fluid.HeatExchangers.Examples.DryCoilEffectivenessNTUMassFlow

Information

This model tests Buildings.Fluid.HeatExchangers.DryCoilEffectivenessNTU 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 DryCoilEffectivenessNTUMassFlow "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.DryCoilEffectivenessNTU 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 DryCoilEffectivenessNTUMassFlow;

Buildings.Fluid.HeatExchangers.Examples.DryCoilEffectivenessNTUPControl Buildings.Fluid.HeatExchangers.Examples.DryCoilEffectivenessNTUPControl

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

Buildings.Fluid.HeatExchangers.Examples.DryCoilEffectivenessNTUPControl

Information

This model demonstrates the use of Buildings.Fluid.HeatExchangers.DryCoilEffectivenessNTU. 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 DryCoilEffectivenessNTUPControl "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.Units.SI.Temperature T_a1_nominal=60 + 273.15 "Temperature at nominal conditions as port a1"; parameter Modelica.Units.SI.Temperature T_b1_nominal=50 + 273.15 "Temperature at nominal conditions as port b1"; parameter Modelica.Units.SI.Temperature T_a2_nominal=20 + 273.15 "Temperature at nominal conditions as port a2"; parameter Modelica.Units.SI.Temperature T_b2_nominal=40 + 273.15 "Temperature at nominal conditions as port b2"; parameter Modelica.Units.SI.MassFlowRate m1_flow_nominal=5 "Nominal mass flow rate medium 1"; parameter Modelica.Units.SI.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) "Boundary condition"; 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) "Boundary condition"; Buildings.Fluid.Sources.Boundary_pT sin_1( redeclare package Medium = Medium1, use_p_in=false, p=300000, T=293.15, nPorts=1) "Boundary condition"; Buildings.Fluid.Sources.Boundary_pT sou_1( redeclare package Medium = Medium1, p=300000 + 9000, nPorts=1, use_T_in=false, T=T_a1_nominal) "Boundary condition"; Buildings.Fluid.Sensors.TemperatureTwoPort temSen( redeclare package Medium = Medium2, m_flow_nominal=m2_flow_nominal) "Temperature sensor"; 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"; Buildings.Controls.Continuous.LimPID P( Ti=30, k=0.1, Td=1) "Controller"; Modelica.Blocks.Sources.Pulse TSet( amplitude=5, period=3600, offset=273.15 + 22) "Temperature setpoint"; Buildings.Fluid.HeatExchangers.DryCoilEffectivenessNTU 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) "Heat exchanger"; 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 DryCoilEffectivenessNTUPControl;

Buildings.Fluid.HeatExchangers.Examples.PlateHeatExchangerEffectivenessNTUPControl Buildings.Fluid.HeatExchangers.Examples.PlateHeatExchangerEffectivenessNTUPControl

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

Buildings.Fluid.HeatExchangers.Examples.PlateHeatExchangerEffectivenessNTUPControl

Information

This model demonstrates the use of Buildings.Fluid.HeatExchangers.PlateHeatExchangerEffectivenessNTU. The valve on the water-side is regulated to track a setpoint temperature for the water 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_nominal0.01Nominal mass flow rate medium 1 [kg/s]
MassFlowRatem2_flow_nominalm1_flow_nominal*(T_a1_nomina...Nominal mass flow rate medium 2 [kg/s]

Modelica definition

model PlateHeatExchangerEffectivenessNTUPControl "Model that demonstrates use of a plate 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.Water "Medium model for water"; parameter Modelica.Units.SI.Temperature T_a1_nominal=60 + 273.15 "Temperature at nominal conditions as port a1"; parameter Modelica.Units.SI.Temperature T_b1_nominal=50 + 273.15 "Temperature at nominal conditions as port b1"; parameter Modelica.Units.SI.Temperature T_a2_nominal=20 + 273.15 "Temperature at nominal conditions as port a2"; parameter Modelica.Units.SI.Temperature T_b2_nominal=40 + 273.15 "Temperature at nominal conditions as port b2"; parameter Modelica.Units.SI.MassFlowRate m1_flow_nominal=0.01 "Nominal mass flow rate medium 1"; parameter Modelica.Units.SI.MassFlowRate m2_flow_nominal=m1_flow_nominal*( 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") = 300000, T=303.15, nPorts=1) "Boundary condition"; Buildings.Fluid.Sources.Boundary_pT sou_2( redeclare package Medium = Medium2, nPorts=1, use_p_in=false, use_T_in=false, p(displayUnit="Pa") = 305000, T=T_a2_nominal) "Boundary condition"; Buildings.Fluid.Sources.Boundary_pT sin_1( redeclare package Medium = Medium1, use_p_in=false, p=300000, T=293.15, nPorts=1) "Boundary condition"; Buildings.Fluid.Sources.Boundary_pT sou_1( redeclare package Medium = Medium1, p=300000 + 9000, nPorts=1, use_T_in=false, T=T_a1_nominal) "Boundary condition"; Buildings.Fluid.Sensors.TemperatureTwoPort temSen( redeclare package Medium = Medium2, m_flow_nominal=m2_flow_nominal) "Temperature sensor"; 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"; Buildings.Controls.Continuous.LimPID P( Ti=30, k=0.1, Td=1) "Controller"; Modelica.Blocks.Sources.Pulse TSet( amplitude=5, period=3600, offset=273.15 + 22) "Temperature setpoint"; Buildings.Fluid.HeatExchangers.PlateHeatExchangerEffectivenessNTU hex( redeclare package Medium1 = Medium1, redeclare package Medium2 = Medium2, show_T=true, m1_flow_nominal=m1_flow_nominal, m2_flow_nominal=m2_flow_nominal, configuration=Buildings.Fluid.Types.HeatExchangerConfiguration.CounterFlow, dp1_nominal(displayUnit="Pa") = 0, dp2_nominal(displayUnit="Pa") = 3000, use_Q_flow_nominal=false, eps_nominal=0.5) "Heat exchanger"; 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 PlateHeatExchangerEffectivenessNTUPControl;

Buildings.Fluid.HeatExchangers.Examples.WaterCooler_T Buildings.Fluid.HeatExchangers.Examples.WaterCooler_T

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

Buildings.Fluid.HeatExchangers.Examples.WaterCooler_T

Information

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

The model consist of a water volume with heat gain from 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_nominal1000Nominal heat loss of the room [W]

Connectors

TypeNameDescription
replaceable package MediumMedium model

Modelica definition

model WaterCooler_T "Example model for the sensible cooler 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=1000, vol(V=V/1000), mov(nominalValuesDefineDefaultPressureCurve=true), TOut(y=273.15 + 22 - 5*cos(time/86400*2*Modelica.Constants.pi))); SensibleCooler_T coo( redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, dp_nominal=1000, T_start=289.15, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, QMin_flow=-Q_flow_nominal) "Cooler"; Controls.SetPoints.Table tab(table=[ 0, 273.15 + 10; 1, 273.15 + 30]) "Table to compute temperature set points"; equation connect(coo.port_b, THeaOut.port_a); connect(conPI.y, tab.u); connect(tab.y,coo. TSet); connect(mov.port_b,coo. port_a); end WaterCooler_T;

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)); Heater_T hea( redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, dp_nominal=1000, T_start=289.15, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, QMax_flow=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, T_start=289.15, 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; parameter Modelica.Units.SI.Temperature T_a1_nominal=5 + 273.15; parameter Modelica.Units.SI.Temperature T_b1_nominal=10 + 273.15; parameter Modelica.Units.SI.Temperature T_a2_nominal=30 + 273.15; parameter Modelica.Units.SI.Temperature T_b2_nominal=15 + 273.15; parameter Modelica.Units.SI.MassFlowRate m1_flow_nominal=0.1 "Nominal mass flow rate medium 1"; parameter Modelica.Units.SI.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); Buildings.Fluid.FixedResistances.PressureDrop res_2( from_dp=true, redeclare package Medium = Medium2, dp_nominal=100, m_flow_nominal=m2_flow_nominal); Buildings.Fluid.FixedResistances.PressureDrop 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, reverseActing=false, yMin=0, 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.WetCoilDiscretizedMassFlow Buildings.Fluid.HeatExchangers.Examples.WetCoilDiscretizedMassFlow

Model of a cooling coil that tests variable mass flow rates

Buildings.Fluid.HeatExchangers.Examples.WetCoilDiscretizedMassFlow

Information

This model demonstrates the use of Buildings.Fluid.HeatExchangers.WetCoilDiscretized 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 WetCoilDiscretizedMassFlow "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)); 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, 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, initType=Modelica.Blocks.Types.Init.SteadyState); 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 WetCoilDiscretizedMassFlow;

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.Units.SI.Temperature T_a1_nominal=5 + 273.15; parameter Modelica.Units.SI.Temperature T_b1_nominal=10 + 273.15; parameter Modelica.Units.SI.Temperature T_a2_nominal=30 + 273.15; parameter Modelica.Units.SI.Temperature T_b2_nominal=10 + 273.15; parameter Modelica.Units.SI.MassFlowRate m1_flow_nominal=5 "Nominal mass flow rate medium 1"; parameter Modelica.Units.SI.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, use_inputFilter=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, reverseActing=false) "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;

Buildings.Fluid.HeatExchangers.Examples.WetCoilEffectivenessNTUMassFlow Buildings.Fluid.HeatExchangers.Examples.WetCoilEffectivenessNTUMassFlow

Model that tests the wet coil effectiveness-NTU model with variable mass flow rates

Buildings.Fluid.HeatExchangers.Examples.WetCoilEffectivenessNTUMassFlow

Information

This example is similar to Buildings.Fluid.HeatExchangers.Examples.DryCoilEffectivenessNTUMassFlow except that the coil model Buildings.Fluid.HeatExchangers.DryCoilEffectivenessNTU is replaced here by Buildings.Fluid.HeatExchangers.WetCoilEffectivenessNTU.

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 WetCoilEffectivenessNTUMassFlow "Model that tests the wet coil effectiveness-NTU model with 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.WetCoilEffectivenessNTU 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, 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.SteadyState) "Heat exchanger"; Sensors.RelativeHumidityTwoPort senRelHum( redeclare package Medium = Medium2, m_flow_nominal=m2_flow_nominal) "Relative humidity sensor"; 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 WetCoilEffectivenessNTUMassFlow;