Buildings.HeatTransfer

Package with heat transfer models

Information


This package contains models for heat transfer elements.

Package Content

NameDescription
Buildings.HeatTransfer.UsersGuide UsersGuide User's Guide
Buildings.HeatTransfer.ConductorSingleLayer ConductorSingleLayer Model for single layer heat conductance
Buildings.HeatTransfer.ConductorMultiLayer ConductorMultiLayer Model for heat conductance through a solid with multiple material layers
Buildings.HeatTransfer.Convection Convection Model for a convective heat transfer
Buildings.HeatTransfer.ConstructionOpaque ConstructionOpaque Model for an opaque construction such as a wall, floor or ceiling
Buildings.HeatTransfer.Data Data Data for heat transfer models
Buildings.HeatTransfer.Functions Functions Functions for heat transfer package
Buildings.HeatTransfer.Examples Examples Collection of models that illustrate model use and test models
Buildings.HeatTransfer.BaseClasses BaseClasses Package with base classes for HeatTransfer package


Buildings.HeatTransfer.ConductorSingleLayer Buildings.HeatTransfer.ConductorSingleLayer

Model for single layer heat conductance

Buildings.HeatTransfer.ConductorSingleLayer

Information


This is a model of a heat conductor for a single material.
If the material is a record that extends

Buildings.HeatTransfer.Data.Solids and its
specific heat capacity (as defined by the record material.c)
is non-zero, then this model computes transient heat conduction.
If material.c=0, or if the material extends

Buildings.HeatTransfer.Data.Resistances, 
then steady-state heat conduction is computed.

The construction has material.nSta ≥ 1 state variables. The state variables are connected to each other through thermal conductors. There is also a thermal conductor between the surfaces and the outermost state variables. Thus, to obtain the surface temperature, use port_a.T (or port_b.T) and not the variable T[1].

The thickness of the construction is divided into nLay ≥ 1 layers of equal material properties. To build multi-layer constructions, use Buildings.HeatTransfer.ConductorMultiLayer.

Extends from Buildings.HeatTransfer.BaseClasses.PartialConductor (Model for heat conductor).

Parameters

TypeNameDefaultDescription
AreaA Heat transfer area [m2]
ThermalResistanceRif (material.R == 0) then ma...Thermal resistance of construction [K/W]
Materialmaterialredeclare parameter Data.Bas...Material from Data.Solids or Data.Resistances
Initialization
BooleansteadyStateInitialfalse=true initializes dT(0)/dt=0, false initializes T(0) at fixed temperature using T_a_start and T_b_start
TemperatureT_a_start293.15Initial temperature at port_a, used if steadyStateInitial = false [K]
TemperatureT_b_start293.15Initial temperature at port_b, used if steadyStateInitial = false [K]

Connectors

TypeNameDescription
HeatPort_aport_aHeat port at surface a
HeatPort_bport_bHeat port at surface b

Modelica definition

model ConductorSingleLayer "Model for single layer heat conductance"
  extends Buildings.HeatTransfer.BaseClasses.PartialConductor(
   final R=if (material.R == 0) then material.x/material.k/A else material.R/A);
   // if material.R == 0, then the material specifies material.k, and this model specifies x
   // For resistances, material.k need not be specified, and hence we use material.R
  // The value T[:].start is used by the solver when finding initial states
  // that satisfy dT/dt=0, which requires solving a system of nonlinear equations
  // if the convection coefficient is a function of temperature.
  Modelica.SIunits.Temperature T[nSta](start=
     {T_a_start+(T_b_start-T_a_start) * UA * sum(1/G[k] for k in 1:i) for i in 1:nSta}) 
    "Temperature at the states";
  Modelica.SIunits.HeatFlowRate Q_flow[nSta+1] 
    "Heat flow rate from state i to i+1";

  replaceable parameter Data.BaseClasses.Material material 
    "Material from Data.Solids or Data.Resistances";

  parameter Boolean steadyStateInitial=false 
    "=true initializes dT(0)/dt=0, false initializes T(0) at fixed temperature using T_a_start and T_b_start";
  parameter Modelica.SIunits.Temperature T_a_start=293.15 
    "Initial temperature at port_a, used if steadyStateInitial = false";
  parameter Modelica.SIunits.Temperature T_b_start=293.15 
    "Initial temperature at port_b, used if steadyStateInitial = false";
protected 
  parameter Modelica.SIunits.HeatCapacity C = A*material.x*material.d*material.c/material.nSta 
    "Heat capacity associated with the temperature state";
  // nodes at surface have only 1/2 the layer thickness
  final parameter Modelica.SIunits.ThermalConductance G[nSta+1]={
  UA*nSta * (if (i==1 or i==(nSta+1)) then 2 else 1) for i in 1:nSta+1} 
    "Thermal conductance of layer between the states";
  Modelica.SIunits.TemperatureSlope der_T[nSta] 
    "Time derivative of temperature (= der(T))";
  final parameter Integer nSta(min=1) = material.nSta 
    "Number of state variables";
initial equation 
  // The initialization is only done for materials that store energy.
  if not material.steadyState then
    if steadyStateInitial then
      der_T = zeros(nSta);
    else
      for i in 1:nSta loop
        T[i] = T_a_start+(T_b_start-T_a_start) * UA * sum(1/G[k] for k in 1:i);
      end for;
      end if;
   end if;

equation 
    port_a.Q_flow = +Q_flow[1];
    port_b.Q_flow = -Q_flow[nSta+1];

    Q_flow[1]      = G[1]      * (port_a.T-T[1]);
    Q_flow[nSta+1] = G[nSta+1] * (T[nSta] -port_b.T);
    for i in 2:nSta loop
       // Q_flow[i] is heat flowing from (i-1) to (i)
       Q_flow[i] = G[i] * (T[i-1]-T[i]);
    end for;
    if material.steadyState then
      der_T = zeros(nSta);
      for i in 2:nSta+1 loop
        Q_flow[i] = Q_flow[1];
      end for;
      else
        for i in 1:nSta loop
          der(T[i]) = (Q_flow[i]-Q_flow[i+1])/C;
          der_T[i] = der(T[i]);
        end for;
    end if;
end ConductorSingleLayer;

Buildings.HeatTransfer.ConductorMultiLayer Buildings.HeatTransfer.ConductorMultiLayer

Model for heat conductance through a solid with multiple material layers

Buildings.HeatTransfer.ConductorMultiLayer

Information


This is a model of a heat conductor with multiple material layers and energy storage.
The construction has at least one material layer, and each layer has
at least one temperature node. The layers are modeled using an instance of 

Buildings.HeatTransfer.ConductorSingleLayer.

The construction material is defined by a record of the package Buildings.HeatTransfer.Data.OpaqueConstructions. This record allows specifying materials that store energy, and material that are a thermal conductor only with no heat storage.

To obtain the surface temperature of the construction, use port_a.T (or port_b.T) and not the variable T[1] because there is a thermal resistance between the surface and the temperature state.

To model a single layer material, use Buildings.HeatTransfer.ConductorSingleLayer.

Extends from Buildings.HeatTransfer.BaseClasses.PartialConductor (Model for heat conductor), Buildings.HeatTransfer.BaseClasses.PartialConstruction (Partial model for constructions with and without convective heat transfer coefficient).

Parameters

TypeNameDefaultDescription
AreaA Heat transfer area [m2]
ThermalResistanceRsum(lay[:].R)Thermal resistance of construction [K/W]
Genericlayersredeclare parameter Building...Construction definition from Data.OpaqueConstructions
Initialization
BooleansteadyStateInitialfalse=true initializes dT(0)/dt=0, false initializes T(0) at fixed temperature using T_a_start and T_b_start
TemperatureT_a_start293.15Initial temperature at port_a, used if steadyStateInitial = false [K]
TemperatureT_b_start293.15Initial temperature at port_b, used if steadyStateInitial = false [K]

Connectors

TypeNameDescription
HeatPort_aport_aHeat port at surface a
HeatPort_bport_bHeat port at surface b

Modelica definition

model ConductorMultiLayer 
  "Model for heat conductance through a solid with multiple material layers"
  extends Buildings.HeatTransfer.BaseClasses.PartialConductor(
   final R=sum(lay[:].R));
  Modelica.SIunits.Temperature T[sum(nSta)] "Temperature at the states";
  Modelica.SIunits.HeatFlowRate Q_flow[sum(nSta)+nLay] 
    "Heat flow rate from state i to i+1";
  extends Buildings.HeatTransfer.BaseClasses.PartialConstruction;

protected 
  ConductorSingleLayer[nLay] lay(
   each final A=A,
   material = layers.material,
   T_a_start = _T_a_start,
   T_b_start = _T_b_start,
   each steadyStateInitial = steadyStateInitial) "Material layer";

protected 
  parameter Modelica.SIunits.Temperature _T_a_start[nLay](fixed=false) 
    "Initial temperature at port_a of respective layer, used if steadyStateInitial = false";
  parameter Modelica.SIunits.Temperature _T_b_start[nLay](fixed=false) 
    "Initial temperature at port_b of respective layer, used if steadyStateInitial = false";

initial equation 
  for i in 1:nLay loop
    _T_a_start[i] = T_b_start+(T_a_start-T_b_start) * 1/R * sum(lay[k].R for k in i:nLay);
    _T_b_start[i] =  T_a_start+(T_b_start-T_a_start) * 1/R * sum(lay[k].R for k in 1:i);
  end for;

equation 
  // This section assigns the temperatures and heat flow rates of the layer models to
  // an array that makes plotting the results easier.
  for i in 1:nLay loop
    for j in 1:nSta[i] loop
      T[sum(nSta[k] for k in 1:(i-1)) +j] = lay[i].T[j];
    end for;
    for j in 1:nSta[i]+1 loop
      Q_flow[sum(nSta[k] for k in 1:i-1)+(i-1)+j] = lay[i].Q_flow[j];
    end for;
  end for;
  connect(port_a, lay[1].port_a);
  for i in 1:nLay-1 loop
  connect(lay[i].port_b, lay[i+1].port_a);
  end for;
  connect(lay[nLay].port_b, port_b);

end ConductorMultiLayer;

Buildings.HeatTransfer.Convection Buildings.HeatTransfer.Convection

Model for a convective heat transfer

Buildings.HeatTransfer.Convection

Information


This is a model for a convective heat transfer.
The model can be configured to use various functions
from the package

Buildings.HeatTransfer.Functions.ConvectiveHeatFlux
to compute the convective heat transfer.

Extends from Buildings.BaseClasses.BaseIcon (Base icon).

Parameters

TypeNameDefaultDescription
AreaA Heat transfer area [m2]

Connectors

TypeNameDescription
HeatPort_asolid 
HeatPort_bfluid 

Modelica definition

model Convection "Model for a convective heat transfer"
  extends Buildings.BaseClasses.BaseIcon;
  import c = Buildings.HeatTransfer.Functions.ConvectiveHeatFlux;
  replaceable function qCon_flow =
      Buildings.HeatTransfer.Functions.ConvectiveHeatFlux.constantCoefficient
                                                 constrainedby 
    Buildings.HeatTransfer.Functions.ConvectiveHeatFlux.BaseClasses.PartialConvectiveHeatFlux(
      dT=dT) "Function for convective heat transfer coefficient";
  parameter Modelica.SIunits.Area A "Heat transfer area";
  Modelica.SIunits.HeatFlowRate Q_flow "Heat flow rate from solid -> fluid";
  Modelica.SIunits.TemperatureDifference dT(start=0) "= solid.T - fluid.T";
  Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a solid;
  Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_b fluid;
equation 
  dT = solid.T - fluid.T;
  solid.Q_flow = Q_flow;
  fluid.Q_flow = -Q_flow;
  // Even if hCon is a step function with a step at zero,
  // the product hCon*dT is differentiable at zero with
  // a continuous first derivative
  Q_flow = A*qCon_flow();

end Convection;

Buildings.HeatTransfer.ConstructionOpaque Buildings.HeatTransfer.ConstructionOpaque

Model for an opaque construction such as a wall, floor or ceiling

Buildings.HeatTransfer.ConstructionOpaque

Information


This is a model for a construction that does not transmit light.
The construction can consist of one or more layers of material. Inside
the material, one-dimensional heat conduction is computed.
The heat conduction is computed dynamic, taking into account
the energy storage of the material, or steady-state.
Steady-state heat conduction is computed if the specific heat capacity
of the material is zero.
At each surface of the material, there is a convective heat transfer 
coefficient, which can be configured to be
use various functions from the package

Buildings.HeatTransfer.Functions.ConvectiveHeatFlux.

To compute heat conduction in the solid, this model uses an instance of Buildings.HeatTransfer.ConductorMultiLayer. See Buildings.HeatTransfer.ConductorMultiLayer for how to define constructions that can be used with this model. The convective heat transfer is computed using the model Buildings.HeatTransfer.Convection.

Extends from Buildings.BaseClasses.BaseIcon (Base icon), Buildings.HeatTransfer.BaseClasses.PartialConstruction (Partial model for constructions with and without convective heat transfer coefficient).

Parameters

TypeNameDefaultDescription
AreaA Heat transfer area [m2]
Genericlayersredeclare parameter Building...Construction definition from Data.OpaqueConstructions
Initialization
BooleansteadyStateInitialfalse=true initializes dT(0)/dt=0, false initializes T(0) at fixed temperature using T_a_start and T_b_start
TemperatureT_a_start293.15Initial temperature at port_a, used if steadyStateInitial = false [K]
TemperatureT_b_start293.15Initial temperature at port_b, used if steadyStateInitial = false [K]
Advanced
CoefficientOfHeatTransferhCon_a_start3Convective heat transfer coefficient on side a, used to compute initial condition [W/(m2.K)]
CoefficientOfHeatTransferhCon_b_starthCon_a_startConvective heat transfer coefficient on side b, used to compute initial condition [W/(m2.K)]

Connectors

TypeNameDescription
HeatPort_aport_aHeat port at outside of air boundary layer near surface a
HeatPort_bport_bHeat port at outside of air boundary layer near surface b
HeatPort_asurf_aHeat port at surface a
HeatPort_bsurf_bHeat port at surface b

Modelica definition

model ConstructionOpaque 
  "Model for an opaque construction such as a wall, floor or ceiling"
  extends Buildings.BaseClasses.BaseIcon;
  extends Buildings.HeatTransfer.BaseClasses.PartialConstruction;
  parameter Modelica.SIunits.Area A "Heat transfer area";

  final parameter Modelica.SIunits.CoefficientOfHeatTransfer U = UA/A 
    "U-value (without surface heat transfer coefficients)";
  final parameter Modelica.SIunits.ThermalConductance UA = 1/R 
    "Thermal conductance of construction (without surface heat transfer coefficients)";
  final parameter Modelica.SIunits.ThermalResistance R = solid.R + 1/A/hCon_a_start + 1/A/hCon_b_start 
    "Thermal resistance of construction";
  ConductorMultiLayer solid(
    final A=A,
    final layers=layers,
    final steadyStateInitial=steadyStateInitial,
    T_a_start= T_b_start + (T_a_start - T_b_start)/R/(A*hCon_a_start),
    T_b_start= T_a_start + (T_b_start - T_a_start)/R/(A*hCon_b_start)) 
    "Model for opaque construction";
  Modelica.SIunits.TemperatureDifference dT "port_a.T - port_b.T";

  Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a port_a 
    "Heat port at outside of air boundary layer near surface a";
  Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_b port_b 
    "Heat port at outside of air boundary layer near surface b";
  Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a surf_a 
    "Heat port at surface a";
  Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_b surf_b 
    "Heat port at surface b";
  Convection con_a(final A=A, redeclare final function qCon_flow = qCon_a_flow)
    "Convective heat transfer at surface a";
  Convection con_b(final A=A, redeclare final function qCon_flow = qCon_b_flow)
    "Convective heat transfer at surface b";

  parameter Modelica.SIunits.CoefficientOfHeatTransfer hCon_a_start=3 
    "Convective heat transfer coefficient on side a, used to compute initial condition";
  parameter Modelica.SIunits.CoefficientOfHeatTransfer hCon_b_start=hCon_a_start 
    "Convective heat transfer coefficient on side b, used to compute initial condition";
  replaceable function qCon_a_flow =
      Buildings.HeatTransfer.Functions.ConvectiveHeatFlux.constantCoefficient
      constrainedby 
    Buildings.HeatTransfer.Functions.ConvectiveHeatFlux.BaseClasses.PartialConvectiveHeatFlux
    "Function for convective heat transfer at side a";
  replaceable function qCon_b_flow =
      Buildings.HeatTransfer.Functions.ConvectiveHeatFlux.constantCoefficient
      constrainedby 
    Buildings.HeatTransfer.Functions.ConvectiveHeatFlux.BaseClasses.PartialConvectiveHeatFlux
    "Function for convective heat transfer at side b";
equation 
  dT = port_a.T - port_b.T;
  connect(port_a, con_a.fluid);

  connect(con_a.solid, solid.port_a);
  connect(solid.port_b, con_b.solid);

  connect(con_b.fluid, port_b);

  connect(solid.port_a, surf_a);
  connect(solid.port_b, surf_b);
end ConstructionOpaque;

Buildings.HeatTransfer.ConstructionOpaque.qCon_a_flow

Function for convective heat transfer at side a

Inputs

TypeNameDefaultDescription
TemperatureDifferencedT Temperature difference solid minus fluid [K]
CoefficientOfHeatTransferhCon3Constant for convective heat transfer coefficient [W/(m2.K)]

Outputs

TypeNameDescription
HeatFluxq_flowConvective heat flux from solid to fluid [W/m2]

Modelica definition

replaceable function qCon_a_flow =
    Buildings.HeatTransfer.Functions.ConvectiveHeatFlux.constantCoefficient
    constrainedby 
  Buildings.HeatTransfer.Functions.ConvectiveHeatFlux.BaseClasses.PartialConvectiveHeatFlux
  "Function for convective heat transfer at side a";

Buildings.HeatTransfer.ConstructionOpaque.qCon_b_flow

Function for convective heat transfer at side b

Inputs

TypeNameDefaultDescription
TemperatureDifferencedT Temperature difference solid minus fluid [K]
CoefficientOfHeatTransferhCon3Constant for convective heat transfer coefficient [W/(m2.K)]

Outputs

TypeNameDescription
HeatFluxq_flowConvective heat flux from solid to fluid [W/m2]

Modelica definition

replaceable function qCon_b_flow =
    Buildings.HeatTransfer.Functions.ConvectiveHeatFlux.constantCoefficient
    constrainedby 
  Buildings.HeatTransfer.Functions.ConvectiveHeatFlux.BaseClasses.PartialConvectiveHeatFlux
  "Function for convective heat transfer at side b";

HTML-documentation generated by Dymola Thu Jun 24 16:55:13 2010.