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).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 |
Type | Name | Default | Description |
---|---|---|---|
Area | A | Heat transfer area [m2] | |
ThermalResistance | R | Thermal resistance of construction [K/W] |
Type | Name | Description |
---|---|---|
HeatPort_a | port_a | Heat port at surface a |
HeatPort_b | port_b | Heat port at surface b |
partial model PartialConductor "Partial model for heat conductor" extends Buildings.BaseClasses.BaseIcon; 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)"; parameter Modelica.SIunits.ThermalResistance R "Thermal resistance of construction"; Modelica.SIunits.TemperatureDifference dT "port_a.T - port_b.T";public 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;
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] |
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) = layers.nLay "Number of layers"; final parameter Integer nSta[nLay](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;
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.
Type | Name | Default | Description |
---|---|---|---|
Generic | material | Material properties |
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] |
function der_temperature_u "Computes the derivative of the temperature of a phase change material with respect to specific internal energy" input Buildings.HeatTransfer.Data.Solids.Generic material "Material properties"; 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=material.TSol+(1-scale)*(material.TLiq-material.TSol); parameter Modelica.SIunits.Temperature Tm2=material.TSol+scale*(material.TLiq-material.TSol); algorithm assert(Buildings.HeatTransfer.Conduction.nSupPCM == 6, "The material must have exactly 6 support points for the u(T) relation."); assert(material.TLiq > material.TSol, "TLiq has to be larger than TSol."); // Get the derivative values at the support points ud:={material.c*scale*material.TSol, material.c*material.TSol, material.c*Tm1 + material.LHea*(Tm1 - material.TSol)/(material.TLiq - material.TSol), material.c*Tm2 + material.LHea*(Tm2 - material.TSol)/(material.TLiq - material.TSol), material.c*material.TLiq + material.LHea, material.c*(material.TLiq + material.TSol*(1 - scale)) + material.LHea}; Td:={scale*material.TSol, material.TSol, Tm1, Tm2, material.TLiq, material.TLiq + material.TSol*(1 - scale)}; dT_du := Buildings.Utilities.Math.Functions.splineDerivatives( x=ud, y=Td, ensureMonotonicity=material.ensureMonotonicity);end der_temperature_u;
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.
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.
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] |
Type | Name | Description |
---|---|---|
Temperature | T | Resulting temperature [K] |
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;