Changeset 902

Show
Ignore:
Timestamp:
12/08/2007 11:19:33 PM (13 months ago)
Author:
hubertus
Message:

Workaround for Trac ticket #28 (issue fixed): Problem seems to actually be in Dymola and was fixed via a workaround.
Problem: function specificEntropy in MixtureGasNasa could be inlined in v 2.2.1, but not in 3.0RC1. That somehow lead to errors when using the inversion in OneNonLinearEquation. Why is unclear. Fixed (in Dymola) by reverting to the inlineable old form of the function.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • Modelica/trunk/Modelica/Media/IdealGases/Common/package.mo

    r883 r902  
    44 
    55 
    6 record DataRecord 
    7   "Coefficient data record for properties of ideal gases based on NASA source" 
     6record DataRecord  
     7  "Coefficient data record for properties of ideal gases based on NASA source"  
    88  extends Modelica.Icons.Record; 
    99  String name "Name of ideal gas"; 
     
    4545 
    4646 
    47 partial package SingleGasNasa 
    48   "Medium model of an ideal gas based on NASA source" 
    49  
     47partial package SingleGasNasa  
     48  "Medium model of an ideal gas based on NASA source"  
     49   
    5050  annotation ( 
    5151    Documentation(info="<HTML> 
     
    150150            100}}), 
    151151            graphics)); 
    152  
     152   
    153153  extends Interfaces.PartialPureSubstance( 
    154154     mediumName=data.name, 
     
    161161     Density(start=10, nominal=10), 
    162162     AbsolutePressure(start=10e5, nominal=10e5)); 
    163  
    164   redeclare record extends ThermodynamicState 
    165     "thermodynamic state variables for ideal gases" 
     163   
     164  redeclare record extends ThermodynamicState  
     165    "thermodynamic state variables for ideal gases"  
    166166    AbsolutePressure p "Absolute pressure of medium"; 
    167167    Temperature T "Temperature of medium"; 
    168168  end ThermodynamicState; 
    169  
    170   redeclare record extends FluidConstants "Extended fluid constants" 
     169   
     170  redeclare record extends FluidConstants "Extended fluid constants"  
    171171    Temperature criticalTemperature "critical temperature"; 
    172172    AbsolutePressure criticalPressure "critical pressure"; 
     
    177177    Temperature meltingPoint "melting point at 101325 Pa"; 
    178178    Temperature normalBoilingPoint "normal boiling point (at 101325 Pa)"; 
    179     DipoleMoment dipoleMoment 
     179    DipoleMoment dipoleMoment  
    180180      "dipole moment of molecule in Debye (1 debye = 3.33564e10-30 C.m)"; 
    181     Boolean hasIdealGasHeatCapacity=false 
     181    Boolean hasIdealGasHeatCapacity=false  
    182182      "true if ideal gas heat capacity is available"; 
    183183    Boolean hasCriticalData=false "true if critical data are known"; 
    184184    Boolean hasDipoleMoment=false "true if a dipole moment known"; 
    185185    Boolean hasFundamentalEquation=false "true if a fundamental equation"; 
    186     Boolean hasLiquidHeatCapacity=false 
     186    Boolean hasLiquidHeatCapacity=false  
    187187      "true if liquid heat capacity is available"; 
    188     Boolean hasSolidHeatCapacity=false 
     188    Boolean hasSolidHeatCapacity=false  
    189189      "true if solid heat capacity is available"; 
    190     Boolean hasAccurateViscosityData=false 
     190    Boolean hasAccurateViscosityData=false  
    191191      "true if accurate data for a viscosity function is available"; 
    192     Boolean hasAccurateConductivityData=false 
     192    Boolean hasAccurateConductivityData=false  
    193193      "true if accurate data for thermal conductivity is available"; 
    194     Boolean hasVapourPressureCurve=false 
     194    Boolean hasVapourPressureCurve=false  
    195195      "true if vapour pressure data, e.g. Antoine coefficents are known"; 
    196196    Boolean hasAcentricFactor=false "true if Pitzer accentric factor is known"; 
    197     SpecificEnthalpy HCRIT0=0.0 
     197    SpecificEnthalpy HCRIT0=0.0  
    198198      "Critical specific enthalpy of the fundamental equation"; 
    199     SpecificEntropy SCRIT0=0.0 
     199    SpecificEntropy SCRIT0=0.0  
    200200      "Critical specific entropy of the fundamental equation"; 
    201     SpecificEnthalpy deltah=0.0 
     201    SpecificEnthalpy deltah=0.0  
    202202      "Difference between specific enthalpy model (h_m) and f.eq. (h_f) (h_m - h_f)"; 
    203     SpecificEntropy deltas=0.0 
     203    SpecificEntropy deltas=0.0  
    204204      "Difference between specific enthalpy model (s_m) and f.eq. (s_f) (s_m - s_f)"; 
    205205  end FluidConstants; 
    206  
     206   
    207207  import SI = Modelica.SIunits; 
    208208  import Modelica.Math; 
    209209  import Modelica.Media.Interfaces.PartialMedium.Choices.ReferenceEnthalpy; 
    210  
    211   constant Boolean excludeEnthalpyOfFormation=true 
     210   
     211  constant Boolean excludeEnthalpyOfFormation=true  
    212212    "If true, enthalpy of formation Hf is not included in specific enthalpy h"; 
    213213  constant ReferenceEnthalpy referenceChoice=Choices. 
    214214        ReferenceEnthalpy.ZeroAt0K "Choice of reference enthalpy"; 
    215   constant SpecificEnthalpy h_offset=0.0 
     215  constant SpecificEnthalpy h_offset=0.0  
    216216    "User defined offset for reference enthalpy, if referenceChoice = UserDefined"; 
    217  
    218   constant IdealGases.Common.DataRecord data 
     217   
     218  constant IdealGases.Common.DataRecord data  
    219219    "Data record of ideal gas substance"; 
    220  
     220   
    221221  constant FluidConstants[nS] fluidConstants "constant data for the fluid"; 
    222  
     222   
    223223  redeclare model extends BaseProperties( 
    224224   T(stateSelect=if preferredMediumStates then StateSelect.prefer else StateSelect.default), 
    225    p(stateSelect=if preferredMediumStates then StateSelect.prefer else StateSelect.default)) 
    226     "Base properties of ideal gas medium" 
    227   equation 
     225   p(stateSelect=if preferredMediumStates then StateSelect.prefer else StateSelect.default))  
     226    "Base properties of ideal gas medium"  
     227  equation  
    228228    assert(T >= 200 and T <= 6000, " 
    229229Temperature T (= " + String(T) + " K) is not in the allowed range 
     
    235235    h = h_T(data, T, excludeEnthalpyOfFormation, referenceChoice, h_offset); 
    236236    u = h - R*T; 
    237  
     237     
    238238    // Has to be written in the form d=f(p,T) in order that static 
    239239    // state selection for p and T is possible 
     
    243243    state.p = p; 
    244244  end BaseProperties; 
    245  
    246     redeclare function setState_pTX 
    247     "Return thermodynamic state as function of p, T and composition X" 
     245   
     246    redeclare function setState_pTX  
     247    "Return thermodynamic state as function of p, T and composition X"  
    248248      extends Modelica.Icons.Function; 
    249249      input AbsolutePressure p "Pressure"; 
     
    251251      input MassFraction X[:]=reference_X "Mass fractions"; 
    252252      output ThermodynamicState state; 
    253     algorithm 
     253    algorithm  
    254254      state := ThermodynamicState(p=p,T=T); 
    255255    end setState_pTX; 
    256  
    257     redeclare function setState_phX 
    258     "Return thermodynamic state as function of p, h and composition X" 
     256   
     257    redeclare function setState_phX  
     258    "Return thermodynamic state as function of p, h and composition X"  
    259259      extends Modelica.Icons.Function; 
    260260      input AbsolutePressure p "Pressure"; 
     
    262262      input MassFraction X[:]=reference_X "Mass fractions"; 
    263263      output ThermodynamicState state; 
    264     algorithm 
     264    algorithm  
    265265      state := ThermodynamicState(p=p,T=T_h(h)); 
    266266    end setState_phX; 
    267  
    268     redeclare function setState_psX 
    269     "Return thermodynamic state as function of p, s and composition X" 
     267   
     268    redeclare function setState_psX  
     269    "Return thermodynamic state as function of p, s and composition X"  
    270270      extends Modelica.Icons.Function; 
    271271      input AbsolutePressure p "Pressure"; 
     
    273273      input MassFraction X[:]=reference_X "Mass fractions"; 
    274274      output ThermodynamicState state; 
    275     algorithm 
     275    algorithm  
    276276      state := ThermodynamicState(p=p,T=T_ps(p,s)); 
    277277    end setState_psX; 
    278  
    279     redeclare function setState_dTX 
    280     "Return thermodynamic state as function of d, T and composition X" 
     278   
     279    redeclare function setState_dTX  
     280    "Return thermodynamic state as function of d, T and composition X"  
    281281      extends Modelica.Icons.Function; 
    282282      input Density d "density"; 
     
    284284      input MassFraction X[:]=reference_X "Mass fractions"; 
    285285      output ThermodynamicState state; 
    286     algorithm 
     286    algorithm  
    287287      state := ThermodynamicState(p=d*data.R*T,T=T); 
    288288    end setState_dTX; 
    289  
    290   redeclare function extends pressure "return pressure of ideal gas" 
    291   algorithm 
     289   
     290  redeclare function extends pressure "return pressure of ideal gas"  
     291  algorithm  
    292292    p := state.p; 
    293293  end pressure; 
    294  
    295   redeclare function extends temperature "return temperature of ideal gas" 
    296   algorithm 
     294   
     295  redeclare function extends temperature "return temperature of ideal gas"  
     296  algorithm  
    297297    T := state.T; 
    298298  end temperature; 
    299  
    300   redeclare function extends density "return density of ideal gas" 
    301   algorithm 
     299   
     300  redeclare function extends density "return density of ideal gas"  
     301  algorithm  
    302302    d := state.p/(data.R*state.T); 
    303303  end density; 
    304  
    305   redeclare function extends specificEnthalpy "Return specific enthalpy" 
    306     extends Modelica.Icons.Function; 
    307   algorithm 
     304   
     305  redeclare function extends specificEnthalpy "Return specific enthalpy"  
     306    extends Modelica.Icons.Function; 
     307  algorithm  
    308308    h := h_T(data,state.T); 
    309309  end specificEnthalpy; 
    310  
    311   redeclare function extends specificInternalEnergy 
    312     "Return specific internal energy" 
    313     extends Modelica.Icons.Function; 
    314   algorithm 
     310   
     311  redeclare function extends specificInternalEnergy  
     312    "Return specific internal energy"  
     313    extends Modelica.Icons.Function; 
     314  algorithm  
    315315    u := h_T(data,state.T) - data.R*state.T; 
    316316  end specificInternalEnergy; 
    317  
    318   redeclare function extends specificEntropy "Return specific entropy" 
    319     extends Modelica.Icons.Function; 
    320   algorithm 
     317   
     318  redeclare function extends specificEntropy "Return specific entropy"  
     319    extends Modelica.Icons.Function; 
     320  algorithm  
    321321    s := s0_T(data, state.T) - data.R*Modelica.Math.log(state.p/reference_p); 
    322322  end specificEntropy; 
    323  
    324   redeclare function extends specificGibbsEnergy "Return specific Gibbs energy" 
    325     extends Modelica.Icons.Function; 
    326   algorithm 
     323   
     324  redeclare function extends specificGibbsEnergy "Return specific Gibbs energy"  
     325    extends Modelica.Icons.Function; 
     326  algorithm  
    327327    g := h_T(data,state.T) - state.T*specificEntropy(state); 
    328328  end specificGibbsEnergy; 
    329  
    330   redeclare function extends specificHelmholtzEnergy 
    331     "Return specific Helmholtz energy" 
    332     extends Modelica.Icons.Function; 
    333   algorithm 
     329   
     330  redeclare function extends specificHelmholtzEnergy  
     331    "Return specific Helmholtz energy"  
     332    extends Modelica.Icons.Function; 
     333  algorithm  
    334334    f := h_T(data,state.T) - data.R*state.T - state.T*specificEntropy(state); 
    335335  end specificHelmholtzEnergy; 
    336  
    337   redeclare function extends specificHeatCapacityCp 
    338     "Return specific heat capacity at constant pressure" 
    339   algorithm 
     336   
     337  redeclare function extends specificHeatCapacityCp  
     338    "Return specific heat capacity at constant pressure"  
     339  algorithm  
    340340    cp := cp_T(data, state.T); 
    341341  end specificHeatCapacityCp; 
    342  
    343   redeclare function extends specificHeatCapacityCv 
    344     "Compute specific heat capacity at constant volume from temperature and gas data" 
    345   algorithm 
     342   
     343  redeclare function extends specificHeatCapacityCv  
     344    "Compute specific heat capacity at constant volume from temperature and gas data"  
     345  algorithm  
    346346    cv := cp_T(data, state.T) - data.R; 
    347347  end specificHeatCapacityCv; 
    348  
    349   redeclare function extends isentropicExponent "Return isentropic exponent" 
    350   algorithm 
     348   
     349  redeclare function extends isentropicExponent "Return isentropic exponent"  
     350  algorithm  
    351351    gamma := specificHeatCapacityCp(state)/specificHeatCapacityCv(state); 
    352352  end isentropicExponent; 
    353  
    354   redeclare function extends velocityOfSound "Return velocity of sound" 
    355     extends Modelica.Icons.Function; 
    356   algorithm 
     353   
     354  redeclare function extends velocityOfSound "Return velocity of sound"  
     355    extends Modelica.Icons.Function; 
     356  algorithm  
    357357    a := sqrt(data.R*state.T*cp_T(data, state.T)/specificHeatCapacityCv(state)); 
    358358  end velocityOfSound; 
    359  
    360   function isentropicEnthalpyApproximation 
    361     "approximate method of calculating h_is from upstream properties and downstream pressure" 
     359   
     360  function isentropicEnthalpyApproximation  
     361    "approximate method of calculating h_is from upstream properties and downstream pressure"  
    362362    extends Modelica.Icons.Function; 
    363363    input SI.Pressure p2 "downstream pressure"; 
    364364    input ThermodynamicState state "properties at upstream location"; 
    365     input Boolean exclEnthForm=excludeEnthalpyOfFormation 
     365    input Boolean exclEnthForm=excludeEnthalpyOfFormation  
    366366      "If true, enthalpy of formation Hf is not included in specific enthalpy h"; 
    367     input ReferenceEnthalpy refChoice=referenceChoice 
     367    input ReferenceEnthalpy refChoice=referenceChoice  
    368368      "Choice of reference enthalpy"; 
    369     input SpecificEnthalpy h_off=h_offset 
     369    input SpecificEnthalpy h_off=h_offset  
    370370      "User defined offset for reference enthalpy, if referenceChoice = UserDefined"; 
    371371    output SI.SpecificEnthalpy h_is "isentropic enthalpy"; 
    372   protected 
     372  protected  
    373373    IsentropicExponent gamma =  isentropicExponent(state) "Isentropic exponent"; 
    374   algorithm 
     374  algorithm  
    375375    h_is := h_T(data,state.T,exclEnthForm,refChoice,h_off) + 
    376376      gamma/(gamma - 1.0)*state.p/density(state)*((p2/state.p)^((gamma - 1)/gamma) - 1.0); 
    377377  end isentropicEnthalpyApproximation; 
    378  
    379   redeclare function extends isentropicEnthalpy "Return isentropic enthalpy" 
    380   input Boolean exclEnthForm=excludeEnthalpyOfFormation 
     378   
     379  redeclare function extends isentropicEnthalpy "Return isentropic enthalpy"  
     380  input Boolean exclEnthForm=excludeEnthalpyOfFormation  
    381381      "If true, enthalpy of formation Hf is not included in specific enthalpy h"; 
    382   input ReferenceEnthalpy refChoice=referenceChoice 
     382  input ReferenceEnthalpy refChoice=referenceChoice  
    383383      "Choice of reference enthalpy"; 
    384   input SpecificEnthalpy h_off=h_offset 
     384  input SpecificEnthalpy h_off=h_offset  
    385385      "User defined offset for reference enthalpy, if referenceChoice = UserDefined"; 
    386   algorithm 
     386  algorithm  
    387387    h_is := isentropicEnthalpyApproximation(p_downstream,refState,exclEnthForm,refChoice,h_off); 
    388388  end isentropicEnthalpy; 
    389  
    390   redeclare function extends isobaricExpansionCoefficient 
    391     "Returns overall the isobaric expansion coefficient beta" 
    392   algorithm 
     389   
     390  redeclare function extends isobaricExpansionCoefficient  
     391    "Returns overall the isobaric expansion coefficient beta"  
     392  algorithm  
    393393    beta := 1/state.T; 
    394394  end isobaricExpansionCoefficient; 
    395  
    396   redeclare function extends isothermalCompressibility 
    397     "Returns overall the isothermal compressibility factor" 
    398   algorithm 
     395   
     396  redeclare function extends isothermalCompressibility  
     397    "Returns overall the isothermal compressibility factor"  
     398  algorithm  
    399399    kappa := 1.0/state.p; 
    400400  end isothermalCompressibility; 
    401  
    402   redeclare function extends density_derp_T 
    403     "Returns the partial derivative of density with respect to pressure at constant temperature" 
    404   algorithm 
     401   
     402  redeclare function extends density_derp_T  
     403    "Returns the partial derivative of density with respect to pressure at constant temperature"  
     404  algorithm  
    405405    ddpT := 1/(state.T*data.R); 
    406406  end density_derp_T; 
    407  
    408   redeclare function extends density_derT_p 
    409     "Returns the partial derivative of density with respect to temperature at constant pressure" 
    410   algorithm 
     407   
     408  redeclare function extends density_derT_p  
     409    "Returns the partial derivative of density with respect to temperature at constant pressure"  
     410  algorithm  
    411411    ddTp := -state.p/(state.T*state.T*data.R); 
    412412  end density_derT_p; 
    413  
    414   redeclare function extends density_derX 
    415     "Returns the partial derivative of density with respect to mass fractions at constant pressure and temperature" 
    416   algorithm 
     413   
     414  redeclare function extends density_derX  
     415    "Returns the partial derivative of density with respect to mass fractions at constant pressure and temperature"  
     416  algorithm  
    417417    dddX := fill(0,0); 
    418418  end density_derX; 
    419  
    420   function cp_T 
    421     "Compute specific heat capacity at constant pressure from temperature and gas data" 
     419   
     420  function cp_T  
     421    "Compute specific heat capacity at constant pressure from temperature and gas data"  
    422422    extends Modelica.Icons.Function; 
    423423    input IdealGases.Common.DataRecord data "Ideal gas data"; 
     
    425425    output SI.SpecificHeatCapacity cp "Specific heat capacity at temperature T"; 
    426426    annotation (InlineNoEvent=false); 
    427   algorithm 
     427  algorithm  
    428428    cp := smooth(0,if T < data.Tlimit then data.R*(1/(T*T)*(data.alow[1] + T*( 
    429429      data.alow[2] + T*(1.*data.alow[3] + T*(data.alow[4] + T*(data.alow[5] + T 
     
    432432      ahigh[5] + T*(data.ahigh[6] + data.ahigh[7]*T)))))))); 
    433433  end cp_T; 
    434  
    435   function cp_Tlow 
    436     "Compute specific heat capacity at constant pressure, low T region" 
     434   
     435  function cp_Tlow  
     436    "Compute specific heat capacity at constant pressure, low T region"  
    437437    extends Modelica.Icons.Function; 
    438438    input IdealGases.Common.DataRecord data "Ideal gas data"; 
     
    440440    output SI.SpecificHeatCapacity cp "Specific heat capacity at temperature T"; 
    441441    annotation (Inline=false, derivative(zeroDerivative=data) = cp_Tlow_der); 
    442   algorithm 
     442  algorithm  
    443443    cp := data.R*(1/(T*T)*(data.alow[1] + T*( 
    444444      data.alow[2] + T*(1.*data.alow[3] + T*(data.alow[4] + T*(data.alow[5] + T 
    445445      *(data.alow[6] + data.alow[7]*T))))))); 
    446446  end cp_Tlow; 
    447  
    448   function cp_Tlow_der 
    449     "Compute specific heat capacity at constant pressure, low T region" 
     447   
     448  function cp_Tlow_der  
     449    "Compute specific heat capacity at constant pressure, low T region"  
    450450    extends Modelica.Icons.Function; 
    451451    input IdealGases.Common.DataRecord data "Ideal gas data"; 
     
    453453    input Real dT "Temperature derivative"; 
    454454    output Real cp_der "Derivative of specific heat capacity"; 
    455   algorithm 
     455  algorithm  
    456456    cp_der := dT*data.R/(T*T*T)*(-2*data.alow[1] + T*( 
    457457      -data.alow[2] + T*T*(data.alow[4] + T*(2.*data.alow[5] + T 
    458458      *(3.*data.alow[6] + 4.*data.alow[7]*T))))); 
    459459  end cp_Tlow_der; 
    460  
     460   
    461461  function h_T "Compute specific enthalpy from temperature and gas data; reference is decided by the  
    462     refChoice input, or by the referenceChoice package constant by default" 
     462    refChoice input, or by the referenceChoice package constant by default"  
    463463    import Modelica.Media.Interfaces.PartialMedium.Choices; 
    464464    extends Modelica.Icons.Function; 
    465465    input IdealGases.Common.DataRecord data "Ideal gas data"; 
    466466    input SI.Temperature T "Temperature"; 
    467     input Boolean exclEnthForm=excludeEnthalpyOfFormation 
     467    input Boolean exclEnthForm=excludeEnthalpyOfFormation  
    468468      "If true, enthalpy of formation Hf is not included in specific enthalpy h"; 
    469     input Choices.ReferenceEnthalpy refChoice=referenceChoice 
     469    input Choices.ReferenceEnthalpy refChoice=referenceChoice  
    470470      "Choice of reference enthalpy"; 
    471     input SI.SpecificEnthalpy h_off=h_offset 
     471    input SI.SpecificEnthalpy h_off=h_offset  
    472472      "User defined offset for reference enthalpy, if referenceChoice = UserDefined"; 
    473473    output SI.SpecificEnthalpy h "Specific enthalpy at temperature T"; 
     
    478478      //                            zeroDerivative=refChoice, 
    479479      //                            zeroDerivative=h_off) = h_T_der); 
    480   algorithm 
     480  algorithm  
    481481    h := smooth(0,(if T < data.Tlimit then data.R*((-data.alow[1] + T*(data. 
    482482      blow[1] + data.alow[2]*Math.log(T) + T*(1.*data.alow[3] + T*(0.5*data. 
     
    490490            0.0)); 
    491491  end h_T; 
    492  
    493   function h_T_der "derivative function for h_T" 
     492   
     493  function h_T_der "derivative function for h_T"  
    494494    import Modelica.Media.Interfaces.PartialMedium.Choices; 
    495495    extends Modelica.Icons.Function; 
    496496    input IdealGases.Common.DataRecord data "Ideal gas data"; 
    497497    input SI.Temperature T "Temperature"; 
    498     input Boolean exclEnthForm=excludeEnthalpyOfFormation 
     498    input Boolean exclEnthForm=excludeEnthalpyOfFormation  
    499499      "If true, enthalpy of formation Hf is not included in specific enthalpy h"; 
    500     input Choices.ReferenceEnthalpy refChoice=referenceChoice 
     500    input Choices.ReferenceEnthalpy refChoice=referenceChoice  
    501501      "Choice of reference enthalpy"; 
    502     input SI.SpecificEnthalpy h_off=h_offset 
     502    input SI.SpecificEnthalpy h_off=h_offset  
    503503      "User defined offset for reference enthalpy, if referenceChoice = UserDefined"; 
    504504    input Real dT "Temperature derivative"; 
    505505    output Real h_der "Specific enthalpy at temperature T"; 
    506   algorithm 
     506  algorithm  
    507507    h_der := dT*cp_T(data,T); 
    508508  end h_T_der; 
    509  
     509   
    510510  function h_Tlow "Compute specific enthalpy, low T region; reference is decided by the  
    511     refChoice input, or by the referenceChoice package constant by default" 
     511    refChoice input, or by the referenceChoice package constant by default"  
    512512    import Modelica.Media.Interfaces.PartialMedium.Choices; 
    513513    extends Modelica.Icons.Function; 
    514514    input IdealGases.Common.DataRecord data "Ideal gas data"; 
    515515    input SI.Temperature T "Temperature"; 
    516     input Boolean exclEnthForm=excludeEnthalpyOfFormation 
     516    input Boolean exclEnthForm=excludeEnthalpyOfFormation  
    517517      "If true, enthalpy of formation Hf is not included in specific enthalpy h"; 
    518     input Choices.ReferenceEnthalpy refChoice=referenceChoice 
     518    input Choices.ReferenceEnthalpy refChoice=referenceChoice  
    519519      "Choice of reference enthalpy"; 
    520     input SI.SpecificEnthalpy h_off=h_offset 
     520    input SI.SpecificEnthalpy h_off=h_offset  
    521521      "User defined offset for reference enthalpy, if referenceChoice = UserDefined"; 
    522522    output SI.SpecificEnthalpy h "Specific enthalpy at temperature T"; 
     
    526526      //                                zeroDerivative=refChoice, 
    527527      //                                zeroDerivative=h_off) = h_Tlow_der); 
    528   algorithm 
     528  algorithm  
    529529    h := data.R*((-data.alow[1] + T*(data. 
    530530      blow[1] + data.alow[2]*Math.log(T) + T*(1.*data.alow[3] + T*(0.5*data. 
     
    536536            0.0); 
    537537  end h_Tlow; 
    538  
     538   
    539539  function h_Tlow_der "Compute specific enthalpy, low T region; reference is decided by the  
    540     refChoice input, or by the referenceChoice package constant by default" 
     540    refChoice input, or by the referenceChoice package constant by default"  
    541541    import Modelica.Media.Interfaces.PartialMedium.Choices; 
    542542    extends Modelica.Icons.Function; 
    543543    input IdealGases.Common.DataRecord data "Ideal gas data"; 
    544544    input SI.Temperature T "Temperature"; 
    545     input Boolean exclEnthForm=excludeEnthalpyOfFormation 
     545    input Boolean exclEnthForm=excludeEnthalpyOfFormation  
    546546      "If true, enthalpy of formation Hf is not included in specific enthalpy h"; 
    547     input Choices.ReferenceEnthalpy refChoice=referenceChoice 
     547    input Choices.ReferenceEnthalpy refChoice=referenceChoice  
    548548      "Choice of reference enthalpy"; 
    549     input SI.SpecificEnthalpy h_off=h_offset 
     549    input SI.SpecificEnthalpy h_off=h_offset  
    550550      "User defined offset for reference enthalpy, if referenceChoice = UserDefined"; 
    551551    input Real dT(unit="K/s") "Temperature derivative"; 
    552     output Real h_der(unit="J/(kg.s)") 
     552    output Real h_der(unit="J/(kg.s)")  
    553553      "Derivative of specific enthalpy at temperature T"; 
    554   algorithm 
     554  algorithm  
    555555    h_der := dT*cp_Tlow(data,T); 
    556556  end h_Tlow_der; 
    557  
    558   function s0_T "Compute specific entropy from temperature and gas data" 
     557   
     558  function s0_T "Compute specific entropy from temperature and gas data"  
    559559    extends Modelica.Icons.Function; 
    560560    input IdealGases.Common.DataRecord data "Ideal gas data"; 
     
    562562    output SI.SpecificEntropy s "Specific entropy at temperature T"; 
    563563    //    annotation (InlineNoEvent=false); 
    564   algorithm 
     564  algorithm  
    565565    s := noEvent(if T < data.Tlimit then data.R*(data.blow[2] - 0.5*data.alow[ 
    566566      1]/(T*T) - data.alow[2]/T + data.alow[3]*Math.log(T) + T*( 
     
    570570       + T*(0.5*data.ahigh[5] + T*(1/3*data.ahigh[6] + 0.25*data.ahigh[7]*T))))); 
    571571  end s0_T; 
    572  
    573   function s0_Tlow "Compute specific entropy, low T region" 
     572   
     573  function s0_Tlow "Compute specific entropy, low T region"  
    574574    extends Modelica.Icons.Function; 
    575575    input IdealGases.Common.DataRecord data "Ideal gas data"; 
     
    577577    output SI.SpecificEntropy s "Specific entropy at temperature T"; 
    578578    //    annotation (InlineNoEvent=false); 
    579   algorithm 
     579  algorithm  
    580580    s := data.R*(data.blow[2] - 0.5*data.alow[ 
    581581      1]/(T*T) - data.alow[2]/T + data.alow[3]*Math.log(T) + T*(