Package with base classes for Buildings.HeatTransfer.Conduction
Information
This package contains base classes that are used to construct the models in
Buildings.HeatTransfer.Conduction.
Extends from Modelica.Icons.BasesPackage (Icon for packages containing base classes).
Package Content
Name |
Description |
PartialConductor
|
Partial model for heat conductor |
PartialConstruction
|
Partial model for multi-layer constructions |
der_temperature_u
|
Computes the derivative of the temperature of a phase change material with respect to specific internal energy |
temperature_u
|
Computes the temperature of a phase change material for a given specific internal energy |
Examples
|
Collection of models that illustrate model use and test models |
Partial model for heat conductor
Information
Partial model for single layer and multi layer heat conductors.
The heat conductor can be steady-state or transient.
Extends from Buildings.BaseClasses.BaseIcon (Base icon).
Parameters
Type | Name | Default | Description |
Area | A | | Heat transfer area [m2] |
ThermalResistance | R | | Thermal resistance of construction [K/W] |
Connectors
Modelica definition
Partial model for multi-layer constructions
Information
Partial model for constructions and multi-layer heat conductors.
Extends from Buildings.BaseClasses.BaseIcon (Base icon).
Parameters
Type | Name | Default | Description |
Area | A | | Heat transfer area [m2] |
Generic | layers | redeclare parameter Building... | Construction definition from Data.OpaqueConstructions |
Initialization |
Boolean | steadyStateInitial | false | =true initializes dT(0)/dt=0, false initializes T(0) at fixed temperature using T_a_start and T_b_start |
Temperature | T_a_start | 293.15 | Initial temperature at port_a, used if steadyStateInitial = false [K] |
Temperature | T_b_start | 293.15 | Initial temperature at port_b, used if steadyStateInitial = false [K] |
Modelica definition
model PartialConstruction
"Partial model for multi-layer constructions"
extends Buildings.BaseClasses.BaseIcon;
parameter Modelica.SIunits.Area A
"Heat transfer area";
replaceable parameter Buildings.HeatTransfer.Data.OpaqueConstructions.Generic
layers
"Construction definition from Data.OpaqueConstructions";
final parameter Integer nLay(min=1, fixed=true) =
size(layers.material, 1)
"Number of layers";
final parameter Integer nSta[nLay](
each min=1)={layers.material[i].nSta
for i
in 1:nLay}
"Number of states";
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";
end PartialConstruction;
Computes the derivative of the temperature of a phase change material with respect to specific internal energy
Information
This function computes at the support points Td the derivatives
dT/du of the cubic hermite spline approximation to the
temperature vs. specific internal energy relation.
These derivatives are then used by the function
Buildings.HeatTransfer.Conduction.BaseClasses.temperature_u
to compute for a given specific internal energy the temperature.
Inputs
Type | Name | Default | Description |
SpecificHeatCapacity | c | | Specific heat capacity [J/(kg.K)] |
Temperature | TSol | | Solidus temperature, used only for PCM. [K] |
Temperature | TLiq | | Liquidus temperature, used only for PCM [K] |
SpecificInternalEnergy | LHea | | Latent heat of phase change [J/kg] |
Boolean | ensureMonotonicity | false | Set to true to force derivatives dT/du to be monotone |
Outputs
Type | Name | Description |
SpecificInternalEnergy | ud[Buildings.HeatTransfer.Conduction.nSupPCM] | Support points for derivatives [J/kg] |
Temperature | Td[Buildings.HeatTransfer.Conduction.nSupPCM] | Support points for derivatives [K] |
Real | dT_du[Buildings.HeatTransfer.Conduction.nSupPCM] | Derivatives dT/du at the support points [kg.K2/J] |
Modelica definition
function der_temperature_u
"Computes the derivative of the temperature of a phase change material with respect to specific internal energy"
input Modelica.SIunits.SpecificHeatCapacity c
"Specific heat capacity";
input Modelica.SIunits.Temperature TSol
"Solidus temperature, used only for PCM.";
input Modelica.SIunits.Temperature TLiq
"Liquidus temperature, used only for PCM";
input Modelica.SIunits.SpecificInternalEnergy LHea
"Latent heat of phase change";
input Boolean ensureMonotonicity = false
"Set to true to force derivatives dT/du to be monotone";
output Modelica.SIunits.SpecificInternalEnergy ud[Buildings.HeatTransfer.Conduction.nSupPCM]
"Support points for derivatives";
output Modelica.SIunits.Temperature Td[Buildings.HeatTransfer.Conduction.nSupPCM]
"Support points for derivatives";
output Real dT_du[Buildings.HeatTransfer.Conduction.nSupPCM](fixed=false, unit="kg.K2/J")
"Derivatives dT/du at the support points";
protected
parameter Real scale=0.999
"Used to place points on the phase transition";
parameter Modelica.SIunits.Temperature Tm1=TSol+(1-scale)*(TLiq-TSol)
"Support point";
parameter Modelica.SIunits.Temperature Tm2=TSol+scale*(TLiq-TSol)
"Support point";
algorithm
assert(Buildings.HeatTransfer.Conduction.nSupPCM == 6,
"The material must have exactly 6 support points for the u(T) relation.");
assert(TLiq > TSol, "TLiq has to be larger than TSol.");
// Get the derivative values at the support points
ud:={c*scale*TSol,
c*TSol,
c*Tm1 + LHea*(Tm1 - TSol)/(TLiq - TSol),
c*Tm2 + LHea*(Tm2 - TSol)/(TLiq - TSol),
c*TLiq + LHea,
c*(TLiq + TSol*(1 - scale)) + LHea};
Td:={scale*TSol,
TSol,
Tm1,
Tm2,
TLiq,
TLiq + TSol*(1 - scale)};
dT_du :=
Buildings.Utilities.Math.Functions.splineDerivatives(
x=ud,
y=Td,
ensureMonotonicity=ensureMonotonicity);
end der_temperature_u;
Computes the temperature of a phase change material for a given specific internal energy
Information
This function computes for a given specific internal energy u
the temperature T(u), using a cubic hermite spline approximation to the
temperature vs. specific internal energy relation.
Input to the function are the derivatives dT/du at the support points.
These derivatives can be computed using
Buildings.HeatTransfer.Conduction.BaseClasses.der_temperature_u.
Implementation
The derivatives dT/du are an input to this function because they typically only need
to be computed once, whereas T(u) must be evaluated at each time step.
Inputs
Type | Name | Default | Description |
SpecificInternalEnergy | ud[Buildings.HeatTransfer.Conduction.nSupPCM] | | Support points for derivatives [J/kg] |
Temperature | Td[Buildings.HeatTransfer.Conduction.nSupPCM] | | Support points for derivatives [K] |
Real | dT_du[:] | | Derivatives dT/du at the support points [kg.K2/J] |
SpecificInternalEnergy | u | | Specific internal energy [J/kg] |
Outputs
Type | Name | Description |
Temperature | T | Resulting temperature [K] |
Modelica definition
function temperature_u
"Computes the temperature of a phase change material for a given specific internal energy"
input Modelica.SIunits.SpecificInternalEnergy ud[Buildings.HeatTransfer.Conduction.nSupPCM]
"Support points for derivatives";
input Modelica.SIunits.Temperature Td[Buildings.HeatTransfer.Conduction.nSupPCM]
"Support points for derivatives";
input Real dT_du[:](
each fixed=false, unit="kg.K2/J")
"Derivatives dT/du at the support points";
input Modelica.SIunits.SpecificInternalEnergy u
"Specific internal energy";
output Modelica.SIunits.Temperature T
"Resulting temperature";
protected
Integer i
"Integer to select data interval";
algorithm
// i is a counter that is used to pick the derivative
// that corresponds to the interval that contains x
i := 1;
for j
in 1:
size(ud,1) - 1
loop
if u > ud[j]
then
i := j;
end if;
end for;
// Extrapolate or interpolate the data
T :=
Buildings.Utilities.Math.Functions.cubicHermiteLinearExtrapolation(
x=u,
x1=ud[i],
x2=ud[i + 1],
y1=Td[i],
y2=Td[i + 1],
y1d=dT_du[i],
y2d=dT_du[i + 1]);
end temperature_u;
Automatically generated Mon Jul 13 14:26:31 2015.