/[ascend]/trunk/models/steam/dsgsat2.a4c
ViewVC logotype

Annotation of /trunk/models/steam/dsgsat2.a4c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1122 - (hide annotations) (download) (as text)
Fri Jan 12 02:43:17 2007 UTC (17 years, 6 months ago) by johnpye
File MIME type: text/x-ascend
File size: 5180 byte(s)
more...
1 johnpye 923 REQUIRE "ivpsystem.a4l";
2     REQUIRE "atoms.a4l";
3     REQUIRE "johnpye/thermo_types.a4c";
4    
5     (*
6 johnpye 1116 An attempt to model direct steam generation in pipe flow, limited to the
7     saturated regime, and with constant-valued friction factor. External heat
8     loss is also simplified.
9 johnpye 923 *)
10 johnpye 1046 REQUIRE "steam/satsteamstream.a4c";
11 johnpye 923
12     MODEL dsgsat2;
13     n IS_A integer_constant;
14 johnpye 1122 n :== 10;
15 johnpye 923
16     (* temporal derivatives *)
17     drho_dt[2..n] IS_A density_rate;
18     dmdot_dt[2..n] IS_A mass_rate_rate;
19     drhou_dt[2..n] IS_A power_per_volume;
20     dTw_dt[2..n] IS_A temperature_rate;
21    
22     (* wall properties *)
23     rho_w IS_A mass_density;
24     D, D_2 IS_A distance;
25     c_w IS_A specific_heat_capacity;
26     A, A_w IS_A area;
27     h_int IS_A heat_transfer_coefficient; (* internal *)
28     h_ext IS_A heat_transfer_coefficient; (* external *)
29     A = 1{PI}*D^2/4;
30     A_w = 1{PI}*(D_2^2 - D^2)/4;
31     dz IS_A distance;
32     L IS_A distance;
33     dz = L / n;
34    
35     (* fluid properties *)
36     node[1..n] IS_A satsteamstream;
37    
38     (* flow properties *)
39     vel[1..n] IS_A speed;
40     T_w[1..n] IS_A temperature;
41 johnpye 1121 T[1..n] IS_A temperature;
42 johnpye 923
43     (* constants, for the moment: *)
44     f IS_A positive_factor;
45     mu_f IS_A viscosity;
46     T_amb IS_A temperature;
47    
48     (* system dynamics *)
49     qdot_t[2..n], qdot_l[2..n] IS_A power_per_length;
50     qdot_s IS_A power_per_length;
51     rhou[1..n] IS_A energy_per_volume;
52    
53     FOR i IN [1..n] CREATE
54     vel[i] = node[i].v*node[i].mdot/A;
55     rhou[i] = node[i].rho * node[i].u;
56     END FOR;
57    
58     (* some aliases just for easier review of the state of the model *)
59     x[1..n] IS_A fraction;
60     mdot[1..n] IS_A mass_rate;
61     p[1..n] IS_A pressure;
62     FOR i IN [1..n] CREATE
63     x[i], node[i].x ARE_THE_SAME;
64     mdot[i], node[i].mdot ARE_THE_SAME;
65     p[i], node[i].p ARE_THE_SAME;
66 johnpye 1121 T[i], node[i].T ARE_THE_SAME;
67 johnpye 923 END FOR;
68    
69     (* differential equations *)
70     FOR i IN [2..n] CREATE
71 johnpye 1122 z_massbal[i]: A * drho_dt[i] * dz = - (node[i].mdot - node[i-1].mdot);
72     z_mombal[i]: dz/A*dmdot_dt[i] = -(node[i].p-node[i-1].p)
73 johnpye 1109 - f/D/2*node[i].rho*node[i].v^2*(
74     node[i].rho*vel[i]^2 - node[i-1].rho*vel[i-1]^2
75 johnpye 1122 );
76     z_enbal[i]: dz * (A * drhou_dt[i] - qdot_t[i]) = - (node[i].Hdot - node[i-1].Hdot);
77 johnpye 1109 z_wall[i]: rho_w*A_w*c_w*dTw_dt[i] = qdot_s - qdot_l[i] - qdot_t[i];
78     z_loss[i]: qdot_l[i] = h_ext*(1{PI}*D_2)*(T_w[i] - T_amb);
79     z_trans[i]: qdot_t[i] = h_int*(1{PI}*D) *(T_w[i] - node[i].T);
80 johnpye 923 END FOR;
81    
82     t IS_A time;
83     METHODS
84 johnpye 1106 METHOD bound_self;
85     vel[1..n].upper_bound := 100 {m/s};
86 johnpye 1121 qdot_l[2..n].lower_bound := 0 {W/m};
87 johnpye 923 FOR i IN [1..n] DO
88     RUN node[i].bound_self;
89     END FOR;
90 johnpye 1106 END bound_self;
91 johnpye 1122 METHOD on_load;
92     RUN configure_steady;
93     END on_load;
94 johnpye 1109 (*---------------- a physically sensible steady-state configuration-----------*)
95     METHOD configure_steady;
96 johnpye 1106 RUN ClearAll;
97 johnpye 1109 RUN specify_steady;
98 johnpye 1121 RUN bound_steady;
99 johnpye 1109 RUN values_steady;
100     END configure_steady;
101 johnpye 1121 METHOD bound_steady;
102     RUN bound_self;
103     T_w[1..n].upper_bound := 1000 {K};
104     END bound_steady;
105 johnpye 1109 METHOD specify_steady;
106     (* change to a proper steady-state problem, with fluid properties FREEd *)
107     FOR i IN [1..n] DO
108     RUN node[i].specify;
109     FIX dTw_dt[i]; FREE T_w[i];
110     FREE rhou[i];
111     END FOR;
112     FIX node[1].p;
113     FREE node[1].T;
114     FIX qdot_s;
115     FIX D, D_2, L;
116     FIX h_int, c_w, rho_w, h_ext;
117     FIX f, mu_f;
118     FIX T_amb;
119     (* fix derivatives to zero *)
120     FOR i IN [2..n] DO
121     (* FIX dmdot_dt[i]; FREE node[i].mdot; *)
122     FREE node[i].x; FIX node[i].p;
123     FIX drho_dt[i]; FREE node[i].p;
124     FIX drhou_dt[i]; FREE node[i].T;
125     FREE mdot[i]; FIX dmdot_dt[i];
126     END FOR;
127     END specify_steady;
128     METHOD values_steady;
129 johnpye 1122 L := 50 {m};
130     h_int := 5 {W/m^2/K};
131     h_ext := 10 {W/m^2/K};
132     node[1].mdot := 0.3 {kg/s};
133 johnpye 1109 node[1].p := 5 {bar};
134 johnpye 1122 node[1].x := 0.2;
135     qdot_s := 1000 {W/m^2} * D_2 * 10;
136 johnpye 1109 FOR i IN [2..n] DO
137     dmdot_dt[i] := 0.0 {kg/s/s};
138 johnpye 1121 drhou_dt[i] := 0 {kJ/m^3/s};
139 johnpye 1109 node[i].v := 0.2 {L/kg};
140     node[i].rho := 6 {kg/L};
141 johnpye 1116 node[i].dp_dT := +0.5 {kPa/K};
142 johnpye 1109 END FOR;
143     (* nothing atm *)
144     END values_steady;
145     (*------------------------- the dynamic problem ------------------------------*)
146 johnpye 1117 METHOD configure_dynamic;
147     RUN ode_init;
148 johnpye 923 FOR i IN [2..n] DO
149 johnpye 1049 FREE drho_dt[i]; FIX node[i].rho;
150     FREE dmdot_dt[i]; FIX node[i].mdot;
151     FREE drhou_dt[i]; FIX rhou[i];
152     FREE dTw_dt[i]; FIX T_w[i];
153 johnpye 1121 FREE node[i].x;
154     FREE node[i].T;
155 johnpye 923 END FOR;
156 johnpye 1122 t := 0 {s};
157     END configure_dynamic;
158    
159 johnpye 1049 METHOD ode_init;
160 johnpye 1109 (* add the necessary meta data to allow solving with the integrator *)
161 johnpye 1049 t.ode_type := -1;
162 johnpye 1050 t.obs_id := 1;
163 johnpye 923
164     FOR i IN [2..n] DO
165     drho_dt[i].ode_id := 4*i; node[i].rho.ode_id := 4*i;
166     drho_dt[i].ode_type := 2; node[i].rho.ode_type := 1;
167    
168     dmdot_dt[i].ode_id := 4*i+1; node[i].mdot.ode_id := 4*i+1;
169     dmdot_dt[i].ode_type := 2; node[i].mdot.ode_type := 1;
170    
171     drhou_dt[i].ode_id := 4*i+2; rhou[i].ode_id := 4*i+2;
172     drhou_dt[i].ode_type := 2; rhou[i].ode_type := 1;
173    
174     dTw_dt[i].ode_id := 4*i+3; T_w[i].ode_id := 4*i+3;
175     dTw_dt[i].ode_type := 2; T_w[i].ode_type := 1;
176     END FOR;
177    
178 johnpye 1055 FOR i IN [1..n] DO
179 johnpye 1050 p[i].obs_id := 1 + 4*i;
180     x[i].obs_id := 2 + 4*i+1;
181 johnpye 923 END FOR;
182 johnpye 1055 FOR i IN [] DO
183 johnpye 1050 (* qdot_t[i].obs_id := 3 + 4*i; *)
184 johnpye 1055 node[i].mdot.obs_id := 3 + 4*i;
185 johnpye 1050 T_w[i].obs_id := 4 + 4*i;
186 johnpye 923 END FOR;
187     END ode_init;
188    
189     METHOD fix_outlet_quality;
190     FIX x[n];
191     FREE node[1].mdot;
192     END fix_outlet_quality;
193    
194     END dsgsat2;
195     ADD NOTES IN dsgsat2;
196     'QRSlv' iterationlimit {50}
197     END NOTES;
198    
199    

Properties

Name Value
svn:executable *

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