modelTemperature_u

Approximation of specific internal energy versus temperature curve with cubic hermite cubic spline

Extends from Modelica.Icons.Example (Icon for runnable examples).

Information

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).

image

Parameters

TypeNameDefaultDescription
Buildings.HeatTransfer.Data.SolidsPCM.GenericmaterialMonotonePhase change material with monotone u-T relation
Buildings.HeatTransfer.Data.SolidsPCM.GenericmaterialNonMonotonePhase change material with non-monotone u-T relation
Modelica.Units.SI.SpecificInternalEnergy[Buildings.HeatTransfer.Conduction.nSupPCM]udSupport points
Modelica.Units.SI.SpecificInternalEnergy[Buildings.HeatTransfer.Conduction.nSupPCM]udMonotoneSupport points
Modelica.Units.SI.Temperature[Buildings.HeatTransfer.Conduction.nSupPCM]TdSupport points
Modelica.Units.SI.Temperature[Buildings.HeatTransfer.Conduction.nSupPCM]TdMonotoneSupport points
Real[Buildings.HeatTransfer.Conduction.nSupPCM]dT_duDerivatives at the support points - non-monotone, default in Modelica PCM
Real[Buildings.HeatTransfer.Conduction.nSupPCM]dT_duMonotoneDerivatives at the support points for monotone increasing cubic splines
Modelica.Units.SI.TemperatureDifferencedTChamaterialMonotone.TSol + materialMonotone.TLiqCharacteristic temperature difference of the problem

Components

TypeNameDefaultDescription
Modelica.Units.SI.SpecificInternalEnergyuSpecific internal energy
Modelica.Units.SI.TemperatureTTemperature for given u without monotone interpolation
Modelica.Units.SI.TemperatureTMonotoneTemperature for given u with monotone interpolation
Modelica.Units.SI.TemperatureTExaExact value of temperature
RealerrMonotoneRelative temperature error between calculated value with monotone interpolation and exact temperature
RealerrNonMonotoneRelative temperature error between calculated value with non-monotone interpolation and exact temperature

Contents

NameDescription
relativeErrorprotectedRelative error

Revisions

  • October 17, 2014, by Michael Wetter:
    Changed the input argument for the function 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.
  • October 11, 2013, by Michael Wetter:
    Added missing each keywords.
  • March 9, 2013, by Michael Wetter:
    Revised implementation to use new data record.
  • January 22, 2013, by Armin Teskeredzic:
    First implementations.