modelTemperature_u
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).
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Buildings.HeatTransfer.Data.SolidsPCM.Generic | materialMonotone | Phase change material with monotone u-T relation | |
| Buildings.HeatTransfer.Data.SolidsPCM.Generic | materialNonMonotone | Phase change material with non-monotone u-T relation | |
| Modelica.Units.SI.SpecificInternalEnergy[Buildings.HeatTransfer.Conduction.nSupPCM] | ud | Support points | |
| Modelica.Units.SI.SpecificInternalEnergy[Buildings.HeatTransfer.Conduction.nSupPCM] | udMonotone | Support points | |
| Modelica.Units.SI.Temperature[Buildings.HeatTransfer.Conduction.nSupPCM] | Td | Support points | |
| Modelica.Units.SI.Temperature[Buildings.HeatTransfer.Conduction.nSupPCM] | TdMonotone | Support points | |
| Real[Buildings.HeatTransfer.Conduction.nSupPCM] | dT_du | Derivatives at the support points - non-monotone, default in Modelica PCM | |
| Real[Buildings.HeatTransfer.Conduction.nSupPCM] | dT_duMonotone | Derivatives at the support points for monotone increasing cubic splines | |
| Modelica.Units.SI.TemperatureDifference | dTCha | materialMonotone.TSol + materialMonotone.TLiq | Characteristic temperature difference of the problem |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Units.SI.SpecificInternalEnergy | u | Specific internal energy | |
| Modelica.Units.SI.Temperature | T | Temperature for given u without monotone interpolation | |
| Modelica.Units.SI.Temperature | TMonotone | Temperature for given u with monotone interpolation | |
| Modelica.Units.SI.Temperature | TExa | Exact value of temperature | |
| Real | errMonotone | Relative temperature error between calculated value with monotone interpolation and exact temperature | |
| Real | errNonMonotone | Relative temperature error between calculated value with non-monotone interpolation and exact temperature |
Contents
| Name | Description |
|---|---|
| relativeErrorprotected | Relative error |
Revisions
-
October 17, 2014, by Michael Wetter:
Changed the input argument for the functionBuildings.HeatTransfer.Conduction.BaseClasses.der_temperature_ufrom typeBuildings.HeatTransfer.Data.BaseClasses.Materialto 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 missingeachkeywords. -
March 9, 2013, by Michael Wetter:
Revised implementation to use new data record. -
January 22, 2013, by Armin Teskeredzic:
First implementations.