Changeset 902
- Timestamp:
- 12/08/2007 11:19:33 PM (13 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
Modelica/trunk/Modelica/Media/IdealGases/Common/package.mo
r883 r902 4 4 5 5 6 record DataRecord 7 "Coefficient data record for properties of ideal gases based on NASA source" 6 record DataRecord 7 "Coefficient data record for properties of ideal gases based on NASA source" 8 8 extends Modelica.Icons.Record; 9 9 String name "Name of ideal gas"; … … 45 45 46 46 47 partial package SingleGasNasa 48 "Medium model of an ideal gas based on NASA source" 49 47 partial package SingleGasNasa 48 "Medium model of an ideal gas based on NASA source" 49 50 50 annotation ( 51 51 Documentation(info="<HTML> … … 150 150 100}}), 151 151 graphics)); 152 152 153 153 extends Interfaces.PartialPureSubstance( 154 154 mediumName=data.name, … … 161 161 Density(start=10, nominal=10), 162 162 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" 166 166 AbsolutePressure p "Absolute pressure of medium"; 167 167 Temperature T "Temperature of medium"; 168 168 end ThermodynamicState; 169 170 redeclare record extends FluidConstants "Extended fluid constants" 169 170 redeclare record extends FluidConstants "Extended fluid constants" 171 171 Temperature criticalTemperature "critical temperature"; 172 172 AbsolutePressure criticalPressure "critical pressure"; … … 177 177 Temperature meltingPoint "melting point at 101325 Pa"; 178 178 Temperature normalBoilingPoint "normal boiling point (at 101325 Pa)"; 179 DipoleMoment dipoleMoment 179 DipoleMoment dipoleMoment 180 180 "dipole moment of molecule in Debye (1 debye = 3.33564e10-30 C.m)"; 181 Boolean hasIdealGasHeatCapacity=false 181 Boolean hasIdealGasHeatCapacity=false 182 182 "true if ideal gas heat capacity is available"; 183 183 Boolean hasCriticalData=false "true if critical data are known"; 184 184 Boolean hasDipoleMoment=false "true if a dipole moment known"; 185 185 Boolean hasFundamentalEquation=false "true if a fundamental equation"; 186 Boolean hasLiquidHeatCapacity=false 186 Boolean hasLiquidHeatCapacity=false 187 187 "true if liquid heat capacity is available"; 188 Boolean hasSolidHeatCapacity=false 188 Boolean hasSolidHeatCapacity=false 189 189 "true if solid heat capacity is available"; 190 Boolean hasAccurateViscosityData=false 190 Boolean hasAccurateViscosityData=false 191 191 "true if accurate data for a viscosity function is available"; 192 Boolean hasAccurateConductivityData=false 192 Boolean hasAccurateConductivityData=false 193 193 "true if accurate data for thermal conductivity is available"; 194 Boolean hasVapourPressureCurve=false 194 Boolean hasVapourPressureCurve=false 195 195 "true if vapour pressure data, e.g. Antoine coefficents are known"; 196 196 Boolean hasAcentricFactor=false "true if Pitzer accentric factor is known"; 197 SpecificEnthalpy HCRIT0=0.0 197 SpecificEnthalpy HCRIT0=0.0 198 198 "Critical specific enthalpy of the fundamental equation"; 199 SpecificEntropy SCRIT0=0.0 199 SpecificEntropy SCRIT0=0.0 200 200 "Critical specific entropy of the fundamental equation"; 201 SpecificEnthalpy deltah=0.0 201 SpecificEnthalpy deltah=0.0 202 202 "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 204 204 "Difference between specific enthalpy model (s_m) and f.eq. (s_f) (s_m - s_f)"; 205 205 end FluidConstants; 206 206 207 207 import SI = Modelica.SIunits; 208 208 import Modelica.Math; 209 209 import Modelica.Media.Interfaces.PartialMedium.Choices.ReferenceEnthalpy; 210 211 constant Boolean excludeEnthalpyOfFormation=true 210 211 constant Boolean excludeEnthalpyOfFormation=true 212 212 "If true, enthalpy of formation Hf is not included in specific enthalpy h"; 213 213 constant ReferenceEnthalpy referenceChoice=Choices. 214 214 ReferenceEnthalpy.ZeroAt0K "Choice of reference enthalpy"; 215 constant SpecificEnthalpy h_offset=0.0 215 constant SpecificEnthalpy h_offset=0.0 216 216 "User defined offset for reference enthalpy, if referenceChoice = UserDefined"; 217 218 constant IdealGases.Common.DataRecord data 217 218 constant IdealGases.Common.DataRecord data 219 219 "Data record of ideal gas substance"; 220 220 221 221 constant FluidConstants[nS] fluidConstants "constant data for the fluid"; 222 222 223 223 redeclare model extends BaseProperties( 224 224 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 228 228 assert(T >= 200 and T <= 6000, " 229 229 Temperature T (= " + String(T) + " K) is not in the allowed range … … 235 235 h = h_T(data, T, excludeEnthalpyOfFormation, referenceChoice, h_offset); 236 236 u = h - R*T; 237 237 238 238 // Has to be written in the form d=f(p,T) in order that static 239 239 // state selection for p and T is possible … … 243 243 state.p = p; 244 244 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" 248 248 extends Modelica.Icons.Function; 249 249 input AbsolutePressure p "Pressure"; … … 251 251 input MassFraction X[:]=reference_X "Mass fractions"; 252 252 output ThermodynamicState state; 253 algorithm 253 algorithm 254 254 state := ThermodynamicState(p=p,T=T); 255 255 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" 259 259 extends Modelica.Icons.Function; 260 260 input AbsolutePressure p "Pressure"; … … 262 262 input MassFraction X[:]=reference_X "Mass fractions"; 263 263 output ThermodynamicState state; 264 algorithm 264 algorithm 265 265 state := ThermodynamicState(p=p,T=T_h(h)); 266 266 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" 270 270 extends Modelica.Icons.Function; 271 271 input AbsolutePressure p "Pressure"; … … 273 273 input MassFraction X[:]=reference_X "Mass fractions"; 274 274 output ThermodynamicState state; 275 algorithm 275 algorithm 276 276 state := ThermodynamicState(p=p,T=T_ps(p,s)); 277 277 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" 281 281 extends Modelica.Icons.Function; 282 282 input Density d "density"; … … 284 284 input MassFraction X[:]=reference_X "Mass fractions"; 285 285 output ThermodynamicState state; 286 algorithm 286 algorithm 287 287 state := ThermodynamicState(p=d*data.R*T,T=T); 288 288 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 292 292 p := state.p; 293 293 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 297 297 T := state.T; 298 298 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 302 302 d := state.p/(data.R*state.T); 303 303 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 308 308 h := h_T(data,state.T); 309 309 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 315 315 u := h_T(data,state.T) - data.R*state.T; 316 316 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 321 321 s := s0_T(data, state.T) - data.R*Modelica.Math.log(state.p/reference_p); 322 322 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 327 327 g := h_T(data,state.T) - state.T*specificEntropy(state); 328 328 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 334 334 f := h_T(data,state.T) - data.R*state.T - state.T*specificEntropy(state); 335 335 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 340 340 cp := cp_T(data, state.T); 341 341 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 346 346 cv := cp_T(data, state.T) - data.R; 347 347 end specificHeatCapacityCv; 348 349 redeclare function extends isentropicExponent "Return isentropic exponent" 350 algorithm 348 349 redeclare function extends isentropicExponent "Return isentropic exponent" 350 algorithm 351 351 gamma := specificHeatCapacityCp(state)/specificHeatCapacityCv(state); 352 352 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 357 357 a := sqrt(data.R*state.T*cp_T(data, state.T)/specificHeatCapacityCv(state)); 358 358 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" 362 362 extends Modelica.Icons.Function; 363 363 input SI.Pressure p2 "downstream pressure"; 364 364 input ThermodynamicState state "properties at upstream location"; 365 input Boolean exclEnthForm=excludeEnthalpyOfFormation 365 input Boolean exclEnthForm=excludeEnthalpyOfFormation 366 366 "If true, enthalpy of formation Hf is not included in specific enthalpy h"; 367 input ReferenceEnthalpy refChoice=referenceChoice 367 input ReferenceEnthalpy refChoice=referenceChoice 368 368 "Choice of reference enthalpy"; 369 input SpecificEnthalpy h_off=h_offset 369 input SpecificEnthalpy h_off=h_offset 370 370 "User defined offset for reference enthalpy, if referenceChoice = UserDefined"; 371 371 output SI.SpecificEnthalpy h_is "isentropic enthalpy"; 372 protected 372 protected 373 373 IsentropicExponent gamma = isentropicExponent(state) "Isentropic exponent"; 374 algorithm 374 algorithm 375 375 h_is := h_T(data,state.T,exclEnthForm,refChoice,h_off) + 376 376 gamma/(gamma - 1.0)*state.p/density(state)*((p2/state.p)^((gamma - 1)/gamma) - 1.0); 377 377 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 381 381 "If true, enthalpy of formation Hf is not included in specific enthalpy h"; 382 input ReferenceEnthalpy refChoice=referenceChoice 382 input ReferenceEnthalpy refChoice=referenceChoice 383 383 "Choice of reference enthalpy"; 384 input SpecificEnthalpy h_off=h_offset 384 input SpecificEnthalpy h_off=h_offset 385 385 "User defined offset for reference enthalpy, if referenceChoice = UserDefined"; 386 algorithm 386 algorithm 387 387 h_is := isentropicEnthalpyApproximation(p_downstream,refState,exclEnthForm,refChoice,h_off); 388 388 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 393 393 beta := 1/state.T; 394 394 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 399 399 kappa := 1.0/state.p; 400 400 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 405 405 ddpT := 1/(state.T*data.R); 406 406 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 411 411 ddTp := -state.p/(state.T*state.T*data.R); 412 412 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 417 417 dddX := fill(0,0); 418 418 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" 422 422 extends Modelica.Icons.Function; 423 423 input IdealGases.Common.DataRecord data "Ideal gas data"; … … 425 425 output SI.SpecificHeatCapacity cp "Specific heat capacity at temperature T"; 426 426 annotation (InlineNoEvent=false); 427 algorithm 427 algorithm 428 428 cp := smooth(0,if T < data.Tlimit then data.R*(1/(T*T)*(data.alow[1] + T*( 429 429 data.alow[2] + T*(1.*data.alow[3] + T*(data.alow[4] + T*(data.alow[5] + T … … 432 432 ahigh[5] + T*(data.ahigh[6] + data.ahigh[7]*T)))))))); 433 433 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" 437 437 extends Modelica.Icons.Function; 438 438 input IdealGases.Common.DataRecord data "Ideal gas data"; … … 440 440 output SI.SpecificHeatCapacity cp "Specific heat capacity at temperature T"; 441 441 annotation (Inline=false, derivative(zeroDerivative=data) = cp_Tlow_der); 442 algorithm 442 algorithm 443 443 cp := data.R*(1/(T*T)*(data.alow[1] + T*( 444 444 data.alow[2] + T*(1.*data.alow[3] + T*(data.alow[4] + T*(data.alow[5] + T 445 445 *(data.alow[6] + data.alow[7]*T))))))); 446 446 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" 450 450 extends Modelica.Icons.Function; 451 451 input IdealGases.Common.DataRecord data "Ideal gas data"; … … 453 453 input Real dT "Temperature derivative"; 454 454 output Real cp_der "Derivative of specific heat capacity"; 455 algorithm 455 algorithm 456 456 cp_der := dT*data.R/(T*T*T)*(-2*data.alow[1] + T*( 457 457 -data.alow[2] + T*T*(data.alow[4] + T*(2.*data.alow[5] + T 458 458 *(3.*data.alow[6] + 4.*data.alow[7]*T))))); 459 459 end cp_Tlow_der; 460 460 461 461 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" 463 463 import Modelica.Media.Interfaces.PartialMedium.Choices; 464 464 extends Modelica.Icons.Function; 465 465 input IdealGases.Common.DataRecord data "Ideal gas data"; 466 466 input SI.Temperature T "Temperature"; 467 input Boolean exclEnthForm=excludeEnthalpyOfFormation 467 input Boolean exclEnthForm=excludeEnthalpyOfFormation 468 468 "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 470 470 "Choice of reference enthalpy"; 471 input SI.SpecificEnthalpy h_off=h_offset 471 input SI.SpecificEnthalpy h_off=h_offset 472 472 "User defined offset for reference enthalpy, if referenceChoice = UserDefined"; 473 473 output SI.SpecificEnthalpy h "Specific enthalpy at temperature T"; … … 478 478 // zeroDerivative=refChoice, 479 479 // zeroDerivative=h_off) = h_T_der); 480 algorithm 480 algorithm 481 481 h := smooth(0,(if T < data.Tlimit then data.R*((-data.alow[1] + T*(data. 482 482 blow[1] + data.alow[2]*Math.log(T) + T*(1.*data.alow[3] + T*(0.5*data. … … 490 490 0.0)); 491 491 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" 494 494 import Modelica.Media.Interfaces.PartialMedium.Choices; 495 495 extends Modelica.Icons.Function; 496 496 input IdealGases.Common.DataRecord data "Ideal gas data"; 497 497 input SI.Temperature T "Temperature"; 498 input Boolean exclEnthForm=excludeEnthalpyOfFormation 498 input Boolean exclEnthForm=excludeEnthalpyOfFormation 499 499 "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 501 501 "Choice of reference enthalpy"; 502 input SI.SpecificEnthalpy h_off=h_offset 502 input SI.SpecificEnthalpy h_off=h_offset 503 503 "User defined offset for reference enthalpy, if referenceChoice = UserDefined"; 504 504 input Real dT "Temperature derivative"; 505 505 output Real h_der "Specific enthalpy at temperature T"; 506 algorithm 506 algorithm 507 507 h_der := dT*cp_T(data,T); 508 508 end h_T_der; 509 509 510 510 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" 512 512 import Modelica.Media.Interfaces.PartialMedium.Choices; 513 513 extends Modelica.Icons.Function; 514 514 input IdealGases.Common.DataRecord data "Ideal gas data"; 515 515 input SI.Temperature T "Temperature"; 516 input Boolean exclEnthForm=excludeEnthalpyOfFormation 516 input Boolean exclEnthForm=excludeEnthalpyOfFormation 517 517 "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 519 519 "Choice of reference enthalpy"; 520 input SI.SpecificEnthalpy h_off=h_offset 520 input SI.SpecificEnthalpy h_off=h_offset 521 521 "User defined offset for reference enthalpy, if referenceChoice = UserDefined"; 522 522 output SI.SpecificEnthalpy h "Specific enthalpy at temperature T"; … … 526 526 // zeroDerivative=refChoice, 527 527 // zeroDerivative=h_off) = h_Tlow_der); 528 algorithm 528 algorithm 529 529 h := data.R*((-data.alow[1] + T*(data. 530 530 blow[1] + data.alow[2]*Math.log(T) + T*(1.*data.alow[3] + T*(0.5*data. … … 536 536 0.0); 537 537 end h_Tlow; 538 538 539 539 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" 541 541 import Modelica.Media.Interfaces.PartialMedium.Choices; 542 542 extends Modelica.Icons.Function; 543 543 input IdealGases.Common.DataRecord data "Ideal gas data"; 544 544 input SI.Temperature T "Temperature"; 545 input Boolean exclEnthForm=excludeEnthalpyOfFormation 545 input Boolean exclEnthForm=excludeEnthalpyOfFormation 546 546 "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 548 548 "Choice of reference enthalpy"; 549 input SI.SpecificEnthalpy h_off=h_offset 549 input SI.SpecificEnthalpy h_off=h_offset 550 550 "User defined offset for reference enthalpy, if referenceChoice = UserDefined"; 551 551 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)") 553 553 "Derivative of specific enthalpy at temperature T"; 554 algorithm 554 algorithm 555 555 h_der := dT*cp_Tlow(data,T); 556 556 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" 559 559 extends Modelica.Icons.Function; 560 560 input IdealGases.Common.DataRecord data "Ideal gas data"; … … 562 562 output SI.SpecificEntropy s "Specific entropy at temperature T"; 563 563 // annotation (InlineNoEvent=false); 564 algorithm 564 algorithm 565 565 s := noEvent(if T < data.Tlimit then data.R*(data.blow[2] - 0.5*data.alow[ 566 566 1]/(T*T) - data.alow[2]/T + data.alow[3]*Math.log(T) + T*( … … 570 570 + T*(0.5*data.ahigh[5] + T*(1/3*data.ahigh[6] + 0.25*data.ahigh[7]*T))))); 571 571 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" 574 574 extends Modelica.Icons.Function; 575 575 input IdealGases.Common.DataRecord data "Ideal gas data"; … … 577 577 output SI.SpecificEntropy s "Specific entropy at temperature T"; 578 578 // annotation (InlineNoEvent=false); 579 algorithm 579 algorithm 580 580 s := data.R*(data.blow[2] - 0.5*data.alow[ 581 581 1]/(T*T) - data.alow[2]/T + data.alow[3]*Math.log(T) + T*(
