Buildings.HeatExchangers.Examples

Collection of models that illustrate model use and test models

Package Content

NameDescription
ConstantEffectiveness  
HeaterCoolerIdeal  
SensibleCoilDiscretized  
SensibleHexElement  


Buildings.HeatExchangers.Examples.ConstantEffectiveness

Buildings.HeatExchangers.Examples.ConstantEffectiveness

Parameters

TypeNameDefaultDescription
replaceable package Medium_1Buildings.Media.ConstantProp... 

Connectors

TypeNameDescription
replaceable package Medium_1 

Modelica definition

model ConstantEffectiveness 
  import Buildings;
  
 package Medium_1 = Buildings.Media.ConstantPropertyLiquidWater;
 package Medium_2 = Buildings.Media.PerfectGases.MoistAir 
    "Medium in the component";
  
  Modelica_Fluid.Sources.PrescribedBoundary_pTX sin_2(          redeclare 
      package Medium = Medium_2, T=273.15 + 10);
    Modelica.Blocks.Sources.Ramp PIn(
    offset=101325,
    height=200,
    duration=60);
  Modelica_Fluid.Sources.PrescribedBoundary_pTX sou_2(          redeclare 
      package Medium = Medium_2, T=273.15 + 5);
    Modelica.Blocks.Sources.Ramp TWat(
    height=10,
    duration=60,
    offset=273.15 + 30,
    startTime=60) "Water temperature";
  Modelica.Blocks.Sources.Constant TDb(k=293.15) "Drybulb temperature";
    Modelica.Blocks.Sources.Constant POut(k=101325);
  Modelica_Fluid.Sources.PrescribedBoundary_pTX sin_1(          redeclare 
      package Medium = Medium_1,
    p=300000,
    T=273.15 + 30);
  Modelica_Fluid.Sources.PrescribedBoundary_pTX sou_1(
    redeclare package Medium = Medium_1,
    p=300000 + 5000,
    T=273.15 + 50);
    Fluids.FixedResistances.FixedResistanceDpM res_2(
    from_dp=true,
    m0_flow=5,
    dp0=10,
    redeclare package Medium = Medium_2);
    Fluids.FixedResistances.FixedResistanceDpM res_1(
    from_dp=true,
    m0_flow=5,
    redeclare package Medium = Medium_1,
    dp0=500);
    Modelica.Blocks.Sources.Ramp PSin_1(
    duration=60,
    offset=300000,
    startTime=240,
    height=10000);
  Buildings.HeatExchangers.ConstantEffectiveness hex(redeclare package Medium_1
      = Medium_1, redeclare package Medium_2 = Medium_2);
equation 
  connect(PIn.y,sou_2. p_in);
  connect(POut.y,sin_2. p_in);
  connect(sin_2.port,res_2. port_b);
  connect(sin_1.port,res_1. port_b);
  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.port, hex.port_a1);
  connect(hex.port_b1, res_1.port_a);
  connect(res_2.port_a, hex.port_b2);
  connect(hex.port_a2, sou_2.port);
end ConstantEffectiveness;

Buildings.HeatExchangers.Examples.HeaterCoolerIdeal

Buildings.HeatExchangers.Examples.HeaterCoolerIdeal

Information


Model that tests the basic class that is used for the heater models. It adds and removes heat for forward and reverse flow. The top and bottom models should give similar results, although the sign of the temperature difference over the components differ because of the reverse flow. The model uses assert statements that will be triggered if results that are expected to be close to each other differ by more than a prescribed threshold.


Parameters

TypeNameDefaultDescription
replaceable package MediumBuildings.Media.ConstantProp... 

Connectors

TypeNameDescription
replaceable package Medium 

Modelica definition

model HeaterCoolerIdeal 
  import Buildings;
  
 package Medium = Buildings.Media.ConstantPropertyLiquidWater;
  Buildings.HeatExchangers.HeaterCoolerIdeal hea1(redeclare package Medium = 
        Medium, Q0_flow=5000) "Heater and cooler";
  Modelica.Blocks.Sources.Constant TDb(k=293.15) "Drybulb temperature";
  Modelica_Fluid.Sources.PrescribedBoundary_pTX sou_1(
    T=293.15,
    redeclare package Medium = Medium,
    p=101335);
    Buildings.Fluids.FixedResistances.FixedResistanceDpM res_11(
    from_dp=true,
    redeclare package Medium = Medium,
    dp0=5,
    m0_flow=0.5);
    Buildings.Fluids.FixedResistances.FixedResistanceDpM res_12(
    from_dp=true,
    redeclare package Medium = Medium,
    dp0=5,
    m0_flow=0.5);
  Modelica_Fluid.Sources.PrescribedBoundary_pTX sin_1(          redeclare 
      package Medium = Medium, T=288.15);
    Modelica.Blocks.Sources.Constant POut(k=101325);
    Modelica.Blocks.Sources.Ramp u(
    height=2,
    duration=1,
    offset=-1,
    startTime=0) "Control signal";
  Buildings.HeatExchangers.HeaterCoolerIdeal hea2(
                                                 redeclare package Medium = 
        Medium, Q0_flow=5000) "Heater and cooler";
  Modelica.Blocks.Math.Gain gain(k=-1);
  Buildings.HeatExchangers.HeaterCoolerIdeal hea3(redeclare package Medium = 
        Medium, Q0_flow=5000) "Heater and cooler";
  Modelica_Fluid.Sources.PrescribedBoundary_pTX sou_2(
    T=293.15,
    redeclare package Medium = Medium,
    p=101335);
    Buildings.Fluids.FixedResistances.FixedResistanceDpM res_2(
    from_dp=true,
    redeclare package Medium = Medium,
    dp0=5,
    m0_flow=0.5);
    Buildings.Fluids.FixedResistances.FixedResistanceDpM res_3(
    from_dp=true,
    redeclare package Medium = Medium,
    dp0=5,
    m0_flow=0.5);
  Modelica_Fluid.Sources.PrescribedBoundary_pTX sin_2(          redeclare 
      package Medium = Medium, T=288.15);
  Buildings.HeatExchangers.HeaterCoolerIdeal hea4(
                                                 redeclare package Medium = 
        Medium, Q0_flow=5000) "Heater and cooler";
    Buildings.Fluids.FixedResistances.FixedResistanceDpM res_4(
    from_dp=true,
    redeclare package Medium = Medium,
    dp0=5,
    m0_flow=0.5);
  Modelica_Fluid.Volumes.MixingVolume mix1(redeclare package Medium = Medium, V=
       0.000001);
  Buildings.Utilities.Controls.AssertEquality ass1(startTime=0.2);
  Modelica.Blocks.Sources.RealExpression y1(y=hea2.medium_b.T_degC);
  Modelica.Blocks.Sources.RealExpression y2(y=hea1.medium_b.T_degC);
  Buildings.Utilities.Controls.AssertEquality ass2(startTime=0.2);
  Modelica.Blocks.Sources.RealExpression y3(y=hea2.medium_a.T_degC);
  Modelica.Blocks.Sources.RealExpression y4(y=hea1.medium_a.T_degC);
  Buildings.Utilities.Controls.AssertEquality ass3(startTime=0.2, threShold=2);
  Modelica.Blocks.Sources.RealExpression y5(y=hea4.medium_b.T_degC);
  Modelica.Blocks.Sources.RealExpression y6(y=hea3.medium_b.T_degC);
  Buildings.Utilities.Controls.AssertEquality ass4(startTime=0.2, threShold=2);
  Modelica.Blocks.Sources.RealExpression y7(y=hea4.medium_a.T_degC);
  Modelica.Blocks.Sources.RealExpression y8(y=hea3.medium_a.T_degC);
  Buildings.HeatExchangers.HeaterCoolerIdeal hea5(redeclare package Medium = 
        Medium, Q0_flow=5000) "Heater and cooler";
  Modelica.Blocks.Sources.Constant TDb1(
                                       k=293.15) "Drybulb temperature";
  Modelica_Fluid.Sources.PrescribedBoundary_pTX sou_3(
    T=293.15,
    redeclare package Medium = Medium,
    p=101335);
    Buildings.Fluids.FixedResistances.FixedResistanceDpM res_1(
    from_dp=true,
    redeclare package Medium = Medium,
    dp0=5,
    m0_flow=0.5);
    Buildings.Fluids.FixedResistances.FixedResistanceDpM res_5(
    from_dp=true,
    redeclare package Medium = Medium,
    dp0=5,
    m0_flow=0.5);
  Modelica_Fluid.Sources.PrescribedBoundary_pTX sin_3(          redeclare 
      package Medium = Medium, T=288.15);
    Modelica.Blocks.Sources.Constant POut1(
                                          k=101325);
  Buildings.HeatExchangers.HeaterCoolerIdeal hea6(
                                                 redeclare package Medium = 
        Medium, Q0_flow=5000) "Heater and cooler";
  Buildings.HeatExchangers.HeaterCoolerIdeal hea7(redeclare package Medium = 
        Medium, Q0_flow=5000) "Heater and cooler";
  Modelica_Fluid.Sources.PrescribedBoundary_pTX sou_4(
    T=293.15,
    redeclare package Medium = Medium,
    p=101335);
    Buildings.Fluids.FixedResistances.FixedResistanceDpM res_6(
    from_dp=true,
    redeclare package Medium = Medium,
    dp0=5,
    m0_flow=0.5);
    Buildings.Fluids.FixedResistances.FixedResistanceDpM res_7(
    from_dp=true,
    redeclare package Medium = Medium,
    dp0=5,
    m0_flow=0.5);
  Modelica_Fluid.Sources.PrescribedBoundary_pTX sin_4(          redeclare 
      package Medium = Medium, T=288.15);
  Buildings.HeatExchangers.HeaterCoolerIdeal hea8(
                                                 redeclare package Medium = 
        Medium, Q0_flow=5000) "Heater and cooler";
    Buildings.Fluids.FixedResistances.FixedResistanceDpM res_8(
    from_dp=true,
    redeclare package Medium = Medium,
    dp0=5,
    m0_flow=0.5);
  Modelica_Fluid.Volumes.MixingVolume mix2(redeclare package Medium = Medium, V=
       0.000001);
  Buildings.Utilities.Controls.AssertEquality ass5(startTime=0.2);
  Modelica.Blocks.Sources.RealExpression y9(y=hea6.medium_b.T_degC);
  Modelica.Blocks.Sources.RealExpression y10(
                                            y=hea5.medium_b.T_degC);
  Buildings.Utilities.Controls.AssertEquality ass6(startTime=0.2);
  Modelica.Blocks.Sources.RealExpression y11(
                                            y=hea6.medium_a.T_degC);
  Modelica.Blocks.Sources.RealExpression y12(
                                            y=hea5.medium_a.T_degC);
  Buildings.Utilities.Controls.AssertEquality ass7(startTime=0.2, threShold=2);
  Modelica.Blocks.Sources.RealExpression y13(
                                            y=hea8.medium_b.T_degC);
  Modelica.Blocks.Sources.RealExpression y14(
                                            y=hea7.medium_b.T_degC);
  Buildings.Utilities.Controls.AssertEquality ass8(startTime=0.2, threShold=2);
  Modelica.Blocks.Sources.RealExpression y15(
                                            y=hea8.medium_a.T_degC);
  Modelica.Blocks.Sources.RealExpression y16(
                                            y=hea7.medium_a.T_degC);
  Buildings.Utilities.Controls.AssertEquality ass9(threShold=1E-2, startTime=
        0.3);
  Modelica.Blocks.Sources.RealExpression y17(y=hea2.medium_b.T_degC);
  Modelica.Blocks.Sources.RealExpression y18(y=hea5.medium_b.T_degC);
  Buildings.Utilities.Controls.AssertEquality ass10(threShold=1E-2, startTime=
        0.3);
  Modelica.Blocks.Sources.RealExpression y19(y=hea4.medium_a.T_degC);
  Modelica.Blocks.Sources.RealExpression y20(y=hea7.medium_a.T_degC);
equation 
  connect(POut.y,sin_1. p_in);
  connect(sou_1.port,res_11. port_a);
  connect(TDb.y,sou_1. T_in);
  connect(sin_1.port, res_12.port_a);
  connect(res_11.port_b, hea1.port_a);
  connect(u.y, hea1.u);
  connect(gain.y, hea2.u);
  connect(u.y, gain.u);
  connect(res_12.port_b, hea2.port_a);
  connect(POut.y,sin_2. p_in);
  connect(sou_2.port, res_2.port_a);
  connect(TDb.y,sou_2. T_in);
  connect(sin_2.port, res_3.port_a);
  connect(res_2.port_b, hea3.port_a);
  connect(u.y, hea3.u);
  connect(gain.y, hea4.u);
  connect(hea3.port_b, mix1.port_a);
  connect(mix1.port_b, res_4.port_a);
  connect(res_3.port_b, hea4.port_a);
  connect(hea4.port_b, res_4.port_b);
  connect(hea1.port_b, hea2.port_b);
  connect(y1.y, ass1.u1);
  connect(y2.y, ass1.u2);
  connect(y3.y, ass2.u1);
  connect(y4.y, ass2.u2);
  connect(y5.y, ass3.u1);
  connect(y6.y, ass3.u2);
  connect(y7.y, ass4.u1);
  connect(y8.y, ass4.u2);
  connect(POut1.y, sin_3.p_in);
  connect(TDb1.y, sou_3.T_in);
  connect(res_1.port_b, hea5.port_a);
  connect(res_5.port_b, hea6.port_a);
  connect(POut1.y, sin_4.p_in);
  connect(TDb1.y, sou_4.T_in);
  connect(res_6.port_b,hea7. port_a);
  connect(hea7.port_b,mix2. port_a);
  connect(mix2.port_b,res_8. port_a);
  connect(res_7.port_b,hea8. port_a);
  connect(hea8.port_b,res_8. port_b);
  connect(hea5.port_b,hea6. port_b);
  connect(y9.y,ass5. u1);
  connect(y10.y, ass5.u2);
  connect(y11.y, ass6.u1);
  connect(y12.y, ass6.u2);
  connect(y13.y, ass7.u1);
  connect(y14.y, ass7.u2);
  connect(y15.y, ass8.u1);
  connect(y16.y, ass8.u2);
  connect(sou_3.port, res_5.port_a);
  connect(sin_3.port, res_1.port_a);
  connect(sin_4.port, res_6.port_a);
  connect(sou_4.port, res_7.port_a);
  connect(y17.y,ass9. u1);
  connect(y18.y,ass9. u2);
  connect(y19.y,ass10. u1);
  connect(y20.y,ass10. u2);
  connect(u.y, hea6.u);
  connect(u.y, hea8.u);
  connect(gain.y, hea5.u);
  connect(gain.y, hea7.u);
end HeaterCoolerIdeal;

Buildings.HeatExchangers.Examples.SensibleCoilDiscretized

Buildings.HeatExchangers.Examples.SensibleCoilDiscretized

Parameters

TypeNameDefaultDescription
replaceable package Medium_1Buildings.Media.ConstantProp... 

Connectors

TypeNameDescription
replaceable package Medium_1 

Modelica definition

model SensibleCoilDiscretized 
  
 package Medium_1 = Buildings.Media.ConstantPropertyLiquidWater;
 package Medium_2 = Buildings.Media.SimpleAirPTDecoupled 
    "Medium in the component";
  
  Buildings.HeatExchangers.SensibleCoilDiscretized hex(
    redeclare package Medium_1 = Medium_1,
    redeclare package Medium_2 = Medium_2,
    m0_flow_1=5,
    dp0_1=2000,
    m0_flow_2=5,
    dp0_2=200,
    Q0_flow=50000,
    nReg=2,
    nPipPar=1,
    nPipSeg=3);
  Modelica_Fluid.Sources.PrescribedBoundary_pTX sin_2(T=293.15, redeclare 
      package Medium = Medium_2);
    Modelica.Blocks.Sources.Ramp PIn(
    offset=101325,
    height=200,
    duration=60);
  Modelica_Fluid.Sources.PrescribedBoundary_pTX sou_2(T=283.15, redeclare 
      package Medium = Medium_2);
    Modelica.Blocks.Sources.Ramp TWat(
    height=10,
    duration=60,
    offset=273.15 + 30,
    startTime=60) "Water temperature";
  Modelica.Blocks.Sources.Constant TDb(k=293.15) "Drybulb temperature";
    Modelica.Blocks.Sources.Constant POut(k=101325);
  Modelica_Fluid.Sources.PrescribedBoundary_pTX sin_1(          redeclare 
      package Medium = Medium_1,
    p=300000,
    T=293.15);
  Modelica_Fluid.Sources.PrescribedBoundary_pTX sou_1(
    T=293.15,
    redeclare package Medium = Medium_1,
    p=300000 + 5000);
    Fluids.FixedResistances.FixedResistanceDpM res_2(
    from_dp=true,
    m0_flow=5,
    dp0=10,
    redeclare package Medium = Medium_2);
    Fluids.FixedResistances.FixedResistanceDpM res_1(
    from_dp=true,
    m0_flow=5,
    dp0=10,
    redeclare package Medium = Medium_1);
    Modelica.Blocks.Sources.Ramp PSin_1(
    duration=60,
    height=5000,
    offset=300000,
    startTime=240);
equation 
  connect(PIn.y,sou_2. p_in);
  connect(POut.y,sin_2. p_in);
  connect(sin_2.port,res_2. port_b);
  connect(sin_1.port,res_1. port_b);
  connect(sou_1.port, hex.port_a1);
  connect(res_2.port_a, hex.port_b2);
  connect(hex.port_b1, res_1.port_a);
  connect(hex.port_a2, sou_2.port);
  connect(TDb.y, sou_2.T_in);
  connect(TWat.y, sou_1.T_in);
  connect(PSin_1.y, sin_1.p_in);
end SensibleCoilDiscretized;

Buildings.HeatExchangers.Examples.SensibleHexElement

Buildings.HeatExchangers.Examples.SensibleHexElement

Parameters

TypeNameDefaultDescription
replaceable package MediumModelica.Media.Air.MoistAir 

Connectors

TypeNameDescription
replaceable package Medium 

Modelica definition

model SensibleHexElement 
  import Buildings;
// package Medium = Modelica.Media.Water.ConstantPropertyLiquidWater;
 package Medium = Modelica.Media.Air.MoistAir;
  Modelica_Fluid.Sources.PrescribedBoundary_pTX sin_2(          redeclare 
      package Medium = Medium, T=288.15);
    Modelica.Blocks.Sources.Ramp PIn(
    height=20,
    offset=101320,
    duration=300,
    startTime=300);
  Modelica_Fluid.Sources.PrescribedBoundary_pTX sou_2(T=283.15, redeclare 
      package Medium = Medium);
    Modelica.Blocks.Sources.Ramp TWat(
    startTime=1,
    offset=278.15,
    height=4,
    duration=300) "Water temperature";
  Modelica.Blocks.Sources.Constant TDb(k=293.15) "Drybulb temperature";
    Modelica.Blocks.Sources.Constant POut(k=101325);
  Modelica_Fluid.Sources.PrescribedBoundary_pTX sin_1(          redeclare 
      package Medium = Medium, T=288.15);
  Modelica_Fluid.Sources.PrescribedBoundary_pTX sou_1(
    T=293.15,
    redeclare package Medium = Medium,
    p=101335);
    Fluids.FixedResistances.FixedResistanceDpM res_22(
    from_dp=true,
    m0_flow=5,
    redeclare package Medium = Medium,
    dp0=5);
    Fluids.FixedResistances.FixedResistanceDpM res_12(
    from_dp=true,
    m0_flow=5,
    redeclare package Medium = Medium,
    dp0=5);
  Buildings.HeatExchangers.BaseClasses.SensibleHexElement hex(
    redeclare package Medium_1 = Medium,
    redeclare package Medium_2 = Medium,
    m0_flow_1=5,
    m0_flow_2=5,
    UA0=9999);
  Modelica.Blocks.Sources.Constant TDb1(k=280.15) "Drybulb temperature";
    Fluids.FixedResistances.FixedResistanceDpM res_11(
    from_dp=true,
    m0_flow=5,
    redeclare package Medium = Medium,
    dp0=5);
    Fluids.FixedResistances.FixedResistanceDpM res_21(
    from_dp=true,
    m0_flow=5,
    redeclare package Medium = Medium,
    dp0=5);
  Modelica.Blocks.Sources.Constant hACon(k=9999) "Convective heat transfer";
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(sin_2.port, res_22.port_b);
  connect(sin_1.port, res_12.port_b);
  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(sou_1.port, res_11.port_a);
  connect(hex.port_a2, res_21.port_b);
  connect(sou_2.port, res_21.port_a);
  connect(hACon.y, hex.Gc_1);
  connect(hACon.y, hex.Gc_2);
end SensibleHexElement;

HTML-documentation generated by Dymola Tue May 27 12:39:48 2008.