LBL logo

Buildings.Media.BaseClasses

Package with base classes for Buildings.Media

Information

This package contains base classes that are used to construct the models in Buildings.Media.

Extends from Modelica.Icons.BasesPackage (Icon for packages containing base classes).

Package Content

NameDescription
TestTemperatureEnthalpyInversion Model to check computation of h(T) and its inverse


Buildings.Media.BaseClasses.TestTemperatureEnthalpyInversion

Model to check computation of h(T) and its inverse

Information

This model computes h=f(T0) and T=g(h). It then checks whether T=T0. Hence, it checks whether the function T_phX is implemented correctly.

Parameters

TypeNameDefaultDescription
replaceable package MediumModelica.Media.Interfaces.Pa... 
TemperatureT0273.15 + 20Temperature [K]

Connectors

TypeNameDescription
replaceable package Medium 

Modelica definition

partial model TestTemperatureEnthalpyInversion 
  "Model to check computation of h(T) and its inverse"
   replaceable package Medium =
        Modelica.Media.Interfaces.PartialCondensingGases;
     parameter Modelica.SIunits.Temperature T0=273.15+20 "Temperature";
     Modelica.SIunits.Temperature T "Temperature";
     Modelica.SIunits.SpecificEnthalpy h "Enthalpy";
     Medium.MassFraction Xi[:] = Medium.reference_X "Mass fraction";
equation 
    h = Medium.h_pTX(p=101325, T=T0, X=Xi);
    T = Medium.T_phX(p=101325, h=h,  X=Xi);
    if (time>0.1) then
    assert(abs(T-T0)<1E-8, "Error in implementation of functions.\n"
       + "   T0 = " + String(T0) + "\n"
       + "   T  = " + String(T));
    end if;
end TestTemperatureEnthalpyInversion;

Automatically generated Tue Jan 8 08:31:26 2013.