Package with base classes for Buildings.Fluid.HeatExchangers.Examples
Information
This package contains base classes that are used to construct the models in
Buildings.Fluid.HeatExchangers.Examples.
Extends from Modelica.Icons.BasesPackage (Icon for packages containing base classes).
Package Content
Name |
Description |
EffectivenessNTUMassFlow
|
Partial model of epsilon-NTU coil that tests variable mass flow rates |
Heater
|
Base class for example model for the heater and cooler |
WetCoilDiscretized
|
Model that demonstrates use of a finite volume model of a heat exchanger with condensation |
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
partial model EffectivenessNTUMassFlow
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.HeatFlowRate Q_flow_nominal = m1_flow_nominal*4200*(T_a1_nominal-T_b1_nominal)
;
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.MassFlowSource_T sin_2(
redeclare package Medium = Medium2,
T=T_a2_nominal,
use_m_flow_in=true) ;
Buildings.Fluid.Sources.Boundary_pT sou_2(
redeclare package Medium = Medium2,
T=T_a2_nominal,
X={0.02,1 - 0.02},
use_T_in=true,
use_X_in=true) ;
Buildings.Fluid.Sources.MassFlowSource_T sin_1(
redeclare package Medium = Medium1,
T=T_a1_nominal,
use_m_flow_in=true) ;
Buildings.Fluid.Sources.Boundary_pT sou_1(
redeclare package Medium = Medium1,
use_T_in=false,
T=T_a1_nominal) ;
Modelica.Blocks.Sources.Constant relHum(k=0.8) ;
Buildings.Utilities.Psychrometrics.X_pTphi x_pTphi(use_p_in=false);
Modelica.Blocks.Sources.Constant temSou_2(k=T_a2_nominal)
;
Modelica.Blocks.Math.Gain mWat_flow(k=-m1_flow_nominal)
;
Modelica.Blocks.Sources.TimeTable mWatGai(
table=[0,1; 0.1,1; 0.2,0.01; 0.3,0.01],
timeScale=3600)
;
Modelica.Blocks.Sources.TimeTable mAirGai(
table=[0,1; 0.5,1; 0.6,-1; 0.7,0; 1,0],
timeScale=3600)
;
Modelica.Blocks.Math.Gain mAir_flow(k=-m2_flow_nominal) ;
equation
connect(x_pTphi.X, sou_2.X_in);
connect(relHum.y, x_pTphi.phi);
connect(temSou_2.y, x_pTphi.T);
connect(temSou_2.y, sou_2.T_in);
connect(mWatGai.y, mWat_flow.u);
connect(mWat_flow.y, sin_1.m_flow_in);
connect(mAirGai.y, mAir_flow.u);
connect(mAir_flow.y, sin_2.m_flow_in);
end EffectivenessNTUMassFlow;
Base class for example model for the heater and cooler
Information
This partial model is used to construct the models
Buildings.Fluid.HeatExchangers.Examples.AirHeater_T
and
Buildings.Fluid.HeatExchangers.Examples.AirHeater_u and
the similar models
Buildings.Fluid.HeatExchangers.Examples.WaterHeater_T
and
Buildings.Fluid.HeatExchangers.Examples.WaterHeater_u.
It consists of a volume with heat loss to the ambient,
a fan,
a set point for the temperature of the volume and a PI controller.
The instance bou
is required to set a reference pressure
for system models in which the fluid is modelled as an incompressible fluid,
and it also is required to account for a variation of density of the fluid.
Parameters
Type | Name | Default | Description |
replaceable package Medium | Modelica.Media.Interfaces.Pa... | 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
partial model Heater
replaceable package Medium =
Modelica.Media.Interfaces.PartialMedium
;
parameter Modelica.SIunits.Volume V = 6*6*2.7 ;
parameter Modelica.SIunits.MassFlowRate m_flow_nominal = V*1.2*6/3600
;
parameter Modelica.SIunits.HeatFlowRate Q_flow_nominal = 30*6*6
;
Buildings.Fluid.MixingVolumes.MixingVolume vol(
redeclare package Medium =
Medium,
T_start=289.15,
V=V,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
m_flow_nominal=m_flow_nominal,
mSenFac=2,
nPorts=3);
Modelica.Thermal.HeatTransfer.Components.ThermalConductor theCon(
G=Q_flow_nominal/20) ;
Buildings.HeatTransfer.Sources.PrescribedTemperature TBou
;
Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor TVol
;
Buildings.Fluid.Movers.FlowControlled_m_flow mov(
redeclare package Medium =
Medium,
m_flow_nominal=m_flow_nominal,
addPowerToMedium=false,
energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState) ;
Modelica.Blocks.Sources.RealExpression TOut(
y(
final unit="K", displayUnit="degC")=
273.15 + 16 - 5*
cos(time/86400*2*Modelica.Constants.pi))
;
Modelica.Blocks.Sources.Pulse TSet(
amplitude=4,
period=86400,
offset=273.15 + 16,
startTime=7*3600,
y(
final unit="K", displayUnit="degC")) ;
Controls.Continuous.LimPID conPI(
k=1,
yMax=1,
yMin=0,
Ti=120) ;
Modelica.Blocks.Sources.Constant mFan_flow(k=m_flow_nominal)
;
Buildings.Fluid.Sources.Boundary_pT bou(
redeclare package Medium =
Medium,
nPorts=1)
;
Sensors.TemperatureTwoPort THeaOut(
redeclare package Medium =
Medium,
m_flow_nominal=m_flow_nominal,
T_start=289.15) ;
FixedResistances.PressureDrop res(
redeclare package Medium =
Medium,
m_flow_nominal=m_flow_nominal,
dp_nominal=100,
linearized=true) ;
equation
connect(theCon.port_a, TBou.port);
connect(vol.heatPort, theCon.port_b);
connect(vol.heatPort, TVol.port);
connect(TOut.y, TBou.T);
connect(TVol.T, conPI.u_m);
connect(TSet.y, conPI.u_s);
connect(mFan_flow.y,mov. m_flow_in);
connect(THeaOut.port_b, vol.ports[1]);
connect(vol.ports[2],mov. port_a);
connect(res.port_b, bou.ports[1]);
connect(res.port_a, vol.ports[3]);
end Heater;
Model that demonstrates use of a finite volume model of a heat exchanger with condensation
Information
This is the base model that is used to test the initialization of the coil model.
There are three instances of the coil model, each having different settings
for the initial conditions.
Parameters
Type | Name | Default | Description |
replaceable package Medium2 | Modelica.Media.Interfaces.Pa... | Medium for air-side |
Temperature | T_a1_nominal | 5 + 273.15 | Water inlet temperature [K] |
Temperature | T_b1_nominal | 10 + 273.15 | Water outlet temperature [K] |
Temperature | T_a2_nominal | 30 + 273.15 | Air inlet temperature [K] |
Temperature | T_b2_nominal | 10 + 273.15 | Air inlet temperature [K] |
MassFlowRate | m1_flow_nominal | 5 | Nominal mass flow rate water-side [kg/s] |
MassFlowRate | m2_flow_nominal | m1_flow_nominal*4200/1000*(T... | Nominal mass flow rate air-side [kg/s] |
Connectors
Type | Name | Description |
replaceable package Medium2 | Medium for air-side |
Modelica definition
partial model WetCoilDiscretized
package Medium1 =
Buildings.Media.Water ;
replaceable package Medium2 =
Modelica.Media.Interfaces.PartialMedium
;
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.HeatExchangers.WetCoilDiscretized hexFixIni(
redeclare package Medium1 = Medium1,
redeclare package Medium2 =
Medium2,
m1_flow_nominal=m1_flow_nominal,
m2_flow_nominal=m2_flow_nominal,
dp2_nominal(displayUnit="Pa") = 200,
nPipPar=1,
nPipSeg=3,
nReg=2,
dp1_nominal(displayUnit="Pa") = 5000,
UA_nominal=m1_flow_nominal*4200*(T_a1_nominal - T_b1_nominal)/
Buildings.Fluid.HeatExchangers.BaseClasses.lmtd(
T_a1_nominal,
T_b1_nominal,
T_a2_nominal,
T_b2_nominal),
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
show_T=true) ;
Sources.MassFlowSource_T sin_2(
redeclare package Medium =
Medium2,
nPorts=1,
use_m_flow_in=true,
T=303.15);
Buildings.Fluid.Sources.Boundary_pT sou_2(
redeclare package Medium =
Medium2,
nPorts=1,
T=293.15);
Modelica.Blocks.Sources.Ramp TWat(
duration=60,
height=15,
offset=273.15 + 5,
startTime=0) ;
Sources.MassFlowSource_T sin_1(
redeclare package Medium = Medium1,
nPorts=1,
use_m_flow_in=true,
T=293.15);
Buildings.Fluid.Sources.Boundary_pT sou_1(
redeclare package Medium = Medium1,
p=300000 + 5000,
use_T_in=true,
T=293.15,
nPorts=1);
Buildings.Fluid.HeatExchangers.WetCoilDiscretized hexSteStaIni(
redeclare package Medium1 = Medium1,
redeclare package Medium2 =
Medium2,
m1_flow_nominal=m1_flow_nominal,
m2_flow_nominal=m2_flow_nominal,
dp2_nominal(displayUnit="Pa") = 200,
nPipPar=1,
nPipSeg=3,
nReg=2,
dp1_nominal(displayUnit="Pa") = 5000,
UA_nominal=m1_flow_nominal*4200*(T_a1_nominal - T_b1_nominal)/
Buildings.Fluid.HeatExchangers.BaseClasses.lmtd(
T_a1_nominal,
T_b1_nominal,
T_a2_nominal,
T_b2_nominal),
energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyStateInitial,
show_T=true) ;
Sources.MassFlowSource_T sin_3(
redeclare package Medium =
Medium2,
nPorts=1,
use_m_flow_in=true,
T=303.15);
Buildings.Fluid.Sources.Boundary_pT sou_3(
redeclare package Medium =
Medium2,
nPorts=1,
T=293.15);
Sources.MassFlowSource_T sin_4(
redeclare package Medium = Medium1,
nPorts=1,
use_m_flow_in=true,
T=293.15);
Buildings.Fluid.Sources.Boundary_pT sou_4(
redeclare package Medium = Medium1,
p=300000 + 5000,
use_T_in=true,
T=293.15,
nPorts=1);
Buildings.Fluid.HeatExchangers.WetCoilDiscretized hexSteSta(
redeclare package Medium1 = Medium1,
redeclare package Medium2 =
Medium2,
m1_flow_nominal=m1_flow_nominal,
m2_flow_nominal=m2_flow_nominal,
dp2_nominal(displayUnit="Pa") = 200,
nPipPar=1,
nPipSeg=3,
nReg=2,
dp1_nominal(displayUnit="Pa") = 5000,
UA_nominal=m1_flow_nominal*4200*(T_a1_nominal - T_b1_nominal)/
Buildings.Fluid.HeatExchangers.BaseClasses.lmtd(
T_a1_nominal,
T_b1_nominal,
T_a2_nominal,
T_b2_nominal),
energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState,
show_T=true) ;
Sources.MassFlowSource_T sin_5(
redeclare package Medium =
Medium2,
nPorts=1,
use_m_flow_in=true,
T=303.15);
Buildings.Fluid.Sources.Boundary_pT sou_5(
redeclare package Medium =
Medium2,
nPorts=1,
T=293.15);
Sources.MassFlowSource_T sin_6(
redeclare package Medium = Medium1,
nPorts=1,
use_m_flow_in=true,
T=293.15);
Buildings.Fluid.Sources.Boundary_pT sou_6(
redeclare package Medium = Medium1,
p=300000 + 5000,
use_T_in=true,
T=293.15,
nPorts=1);
Modelica.Blocks.Sources.Ramp m2_flow(
duration=60,
startTime=60,
height=1.1*m2_flow_nominal,
offset=-m2_flow_nominal) ;
Modelica.Blocks.Sources.Ramp m1_flow(
duration=60,
startTime=180,
height=1.1*m1_flow_nominal,
offset=-m1_flow_nominal) ;
Modelica.Blocks.Sources.Ramp m1_flow1(
duration=60,
startTime=180,
height=1.1*m1_flow_nominal,
offset=-m1_flow_nominal) ;
Modelica.Blocks.Sources.Ramp m1_flow2(
duration=60,
startTime=180,
height=1.1*m1_flow_nominal,
offset=-m1_flow_nominal) ;
equation
connect(TWat.y, sou_1.T_in);
connect(sou_1.ports[1], hexFixIni.port_a1);
connect(sou_2.ports[1], hexFixIni.port_a2);
connect(hexFixIni.port_b1, sin_1.ports[1]);
connect(hexFixIni.port_b2, sin_2.ports[1]);
connect(TWat.y,sou_4. T_in);
connect(sou_4.ports[1], hexSteStaIni.port_a1);
connect(sou_3.ports[1], hexSteStaIni.port_a2);
connect(hexSteStaIni.port_b1, sin_4.ports[1]);
connect(TWat.y,sou_6. T_in);
connect(sou_6.ports[1], hexSteSta.port_a1);
connect(sou_5.ports[1], hexSteSta.port_a2);
connect(hexSteSta.port_b1, sin_6.ports[1]);
connect(hexSteSta.port_b2, sin_5.ports[1]);
connect(hexSteStaIni.port_b2, sin_3.ports[1]);
connect(m2_flow.y, sin_2.m_flow_in);
connect(m2_flow.y, sin_3.m_flow_in);
connect(m2_flow.y, sin_5.m_flow_in);
connect(m1_flow.y, sin_1.m_flow_in);
connect(m1_flow1.y, sin_4.m_flow_in);
connect(m1_flow2.y, sin_6.m_flow_in);
end WetCoilDiscretized;