Buildings.HeatTransfer.Conduction.BaseClasses

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
Buildings.HeatTransfer.Conduction.BaseClasses.PartialConductor PartialConductor Partial model for heat conductor
Buildings.HeatTransfer.Conduction.BaseClasses.PartialConstruction PartialConstruction Partial model for multi-layer constructions
Buildings.HeatTransfer.Conduction.BaseClasses.der_temperature_u der_temperature_u Computes the derivative of the temperature of a phase change material with respect to specific internal energy
Buildings.HeatTransfer.Conduction.BaseClasses.temperature_u temperature_u Computes the temperature of a phase change material for a given specific internal energy
Buildings.HeatTransfer.Conduction.BaseClasses.Examples Examples Collection of models that illustrate model use and test models

Buildings.HeatTransfer.Conduction.BaseClasses.PartialConductor Buildings.HeatTransfer.Conduction.BaseClasses.PartialConductor

Partial model for heat conductor

Buildings.HeatTransfer.Conduction.BaseClasses.PartialConductor

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

TypeNameDefaultDescription
AreaA Heat transfer area [m2]
ThermalResistanceR Thermal resistance of construction [K/W]

Connectors

TypeNameDescription
HeatPort_aport_aHeat port at surface a
HeatPort_bport_bHeat port at surface b

Modelica definition

partial model PartialConductor "Partial model for heat conductor" extends Buildings.BaseClasses.BaseIcon; parameter Modelica.Units.SI.Area A "Heat transfer area"; final parameter Modelica.Units.SI.CoefficientOfHeatTransfer U=UA/A "U-value (without surface heat transfer coefficients)"; final parameter Modelica.Units.SI.ThermalConductance UA=1/R "Thermal conductance of construction (without surface heat transfer coefficients)"; parameter Modelica.Units.SI.ThermalResistance R "Thermal resistance of construction"; Modelica.Units.SI.TemperatureDifference dT "port_a.T - port_b.T"; Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a port_a "Heat port at surface a"; Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_b port_b "Heat port at surface b"; equation dT = port_a.T - port_b.T; end PartialConductor;

Buildings.HeatTransfer.Conduction.BaseClasses.PartialConstruction Buildings.HeatTransfer.Conduction.BaseClasses.PartialConstruction

Partial model for multi-layer constructions

Buildings.HeatTransfer.Conduction.BaseClasses.PartialConstruction

Information

Partial model for constructions and multi-layer heat conductors.

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

Parameters

TypeNameDefaultDescription
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]

Modelica definition

model PartialConstruction "Partial model for multi-layer constructions" extends Buildings.BaseClasses.BaseIcon; 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.Units.SI.Temperature T_a_start=293.15 "Initial temperature at port_a, used if steadyStateInitial = false"; parameter Modelica.Units.SI.Temperature T_b_start=293.15 "Initial temperature at port_b, used if steadyStateInitial = false"; end PartialConstruction;

Buildings.HeatTransfer.Conduction.BaseClasses.der_temperature_u

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

TypeNameDefaultDescription
SpecificHeatCapacityc Specific heat capacity [J/(kg.K)]
TemperatureTSol Solidus temperature, used only for PCM. [K]
TemperatureTLiq Liquidus temperature, used only for PCM [K]
SpecificInternalEnergyLHea Latent heat of phase change [J/kg]
BooleanensureMonotonicityfalseSet to true to force derivatives dT/du to be monotone

Outputs

TypeNameDescription
SpecificInternalEnergyud[Buildings.HeatTransfer.Conduction.nSupPCM]Support points for derivatives [J/kg]
TemperatureTd[Buildings.HeatTransfer.Conduction.nSupPCM]Support points for derivatives [K]
RealdT_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.Units.SI.SpecificHeatCapacity c "Specific heat capacity"; input Modelica.Units.SI.Temperature TSol "Solidus temperature, used only for PCM."; input Modelica.Units.SI.Temperature TLiq "Liquidus temperature, used only for PCM"; input Modelica.Units.SI.SpecificInternalEnergy LHea "Latent heat of phase change"; input Boolean ensureMonotonicity = false "Set to true to force derivatives dT/du to be monotone"; output Modelica.Units.SI.SpecificInternalEnergy ud[Buildings.HeatTransfer.Conduction.nSupPCM] "Support points for derivatives"; output Modelica.Units.SI.Temperature Td[Buildings.HeatTransfer.Conduction.nSupPCM] "Support points for derivatives"; output Real dT_du[Buildings.HeatTransfer.Conduction.nSupPCM]( each fixed=false, each 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.Units.SI.Temperature Tm1=TSol + (1 - scale)*(TLiq - TSol) "Support point"; parameter Modelica.Units.SI.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;

Buildings.HeatTransfer.Conduction.BaseClasses.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

TypeNameDefaultDescription
SpecificInternalEnergyud[Buildings.HeatTransfer.Conduction.nSupPCM] Support points for derivatives [J/kg]
TemperatureTd[Buildings.HeatTransfer.Conduction.nSupPCM] Support points for derivatives [K]
RealdT_du[:] Derivatives dT/du at the support points [kg.K2/J]
SpecificInternalEnergyu Specific internal energy [J/kg]

Outputs

TypeNameDescription
TemperatureTResulting temperature [K]

Modelica definition

function temperature_u "Computes the temperature of a phase change material for a given specific internal energy" input Modelica.Units.SI.SpecificInternalEnergy ud[Buildings.HeatTransfer.Conduction.nSupPCM] "Support points for derivatives"; input Modelica.Units.SI.Temperature Td[Buildings.HeatTransfer.Conduction.nSupPCM] "Support points for derivatives"; input Real dT_du[:](each fixed=false, each unit="kg.K2/J") "Derivatives dT/du at the support points"; input Modelica.Units.SI.SpecificInternalEnergy u "Specific internal energy"; output Modelica.Units.SI.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;