This example tests and demonstrates the implementation of the specific internal energy versus temperature T(u) relationship for phase-change problems. Cubic hermite interpolation and linear extrapolation is used to approximate the piece-wise linear T(u) relationship. A piece-wise linear T(u) relationship is assumed in all three characteristic regions (solid, mushy and liquid). The example uses the functions Buildings.HeatTransfer.Conduction.BaseClasses.der_temperature_u and Buildings.HeatTransfer.Conduction.BaseClasses.temperature_u. The first function is used to compute the derivatives at the support points, and the second function computes the temperature for a given specific internal energy.
The example also demonstrates the use of cubic hermite spline interpolation with
two different settings: One produces an approximation of the T(u) relationship that is monotone,
whereas the other does not enforce monotonicity.
The latter one is used by default in the Buildings
library,
since it produces a higher accuracy in the mushy
region, especially for materials in which phase-change transformation occurs in a wide
temperature interval (see the figure below).
The curves errNonMonotone
and
errMonotone
represent the relative error between approximated and exact temperatures
obtained for different specific internal energy values (right hand side figure).
Buildings.HeatTransfer.Conduction.BaseClasses.der_temperature_u
from type
Buildings.HeatTransfer.Data.BaseClasses.Material
to the elements of this type as OpenModelica fails to translate the
model if the input to this function is a record.
each
keywords.