Buildings.HeatTransfer.Examples

Collection of models that illustrate model use and test models

Information


This package contains examples for the use of models
that can be found in 
Buildings.HeatTransfer.

Extends from Buildings.BaseClasses.BaseIconExamples (Icon for Examples packages).

Package Content

NameDescription
ConductorStepResponse Test model for heat conductor
ConductorSteadyStateTransient Test model for heat conductor
ConductorSingleLayer Test model for heat conductor
ConductorMultiLayer Test model for heat conductor
ConductorInitialization Test model for heat conductor initialization
ConstructionSymmetric Test model for a construction with the same boundary condition on both sides
Convection Test model for convective heat transfer coefficients
ConstructionConvection Test model for a construction with different film coefficients


Buildings.HeatTransfer.Examples.ConductorStepResponse

Test model for heat conductor

Buildings.HeatTransfer.Examples.ConductorStepResponse

Information


This example illustrates modeling of multi-layer materials. It also tests if the 
multi-layer material computes the same heat transfer with its boundary condition 
as two instances of a single layer material. 
The insulation and the brick are computed using transient heat conduction.
The assert block will stop the simulation if the heat exchange with the boundary
condition differs.

Modelica definition

model ConductorStepResponse "Test model for heat conductor"
  import Buildings;
  Buildings.HeatTransfer.Data.Solids.Brick brick(x=0.12, nStaRef=4);
  Buildings.HeatTransfer.Data.Solids.InsulationBoard insul(
    x=0.05, nStaRef=3) "Insulation";
  Buildings.HeatTransfer.Data.OpaqueConstructions.Generic composite(nLay=2,
      material={insul,brick});
  Buildings.HeatTransfer.ConductorMultiLayer conMul(
    A=2, layers=composite);
  Buildings.HeatTransfer.ConductorSingleLayer con(
    A=2, material=brick);
  Modelica.Thermal.HeatTransfer.Sources.FixedTemperature TB(T=293.15);
  Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperature TA;
  Modelica.Blocks.Sources.Step step(
    height=10,
    offset=293.15,
    startTime=3600);
  Buildings.HeatTransfer.ConductorSingleLayer con1(
    A=2, material=insul);
  Modelica.Thermal.HeatTransfer.Sources.FixedTemperature TB1(
                                                            T=293.15);
  Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperature TA1;
  Buildings.HeatTransfer.ConductorSingleLayer con2(
    A=2, material=brick);
  Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperature TA2;
  Modelica.Thermal.HeatTransfer.Sources.FixedTemperature TB2(
                                                            T=293.15);
  Modelica.Thermal.HeatTransfer.Sensors.HeatFlowSensor heaFlo1;
  Modelica.Thermal.HeatTransfer.Sensors.HeatFlowSensor heaFlo2;
  Buildings.Utilities.Diagnostics.AssertEquality assertEquality(threShold=1E-8);
  Buildings.HeatTransfer.Convection conv1(        A=2) 
    "Convective heat transfer";
  Buildings.HeatTransfer.Convection conv2(        A=2) 
    "Convective heat transfer";
equation 
  connect(con.port_b,TB. port);
  connect(step.y,TA. T);
  connect(step.y,TA1. T);
  connect(con1.port_b,con2. port_a);
  connect(con2.port_b,TB1. port);
  connect(TA2.T,step. y);
  connect(heaFlo1.port_b,con1. port_a);
  connect(assertEquality.u1,heaFlo2. Q_flow);
  connect(assertEquality.u2,heaFlo1. Q_flow);
  connect(TA.port,con. port_a);
  connect(conMul.port_b,TB2. port);
  connect(conMul.port_a,heaFlo2. port_b);
  connect(TA1.port, conv1.fluid);
  connect(conv1.solid, heaFlo1.port_a);
  connect(TA2.port, conv2.fluid);
  connect(conv2.solid, heaFlo2.port_a);
end ConductorStepResponse;

Buildings.HeatTransfer.Examples.ConductorSteadyStateTransient

Test model for heat conductor

Buildings.HeatTransfer.Examples.ConductorSteadyStateTransient

Information


This example illustrates modeling of multi-layer materials. It also tests if the 
multi-layer material computes the same heat transfer with its boundary condition 
as two instances of a single layer material. 
The insulation is computed in steady-state, whereas the brick is computed using transient
heat conduction.
The assert block will stop the simulation if the heat exchange with the boundary
condition differs.

Modelica definition

model ConductorSteadyStateTransient "Test model for heat conductor"
  import Buildings;

  Buildings.HeatTransfer.Data.Solids.Brick brick(x=0.12, nStaRef=4);
  Buildings.HeatTransfer.Data.Solids.InsulationBoard insul(
    x=0.05,
    c=0,
    nStaRef=3) "Insulation";
  Buildings.HeatTransfer.Data.OpaqueConstructions.Generic composite(nLay=2, material=
       {insul,brick});

  Buildings.HeatTransfer.ConductorMultiLayer conMul(
    A=2, layers=composite);
  Buildings.HeatTransfer.ConductorSingleLayer con(
    A=2, material=brick);

  Modelica.Thermal.HeatTransfer.Sources.FixedTemperature TB(T=293.15);
  Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperature TA;

  Modelica.Blocks.Sources.Step step(
    height=10,
    offset=293.15,
    startTime=3600);
  Buildings.HeatTransfer.ConductorSingleLayer con1(
    A=2, material=insul);
  Modelica.Thermal.HeatTransfer.Sources.FixedTemperature TB1(T=293.15);
  Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperature TA1;
  Buildings.HeatTransfer.ConductorSingleLayer con2(
    A=2, material=brick);
  Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperature TA2;
  Modelica.Thermal.HeatTransfer.Sources.FixedTemperature TB2(T=293.15);
  Modelica.Thermal.HeatTransfer.Sensors.HeatFlowSensor heaFlo1;
  Modelica.Thermal.HeatTransfer.Sensors.HeatFlowSensor heaFlo2;
  Buildings.Utilities.Diagnostics.AssertEquality assertEquality(threShold=1E-8);
  Buildings.HeatTransfer.Convection conv1(        A=2) 
    "Convective heat transfer";
  Buildings.HeatTransfer.Convection conv2(        A=2) 
    "Convective heat transfer";
equation 
  connect(con.port_b, TB.port);
  connect(step.y, TA.T);
  connect(step.y, TA1.T);
  connect(con1.port_b, con2.port_a);
  connect(con2.port_b, TB1.port);
  connect(TA2.T, step.y);
  connect(heaFlo1.port_b, con1.port_a);
  connect(assertEquality.u1, heaFlo2.Q_flow);
  connect(assertEquality.u2, heaFlo1.Q_flow);
  connect(TA.port, con.port_a);
  connect(conMul.port_b, TB2.port);
  connect(conMul.port_a, heaFlo2.port_b);
  connect(TA1.port, conv1.fluid);
  connect(conv1.solid, heaFlo1.port_a);
  connect(TA2.port, conv2.fluid);
  connect(conv2.solid, heaFlo2.port_a);
end ConductorSteadyStateTransient;

Buildings.HeatTransfer.Examples.ConductorSingleLayer

Test model for heat conductor

Buildings.HeatTransfer.Examples.ConductorSingleLayer

Information


This example tests if two conductors in series computes the same heat transfer
as one conductor with twice the thickness.
The assert block will stop the simulation if the heat exchange with the boundary
condition differs.

Modelica definition

model ConductorSingleLayer "Test model for heat conductor"
  import Buildings;
  Buildings.HeatTransfer.ConductorSingleLayer con(A=1, material=concrete200);
  Modelica.Thermal.HeatTransfer.Sources.FixedTemperature TB(T=293.15);
  Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperature TA;
  Modelica.Blocks.Sources.Step step(
    height=10,
    offset=293.15,
    startTime=3600);
  Buildings.HeatTransfer.ConductorSingleLayer con1(
    A=1, material=concrete100);
  Modelica.Thermal.HeatTransfer.Sources.FixedTemperature TB1(
                                                            T=293.15);
  Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperature TA1;
  Buildings.HeatTransfer.ConductorSingleLayer con2(
    A=1, material=concrete100);
  Modelica.Thermal.HeatTransfer.Sensors.HeatFlowSensor heaFlo2;
  Modelica.Thermal.HeatTransfer.Sensors.HeatFlowSensor heaFlo1;
  Buildings.Utilities.Diagnostics.AssertEquality assertEquality(threShold=1E-8);
  Buildings.HeatTransfer.Data.Solids.Concrete concrete200(x=0.2, nStaRef=4);
  Buildings.HeatTransfer.Data.Solids.Concrete concrete100(x=0.1, nStaRef=2);
  Buildings.HeatTransfer.Convection conv1(              A=1) 
    "Convective heat transfer";
  Buildings.HeatTransfer.Convection conv2(              A=1) 
    "Convective heat transfer";
equation 
  connect(con.port_b, TB.port);
  connect(step.y, TA.T);
  connect(step.y, TA1.T);
  connect(con1.port_b, con2.port_a);
  connect(con2.port_b, TB1.port);
  connect(heaFlo2.port_b, con1.port_a);
  connect(heaFlo1.port_b, con.port_a);
  connect(assertEquality.u1, heaFlo2.Q_flow);
  connect(assertEquality.u2, heaFlo1.Q_flow);
  connect(TA.port, conv1.fluid);
  connect(TA1.port, conv2.fluid);
  connect(conv2.solid, heaFlo2.port_a);
  connect(conv1.solid, heaFlo1.port_a);
end ConductorSingleLayer;

Buildings.HeatTransfer.Examples.ConductorMultiLayer

Test model for heat conductor

Buildings.HeatTransfer.Examples.ConductorMultiLayer

Information


This example illustrates how to use a solid material, set its heat capacity to zero, 
and then use this material in a multi-layer construction.
The plot window shows that the insulation is computed in steady state, where
as the brick is computed using transient heat conduction.

Modelica definition

model ConductorMultiLayer "Test model for heat conductor"
  import Buildings;
  Modelica.Thermal.HeatTransfer.Sources.FixedTemperature TB(T=293.15);
  Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperature TA;
  Modelica.Blocks.Sources.Step step(
    height=10,
    offset=293.15,
    startTime=43200);
  Buildings.HeatTransfer.ConductorMultiLayer con(
    steadyStateInitial=false,
    redeclare Buildings.HeatTransfer.Data.OpaqueConstructions.Insulation100Concrete200
      layers,
    A=0.1);
  Buildings.HeatTransfer.Convection conv(              A=0.1) 
    "Convective heat transfer";
equation 
  connect(step.y, TA.T);
  connect(con.port_b, TB.port);
  connect(conv.fluid, TA.port);
  connect(conv.solid, con.port_a);
end ConductorMultiLayer;

Buildings.HeatTransfer.Examples.ConductorInitialization

Test model for heat conductor initialization

Buildings.HeatTransfer.Examples.ConductorInitialization

Information


This example illustrates how to initialize heat conductors in steady state and with
predefined temperatures.

Modelica definition

model ConductorInitialization 
  "Test model for heat conductor initialization"
  import Buildings;
  Modelica.Thermal.HeatTransfer.Sources.FixedTemperature TB(T=303.15);
  Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperature TA;
  Buildings.HeatTransfer.Data.OpaqueConstructions.Generic compositeWall(
      material={insulation,brick}, final nLay=2) 
    "Composite wall consisting of insulation and material";
  Buildings.HeatTransfer.Data.Solids.Brick brick(x=0.18, nStaRef=3);
  Buildings.HeatTransfer.Data.Solids.InsulationBoard insulation(x=0.05, nStaRef=2);

  Buildings.HeatTransfer.ConductorMultiLayer conS1(
    A=2,
    steadyStateInitial=true,
    layers=compositeWall);

  Buildings.HeatTransfer.ConductorSingleLayer conS2(
    A=2,
    steadyStateInitial=true,
    material=brick);

  Buildings.HeatTransfer.ConductorMultiLayer conD1(
    A=2,
    steadyStateInitial=false,
    layers=compositeWall,
    T_a_start=288.15,
    T_b_start=298.15);

  Buildings.HeatTransfer.ConductorSingleLayer conD2(
    A=2,
    material=brick,
    steadyStateInitial=false,
    T_a_start=288.15,
    T_b_start=298.15);

  Modelica.Thermal.HeatTransfer.Sources.FixedTemperature TB1(T=303.15);
  Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperature TA1;

  Modelica.Thermal.HeatTransfer.Sources.FixedTemperature TB2(T=303.15);
  Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperature TA2;

  Modelica.Thermal.HeatTransfer.Sources.FixedTemperature TB3(T=303.15);
  Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperature TA3;
  Modelica.Blocks.Sources.Step step(
    height=10,
    offset=283.15,
    startTime=43200);

equation 
  connect(step.y, TA.T);
  connect(conS1.port_b, TB.port);
  connect(TA.port, conS1.port_a);
  connect(conS2.port_b, TB1.port);
  connect(TA1.port, conS2.port_a);
  connect(TA1.T, step.y);
  connect(conD1.port_b, TB2.port);
  connect(TA2.port, conD1.port_a);
  connect(TA2.T, step.y);
  connect(TA3.T, step.y);
  connect(TA3.port, conD2.port_a);
  connect(conD2.port_b, TB3.port);
end ConductorInitialization;

Buildings.HeatTransfer.Examples.ConstructionSymmetric

Test model for a construction with the same boundary condition on both sides

Buildings.HeatTransfer.Examples.ConstructionSymmetric

Information


This example test the construction model. The boundary condition 
at both surfaces are identical. Thus, the model on top and the composite
model on the bottom should give identical results.
The assert block will stop the simulation if the heat exchange with the boundary
condition differs.

Modelica definition

model ConstructionSymmetric 
  "Test model for a construction with the same boundary condition on both sides"
  import Buildings;
  Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperature TA;
  Modelica.Blocks.Sources.Step step(
    offset=293.15,
    startTime=43200,
    height=20);
  Buildings.HeatTransfer.ConductorMultiLayer con(
    steadyStateInitial=true,
    redeclare Buildings.HeatTransfer.Data.OpaqueConstructions.Brick120 layers(
        material={Data.Solids.Brick(x=0.12, nStaRef=5)}),
    A=10);
  Buildings.HeatTransfer.Convection conv(        A=10, redeclare function
      qCon_flow = Buildings.HeatTransfer.Functions.ConvectiveHeatFlux.wall) 
    "Convective heat transfer";
  Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperature TA1;
  Buildings.HeatTransfer.Convection conv1(        A=10, redeclare function
      qCon_flow = Buildings.HeatTransfer.Functions.ConvectiveHeatFlux.wall) 
    "Convective heat transfer";
  Buildings.HeatTransfer.ConstructionOpaque conMod(
    steadyStateInitial=true,
    redeclare Buildings.HeatTransfer.Data.OpaqueConstructions.Brick120 layers(
        material={Data.Solids.Brick(x=0.12, nStaRef=5)}),
    A=10,
    redeclare function qCon_a_flow =
        Buildings.HeatTransfer.Functions.ConvectiveHeatFlux.wall,
    redeclare function qCon_b_flow =
        Buildings.HeatTransfer.Functions.ConvectiveHeatFlux.wall) 
    "Model of the construction with convective heat transfer";
  Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperature TA2;
  Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperature TA3;
  Modelica.Thermal.HeatTransfer.Sensors.HeatFlowSensor heaFlo1;
  Modelica.Thermal.HeatTransfer.Sensors.HeatFlowSensor heaFlo2;
  Buildings.Utilities.Diagnostics.AssertEquality assertEquality(threShold=1E-8);
  Buildings.Utilities.Diagnostics.AssertEquality assertEquality1(
                                                                threShold=1E-8);
  Modelica.Thermal.HeatTransfer.Sensors.HeatFlowSensor heaFlo3;
  Modelica.Blocks.Sources.Constant Tb(k=293.15 + 30);
equation 
  connect(step.y, TA.T);
  connect(conv.fluid, TA.port);
  connect(conv.solid, con.port_a);
  connect(conv1.solid, con.port_b);
  connect(step.y, TA2.T);
  connect(TA1.port, heaFlo1.port_a);
  connect(heaFlo1.port_b, conv1.fluid);
  connect(conMod.port_b, heaFlo3.port_b);
  connect(heaFlo3.port_a, TA3.port);
  connect(heaFlo1.Q_flow, assertEquality.u1);
  connect(heaFlo2.Q_flow, assertEquality1.u1);
  connect(heaFlo3.Q_flow, assertEquality1.u2);
  connect(heaFlo3.Q_flow, assertEquality.u2);
  connect(Tb.y, TA1.T);
  connect(Tb.y, TA3.T);
  connect(TA2.port, heaFlo2.port_b);
  connect(heaFlo2.port_a, conMod.port_a);
end ConstructionSymmetric;

Buildings.HeatTransfer.Examples.Convection

Test model for convective heat transfer coefficients

Buildings.HeatTransfer.Examples.Convection

Information


This example tests the convective heat transfer models.

Modelica definition

model Convection 
  "Test model for convective heat transfer coefficients"
  import Buildings;
  Modelica.Blocks.Sources.Ramp step(
    duration=1,
    startTime=0,
    height=10,
    offset=293.15 - 5);
  Modelica.Thermal.HeatTransfer.Sources.FixedTemperature TB(T=293.15);
  Buildings.HeatTransfer.Convection conCon(A=1, redeclare function qCon_flow =
        Buildings.HeatTransfer.Functions.ConvectiveHeatFlux.constantCoefficient);
  Buildings.HeatTransfer.Convection conVer(               A=1, redeclare 
      function qCon_flow =
        Buildings.HeatTransfer.Functions.ConvectiveHeatFlux.wall);
  Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperature TA1;
  Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperature TA2;
  Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperature TA3;
  Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperature TA4;
  Buildings.HeatTransfer.Convection conHorFluTop(
      A=1, redeclare function qCon_flow =
        Buildings.HeatTransfer.Functions.ConvectiveHeatFlux.ceiling) 
    "Convection model with fluid on top";
  Buildings.HeatTransfer.Convection conHorSolTop(
      A=1, redeclare function qCon_flow =
        Buildings.HeatTransfer.Functions.ConvectiveHeatFlux.floor) 
    "Convection model with solid on top";
  Modelica.Thermal.HeatTransfer.Sources.FixedTemperature TB1(T=293.15);
  Modelica.Thermal.HeatTransfer.Sources.FixedTemperature TB2(T=293.15);
  Modelica.Thermal.HeatTransfer.Sources.FixedTemperature TB3(T=293.15);
equation 
  connect(conCon.solid, TB.port);
  connect(step.y, TA4.T);
  connect(step.y, TA3.T);
  connect(step.y, TA2.T);
  connect(step.y, TA1.T);
  connect(TA1.port, conCon.fluid);
  connect(TA2.port, conVer.fluid);
  connect(TA3.port, conHorFluTop.fluid);
  connect(TA4.port, conHorSolTop.fluid);
  connect(TB1.port, conVer.solid);
  connect(TB2.port, conHorFluTop.solid);
  connect(TB3.port, conHorSolTop.solid);
end Convection;

Buildings.HeatTransfer.Examples.ConstructionConvection

Test model for a construction with different film coefficients

Buildings.HeatTransfer.Examples.ConstructionConvection

Information


This example test the construction model with different convective heat transfer coefficients.

Modelica definition

model ConstructionConvection 
  "Test model for a construction with different film coefficients"
  import Buildings;
  Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperature TA;
  Modelica.Blocks.Sources.Step step(
    offset=293.15,
    startTime=43200,
    height=20);
  Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperature TA1;
  Buildings.HeatTransfer.ConstructionOpaque const(
    steadyStateInitial=true,
    A=10,
    redeclare function qCon_a_flow =
        Buildings.HeatTransfer.Functions.ConvectiveHeatFlux.constantCoefficient,
    redeclare function qCon_b_flow =
        Buildings.HeatTransfer.Functions.ConvectiveHeatFlux.constantCoefficient,
    redeclare Buildings.HeatTransfer.Data.OpaqueConstructions.Concrete200
      layers) "Model of the construction with convective heat transfer";

  Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperature TB1;
  Modelica.Blocks.Sources.Constant Tb(k=293.15 + 30);
  Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperature TA4;
  Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperature TA5;
  Buildings.HeatTransfer.ConstructionOpaque wall(
    steadyStateInitial=true,
    A=10,
    redeclare function qCon_a_flow =
        Buildings.HeatTransfer.Functions.ConvectiveHeatFlux.wall,
    redeclare function qCon_b_flow =
        Buildings.HeatTransfer.Functions.ConvectiveHeatFlux.wall,
    redeclare Buildings.HeatTransfer.Data.OpaqueConstructions.Concrete200
      layers) "Model of the construction with convective heat transfer";
  Buildings.HeatTransfer.ConstructionOpaque floor(
    steadyStateInitial=true,
    A=10,
    redeclare function qCon_a_flow =
        Buildings.HeatTransfer.Functions.ConvectiveHeatFlux.floor,
    redeclare function qCon_b_flow =
        Buildings.HeatTransfer.Functions.ConvectiveHeatFlux.ceiling,
    redeclare Buildings.HeatTransfer.Data.OpaqueConstructions.Concrete200
      layers) "Model of the construction with convective heat transfer";
  Buildings.HeatTransfer.ConstructionOpaque ceiling(
    steadyStateInitial=true,
    A=10,
    redeclare function qCon_a_flow =
        Buildings.HeatTransfer.Functions.ConvectiveHeatFlux.ceiling,
    redeclare function qCon_b_flow =
        Buildings.HeatTransfer.Functions.ConvectiveHeatFlux.floor,
    redeclare Buildings.HeatTransfer.Data.OpaqueConstructions.Concrete200
      layers) "Model of the construction with convective heat transfer";
  Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperature TB2;
  Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperature TB3;
  Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperature TB4;
equation 
  connect(step.y, TA.T);
  connect(Tb.y,TB1. T);
  connect(TA.port, const.port_a);
  connect(TA1.port, wall.port_a);
  connect(TA4.port, floor.port_a);
  connect(TA5.port,ceiling. port_a);
  connect(step.y, TA1.T);
  connect(step.y, TA4.T);
  connect(step.y, TA5.T);
  connect(Tb.y, TB2.T);
  connect(Tb.y, TB3.T);
  connect(Tb.y, TB4.T);
  connect(const.port_b, TB1.port);
  connect(wall.port_b, TB2.port);
  connect(floor.port_b, TB3.port);
  connect(ceiling.port_b, TB4.port);
end ConstructionConvection;

HTML-documentation generated by Dymola Fri Jul 30 18:07:03 2010.