Changeset 351
- Timestamp:
- 02/21/06 10:47:41 (3 years ago)
- Location:
- Modelica/trunk/Media
- Files:
-
- 2 modified
-
Water/package.mo (modified) (28 diffs)
-
package.mo (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
Modelica/trunk/Media/Water/package.mo
r339 r351 209 209 </html>")); 210 210 211 211 212 extends Modelica.Icons.Library; 212 213 constant Interfaces.PartialMedium.FluidConstants[1] waterConstants( … … 227 228 each hasCriticalData=true); 228 229 230 229 231 package ConstantPropertyLiquidWater 230 232 "Water: Simple liquid water medium (incompressible, constant data)" … … 263 265 end ConstantPropertyLiquidWater; 264 266 267 265 268 package IdealSteam "Water: Steam as ideal gas from NASA source" 266 269 extends IdealGases.SingleGases.H2O( … … 271 274 end IdealSteam; 272 275 276 273 277 package StandardWater = WaterIF97_ph 274 278 "Water using the IF97 standard, explicit in p and h. Recommended for most applications"; 275 279 280 276 281 package StandardWaterOnePhase = WaterIF97_pT 277 282 "Water using the IF97 standard, explicit in p and T. Recommended for one-phase applications"; 283 278 284 279 285 package WaterIF97OnePhase_ph … … 290 296 end WaterIF97OnePhase_ph; 291 297 298 292 299 package WaterIF97_pT "Water using the IF97 standard, explicit in p and T" 293 300 extends WaterIF97_base( … … 299 306 end WaterIF97_pT; 300 307 308 301 309 package WaterIF97_ph "Water using the IF97 standard, explicit in p and h" 302 310 extends WaterIF97_base( … … 310 318 </html>")); 311 319 end WaterIF97_ph; 320 312 321 313 322 partial package WaterIF97_base … … 441 450 end if; 442 451 if dT_explicit then 443 p = p _dT(d, T, phase);444 h = h_dT(d, T, phase);452 p = pressure_dT(d, T, phase); 453 h = specificEnthalpy_dT(d, T, phase); 445 454 sat.Tsat = T; 446 455 sat.psat = saturationPressure(T); 447 456 elseif ph_explicit then 448 d = rho_ph(p, h, phase);449 T = T_ph(p, h, phase);457 d = density_ph(p, h, phase); 458 T = temperature_ph(p, h, phase); 450 459 sat.Tsat = saturationTemperature(p); 451 460 sat.psat = p; 452 461 else 453 h = h_pT(p, T);454 d = rho_pT(p, T);462 h = specificEnthalpy_pT(p, T); 463 d = density_pT(p, T); 455 464 sat.psat = p; 456 465 sat.Tsat = saturationTemperature(p); … … 465 474 end BaseProperties; 466 475 467 redeclare function extends rho_ph 468 "compute density as a function of pressure and specific enthalpy" 476 redeclare function density_ph 477 "Computes density as a function of pressure and specific enthalpy" 478 extends Modelica.Icons.Function; 479 input AbsolutePressure p "Pressure"; 480 input SpecificEnthalpy h "Specific enthalpy"; 481 input FixedPhase phase "2 for two-phase, 1 for one-phase, 0 if not known"; 482 output Density d "Density"; 469 483 algorithm 470 484 d := IF97_Utilities.rho_ph(p, h, phase); 471 end rho_ph; 472 473 redeclare function extends T_ph 474 "compute temperature as a function of pressure and specific enthalpy" 485 end density_ph; 486 487 redeclare function temperature_ph 488 "Computes temperature as a function of pressure and specific enthalpy" 489 extends Modelica.Icons.Function; 490 input AbsolutePressure p "Pressure"; 491 input SpecificEnthalpy h "Specific enthalpy"; 492 input FixedPhase phase "2 for two-phase, 1 for one-phase, 0 if not known"; 493 output Temperature T "Temperature"; 475 494 algorithm 476 495 T := IF97_Utilities.T_ph(p, h, phase); 477 end T_ph;478 496 end temperature_ph; 497 /* 479 498 redeclare function extends temperature_phX 480 499 "Compute temperature from pressure and specific enthalpy" … … 482 501 T := T_ph(p, h); 483 502 end temperature_phX; 484 503 485 504 redeclare function extends temperature_psX 486 505 "Compute temperature from pressure and specific enthalpy" 487 506 algorithm 488 507 assert(false,"not yet implemented"); 489 // T := IF97_Utilities.T_ps(p, s);508 // T := IF97_Utilities.T_ps(p, s); 490 509 end temperature_psX; 491 510 */ 511 redeclare function temperature_ps 512 "Computes temperature as a function of pressure and specific entropy" 513 extends Modelica.Icons.Function; 514 input AbsolutePressure p "Pressure"; 515 input SpecificEntropy s "Specific entropy"; 516 input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known"; 517 output Temperature T "Temperature"; 518 algorithm 519 assert(false,"not yet implemented"); 520 end temperature_ps; 521 /* 492 522 redeclare function extends density_phX 493 523 "Compute density from pressure and specific enthalpy" … … 495 525 d := IF97_Utilities.rho_ph(p, h); 496 526 end density_phX; 497 498 redeclare function extends p_dT 499 "compute pressure as a function of density and temperature" 527 */ 528 redeclare function pressure_dT 529 "Computes pressure as a function of density and temperature" 530 extends Modelica.Icons.Function; 531 input Density d "Density"; 532 input Temperature T "Temperature"; 533 input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known"; 534 output AbsolutePressure p "Pressure"; 500 535 algorithm 501 536 p := IF97_Utilities.p_dT(d, T, phase); 502 end p_dT; 503 504 redeclare function extends h_dT 505 "compute specific enthalpy as a function of density and temperature" 537 end pressure_dT; 538 539 redeclare function specificEnthalpy_dT 540 "Computes specific enthalpy as a function of density and temperature" 541 extends Modelica.Icons.Function; 542 input Density d "Density"; 543 input Temperature T "Temperature"; 544 input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known"; 545 output SpecificEnthalpy h "specific enthalpy"; 506 546 algorithm 507 547 h := IF97_Utilities.h_dT(d, T, phase); 508 end h_dT; 509 510 redeclare function extends h_pT 511 "compute specific enthalpy as a function of pressure and temperature" 548 end specificEnthalpy_dT; 549 550 redeclare function specificEnthalpy_pT 551 "Computes specific enthalpy as a function of pressure and temperature" 552 extends Modelica.Icons.Function; 553 input AbsolutePressure p "Pressure"; 554 input Temperature T "Temperature"; 555 input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known"; 556 output SpecificEnthalpy h "specific enthalpy"; 512 557 algorithm 513 558 h := IF97_Utilities.h_pT(p, T); 514 end h_pT;515 559 end specificEnthalpy_pT; 560 /* 516 561 redeclare function extends specificEnthalpy_pTX 517 562 "Compute specific enthalpy from pressure, temperature and mass fraction" … … 519 564 h := h_pT(p, T); 520 565 end specificEnthalpy_pTX; 521 522 redeclare function extends rho_pT 523 "compute density as a function of pressure and temperature" 566 */ 567 redeclare function density_pT 568 "Computes density as a function of pressure and temperature" 569 extends Modelica.Icons.Function; 570 input AbsolutePressure p "Pressure"; 571 input Temperature T "Temperature"; 572 input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known"; 573 output Density d "Density"; 524 574 algorithm 525 575 d := IF97_Utilities.rho_pT(p, T); 526 end rho_pT;576 end density_pT; 527 577 528 578 redeclare function extends setDewState … … 578 628 end specificEntropy; 579 629 580 redeclare function extends heatCapacity_cp630 redeclare function extends specificHeatCapacityCp 581 631 "specific heat capacity at constant pressure of water" 582 632 … … 593 643 cp := IF97_Utilities.cp_ph(state.p, state.h, state.phase); 594 644 end if; 595 end heatCapacity_cp;596 597 redeclare function extends heatCapacity_cv645 end specificHeatCapacityCp; 646 647 redeclare function extends specificHeatCapacityCv 598 648 "specific heat capacity at constant volume of water" 599 649 algorithm … … 605 655 cv := IF97_Utilities.cv_ph(state.p, state.h, state.phase); 606 656 end if; 607 end heatCapacity_cv;657 end specificHeatCapacityCv; 608 658 609 659 redeclare function extends isentropicExponent "Return isentropic exponent" … … 660 710 refState), 0); 661 711 end isentropicEnthalpy; 662 712 /* 663 713 redeclare function extends specificEnthalpy_psX "compute h(p,s)" 664 714 algorithm 665 715 h := IF97_Utilities.isentropicEnthalpy(p, s, 0); 666 716 end specificEnthalpy_psX; 717 */ 718 redeclare function specificEnthalpy_ps 719 "Computes specific enthalpy as a function of pressure and specific entropy" 720 extends Modelica.Icons.Function; 721 input AbsolutePressure p "Pressure"; 722 input SpecificEntropy s "Specific entropy"; 723 input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known"; 724 output SpecificEnthalpy h "specific enthalpy"; 725 algorithm 726 h := IF97_Utilities.isentropicEnthalpy(p, s, 0); 727 end specificEnthalpy_ps; 667 728 668 729 redeclare function extends density_derh_p … … 760 821 761 822 end WaterIF97_base; 823 762 824 763 825 partial package WaterIF97_fixedregion … … 911 973 end BaseProperties; 912 974 913 redeclare function extends rho_ph 914 "compute density as a function of pressure and specific enthalpy" 975 redeclare function density_ph 976 "Computes density as a function of pressure and specific enthalpy" 977 extends Modelica.Icons.Function; 978 input AbsolutePressure p "Pressure"; 979 input SpecificEnthalpy h "Specific enthalpy"; 980 input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known"; 915 981 input Integer region=0 916 982 "if 0, region is unknown, otherwise known and this input"; 983 output Density d "Density"; 917 984 algorithm 918 985 d := IF97_Utilities.rho_ph(p, h, phase, region); 919 end rho_ph; 920 921 redeclare function extends T_ph 922 "compute temperature as a function of pressure and specific enthalpy" 986 end density_ph; 987 988 redeclare function temperature_ph 989 "Computes temperature as a function of pressure and specific enthalpy" 990 extends Modelica.Icons.Function; 991 input AbsolutePressure p "Pressure"; 992 input SpecificEnthalpy h "Specific enthalpy"; 993 input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known"; 923 994 input Integer region=0 924 995 "if 0, region is unknown, otherwise known and this input"; 996 output Temperature T "Temperature"; 925 997 algorithm 926 998 T := IF97_Utilities.T_ph(p, h, phase, region); 927 end T_ph; 928 929 redeclare function extends p_dT 930 "compute pressure as a function of density and temperature" 999 end temperature_ph; 1000 1001 redeclare function pressure_dT 1002 "Computes pressure as a function of density and temperature" 1003 extends Modelica.Icons.Function; 1004 input Density d "Density"; 1005 input Temperature T "Temperature"; 1006 input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known"; 931 1007 input Integer region=0 932 1008 "if 0, region is unknown, otherwise known and this input"; 1009 output AbsolutePressure p "Pressure"; 933 1010 algorithm 934 1011 p := IF97_Utilities.p_dT(d, T, phase, region); 935 end p_dT; 936 937 redeclare function extends h_dT 938 "compute specific enthalpy as a function of density and temperature" 1012 end pressure_dT; 1013 1014 redeclare function specificEnthalpy_dT 1015 "Computes specific enthalpy as a function of density and temperature" 1016 extends Modelica.Icons.Function; 1017 input Density d "Density"; 1018 input Temperature T "Temperature"; 1019 input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known"; 939 1020 input Integer region=0 940 1021 "if 0, region is unknown, otherwise known and this input"; 1022 output SpecificEnthalpy h "specific enthalpy"; 941 1023 algorithm 942 1024 h := IF97_Utilities.h_dT(d, T, phase, region); 943 end h_dT; 944 945 redeclare function extends h_pT 946 "compute specific enthalpy as a function of pressure and temperature" 1025 end specificEnthalpy_dT; 1026 1027 redeclare function specificEnthalpy_pT 1028 "Computes specific enthalpy as a function of pressure and temperature" 1029 extends Modelica.Icons.Function; 1030 input AbsolutePressure p "Pressure"; 1031 input Temperature T "Temperature"; 1032 input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known"; 947 1033 input Integer region=0 948 1034 "if 0, region is unknown, otherwise known and this input"; 1035 output SpecificEnthalpy h "specific enthalpy"; 949 1036 algorithm 950 1037 h := IF97_Utilities.h_pT(p, T, region); 951 end h_pT; 952 953 redeclare function extends rho_pT 954 "compute density as a function of pressure and temperature" 1038 end specificEnthalpy_pT; 1039 1040 redeclare function density_pT 1041 "Computes density as a function of pressure and temperature" 1042 extends Modelica.Icons.Function; 1043 input AbsolutePressure p "Pressure"; 1044 input Temperature T "Temperature"; 1045 input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known"; 955 1046 input Integer region=0 956 1047 "if 0, region is unknown, otherwise known and this input"; 1048 output Density d "Density"; 957 1049 algorithm 958 1050 d := IF97_Utilities.rho_pT(p, T, region); 959 end rho_pT;1051 end density_pT; 960 1052 961 1053 redeclare function extends setDewState … … 1009 1101 end specificEntropy; 1010 1102 1011 redeclare function extends heatCapacity_cp1103 redeclare function extends specificHeatCapacityCp 1012 1104 "specific heat capacity at constant pressure of water" 1013 1105 algorithm … … 1019 1111 cp := IF97_Utilities.cp_ph(state.p, state.h, Region); 1020 1112 end if; 1021 end heatCapacity_cp;1022 1023 redeclare function extends heatCapacity_cv1113 end specificHeatCapacityCp; 1114 1115 redeclare function extends specificHeatCapacityCv 1024 1116 "specific heat capacity at constant volume of water" 1025 1117 algorithm … … 1031 1123 cv := IF97_Utilities.cv_ph(state.p, state.h, state.phase, Region); 1032 1124 end if; 1033 end heatCapacity_cv;1125 end specificHeatCapacityCv; 1034 1126 1035 1127 redeclare function extends isentropicExponent "Return isentropic exponent" … … 1185 1277 1186 1278 end WaterIF97_fixedregion; 1279 1187 1280 1188 1281 package WaterIF97_R1ph "region 1 (liquid) water according to IF97 standard" … … 1199 1292 end WaterIF97_R1ph; 1200 1293 1294 1201 1295 package WaterIF97_R2ph "region 2 (steam) water according to IF97 standard" 1202 1296 extends WaterIF97_fixedregion( … … 1212 1306 end WaterIF97_R2ph; 1213 1307 1308 1214 1309 package WaterIF97_R3ph "region 3 water according to IF97 standard" 1215 1310 extends WaterIF97_fixedregion( … … 1225 1320 end WaterIF97_R3ph; 1226 1321 1322 1227 1323 package WaterIF97_R4ph "region 4 water according to IF97 standard" 1228 1324 extends WaterIF97_fixedregion( … … 1238 1334 end WaterIF97_R4ph; 1239 1335 1336 1240 1337 package WaterIF97_R5ph "region 5 water according to IF97 standard" 1241 1338 extends WaterIF97_fixedregion( … … 1251 1348 end WaterIF97_R5ph; 1252 1349 1350 1253 1351 package WaterIF97_R1pT "region 1 (liquid) water according to IF97 standard" 1254 1352 extends WaterIF97_fixedregion( … … 1264 1362 end WaterIF97_R1pT; 1265 1363 1364 1266 1365 package WaterIF97_R2pT "region 2 (steam) water according to IF97 standard" 1267 1366 extends WaterIF97_fixedregion( -
Modelica/trunk/Media/package.mo
r350 r351 4373 4373 extends PartialMedium; 4374 4374 // the following are parallel to the cape-open names 4375 4376 replaceable partial function rho_ph 4377 "compute density as a function of pressure and specific enthalpy" 4378 extends Modelica.Icons.Function; 4379 input AbsolutePressure p "pressure"; 4380 input SpecificEnthalpy h "specific enthalpy"; 4381 input Integer phase = 0 4382 "phase of the fluid: 1 for 1-phase, 2 for two-phase, 0 for not known, e.g. interactive use"; 4383 output Density d "density"; 4384 end rho_ph; 4385 4386 replaceable partial function T_ph 4387 "compute temperature as a function of pressure and specific enthalpy" 4388 extends Modelica.Icons.Function; 4389 input AbsolutePressure p "pressure"; 4390 input SpecificEnthalpy h "specific enthalpy"; 4391 input Integer phase = 0 4392 "phase of the fluid: 1 for 1-phase, 2 for two-phase, 0 for not known, e.g. interactive use"; 4393 output Temperature T "temperature"; 4394 end T_ph; 4395 4396 replaceable partial function rho_pT 4397 "compute density as a function of pressure and temperature" 4398 extends Modelica.Icons.Function; 4399 input AbsolutePressure p "pressure"; 4400 input Temperature T "temperature"; 4401 output Density d "density"; 4402 end rho_pT; 4403 4404 replaceable partial function h_pT 4405 "compute specific enthalpy as a function of pressure and temperature" 4406 extends Modelica.Icons.Function; 4407 input AbsolutePressure p "pressure"; 4408 input Temperature T "temperature"; 4375 /* 4376 replaceable partial function rho_ph 4377 "compute density as a function of pressure and specific enthalpy" 4378 extends Modelica.Icons.Function; 4379 input AbsolutePressure p "pressure"; 4380 input SpecificEnthalpy h "specific enthalpy"; 4381 input Integer phase = 0 4382 "phase of the fluid: 1 for 1-phase, 2 for two-phase, 0 for not known, e.g. interactive use"; 4383 output Density d "density"; 4384 end rho_ph; 4385 4386 replaceable partial function T_ph 4387 "compute temperature as a function of pressure and specific enthalpy" 4388 extends Modelica.Icons.Function; 4389 input AbsolutePressure p "pressure"; 4390 input SpecificEnthalpy h "specific enthalpy"; 4391 input Integer phase = 0 4392 "phase of the fluid: 1 for 1-phase, 2 for two-phase, 0 for not known, e.g. interactive use"; 4393 output Temperature T "temperature"; 4394 end T_ph; 4395 4396 replaceable partial function rho_pT 4397 "compute density as a function of pressure and temperature" 4398 extends Modelica.Icons.Function; 4399 input AbsolutePressure p "pressure"; 4400 input Temperature T "temperature"; 4401 output Density d "density"; 4402 end rho_pT; 4403 4404 replaceable partial function h_pT 4405 "compute specific enthalpy as a function of pressure and temperature" 4406 extends Modelica.Icons.Function; 4407 input AbsolutePressure p "pressure"; 4408 input Temperature T "temperature"; 4409 output SpecificEnthalpy h "specific enthalpy"; 4410 end h_pT; 4411 4412 replaceable partial function p_dT 4413 "compute pressure as a function of density and temperature" 4414 extends Modelica.Icons.Function; 4415 input Density d "density"; 4416 input Temperature T "temperature"; 4417 input Integer phase = 0 4418 "phase of the fluid: 1 for 1-phase, 2 for two-phase, 0 for not known, e.g. interactive use"; 4419 output AbsolutePressure p "pressure"; 4420 end p_dT; 4421 4422 replaceable partial function h_dT 4423 "compute specific enthalpy as a function of density and temperature" 4424 extends Modelica.Icons.Function; 4425 input Density d "density"; 4426 input Temperature T "temperature"; 4427 input Integer phase = 0 4428 "phase of the fluid: 1 for 1-phase, 2 for two-phase, 0 for not known, e.g. interactive use"; 4429 output SpecificEnthalpy h "specific enthalpy"; 4430 end h_dT; 4431 */ 4432 replaceable function density_ph 4433 "Computes density as a function of pressure and specific enthalpy" 4434 extends Modelica.Icons.Function; 4435 input AbsolutePressure p "Pressure"; 4436 input SpecificEnthalpy h "Specific enthalpy"; 4437 output Density d "Density"; 4438 algorithm 4439 d := density_phX(p, h, fill(0,0)); 4440 end density_ph; 4441 4442 replaceable function temperature_ph 4443 "Computes temperature as a function of pressure and specific enthalpy" 4444 extends Modelica.Icons.Function; 4445 input AbsolutePressure p "Pressure"; 4446 input SpecificEnthalpy h "Specific enthalpy"; 4447 output Temperature T "Temperature"; 4448 algorithm 4449 T := temperature_phX(p, h, fill(0,0)); 4450 end temperature_ph; 4451 4452 replaceable function pressure_dT 4453 "Computes pressure as a function of density and temperature" 4454 extends Modelica.Icons.Function; 4455 input Density d "Density"; 4456 input Temperature T "Temperature"; 4457 output AbsolutePressure p "Pressure"; 4458 algorithm 4459 p := pressure(setState_pTX(d, T, fill(0,0))); 4460 end pressure_dT; 4461 4462 replaceable function specificEnthalpy_dT 4463 "Computes specific enthalpy as a function of density and temperature" 4464 extends Modelica.Icons.Function; 4465 input Density d "Density"; 4466 input Temperature T "Temperature"; 4409 4467 output SpecificEnthalpy h "specific enthalpy"; 4410 end h_pT; 4411 4412 replaceable partial function p_dT 4413 "compute pressure as a function of density and temperature" 4414 extends Modelica.Icons.Function; 4415 input Density d "density"; 4416 input Temperature T "temperature"; 4417 input Integer phase = 0 4418 "phase of the fluid: 1 for 1-phase, 2 for two-phase, 0 for not known, e.g. interactive use"; 4419 output AbsolutePressure p "pressure"; 4420 end p_dT; 4421 4422 replaceable partial function h_dT 4423 "compute specific enthalpy as a function of density and temperature" 4424 extends Modelica.Icons.Function; 4425 input Density d "density"; 4426 input Temperature T "temperature"; 4427 input Integer phase = 0 4428 "phase of the fluid: 1 for 1-phase, 2 for two-phase, 0 for not known, e.g. interactive use"; 4468 algorithm 4469 h := specificEnthalpy(setState_pTX(d, T, fill(0,0))); 4470 end specificEnthalpy_dT; 4471 4472 replaceable function specificEnthalpy_ps 4473 "Computes specific enthalpy as a function of pressure and specific entropy" 4474 extends Modelica.Icons.Function; 4475 input AbsolutePressure p "Pressure"; 4476 input SpecificEntropy s "Specific entropy"; 4429 4477 output SpecificEnthalpy h "specific enthalpy"; 4430 end h_dT; 4431 4478 algorithm 4479 h := specificEnthalpy_psX(p,s,fill(0,0)); 4480 end specificEnthalpy_ps; 4481 4482 replaceable function temperature_ps 4483 "Computes temperature as a function of pressure and specific entropy" 4484 extends Modelica.Icons.Function; 4485 input AbsolutePressure p "Pressure"; 4486 input SpecificEntropy s "Specific entropy"; 4487 output Temperature T "Temperature"; 4488 algorithm 4489 T := temperature_psX(p,s,fill(0,0)); 4490 end temperature_ps; 4491 4492 replaceable function specificEnthalpy_pT 4493 "Computes specific enthalpy as a function of pressure and temperature" 4494 extends Modelica.Icons.Function; 4495 input AbsolutePressure p "Pressure"; 4496 input Temperature T "Temperature"; 4497 output SpecificEnthalpy h "specific enthalpy"; 4498 algorithm 4499 h := specificEnthalpy_pTX(p, T, fill(0,0)); 4500 end specificEnthalpy_pT; 4501 4502 replaceable function density_pT 4503 "Computes density as a function of pressure and temperature" 4504 extends Modelica.Icons.Function; 4505 input AbsolutePressure p "Pressure"; 4506 input Temperature T "Temperature"; 4507 output Density d "Density"; 4508 algorithm 4509 d := density(setState_pTX(p, T, fill(0,0))); 4510 end density_pT; 4432 4511 end PartialPureSubstance; 4433 4512 … … 4876 4955 h := specificEnthalpy(setState_psX(p,s,X,phase)); 4877 4956 end specificEnthalpy_psX; 4957 4958 // alias functions for simplified access 4959 // note that there is a Dymola error which does not allow writing 4960 // replaceable function density_ph = density_phX(p,h,fill(0,0)) 4961 4962 redeclare replaceable function density_ph 4963 "Computes density as a function of pressure and specific enthalpy" 4964 extends Modelica.Icons.Function; 4965 input AbsolutePressure p "Pressure"; 4966 input SpecificEnthalpy h "Specific enthalpy"; 4967 input FixedPhase phase=0 4968 "2 for two-phase, 1 for one-phase, 0 if not known"; 4969 output Density d "Density"; 4970 algorithm 4971 d := density_phX(p, h, fill(0,0), phase); 4972 end density_ph; 4973 4974 redeclare replaceable function temperature_ph 4975 "Computes temperature as a function of pressure and specific enthalpy" 4976 extends Modelica.Icons.Function; 4977 input AbsolutePressure p "Pressure"; 4978 input SpecificEnthalpy h "Specific enthalpy"; 4979 input FixedPhase phase=0
