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.BaseClasses.
Extends from Modelica.Icons.ExamplesPackage (Icon for packages containing runnable examples).
Package Content
Name |
Description |
EpsilonNTUZ
|
Test model for the functions epsilon_ntuZ and ntu_epsilonZ |
HACoilInside
|
Test model for HACoilInside |
HADryCoil
|
Test model for dry coil convection coefficient |
HANaturalCylinder
|
Test model for natural convection outside of a coil |
HexElementLatent
|
Model that tests the basic element that is used to built heat exchanger models |
HexElementLatentLoop
|
Model that tests the basic element that is used to built heat exchanger models |
HexElementSensible
|
Model that tests the basic element that is used to built heat exchanger models |
MassExchange
|
Test model for latent heat exchange |
RayleighNumber
|
Test model for RayleighNumber |
Test model for the functions epsilon_ntuZ and ntu_epsilonZ
Information
Model to test the implementation of the epsilon-NTU functions and their inverse functions.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Modelica definition
model EpsilonNTUZ
extends Modelica.Icons.Example;
import f =
Buildings.Fluid.Types.HeatExchangerFlowRegime;
Real Z[6] ;
Real epsilon[6] ;
Real eps[6] ;
Real ntu[6] ;
Real diff[6] ;
equation
for conf
in {
Integer(f.ParallelFlow),
Integer(f.CounterFlow),
Integer(f.CrossFlowUnmixed),
Integer(f.CrossFlowCMinMixedCMaxUnmixed),
Integer(f.CrossFlowCMinUnmixedCMaxMixed),
Integer(f.ConstantTemperaturePhaseChange)}
loop
Z[conf] =
abs(
cos(time));
epsilon[conf] = 0.01 + 0.98*
abs(
sin(time)) * 1/(1+Z[conf]);
ntu[conf] =
ntu_epsilonZ(epsilon[conf], Z[conf], conf);
eps[conf] =
epsilon_ntuZ(ntu[conf], Z[conf], conf);
diff[conf] = epsilon[conf] - eps[conf];
end for;
end EpsilonNTUZ;
Test model for HACoilInside
Information
Test model for
Buildings.Fluid.HeatExchanger.BaseClassess.HACoilInside.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Modelica definition
Test model for dry coil convection coefficient
Information
Test model for
Buildings.Fluid.HeatExchangers.BaseClasses.HADryCoil.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Modelica definition
model HADryCoil
extends Modelica.Icons.Example;
Buildings.Fluid.HeatExchangers.BaseClasses.HADryCoil hADryCoi(
m_flow_nominal_w=0.1,
UA_nominal=10000,
m_flow_nominal_a=2.5) ;
Modelica.Blocks.Sources.Ramp TWat(
offset=293.15,
duration=20,
startTime=40,
height=40) ;
Modelica.Blocks.Sources.Ramp TAir(
height=-20,
offset=293.15,
duration=20,
startTime=60) ;
Modelica.Blocks.Sources.Ramp mWat_flow(
height=0.1,
duration=20,
offset=0) ;
Modelica.Blocks.Sources.Ramp mAir_flow(
duration=20,
offset=0,
height=2.5,
startTime=20) ;
Buildings.Fluid.HeatExchangers.BaseClasses.HADryCoil hADryCoiAir(
m_flow_nominal_w=0.1,
UA_nominal=10000,
m_flow_nominal_a=2.5,
waterSideFlowDependent=false,
waterSideTemperatureDependent=false)
;
Buildings.Fluid.HeatExchangers.BaseClasses.HADryCoil hADryCoiWat(
m_flow_nominal_w=0.1,
UA_nominal=10000,
m_flow_nominal_a=2.5,
airSideFlowDependent=false,
airSideTemperatureDependent=false) ;
equation
connect(TWat.y, hADryCoi.T_1);
connect(hADryCoi.T_2, TAir.y);
connect(mAir_flow.y, hADryCoi.m2_flow);
connect(mWat_flow.y, hADryCoi.m1_flow);
connect(TWat.y, hADryCoiAir.T_1);
connect(hADryCoiAir.T_2, TAir.y);
connect(mAir_flow.y, hADryCoiAir.m2_flow);
connect(mWat_flow.y, hADryCoiAir.m1_flow);
connect(TWat.y, hADryCoiWat.T_1);
connect(hADryCoiWat.T_2, TAir.y);
connect(mAir_flow.y, hADryCoiWat.m2_flow);
connect(mWat_flow.y, hADryCoiWat.m1_flow);
end HADryCoil;
Test model for natural convection outside of a coil
Information
Test model for
Buildings.Fluid.HeatExchangers.BaseClasses.HANaturalCylinder.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Modelica definition
model HANaturalCylinder
extends Modelica.Icons.Example;
Buildings.Fluid.HeatExchangers.BaseClasses.HANaturalCylinder hANatCyl(
redeclare
package Medium =
Buildings.Media.Water,
ChaLen=0.1,
hA_nominal=10,
TFlu_nominal=293.15,
TSur_nominal=313.15)
;
Modelica.Blocks.Sources.Ramp TSur(
duration=100,
height=50,
offset=293.15) ;
Modelica.Blocks.Sources.Ramp TFlu(
duration=100,
startTime=150,
height=50,
offset=293.15) ;
equation
connect(TSur.y, hANatCyl.TSur);
connect(TFlu.y, hANatCyl.TFlu);
end HANaturalCylinder;
Model that tests the basic element that is used to built heat exchanger models
Information
This model verifies that the energy among the two fluid streams is conserved.
This energy is measured by the quantity netEne.y
.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Modelica definition
model HexElementLatent
extends Modelica.Icons.Example;
package Medium_W =
Buildings.Media.Water;
package Medium_A =
Buildings.Media.Air;
Buildings.Fluid.Sources.Boundary_pT sin_2(
redeclare package Medium = Medium_A,
use_p_in=true,
use_T_in=true,
T=288.15,
nPorts=1);
Modelica.Blocks.Sources.Ramp PIn(
height=20,
duration=300,
startTime=300,
offset=101324.95);
Buildings.Fluid.Sources.Boundary_pT sou_2(
redeclare package Medium = Medium_A,
use_p_in=true,
use_T_in=true,
T=283.15,
nPorts=1);
Modelica.Blocks.Sources.Ramp TWat(
startTime=1,
height=4,
duration=300,
offset=303.15) ;
Modelica.Blocks.Sources.Constant TDb(k=278.15) ;
Modelica.Blocks.Sources.Constant POut(k=101325);
Buildings.Fluid.Sources.Boundary_pT sin_1(
redeclare package Medium = Medium_W,
use_p_in=true,
T=288.15,
nPorts=1);
Buildings.Fluid.Sources.Boundary_pT sou_1(
redeclare package Medium = Medium_W,
use_T_in=true,
p=101340,
T=293.15,
nPorts=1);
Buildings.Fluid.FixedResistances.PressureDrop res_22(
m_flow_nominal=5,
dp_nominal=5,
redeclare package Medium = Medium_A);
Buildings.Fluid.FixedResistances.PressureDrop res_12(
m_flow_nominal=5,
dp_nominal=5,
redeclare package Medium = Medium_W);
Buildings.Fluid.HeatExchangers.BaseClasses.HexElementLatent hex(
m1_flow_nominal=5,
m2_flow_nominal=5,
UA_nominal=9999,
redeclare package Medium1 = Medium_W,
redeclare package Medium2 = Medium_A,
dp1_nominal=10,
dp2_nominal=10,
energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState);
Modelica.Blocks.Sources.Constant TDb1(k=303.15) ;
Modelica.Blocks.Sources.Constant hACon(k=10000) ;
Sensors.EnthalpyFlowRate senEntFlo(
redeclare package Medium = Medium_W,
m_flow_nominal=5,
tau=0,
initType=Modelica.Blocks.Types.Init.SteadyState)
;
Sensors.EnthalpyFlowRate senEntFlo1(
redeclare package Medium = Medium_W,
m_flow_nominal=5,
tau=0,
initType=Modelica.Blocks.Types.Init.SteadyState)
;
Sensors.EnthalpyFlowRate senEntFlo2(
m_flow_nominal=5,
tau=0,
initType=Modelica.Blocks.Types.Init.SteadyState,
redeclare package Medium = Medium_A) ;
Sensors.EnthalpyFlowRate senEntFlo3(
m_flow_nominal=5,
tau=0,
initType=Modelica.Blocks.Types.Init.SteadyState,
redeclare package Medium = Medium_A) ;
Modelica.Blocks.Math.MultiSum netEne(nu=4, k={1,-1,1,-1})
;
equation
connect(TDb.y, sou_1.T_in);
connect(POut.y, sin_1.p_in);
connect(PIn.y, sou_2.p_in);
connect(TWat.y, sou_2.T_in);
connect(POut.y, sin_2.p_in);
connect(TDb1.y, sin_2.T_in);
connect(hACon.y, hex.Gc_1);
connect(hACon.y, hex.Gc_2);
connect(sin_1.ports[1], res_12.port_b);
connect(sin_2.ports[1], res_22.port_b);
connect(senEntFlo.port_b, hex.port_a1);
connect(senEntFlo.port_a, sou_1.ports[1]);
connect(res_12.port_a, senEntFlo1.port_b);
connect(hex.port_b1, senEntFlo1.port_a);
connect(res_22.port_a, senEntFlo2.port_a);
connect(senEntFlo2.port_b, hex.port_b2);
connect(hex.port_a2, senEntFlo3.port_a);
connect(senEntFlo3.port_b, sou_2.ports[1]);
connect(netEne.u[1], senEntFlo.H_flow);
connect(senEntFlo1.H_flow, netEne.u[2]);
connect(senEntFlo2.H_flow, netEne.u[3]);
connect(senEntFlo3.H_flow, netEne.u[4]);
end HexElementLatent;
Model that tests the basic element that is used to built heat exchanger models
Information
This test circulates air in a loop. Air has a constant inlet temperature into the coil.
The model verifies that the air will be dehumidified
to the dewpoint of the coil surface.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Parameters
Type | Name | Default | Description |
MassFlowRate | mW_flow_nominal | 0.1 | Water mass flow rate [kg/s] |
MassFlowRate | mA_flow_nominal | 0.14 | Air mass flow rate [kg/s] |
Modelica definition
model HexElementLatentLoop
extends Modelica.Icons.Example;
package Medium_W =
Buildings.Media.Water;
package Medium_A =
Buildings.Media.Air;
parameter Modelica.SIunits.MassFlowRate mW_flow_nominal = 0.1 ;
parameter Modelica.SIunits.MassFlowRate mA_flow_nominal = 0.14 ;
Buildings.Fluid.Sources.Boundary_pT sin_2(
redeclare package Medium = Medium_A,
use_p_in=false,
use_T_in=false,
nPorts=1)
;
Buildings.Fluid.Sources.Boundary_pT sin_1(
redeclare package Medium = Medium_W, nPorts=1) ;
Sources.MassFlowSource_T sou(
redeclare package Medium = Medium_W,
m_flow=5,
nPorts=1,
use_T_in=true)
;
Buildings.Fluid.HeatExchangers.BaseClasses.HexElementLatent hex(
redeclare package Medium1 = Medium_W,
redeclare package Medium2 = Medium_A,
dp2_nominal=5,
UA_nominal=1E3,
m1_flow_nominal=mW_flow_nominal,
m2_flow_nominal=mA_flow_nominal,
dp1_nominal=0,
show_T=true,
energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState)
;
Modelica.Blocks.Sources.Constant hACon(k=70) ;
Movers.FlowControlled_m_flow fan(
redeclare package Medium = Medium_A,
m_flow_nominal=mA_flow_nominal,
inputType=Buildings.Fluid.Types.InputType.Constant,
addPowerToMedium=false,
nominalValuesDefineDefaultPressureCurve=true,
dp_nominal=5,
use_inputFilter=false,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial)
;
Buildings.Utilities.Psychrometrics.pW_TDewPoi TDewPoi
;
public
Buildings.Utilities.Psychrometrics.X_pW humRatPre(use_p_in=false)
;
Modelica.Blocks.Sources.Constant TWat(k=273.15 + 5) ;
Buildings.Fluid.HeatExchangers.PrescribedOutlet hea(
redeclare package Medium = Medium_A,
m_flow_nominal=mA_flow_nominal,
dp_nominal=0,
energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState,
use_X_wSet=false) ;
Modelica.Blocks.Sources.Constant TAir(k=273.15 + 20) ;
Modelica.Blocks.Sources.RealExpression TSur(y=hex.masExc.TSur)
;
equation
connect(hACon.y, hex.Gc_1);
connect(hACon.y, hex.Gc_2);
connect(sou.ports[1], hex.port_a1);
connect(sin_1.ports[1], hex.port_b1);
connect(fan.port_a, hex.port_b2);
connect(sin_2.ports[1], fan.port_a);
connect(TDewPoi.p_w, humRatPre.p_w);
connect(TWat.y, sou.T_in);
connect(fan.port_b, hea.port_a);
connect(hea.port_b, hex.port_a2);
connect(TAir.y, hea.TSet);
connect(TSur.y, TDewPoi.T);
end HexElementLatentLoop;
Model that tests the basic element that is used to built heat exchanger models
Information
Extends from Modelica.Icons.Example (Icon for runnable examples).
Modelica definition
model HexElementSensible
extends Modelica.Icons.Example;
package Medium_W =
Buildings.Media.Water;
package Medium_A =
Buildings.Media.Air;
Buildings.Fluid.Sources.Boundary_pT sin_2(
redeclare package Medium = Medium_A,
use_p_in=true,
use_T_in=true,
T=288.15,
nPorts=1);
Modelica.Blocks.Sources.Ramp PIn(
height=20,
duration=300,
startTime=300,
offset=101325);
Buildings.Fluid.Sources.Boundary_pT sou_2(
redeclare package Medium = Medium_A,
use_p_in=true,
use_T_in=true,
T=283.15,
nPorts=1);
Modelica.Blocks.Sources.Ramp TWat(
startTime=1,
height=4,
duration=300,
offset=303.15) ;
Modelica.Blocks.Sources.Constant TDb(k=278.15) ;
Modelica.Blocks.Sources.Constant POut(k=101325);
Buildings.Fluid.Sources.Boundary_pT sin_1(
redeclare package Medium = Medium_W,
use_p_in=true,
T=288.15,
nPorts=1);
Buildings.Fluid.Sources.Boundary_pT sou_1(
redeclare package Medium = Medium_W,
use_T_in=true,
nPorts=1,
p=101340,
T=293.15);
Buildings.Fluid.FixedResistances.PressureDrop res_22(
m_flow_nominal=5,
dp_nominal=5,
redeclare package Medium = Medium_A);
Buildings.Fluid.FixedResistances.PressureDrop res_12(
m_flow_nominal=5,
dp_nominal=5,
redeclare package Medium = Medium_W);
Buildings.Fluid.HeatExchangers.BaseClasses.HexElementSensible hex(
m1_flow_nominal=5,
m2_flow_nominal=5,
UA_nominal=9999,
redeclare package Medium1 = Medium_W,
redeclare package Medium2 = Medium_A,
dp1_nominal=5,
dp2_nominal=5,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial);
Modelica.Blocks.Sources.Constant TDb1(k=303.15) ;
Buildings.Fluid.FixedResistances.PressureDrop res_11(
m_flow_nominal=5,
dp_nominal=5,
redeclare package Medium = Medium_W);
Buildings.Fluid.FixedResistances.PressureDrop res_21(
m_flow_nominal=5,
dp_nominal=5,
redeclare package Medium = Medium_A);
Modelica.Blocks.Sources.Constant hACon(k=10000) ;
equation
connect(TDb.y, sou_1.T_in);
connect(POut.y, sin_1.p_in);
connect(PIn.y, sou_2.p_in);
connect(TWat.y, sou_2.T_in);
connect(POut.y, sin_2.p_in);
connect(hex.port_b1, res_12.port_a);
connect(res_22.port_a, hex.port_b2);
connect(TDb1.y, sin_2.T_in);
connect(res_11.port_b, hex.port_a1);
connect(hex.port_a2, res_21.port_b);
connect(hACon.y, hex.Gc_1);
connect(hACon.y, hex.Gc_2);
connect(sou_2.ports[1], res_21.port_a);
connect(sin_1.ports[1], res_12.port_b);
connect(sou_1.ports[1], res_11.port_a);
connect(sin_2.ports[1], res_22.port_b);
end HexElementSensible;
Test model for latent heat exchange
Information
Extends from Modelica.Icons.Example (Icon for runnable examples).
Modelica definition
Test model for RayleighNumber
Information
Test model for
Buildings.Fluid.HeatExchangers.BaseClasses.RayleighNumber.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Modelica definition