/[ascend]/trunk/models/johnpye/dsg.a4c
ViewVC logotype

Contents of /trunk/models/johnpye/dsg.a4c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 743 - (show annotations) (download) (as text)
Thu Jul 6 14:22:26 2006 UTC (14 years, 4 months ago) by johnpye
File MIME type: text/x-ascend
File size: 3421 byte(s)
Few small changes to fix for Linux after the recent MSVC++ oriented changes.
1 REQUIRE "atoms.a4l";
2 REQUIRE "johnpye/thermo_types.a4c";
3 IMPORT "freesteam";
4 IMPORT "dsg";
5
6 (*
7 This model requires the 'freesteam' library be installed on your system.
8 You must compile it with the 'ASCEND_CONFIG=`which ascend-config`' flag
9 to ensure that the required external library is installed where ASCEND
10 can find it. Alternatively, you can specify the location by adding to the
11 ASCENDLIBRARY path variable
12
13 This model also requires the 'dsg' library for Direct Steam Generation
14 calculations, available on request from http://pye.dyndns.org/
15 *)
16
17 MODEL dsg;
18 (* temporal derivatives *)
19 drho_dt IS_A density_rate;
20 dmdot_dt IS_A mass_rate_rate;
21 drhou_dt IS_A solver_var;
22 dTw_dt IS_A temperature_rate;
23
24 (* spatial derivatives *)
25 dmdot_dz IS_A mass_rate_per_length;
26 dmdoth_dz IS_A solver_var;
27 dekdot_dz IS_A solver_var;
28 dp_dz IS_A pressure_per_length;
29 drhovel2_dz IS_A pressure_per_length;
30
31 (* wall properties *)
32 rhow IS_A mass_density;
33 D2 IS_A distance;
34 cw IS_A specific_heat_capacity;
35 Aw IS_A area;
36 hw IS_A heat_transfer_coefficient;
37
38 Aw = 1{PI}*(D2^2 - D^2)/4;
39
40 (* conservation equations *)
41 massbal: drho_dt = -1/A * dmdot_dz;
42 mombal: 1/A * dmdot_dt = -dp_dz - f/D/2*rho*vel^2 - drhovel2_dz;
43 enerbal: drhou_dt = 1/A * ( qdott - dmdoth_dz + mdot * dekdot_dz );
44 pipebal: dTw_dt = 1/rhow/Aw/cw * (qdots - qdotl - qdott);
45
46 rho IS_A mass_density;
47 mdot IS_A mass_rate;
48 p IS_A pressure;
49 f IS_A factor; (* pipe friction factor *)
50 u IS_A specific_energy;
51 h IS_A specific_enthalpy;
52 vel IS_A speed;
53 qdott, qdotl,qdots IS_A power_per_length;
54 mu IS_A viscosity;
55 v IS_A specific_volume;
56 T1,Tw,T2,Tamb IS_A temperature;
57
58 rho * v = 1;
59
60 thermo_props: iapws97_uvmu_ph(
61 p,h : INPUT;
62 u,v,mu : OUTPUT
63 );
64
65 vel = rho*mdot/A;
66
67 Re IS_A factor;
68 Re_rel: Re = rho*vel*D/mu;
69 eps_on_D IS_A factor;
70 eps_on_D_rel: eps_on_D = eps/D;
71
72 D IS_A distance;
73 eps IS_A distance;
74 A IS_A area;
75 A = 1{PI}* D^2 / 4;
76
77 friction: dsg_fric_factor_two_phase(
78 Re, eps_on_D : INPUT;
79 f : OUTPUT
80 );
81
82 twophmult: dsg_phi2_martinelli_nelson(
83 p,x : INPUT;
84 rho2 : OUTPUT
85
86 cavity_losses: dsg_ext_heat_loss(
87 T2,Tamb,D2,hw : INPUT;
88 qdotl : OUTPUT
89 );
90
91 Tw = (T1 + T2)/2;
92
93 METHODS
94
95 METHOD specify;
96 (* design parameters, geometry, materials of construction *)
97 FIX rhow,D2,cw,hw;
98 FIX D, eps;
99 FIX qdots;
100 FIX Tamb;
101
102 (* states *)
103 FIX T1, T2, p, h, mdot;
104
105 (* spatial derivs are all fixed -- because we would know what's next door *)
106 FIX dmdot_dz, dmdoth_dz, dekdot_dz, dp_dz, drhovel2_dz;
107
108 FIX dTw_dt;
109 END specify;
110
111 METHOD values;
112 (* design parameters *)
113 D := 60 {mm};
114 D2 := 70 {mm};
115 eps := 0.05 {mm};
116 rhow := 7.8 {g/cm^3};
117 cw := 0.47 {J/g/K};
118 hw := 10 {W/m^2/K};
119 Tamb := 300 {K};
120
121 (* states *)
122 T1 := 600 {K};
123 T2 := 500 {K};
124 p := 10 {bar};
125 h := 2000 {kJ/kg};
126 mdot := 0.001 {kg/s};
127
128 (* spatial derivs *)
129 dp_dz := -500 {Pa/m};
130 dmdot_dz := 0 {kg/s/m};
131 drhovel2_dz := (0 {kg/m^3}) * (0 {m/s})^2 / (1 {m});
132 dekdot_dz := 0 {W/m};
133 dmdoth_dz := dmdot_dz * 0 {kJ/kg};
134
135 (* derivative variables *)
136 drho_dt := 0 {kg/m^3/s};
137 dmdot_dt := 0 {kg/s/s};
138 drhou_dt := 0 {kg/m^3*kJ/kg/s};
139 dTw_dt := 0 {K/s};
140
141 (* bounds *)
142 f.lower_bound := 0.008;
143 v.lower_bound := 0.00999 {m^3/kg};
144 v.upper_bound := 1/(0.0202 {kg/m^3});
145 u.lower_bound := 0 {kJ/kg};
146 u.upper_bound := 3663 {kJ/kg};
147
148 (* starting guesses *)
149 Re := 10000;
150 END values;
151
152 METHOD on_load;
153 RUN reset;
154 RUN values;
155 END on_load;
156
157 END dsg;

Properties

Name Value
svn:executable *

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22