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 |
AirHeater_T
|
Example model for the heater with prescribed outlet temperature and air as the medium |
AirHeater_u
|
Example model for the heater with prescribed heat input and air as the medium |
DryCoilCounterFlowMassFlow
|
Model of a cooling coil that tests variable mass flow rates |
DryCoilCounterFlowPControl
|
Model that demonstrates use of a heat exchanger without condensation and with feedback control |
DryCoilDiscretized
|
Model that demonstrates use of a finite volume model of a heat exchanger without condensation |
DryCoilDiscretizedPControl
|
Model that demonstrates use of a finite volume model of a heat exchanger without condensation and with feedback control |
DryEffectivenessNTU
|
Model that demonstrates use of a heat exchanger without condensation that uses the epsilon-NTU relation |
DryEffectivenessNTUMassFlow
|
Model of epsilon-NTU dry coil that tests variable mass flow rates |
DryEffectivenessNTUPControl
|
Model that demonstrates use of a heat exchanger without condensation that uses the epsilon-NTU relation with feedback control |
WaterCooler_T
|
Example model for the sensible cooler with prescribed outlet temperature and water as the medium |
WaterHeater_T
|
Example model for the heater with prescribed outlet temperature and water as the medium |
WaterHeater_u
|
Example model for the heater with prescribed heat input and water as the medium |
WetCoilCounterFlowMassFlow
|
Model of a cooling coil that tests variable mass flow rates |
WetCoilCounterFlowPControl
|
Model that demonstrates use of a heat exchanger with condensation and with feedback control |
WetCoilDiscretizedMassFlow
|
Model of a cooling coil that tests variable mass flow rates |
WetCoilDiscretizedPControl
|
Model that demonstrates use of a finite volume model of a heat exchanger with condensation and feedback control |
BaseClasses
|
Package with base classes for Buildings.Fluid.HeatExchangers.Examples |
Example model for the heater with prescribed outlet temperature and air as the medium
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
Type | Name | Default | Description |
replaceable package Medium | PartialMedium | Medium model |
Volume | V | 6*6*2.7 | Volume [m3] |
MassFlowRate | m_flow_nominal | V*1.2*6/3600 | Nominal mass flow rate [kg/s] |
HeatFlowRate | Q_flow_nominal | 30*6*6 | Nominal heat loss of the room [W] |
Connectors
Type | Name | Description |
replaceable package Medium | Medium model |
Modelica definition
model AirHeater_T
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) ;
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;
Example model for the heater with prescribed heat input and air as the medium
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
Type | Name | Default | Description |
replaceable package Medium | PartialMedium | Medium model |
Volume | V | 6*6*2.7 | Volume [m3] |
MassFlowRate | m_flow_nominal | V*1.2*6/3600 | Nominal mass flow rate [kg/s] |
HeatFlowRate | Q_flow_nominal | 30*6*6 | Nominal heat loss of the room [W] |
Connectors
Type | Name | Description |
replaceable package Medium | Medium model |
Modelica definition
model AirHeater_u
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) ;
equation
connect(hea.port_b, THeaOut.port_a);
connect(conPI.y, hea.u);
connect(mov.port_b, hea.port_a);
end AirHeater_u;
Model of a cooling coil that tests variable mass flow rates
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
Type | Name | Default | Description |
Temperature | T_a1_nominal | 5 + 273.15 | Nominal water inlet temperature [K] |
Temperature | T_b1_nominal | 10 + 273.15 | Nominal water outlet temperature [K] |
Temperature | T_a2_nominal | 30 + 273.15 | Nominal air inlet temperature [K] |
Temperature | T_b2_nominal | 15 + 273.15 | Nominal air outlet temperature [K] |
HeatFlowRate | Q_flow_nominal | m1_flow_nominal*4200*(T_a1_n... | Nominal heat transfer [W] |
MassFlowRate | m1_flow_nominal | 0.1 | Nominal mass flow rate medium 1 [kg/s] |
MassFlowRate | m2_flow_nominal | m1_flow_nominal*4200/1000*(T... | Nominal mass flow rate medium 2 [kg/s] |
Modelica definition
model DryCoilCounterFlowMassFlow
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;
Model that demonstrates use of a heat exchanger without condensation and with feedback control
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
Type | Name | Default | Description |
Temperature | T_a1_nominal | 5 + 273.15 | [K] |
Temperature | T_b1_nominal | 10 + 273.15 | [K] |
Temperature | T_a2_nominal | 30 + 273.15 | [K] |
Temperature | T_b2_nominal | 15 + 273.15 | [K] |
MassFlowRate | m1_flow_nominal | 0.1 | Nominal mass flow rate medium 1 [kg/s] |
MassFlowRate | m2_flow_nominal | m1_flow_nominal*4200/1000*(T... | Nominal mass flow rate medium 2 [kg/s] |
Modelica definition
model DryCoilCounterFlowPControl
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 ;
parameter Modelica.SIunits.MassFlowRate m2_flow_nominal=m1_flow_nominal*4200/1000
*(T_a1_nominal - T_b1_nominal)/(T_b2_nominal - T_a2_nominal) ;
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) ;
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]) ;
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) ;
Modelica.Blocks.Sources.Ramp TWat(
height=30,
offset=T_a1_nominal,
startTime=300,
duration=2000) ;
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;
Model that demonstrates use of a finite volume model of a heat exchanger without condensation
Information
This model tests
Buildings.Fluid.HeatExchangers.DryCoilDiscretized
for different inlet conditions.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Parameters
Type | Name | Default | Description |
Temperature | T_a1_nominal | 60 + 273.15 | [K] |
Temperature | T_b1_nominal | 40 + 273.15 | [K] |
Temperature | T_a2_nominal | 5 + 273.15 | [K] |
Temperature | T_b2_nominal | 20 + 273.15 | [K] |
MassFlowRate | m1_flow_nominal | 5 | Nominal mass flow rate medium 1 [kg/s] |
MassFlowRate | m2_flow_nominal | m1_flow_nominal*4200/1000*(T... | Nominal mass flow rate medium 2 [kg/s] |
Modelica definition
model DryCoilDiscretized
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 ;
parameter Modelica.SIunits.MassFlowRate m2_flow_nominal=m1_flow_nominal*4200/1000
*(T_a1_nominal - T_b1_nominal)/(T_b2_nominal - T_a2_nominal) ;
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) ;
Modelica.Blocks.Sources.Constant TDb(k=273.15 + 5) ;
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) ;
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;
Model that demonstrates use of a finite volume model of a heat exchanger without condensation and with feedback control
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
Type | Name | Default | Description |
Temperature | T_a1_nominal | 60 + 273.15 | [K] |
Temperature | T_b1_nominal | 50 + 273.15 | [K] |
Temperature | T_a2_nominal | 20 + 273.15 | [K] |
Temperature | T_b2_nominal | 40 + 273.15 | [K] |
MassFlowRate | m1_flow_nominal | 5 | Nominal mass flow rate medium 1 [kg/s] |
MassFlowRate | m2_flow_nominal | m1_flow_nominal*4200/1000*(T... | Nominal mass flow rate medium 2 [kg/s] |
Modelica definition
model DryCoilDiscretizedPControl
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=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 ;
parameter Modelica.SIunits.MassFlowRate m2_flow_nominal=m1_flow_nominal*4200/1000
*(T_a1_nominal - T_b1_nominal)/(T_b2_nominal - T_a2_nominal) ;
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) ;
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]) ;
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) ;
Buildings.Controls.Continuous.LimPID con(
k=1,
Ti=60,
controllerType=Modelica.Blocks.Types.SimpleController.P,
Td=60) ;
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;
Model that demonstrates use of a heat exchanger without condensation that uses the epsilon-NTU relation
Information
This model tests
Buildings.Fluid.HeatExchangers.DryEffectivenessNTU
for different inlet conditions.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Parameters
Type | Name | Default | Description |
SpecificHeatCapacity | cp1 | Medium1.specificHeatCapacity... | Specific heat capacity of medium 2 [J/(kg.K)] |
SpecificHeatCapacity | cp2 | Medium2.specificHeatCapacity... | Specific heat capacity of medium 2 [J/(kg.K)] |
MassFlowRate | m1_flow | 5 | Nominal mass flow rate medium 1 [kg/s] |
MassFlowRate | m2_flow | m1_flow*cp1/cp2 | Nominal mass flow rate medium 2 [kg/s] |
Modelica definition
model DryEffectivenessNTU
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)) ;
parameter Modelica.SIunits.SpecificHeatCapacity cp2=
Medium2.specificHeatCapacityCp(
Medium2.setState_pTX(
Medium2.p_default,
Medium2.T_default,
Medium2.X_default)) ;
parameter Modelica.SIunits.MassFlowRate m1_flow=5 ;
parameter Modelica.SIunits.MassFlowRate m2_flow=m1_flow*cp1/cp2 ;
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) ;
Modelica.Blocks.Sources.Constant TDb(k=293.15) ;
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;
Model of epsilon-NTU dry coil that tests variable mass flow rates
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
Type | Name | Default | Description |
Temperature | T_a1_nominal | 5 + 273.15 | Nominal water inlet temperature [K] |
Temperature | T_b1_nominal | 10 + 273.15 | Nominal water outlet temperature [K] |
Temperature | T_a2_nominal | 30 + 273.15 | Nominal air inlet temperature [K] |
Temperature | T_b2_nominal | 15 + 273.15 | Nominal air outlet temperature [K] |
HeatFlowRate | Q_flow_nominal | m1_flow_nominal*4200*(T_a1_n... | Nominal heat transfer [W] |
MassFlowRate | m1_flow_nominal | 0.1 | Nominal mass flow rate medium 1 [kg/s] |
MassFlowRate | m2_flow_nominal | m1_flow_nominal*4200/1000*(T... | Nominal mass flow rate medium 2 [kg/s] |
Modelica definition
model DryEffectivenessNTUMassFlow
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;
Model that demonstrates use of a heat exchanger without condensation that uses the epsilon-NTU relation with feedback control
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
Type | Name | Default | Description |
Temperature | T_a1_nominal | 60 + 273.15 | Temperature at nominal conditions as port a1 [K] |
Temperature | T_b1_nominal | 50 + 273.15 | Temperature at nominal conditions as port b1 [K] |
Temperature | T_a2_nominal | 20 + 273.15 | Temperature at nominal conditions as port a2 [K] |
Temperature | T_b2_nominal | 40 + 273.15 | Temperature at nominal conditions as port b2 [K] |
MassFlowRate | m1_flow_nominal | 5 | Nominal mass flow rate medium 1 [kg/s] |
MassFlowRate | m2_flow_nominal | m1_flow_nominal*4200/1000*(T... | Nominal mass flow rate medium 2 [kg/s] |
Modelica definition
model DryEffectivenessNTUPControl
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=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 ;
parameter Modelica.SIunits.MassFlowRate m2_flow_nominal=m1_flow_nominal*4200/1000
*(T_a1_nominal - T_b1_nominal)/(T_b2_nominal - T_a2_nominal) ;
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) ;
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) ;
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;
Example model for the sensible cooler with prescribed outlet temperature and water as the medium
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
Type | Name | Default | Description |
replaceable package Medium | PartialMedium | Medium model |
Volume | V | 6*6*2.7 | Volume [m3] |
MassFlowRate | m_flow_nominal | V*1000/3600 | Nominal mass flow rate [kg/s] |
HeatFlowRate | Q_flow_nominal | 1000 | Nominal heat loss of the room [W] |
Connectors
Type | Name | Description |
replaceable package Medium | Medium model |
Modelica definition
model WaterCooler_T
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,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
QMin_flow=-Q_flow_nominal) ;
Controls.SetPoints.Table tab(table=[0, 273.15 + 10; 1, 273.15 + 30]) ;
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;
Example model for the heater with prescribed outlet temperature and water as the medium
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
Type | Name | Default | Description |
replaceable package Medium | PartialMedium | Medium model |
Volume | V | 6*6*2.7 | Volume [m3] |
MassFlowRate | m_flow_nominal | V*1000/3600 | Nominal mass flow rate [kg/s] |
HeatFlowRate | Q_flow_nominal | 100 | Nominal heat loss of the room [W] |
Connectors
Type | Name | Description |
replaceable package Medium | Medium model |
Modelica definition
model WaterHeater_T
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,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
QMax_flow=Q_flow_nominal) ;
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;
Example model for the heater with prescribed heat input and water as the medium
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
Type | Name | Default | Description |
replaceable package Medium | PartialMedium | Medium model |
Volume | V | 6*6*2.7 | Volume [m3] |
MassFlowRate | m_flow_nominal | V*1000/3600 | Nominal mass flow rate [kg/s] |
HeatFlowRate | Q_flow_nominal | 100 | Nominal heat loss of the room [W] |
Connectors
Type | Name | Description |
replaceable package Medium | Medium model |
Modelica definition
model WaterHeater_u
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) ;
equation
connect(hea.port_b, THeaOut.port_a);
connect(conPI.y, hea.u);
connect(mov.port_b, hea.port_a);
end WaterHeater_u;
Model of a cooling coil that tests variable mass flow rates
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
Type | Name | Default | Description |
Temperature | T_a1_nominal | 5 + 273.15 | Nominal water inlet temperature [K] |
Temperature | T_b1_nominal | 10 + 273.15 | Nominal water outlet temperature [K] |
Temperature | T_a2_nominal | 30 + 273.15 | Nominal air inlet temperature [K] |
Temperature | T_b2_nominal | 15 + 273.15 | Nominal air outlet temperature [K] |
HeatFlowRate | Q_flow_nominal | m1_flow_nominal*4200*(T_a1_n... | Nominal heat transfer [W] |
MassFlowRate | m1_flow_nominal | 0.1 | Nominal mass flow rate medium 1 [kg/s] |
MassFlowRate | m2_flow_nominal | m1_flow_nominal*4200/1000*(T... | Nominal mass flow rate medium 2 [kg/s] |
Modelica definition
model WetCoilCounterFlowMassFlow
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;
Model that demonstrates use of a heat exchanger with condensation and with feedback control
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
Type | Name | Default | Description |
Temperature | T_a1_nominal | 5 + 273.15 | [K] |
Temperature | T_b1_nominal | 10 + 273.15 | [K] |
Temperature | T_a2_nominal | 30 + 273.15 | [K] |
Temperature | T_b2_nominal | 15 + 273.15 | [K] |
MassFlowRate | m1_flow_nominal | 0.1 | Nominal mass flow rate medium 1 [kg/s] |
MassFlowRate | m2_flow_nominal | m1_flow_nominal*4200/1000*(T... | Nominal mass flow rate medium 2 [kg/s] |
Modelica definition
model WetCoilCounterFlowPControl
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 ;
parameter Modelica.SIunits.MassFlowRate m2_flow_nominal=m1_flow_nominal*4200/1000
*(T_a1_nominal - T_b1_nominal)/(T_b2_nominal - T_a2_nominal) ;
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) ;
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]) ;
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) ;
Modelica.Blocks.Sources.Ramp TWat(
height=30,
offset=T_a1_nominal,
startTime=300,
duration=2000) ;
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;
Model of a cooling coil that tests variable mass flow rates
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
Type | Name | Default | Description |
Temperature | T_a1_nominal | 5 + 273.15 | Nominal water inlet temperature [K] |
Temperature | T_b1_nominal | 10 + 273.15 | Nominal water outlet temperature [K] |
Temperature | T_a2_nominal | 30 + 273.15 | Nominal air inlet temperature [K] |
Temperature | T_b2_nominal | 15 + 273.15 | Nominal air outlet temperature [K] |
HeatFlowRate | Q_flow_nominal | m1_flow_nominal*4200*(T_a1_n... | Nominal heat transfer [W] |
MassFlowRate | m1_flow_nominal | 0.1 | Nominal mass flow rate medium 1 [kg/s] |
MassFlowRate | m2_flow_nominal | m1_flow_nominal*4200/1000*(T... | Nominal mass flow rate medium 2 [kg/s] |
Modelica definition
model WetCoilDiscretizedMassFlow
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;
Model that demonstrates use of a finite volume model of a heat exchanger with condensation and feedback control
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
Type | Name | Default | Description |
Temperature | T_a1_nominal | 5 + 273.15 | [K] |
Temperature | T_b1_nominal | 10 + 273.15 | [K] |
Temperature | T_a2_nominal | 30 + 273.15 | [K] |
Temperature | T_b2_nominal | 10 + 273.15 | [K] |
MassFlowRate | m1_flow_nominal | 5 | Nominal mass flow rate medium 1 [kg/s] |
MassFlowRate | m2_flow_nominal | m1_flow_nominal*4200/1000*(T... | Nominal mass flow rate medium 2 [kg/s] |
Modelica definition
model WetCoilDiscretizedPControl
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 ;
parameter Modelica.SIunits.MassFlowRate m2_flow_nominal=m1_flow_nominal*4200/1000
*(T_a1_nominal - T_b1_nominal)/(T_b2_nominal - T_a2_nominal) ;
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]) ;
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) ;
Buildings.Fluid.Actuators.Motors.IdealMotor mot(tOpe=60) ;
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;