# Contents of /trunk/models/johnpye/iapws_sat_curves.a4c

Wed Dec 14 06:25:28 2005 UTC (14 years, 9 months ago) by johnpye
File MIME type: text/x-ascend
File size: 1378 byte(s)
```Moving saturation curves into a separate file.
Adding a simple loop simulation using ideal-steam and fixed-density water.
```
 1 REQUIRE "johnpye/thermo_types.a4c"; 2 3 MODEL iapws_sat_curves; 4 5 rhof IS_A mass_density; 6 rhog IS_A mass_density; 7 rhoc IS_A mass_density_constant; 8 Tc IS_A temperature_constant; 9 T IS_A temperature; 10 11 rhoc :== 322 {kg/m^3}; 12 Tc :== 647.096 {K}; 13 14 tau IS_A factor; 15 16 tau = 1 - T/Tc; 17 18 rhof / rhoc = 1 + b[1]*tau^(1/3) + b[2]*tau^(2/3) + b[3]*tau^(5/3) + b[4]*tau^(16/3) + b[5] * tau^(43/3) + b[6]*tau^(110/3); 19 20 rhog / rhoc = exp( c[1]*tau^(2/6) + c[2] * tau^(4/6) +c[3]*tau^(8/6) + c[4] *tau^(18/6) + c[5]*tau^(37/6) + c[6]*tau^(71/6) ); 21 22 b[1..6] IS_A real_constant; 23 b[1] :== 1.99274064; 24 b[2] :== 1.09965342; 25 b[3] :== -0.510839303; 26 b[4] :== -1.75493479; 27 b[5] :== -45.5170352; 28 b[6] :== -6.74694450e5; 29 30 c[1..6] IS_A real_constant; 31 c[1] :== -2.03150240; 32 c[2] :== -2.68302940; 33 c[3] :== -5.38626492; 34 c[4] :== -17.2991605; 35 c[5] :== -44.7586581; 36 c[6] :== -63.9201063; 37 38 METHODS 39 40 METHOD default_self; 41 RUN test_1; 42 END default_self; 43 44 METHOD specify; 45 T.fixed := TRUE; 46 END specify; 47 48 METHOD values; 49 T := 273.16 {K}; 50 END values; 51 52 (* the following methods implement the reference data points from the IAPWS supsat.pdf release. *) 53 54 METHOD test_1; 55 RUN ClearAll; 56 RUN specify; 57 RUN values; 58 END test_1; 59 60 METHOD test_2; 61 RUN ClearAll; 62 RUN specify; 63 T := 373.1243 {K}; 64 END test_2; 65 66 METHOD test_3; 67 RUN ClearAll; 68 RUN specify; 69 T := 647.096 {K}; 70 END test_3; 71 72 END iapws_sat_curves;