Parent Directory | Revision Log

Revision **1171** -
(**show annotations**)
(**download**)
(**as text**)

*Wed Jan 17 12:27:55 2007 UTC*
(13 years, 5 months ago)
by *johnpye*

File MIME type: text/x-ascend

File size: 2601 byte(s)

File MIME type: text/x-ascend

File size: 2601 byte(s)

Added notes for freesteam installation.

1 | REQUIRE "atoms.a4l"; |

2 | REQUIRE "johnpye/thermo_types.a4c"; |

3 | IMPORT "freesteam"; |

4 | (* |

5 | A second solution the Horwitz A, "The Case of the Collapsing Can", Chemical |

6 | Engineering Progress, Jun 1997, pp.61-65. |

7 | |

8 | "A fixed-volume vessel contains one pound of saturated water vapor at 14.7 |

9 | psia. One pound of water at 70 deg F and 14.7 psia is introduced |

10 | into the vessel. Assuming the entire process is adiabatic (no heat loss to |

11 | the surroundings), find the amount of liquid and vapor present in the |

12 | vessel, and the temperature and pressure in the vessel." |

13 | |

14 | Whereas the 'collapsingcan.a4c' model uses the simple polynomial curve fits |

15 | published in the original article, this model will use full IAPWS steam |

16 | properties from the freesteam project. |

17 | |

18 | Note that you will need to have freesteam (http://freesteam.sf.net) installed |

19 | on your machine for this to work. If you have already installed ASCEND and |

20 | you have the command 'ascend-config' available on your path, it should |

21 | just be a matter of downloading freesteam and typing |

22 | |

23 | $ tar jxvf freesteam-0.6.2.tar.bz2 |

24 | $ cd freesteam-0.6.2 |

25 | $ scons ascend |

26 | $ scons install |

27 | |

28 | The run the model-- |

29 | $ ascend collapsingcan2.a4c |

30 | |

31 | Model file created by John Pye, Jan 2007. |

32 | *) |

33 | |

34 | MODEL water; |

35 | p IS_A pressure; |

36 | T IS_A temperature; |

37 | v IS_A specific_volume; |

38 | x IS_A fraction; |

39 | u IS_A specific_energy; |

40 | m IS_A mass; |

41 | iapws: iapws97_Tvx_pu( |

42 | p,u : INPUT; |

43 | T,v,x : OUTPUT |

44 | ); |

45 | METHODS |

46 | METHOD on_load; |

47 | p := 14.7 {psi}; |

48 | x := 1.0; |

49 | m := 1 {lbm}; |

50 | FIX p,x,m; |

51 | END on_load; |

52 | END water; |

53 | |

54 | MODEL collapsingcan2; |

55 | vap IS_A water; |

56 | liq IS_A water; |

57 | |

58 | mix IS_A water; |

59 | mix.m = vap.m + liq.m; |

60 | mix.m*mix.u = vap.m*vap.u + liq.m*liq.u; |

61 | mix.m*mix.v = vap.m*vap.v; |

62 | |

63 | T_F IS_A temperature; |

64 | T_F = mix.T - 459.57 {R}; |

65 | |

66 | m_liq IS_A mass; |

67 | m_liq = (1-mix.x)*mix.m; |

68 | |

69 | m_vap IS_A mass; |

70 | m_vap = mix.x*mix.m; |

71 | |

72 | METHODS |

73 | METHOD on_load; |

74 | vap.p := 14.7 {psi}; |

75 | vap.x := 1.0; |

76 | vap.m := 1 {lbm}; |

77 | FIX vap.p, vap.x, vap.m; |

78 | |

79 | liq.T := (70 {R} + 459.67 {R}); |

80 | liq.p := 14.7 {psi}; |

81 | liq.m := 1 {lbm}; |

82 | FIX liq.T, liq.p, liq.m; |

83 | liq.u := 100 {kJ/kg}; (* initial guess *) |

84 | END on_load; |

85 | |

86 | METHOD self_test; |

87 | (* The following results use the solution values as published in the |

88 | original paper. Note that this model is tested regularly as part of the |

89 | ASCEND automated test suite, 'test.py'. *) |

90 | ASSERT abs(m_liq - 1.1453809 {lbm}) < 0.00005 {lbm}; |

91 | ASSERT abs(m_vap - 0.85461909 {lbm}) < 0.002 {lbm}; |

92 | ASSERT abs(mix.p - 12.434039 {psi}) < 0.003 {psi}; |

93 | ASSERT abs(mix.T - (203.67756 {R} + 459.67{R})) < 0.025 {R}; |

94 | END self_test; |

95 | |

96 | END collapsingcan2; |

97 | (* :ex: set ts=4: *) |

john.pye@anu.edu.au | ViewVC Help |

Powered by ViewVC 1.1.22 |