/[ascend]/trunk/models/westerberg/H2ProcessRigorous.AWW.a4c
ViewVC logotype

Contents of /trunk/models/westerberg/H2ProcessRigorous.AWW.a4c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 821 - (show annotations) (download) (as text)
Thu Aug 17 11:57:54 2006 UTC (16 years, 3 months ago) by johnpye
File MIME type: text/x-ascend
File size: 22960 byte(s)
Changed 'hr' to 'h' and 'dy' to 'd' in accordance with SI units.
1 REQUIRE "stream_holdup.a4l";
2
3 (* => stream_holdup.a4l, thermodynamics.a4l,
4 * components.a4l, phases.a4l, atoms.a4l, measures.a4l,
5 * system.a4l, basemodel.a4l *)
6
7 ATOM heat_transfer_coefficient REFINES solver_var
8 DIMENSION M/T^3/TMP
9 DEFAULT 10.0 {BTU/ft^2/h/R};
10 lower_bound := 0.001 {BTU/ft^2/h/R};
11 upper_bound := 1000 {BTU/ft^2/h/R};
12 nominal := 10 {BTU/ft^2/h/R};
13 END heat_transfer_coefficient;
14
15 ATOM reaction_rate REFINES solver_var
16 DIMENSION Q/M/T
17 DEFAULT 1e-5 {mole/g/s};
18 lower_bound := -1e20 {mole/g/s};
19 upper_bound := 1e20 {mole/g/s};
20 nominal := 1e-5 {mole/g/s};
21 END reaction_rate;
22
23 ATOM partial_pressure REFINES solver_var
24 DIMENSION M/L/T^2
25 DEFAULT 1.0{atm};
26 lower_bound := 0.00{Pa};
27 upper_bound := 5000{atm};
28 nominal := 1.0{atm};
29 END partial_pressure;
30
31 ATOM pressure_squared REFINES solver_var
32 DIMENSION M^2/L^2/T^4
33 DEFAULT 1.0{atm^2};
34 lower_bound := 0.00{Pa^2};
35 upper_bound := 5000{atm^2};
36 nominal := 1.0{atm^2};
37 END pressure_squared;
38
39 ATOM volume_flux_rate REFINES solver_var
40 DIMENSION L^3/L^2/T
41 DEFAULT 10 {cm^3/cm^2/min};
42 lower_bound := 0.0 {cm^3/cm^2/min};
43 upper_bound := 100 {cm^3/cm^2/min};
44 nominal := 10 {cm^3/cm^2/min};
45 END volume_flux_rate;
46
47
48 MODEL VaporStream;
49 cd IS_A components_data([
50 'nitrogen',
51 'oxygen',
52 'water',
53 'hydrogen',
54 'carbon_monoxide',
55 'carbon_dioxide',
56 'methane',
57 'ethane',
58 'propane',
59 'n_butane'],'methane' );
60 pd IS_A phases_data('V', 'ideal_vapor_mixture', 'none', 'none');
61 equil IS_A start_true;
62 str IS_A stream(cd,pd,equil);
63
64 cost_per_mole IS_A cost_per_mole;
65 cost IS_A cost_per_time;
66 cost = cost_per_mole * flow;
67
68 comp ALIASES str.components;
69 P ALIASES str.P;
70 T ALIASES str.T;
71 flow ALIASES str.flow;
72 f ALIASES str.f;
73 y ALIASES str.y;
74 H_flow ALIASES str.H_flow;
75 thermo ALIASES cd.data;
76
77 METHODS
78 METHOD seqmod;
79 FIX str.state.slack_PhaseDisappearance['vapor'];
80 FIX cost_per_mole;
81 END seqmod;
82 METHOD specify;
83 RUN seqmod;
84 FIX T;
85 FIX P;
86 FIX f[comp];
87 END specify;
88 METHOD values;
89 str.state.slack_PhaseDisappearance['vapor'] := 0;
90 T := 800 {K};
91 P := 1 {atm};
92 f[comp] := 1 {mole/min};
93 cost_per_mole := 0 {USD/mole};
94 END values;
95 END VaporStream;
96
97 MODEL ZeroFeedAll REFINES VaporStream;
98 METHODS
99 METHOD seqmod;
100 RUN VaporStream::seqmod;
101
102 FREE f[comp];
103 FIX y[comp];
104 FREE y['hydrogen'];
105 FIX flow;
106 END seqmod;
107 METHOD specify;
108 RUN VaporStream::specify;
109 RUN seqmod;
110 END specify;
111 METHOD values;
112 RUN VaporStream::values;
113
114 y['nitrogen'] := 0.1;
115 y['oxygen'] := 0.1;
116 y['water'] := 0.1;
117 y['hydrogen'] := 0.1;
118 y['carbon_monoxide'] := 0.1;
119 y['carbon_dioxide'] := 0.1;
120 y['methane'] := 0.1;
121 y['ethane'] := 0.1;
122 y['propane'] := 0.1;
123 y['n_butane'] := 0.1;
124
125 T := 298 {K};
126 flow := 1e-6 {mole/min};
127 END values;
128 END ZeroFeedAll;
129
130 MODEL NaturalGasFeed REFINES VaporStream;
131 R IS_A gas_constant;
132
133 METHODS
134 METHOD seqmod;
135 RUN VaporStream::seqmod;
136
137 FREE f[comp];
138 FIX y[comp];
139 FREE y['hydrogen'];
140 END seqmod;
141 METHOD specify;
142 RUN VaporStream::specify;
143 RUN seqmod;
144
145 FIX flow;
146 END specify;
147 METHOD values;
148 RUN VaporStream::values;
149
150 (* Approx Worst CASE FROM Perry's 7th Ed, p.27-12 *)
151 y['nitrogen'] := 0.0104;
152 y['oxygen'] := 0;
153 y['water'] := 0;
154 y['hydrogen'] := 0;
155 y['carbon_monoxide'] := 0;
156 y['carbon_dioxide'] := 0.011;
157 y['methane'] := 0.863;
158 y['ethane'] := 0.081;
159 y['propane'] := 0.028;
160 y['n_butane'] := 0.0066;
161
162 T := 298 {K};
163 flow := 1 {mole/min};
164
165 cost_per_mole := ( 5 {USD/ft^3} ) *
166 ( 8.3144 {J/mole/K} ) * ( 298 {K} ) / ( 1 {atm} );
167 END values;
168 END NaturalGasFeed;
169
170 MODEL AirFeed REFINES VaporStream;
171 METHODS
172 METHOD seqmod;
173 RUN VaporStream::seqmod;
174
175 FREE f[comp];
176 FIX y[comp];
177 FREE y['hydrogen'];
178 END seqmod;
179 METHOD specify;
180 RUN VaporStream::specify;
181 RUN seqmod;
182
183 FIX flow;
184 END specify;
185 METHOD values;
186 RUN VaporStream::values;
187
188 y[comp] := 0;
189 y['nitrogen'] := 0.79;
190 y['oxygen'] := 0.21;
191
192 T := 298 {K};
193 flow := 1 {mole/min};
194 END values;
195 END AirFeed;
196
197 MODEL SteamFeed REFINES VaporStream;
198 METHODS
199 METHOD seqmod;
200 RUN VaporStream::seqmod;
201
202 FREE f[comp];
203 FIX y[comp];
204 FREE y['hydrogen'];
205 END seqmod;
206 METHOD specify;
207 RUN VaporStream::specify;
208 RUN seqmod;
209
210 FIX flow;
211 END specify;
212 METHOD values;
213 RUN VaporStream::values;
214
215 y[comp] := 0;
216 y['water'] := 1;
217
218 flow := 1 {mole/min};
219 T := 800 {K};
220 END values;
221 END SteamFeed;
222
223 MODEL HydrogenStream REFINES VaporStream;
224 METHODS
225 METHOD seqmod;
226 RUN VaporStream::seqmod;
227
228 FREE f[comp];
229 FIX y[comp];
230 FREE y['hydrogen'];
231 END seqmod;
232 METHOD specify;
233 RUN VaporStream::specify;
234 RUN seqmod;
235
236 FIX flow;
237 END specify;
238 METHOD values;
239 RUN VaporStream::values;
240
241 y[comp] := 0;
242 y['hydrogen'] := 1;
243
244 flow := 1 {mole/min};
245 T := 800 {K};
246 END values;
247 END HydrogenStream;
248
249
250 MODEL MixerUnit(
251 in1 WILL_BE VaporStream;
252 in2 WILL_BE VaporStream;
253 out WILL_BE VaporStream; );
254
255 FOR i IN in1.comp CREATE
256 out.f[i] = in1.f[i] + in2.f[i];
257 END FOR;
258 out.H_flow = in1.H_flow + in2.H_flow;
259 out.P = in1.P - (in1.P-in2.P)*(0.5 + arctan(in1.P-in2.P));
260
261 METHODS
262 METHOD seqmod;
263 RUN in1.seqmod;
264 RUN in2.seqmod;
265 RUN out.seqmod;
266 END seqmod;
267 METHOD specify;
268 RUN seqmod;
269
270 RUN in1.specify;
271 RUN in2.specify;
272 END specify;
273 METHOD values;
274 RUN in1.values;
275 RUN in2.values;
276 RUN out.values;
277 END values;
278 END MixerUnit;
279
280
281 MODEL BurnerUnit(
282 fuel WILL_BE VaporStream;
283 air WILL_BE VaporStream;
284 exhaust WILL_BE VaporStream;);
285
286 feed IS_A VaporStream;
287 mix IS_A MixerUnit(fuel,air,feed);
288
289 exhaust.f['nitrogen'] = feed.f['nitrogen'];
290 exhaust.f['oxygen'] = feed.f['oxygen'] - 0.5*feed.f['hydrogen']
291 - 0.5*feed.f['carbon_monoxide']
292 - 2.0*feed.f['methane'] - 3.5*feed.f['ethane']
293 - 5.0*feed.f['propane'] - 6.5*feed.f['n_butane'];
294 exhaust.f['water'] = feed.f['water'] + feed.f['hydrogen']
295 + 2.0*feed.f['methane'] + 3.0*feed.f['ethane']
296 + 4.0*feed.f['propane'] + 5.0*feed.f['n_butane'];
297 exhaust.f['hydrogen'] = 0 {mole/h};
298 exhaust.f['carbon_dioxide'] = feed.f['carbon_dioxide']
299 + 1.0*feed.f['carbon_monoxide']
300 + 1.0*feed.f['methane']
301 + 2.0*feed.f['ethane']
302 + 3.0*feed.f['propane']
303 + 4.0*feed.f['n_butane'];
304 exhaust.f['carbon_monoxide'] = 0 {mole/h};
305 exhaust.f['methane'] = 0 {mole/h};
306 exhaust.f['ethane'] = 0 {mole/h};
307 exhaust.f['propane'] = 0 {mole/h};
308 exhaust.f['n_butane'] = 0 {mole/h};
309
310 exhaust.H_flow = feed.H_flow;
311
312 (* zero pressure drop - unrealistic! *)
313 exhaust.P = feed.P;
314
315
316 METHODS
317 METHOD seqmod;
318 RUN mix.seqmod;
319 RUN fuel.seqmod;
320 RUN air.seqmod;
321 RUN feed.seqmod;
322 RUN exhaust.seqmod;
323 END seqmod;
324 METHOD specify;
325 RUN seqmod;
326
327 RUN fuel.specify;
328 RUN air.specify;
329 END specify;
330 METHOD values;
331 RUN mix.values;
332 RUN fuel.values;
333 RUN air.values;
334 RUN feed.values;
335 RUN exhaust.values;
336
337 air.flow := 10 * fuel.flow;
338 END values;
339 END BurnerUnit;
340
341 MODEL PreReformerUnit(
342 Ri WILL_BE VaporStream;
343 Xi WILL_BE VaporStream;
344 Ro WILL_BE VaporStream;
345 Xo WILL_BE VaporStream;
346 A WILL_BE area;
347 );
348
349 Q IS_A energy_rate;
350 U IS_A heat_transfer_coefficient;
351
352 Q = U*A*(Xo.T-Ro.T);
353 Ro.H_flow = Ri.H_flow + Q;
354 Xo.H_flow = Xi.H_flow - Q;
355
356 FOR i IN Xi.comp CREATE
357 Xo.f[i] = Xi.f[i];
358 END FOR;
359
360 Ro.f['nitrogen'] = Ri.f['nitrogen'];
361 Ro.f['oxygen'] = 0;
362 Ro.f['hydrogen'] = Ri.f['hydrogen'] + 4*Ri.f['oxygen']
363 - Ri.f['ethane'] - 2*Ri.f['propane']
364 - 3*Ri.f['n_butane'];
365 Ro.f['water'] = Ri.f['water'];
366 Ro.f['carbon_dioxide'] = Ri.f['carbon_dioxide'];
367 Ro.f['carbon_monoxide'] = Ri.f['carbon_monoxide'] + 2*Ri.f['oxygen'];
368 Ro.f['methane'] = Ri.f['methane'] + 2*Ri.f['ethane']
369 + 3*Ri.f['propane'] + 4*Ri.f['n_butane']
370 - 2*Ri.f['oxygen'];
371 Ro.f['ethane'] = 0;
372 Ro.f['propane'] = 0;
373 Ro.f['n_butane'] = 0;
374
375 Xo.P = Xi.P;
376 Ro.P = Ri.P;
377
378 METHODS
379 METHOD seqmod;
380 RUN Ri.seqmod;
381 RUN Xi.seqmod;
382 RUN Ro.seqmod;
383 RUN Xo.seqmod;
384
385 FIX U;
386 END seqmod;
387 METHOD specify;
388 RUN seqmod;
389
390 RUN Ri.specify;
391 RUN Xi.specify;
392
393 FIX A;
394 END specify;
395 METHOD values;
396 RUN Ri.values;
397 RUN Xi.values;
398 RUN Ro.values;
399 RUN Xo.values;
400
401 A := 40 {cm^2};
402 U := 10 {BTU/ft^2/h/R}; (* Perry's table 11-5, p.11-26 *)
403 END values;
404 END PreReformerUnit;
405
406 MODEL ReformerSection(
407 Ri WILL_BE VaporStream; (* Reactant in *)
408 Hi WILL_BE VaporStream; (* Pure Hydrogen in *)
409 Xi WILL_BE VaporStream; (* Burner Exhaust in *)
410 Ro WILL_BE VaporStream; (* Reactant out *)
411 Ho WILL_BE VaporStream; (* Pure Hydrogen out *)
412 Xo WILL_BE VaporStream; (* Burner Exhaust out *)
413 Cat WILL_BE mass; (* Catalyst Mass *)
414 A_heat WILL_BE area;
415 A_membrane WILL_BE area;
416 );
417
418 Hx IS_A HydrogenStream; (* H2 Permeate pseudo-stream *)
419 Q_heat, Q_membrane IS_A energy_rate; (* Heat transfer across walls *)
420 U_heat, U_membrane IS_A heat_transfer_coefficient;
421
422 FluxRate IS_A volume_flux_rate;
423
424 r1, r2, r3 IS_A reaction_rate;
425 P_me, P_wa, P_co, P_h2, P_co2 IS_A partial_pressure;
426 R IS_A gas_constant;
427 Den, K_p2 IS_A factor;
428 K_p1, K_p3 IS_A pressure_squared;
429
430 (* Kinetic data *)
431 H_K_co, H_K_h2, H_K_wa IS_A real_constant;
432 A_K_co, A_K_h2_sqr IS_A real_constant;
433 A_K_wa IS_A factor_constant;
434
435 E1, E2, E3 IS_A real_constant;
436 A1, A2, A3 IS_A factor_constant;
437 Units1, Units2, Units3 IS_A real_constant;
438
439 H_K_co :== -140.0 {kJ/mole};
440 H_K_wa :== 15.9 {kJ/mole};
441 H_K_h2 :== -93.4 {kJ/mole};
442 A_K_co :== 5.127e-13 {kPa^-1};
443 A_K_h2_sqr :== 3.22624e-19 {kPa^-1}; (* 5.68e-10 ^ 2 *)
444 A_K_wa :== 9.251;
445
446 E1 :== 209.2 {kJ/mole};
447 E2 :== 15.4 {kJ/mole};
448 E3 :== 109.4 {kJ/mole};
449 A1 :== 5.922e8;
450 A2 :== 6.028e-4;
451 A3 :== 1.093e3;
452 Units1 :== 1 {kg_mole^4/kg^4/s^4/kPa};
453 Units2 :== 1 {kg_mole/kg/s/kPa};
454 Units3 :== 1 {kg_mole^4/kg^4/s^4/kPa};
455
456 (* Reaction kinetics *)
457 P_me = Ro.P * Ro.y['methane'];
458 P_wa = Ro.P * Ro.y['water'];
459 P_h2 = Ro.P * Ro.y['hydrogen'];
460 P_co = Ro.P * Ro.y['carbon_monoxide'];
461 P_co2 = Ro.P * Ro.y['carbon_dioxide'];
462
463 Den = 1 + A_K_co*exp(H_K_co/(R*Ro.T))*P_co
464 + ((A_K_h2_sqr*P_h2)^(0.5))*exp(H_K_h2/(R*Ro.T))
465 + A_K_wa*exp(H_K_wa/(R*Ro.T))*P_wa/P_h2;
466
467 K_p1 = ( 1.198e17 {kPa^2} )*exp( (-26830 {K}) / Ro.T );
468 K_p2 = ( 1.767e-2 {kPa^0} )*exp( ( 4400 {K}) / Ro.T );
469 K_p3 = ( 2.117e15 {kPa^2} )*exp( (-22430 {K}) / Ro.T );
470
471 (* Reaction rates *)
472 r1 = ( Units1 * (P_me*(P_wa^(0.5))/(P_h2^(1.25)))^4 )^(0.25) *
473 (1-P_co *P_h2^3/(K_p1*P_me*P_wa )) / ( Den^2 );
474 r2 = Units2 * (P_co*(P_wa^(0.5))/(P_h2^(0.50))) *
475 (1-P_co2*P_h2 /(K_p2*P_co*P_wa )) / ( Den^2 );
476 r3 = ( Units3 * (P_me*(P_wa )/(P_h2^(1.75)))^4 )^(0.25) *
477 (1-P_co2*P_h2^4/(K_p3*P_me*P_wa^2)) / ( Den^2 );
478
479
480 (* energy balances *)
481 Xo.H_flow = Xi.H_flow - Q_heat;
482 Ro.H_flow = Ri.H_flow + Q_heat - Q_membrane - Hx.H_flow;
483 Ho.H_flow = Hi.H_flow + Q_membrane + Hx.H_flow;
484
485 Q_heat = U_heat*A_heat*(Xo.T - Ro.T);
486 Q_membrane = U_membrane*A_membrane*(Ro.T - Ho.T);
487
488 (* mass balances for Exhaust and Hydrogen streams *)
489 FOR i IN Xi.comp CREATE
490 Xo.f[i] = Xi.f[i];
491 END FOR;
492 FOR i IN Hi.comp CREATE
493 Ho.f[i] = Hi.f[i] + Hx.f[i];
494 END FOR;
495
496 (* mass balances (+reaction) for the Reactant stream *)
497 Ro.f['nitrogen'] = Ri.f['nitrogen'] - Hx.f['nitrogen'];
498 Ro.f['oxygen'] = Ri.f['oxygen'] - Hx.f['oxygen'];
499 Ro.f['hydrogen'] = Ri.f['hydrogen'] + Cat*(3*r1 + r2 + 4*r3)
500 - Hx.f['hydrogen'];
501 Ro.f['water'] = Ri.f['water'] + Cat*(-1*r1 - r2 - 2*r3) - Hx.f['water'];
502 Ro.f['carbon_monoxide'] = Ri.f['carbon_monoxide'] + Cat*(r1 - r2)
503 - Hx.f['carbon_monoxide'];
504 Ro.f['carbon_dioxide'] = Ri.f['carbon_dioxide'] + Cat*(r2 + r3)
505 - Hx.f['carbon_dioxide'];
506 Ro.f['methane'] = Ri.f['methane'] + Cat*(-1*r1 - r3) - Hx.f['methane'];
507 Ro.f['ethane'] = Ri.f['ethane'] - Hx.f['ethane'];
508 Ro.f['propane'] = Ri.f['propane'] - Hx.f['propane'];
509 Ro.f['n_butane'] = Ri.f['n_butane'] - Hx.f['n_butane'];
510
511
512 (* membrane calculations - based on data from www.rebresearch.com.
513 Corrleations derived from data at 400 C. Units are cm^3 hydrogen
514 per cm^2 membrane per minute. I *BELIEVE* that the cm^3 are
515 actually Standard cc per minute. *)
516 FluxRate = 0.44557 {cm^3/cm^2/min/psi} * P_h2
517 - 8.509e-4 {cm^3/cm^2/min/psi^2} * P_h2^2;
518 Hx.f['hydrogen'] = FluxRate * A_membrane * 1 {atm} / 298 {K} / R;
519
520
521 (* Specs for the Hydrogen Permeate *)
522 Hx.T = Ro.T;
523 Hx.P = Ho.P;
524
525 (* Zero Pressure Drop - unrealistic! *)
526 Ro.P = Ri.P;
527 Ho.P = Hi.P;
528 Xo.P = Xi.P;
529
530 Ri_methane ALIASES Ri.f['methane'];
531 Ro_methane ALIASES Ro.f['methane'];
532 Ri_hydrogen ALIASES Ri.f['hydrogen'];
533 Ro_hydrogen ALIASES Ro.f['hydrogen'];
534
535 METHODS
536 METHOD seqmod;
537 RUN Hi.seqmod;
538 RUN Ri.seqmod;
539 RUN Xi.seqmod;
540 RUN Ho.seqmod;
541 RUN Ro.seqmod;
542 RUN Xo.seqmod;
543 RUN Hx.seqmod;
544
545 FIX U_heat;
546 FIX U_membrane;
547 END seqmod;
548 METHOD specify;
549 RUN seqmod;
550
551 RUN Hi.specify;
552 RUN Ri.specify;
553 RUN Xi.specify;
554
555 FIX Cat;
556 FIX A_heat;
557 FIX A_membrane;
558 END specify;
559 METHOD values;
560 RUN Hi.values;
561 RUN Ri.values;
562 RUN Xi.values;
563 RUN Ho.values;
564 RUN Ro.values;
565 RUN Xo.values;
566 RUN Hx.values;
567
568 U_heat := 10 {BTU/ft^2/h/R}; (* Perry's table 11-5, p.11-26 *)
569 U_membrane := 2 {BTU/ft^2/h/R}; (* Perry's table 11-4, p.11-25 *)
570
571 Cat := 1 {gram};
572 A_heat := 2 {cm^2};
573 A_membrane := 25 {cm^2};
574
575 Hi.T := 800 {K};
576 Ho.T := 800 {K};
577 Ri.T := 800 {K};
578 Ro.T := 800 {K};
579 Xi.T := 1800 {K};
580 Xo.T := 1600 {K};
581 END values;
582 END ReformerSection;
583
584 MODEL CocurrentReformer(
585 Ri WILL_BE VaporStream; (* Reactant in *)
586 Hi WILL_BE VaporStream; (* Pure Hydrogen in *)
587 Xi WILL_BE VaporStream; (* Burner Exhaust in *)
588 Ro WILL_BE VaporStream; (* Reactant out *)
589 Ho WILL_BE VaporStream; (* Pure Hydrogen out *)
590 Xo WILL_BE VaporStream; (* Burner Exhaust out *)
591 NStages WILL_BE integer_constant;
592 ) WHERE ( NStages >= 3; );
593
594 R[2..NStages] IS_A VaporStream;
595 H[2..NStages] IS_A VaporStream;
596 X[2..NStages] IS_A VaporStream;
597 Cat IS_A mass;
598 A_q[1..NStages], A_mem IS_A area;
599
600 SectionTemp IS_A temperature;
601
602 (* Hook up the reformer *)
603 FOR i IN [2..NStages-1] CREATE
604 Section[i] IS_A ReformerSection(R[i], H[i], X[i],
605 R[i+1], H[i+1], X[i+1], Cat, A_q[i], A_mem);
606 R[i+1].T = SectionTemp;
607 END FOR;
608
609 (* Attach the inputs and outputs *)
610 Section1 IS_A ReformerSection(Ri, Hi, Xi,
611 R[2], H[2], X[2], Cat, A_q[1], A_mem);
612 SectionN IS_A ReformerSection(R[NStages], H[NStages], X[NStages],
613 Ro, Ho, Xo, Cat, A_q[NStages], A_mem);
614 R[2].T = SectionTemp;
615 Ro.T = SectionTemp;
616
617 METHODS
618 METHOD seqmod;
619 FOR i IN [2..NStages-1] DO
620 RUN Section[i].seqmod;
621 END FOR;
622 RUN Section1.seqmod;
623 RUN SectionN.seqmod;
624
625 FIX SectionTemp;
626 END seqmod;
627 METHOD specify;
628 RUN seqmod;
629
630 RUN Ri.specify;
631 RUN Hi.specify;
632 RUN Xi.specify;
633
634 FIX Cat;
635 FIX A_mem;
636 END specify;
637 METHOD values;
638 FOR i IN [2..NStages-1] DO
639 RUN Section[i].values;
640 END FOR;
641 RUN Section1.values;
642 RUN SectionN.values;
643
644 SectionTemp := 800 {K};
645
646 Cat := 1 {gram};
647 A_mem := 30 {cm^2};
648 A_q[1..NStages] := 1 {cm^2};
649 END values;
650 END CocurrentReformer;
651
652 (* ----- MAIN MODEL -------------------------------------------------- *)
653
654 MODEL main;
655 Fuel, Reactant IS_A NaturalGasFeed;
656 Air IS_A AirFeed;
657 Steam IS_A SteamFeed;
658 Hydrogen IS_A HydrogenStream;
659
660 Hin IS_A HydrogenStream;
661
662 BurnerExhaust, Xin, Exhaust IS_A VaporStream;
663 Hout IS_A VaporStream;
664 WetGas, Pre_Rin, Rin, OffGas IS_A VaporStream;
665
666 NS IS_A integer_constant;
667 t_Catalyst IS_A mass;
668 A_pre, t_A_q, t_A_membrane IS_A area;
669 c_CH4_conversion, c_H2_recovery, WaterRatio IS_A factor;
670 WaterOut IS_A molar_rate;
671
672 Burner IS_A BurnerUnit(Fuel, Air, BurnerExhaust);
673 Mix_r1 IS_A MixerUnit(Reactant, Steam, WetGas);
674 Mix_r2 IS_A MixerUnit(WetGas, Hydrogen, Pre_Rin);
675 PreReformer IS_A PreReformerUnit(Pre_Rin, BurnerExhaust, Rin, Xin, A_pre);
676 Reformer IS_A CocurrentReformer(Rin, Hin, Xin, OffGas, Hout, Exhaust, NS);
677
678 NS :== 100;
679
680 Cat ALIASES Reformer.Cat;
681 A_mem ALIASES Reformer.A_mem;
682
683 Steam.f['water'] = WaterRatio * Rin.f['methane'];
684
685 (* Excess air for burner - see Perry's p.27-25, fig. 27-12 *)
686 Air.f['oxygen'] = 1.5 * ( Air.f['oxygen'] - BurnerExhaust.f['oxygen'] );
687
688 (* reaction efficiency *)
689 (* OffGas.f['methane'] = 0.1 * Reactant.f['methane']; *)
690
691 (* Recovery Efficiency *)
692 Hout.f['hydrogen'] = 9*OffGas.f['hydrogen'];
693
694 (* some calculated output variables *)
695 c_CH4_conversion = 1 - f_MethaneLost/f_MethaneIn;
696 c_H2_recovery = f_HydrogenOut/(f_HydrogenOut+f_HydrogenLost);
697 t_A_q = SUM[Reformer.A_q[1..NS]];
698 t_A_membrane = A_mem * NS;
699 t_Catalyst = Cat * NS;
700 f_HydrogenOut ALIASES Reformer.Ho.f['hydrogen'];
701 f_HydrogenLost ALIASES Reformer.Ro.f['hydrogen'];
702 f_MethaneIn ALIASES Reformer.Ri.f['methane'];
703 f_MethaneLost ALIASES Reformer.Ro.f['methane'];
704 f_CarbonMonoxide ALIASES Reformer.Ro.f['carbon_monoxide'];
705 WaterOut = f_HydrogenOut - Steam.f['water'];
706
707 METHODS
708 METHOD default_self;
709 END default_self;
710 METHOD seqmod;
711 RUN Burner.seqmod;
712 RUN Mix_r1.seqmod;
713 RUN Mix_r2.seqmod;
714 RUN PreReformer.seqmod;
715 RUN Reformer.seqmod;
716
717 WaterOut.lower_bound := -10 {mole/min};
718 END seqmod;
719 METHOD specify;
720 RUN seqmod;
721
722 RUN Fuel.specify;
723 RUN Reactant.specify;
724 RUN Steam.specify;
725 RUN Air.specify;
726 RUN Hin.specify;
727 RUN Hydrogen.specify;
728
729 FREE Air.flow;
730 FREE Steam.flow;
731 FREE Hydrogen.flow;
732
733 FIX Rin.T;
734 FIX Rin.y['hydrogen'];
735 FIX Cat;
736 (* FIX A_mem; *)
737 FIX WaterRatio;
738 END specify;
739 METHOD values;
740 RUN Burner.values;
741 RUN Mix_r1.values;
742 RUN Mix_r2.values;
743 RUN PreReformer.values;
744 RUN Reformer.values;
745
746 Fuel.flow := 0.075 {mole/min};
747 Reactant.flow := 0.2 {mole/min};
748 Hin.flow := 1e-7 {mole/min};
749
750 Steam.P := 150 {psi};
751 Reactant.P := 150 {psi};
752 Hydrogen.P := 150 {psi};
753
754 Rin.T := 800 {K};
755 Rin.y['hydrogen'] := 0.01;
756 Cat := 1 {gram};
757 A_mem := 40 {cm^2};
758 WaterRatio := 3;
759 END values;
760 END main;
761
762 (*************************************************************************)
763
764 (* Art's original model ...
765
766 MODEL reformer(
767 cd WILL_BE components_data;
768 CH4in WILL_BE stream;
769 H2Oin WILL_BE stream;
770 PROD WILL_BE stream;)
771
772 Qin IS_A energy_flow;
773 Qin = PROD.H_flow - CH4in.H_flow - H2Oin.H_flow;
774
775 METHODS
776
777 METHOD specify;
778 END specify;
779
780 END reformer;
781
782 MODEL hydrogenPlant;
783
784
785 (* values set in METHOD default_self *)
786
787 pdV IS_A phases_data('V', 'ideal_vapor_mixture', 'none', 'none');
788 pdL IS_A phases_data('L', 'none', 'UNIFAC_liquid_mixture', 'none');
789 pdVL IS_A phases_data('VL', 'ideal_vapor_mixture',
790 'UNIFAC_liquid_mixture', 'none');
791 equilibrated IS_A start_false;
792
793
794 (* Qin is unit specific *)
795 Qin IS_A energy_rate;
796
797
798 MethaneFeed IS_A stream(cd, pdV, equilibrated);
799 WaterFeed IS_A stream(cd, pdV, equilibrated);
800 refOut IS_A stream(cd, pdV, equilibrated);
801
802 ref IS_A reformer(cd, MethaneFeed, WaterFeed, refOut);
803
804 METHODS
805
806 METHOD default_self;
807 H2 := 'hydrogen';
808 CO := 'carbon_monoxide';
809 CO2 := 'carbon_dioxide';
810 C1 := 'methane';
811 C2 := 'ethane';
812 C3 := 'propane';
813 H2O := 'water';
814 END default_self;
815
816 METHOD specify;
817
818 RUN MethaneFeed.reset;
819 RUN WaterFeed.reset;
820 RUN refOut.reset;
821
822 END specify;
823
824 METHOD values;
825 MethaneFeed.T := 300 {K};
826 MethaneFeed.P := 200 {psia};
827 MethaneFeed.state.f[H2] := 0.0 {kmol/h};
828 MethaneFeed.state.f[CO] := 0.0 {kmol/h};
829 MethaneFeed.state.f[CO2] := 0.0 {kmol/h};
830 MethaneFeed.state.f[C1] := 0.93 {kmol/h};
831 MethaneFeed.state.f[C2] := 0.06 {kmol/h};
832 MethaneFeed.state.f[C3] := 0.01 {kmol/h};
833 MethaneFeed.state.f[H2O] := 0.0 {kmol/h};
834
835 WaterFeed.flow := 1 {kmol/h};
836 WaterFeed.T := 300 {K};
837 WaterFeed.P := 200 {psia};
838 WaterFeed.state.f[H2] := 0.0 {kmol/h};
839 WaterFeed.state.f[CO] := 0.0 {kmol/h};
840 WaterFeed.state.f[CO2] := 0.0 {kmol/h};
841 WaterFeed.state.f[C1] := 0.0 {kmol/h};
842 WaterFeed.state.f[C2] := 0.0 {kmol/h};
843 WaterFeed.state.f[C3] := 0.0 {kmol/h};
844 WaterFeed.state.f[H2O] := 1.0 {kmol/h};
845
846 refOut.T := 300 {K};
847 refOut.P := 190 {psia};
848 refOut.state.f[H2] := 0.0 {kmol/h};
849 refOut.state.f[CO] := 0.0 {kmol/h};
850 refOut.state.f[CO2] := 0.0 {kmol/h};
851 refOut.state.f[C1] := 0.93 {kmol/h};
852 refOut.state.f[C2] := 0.06 {kmol/h};
853 refOut.state.f[C3] := 0.01 {kmol/h};
854 refOut.state.f[H2O] := 0.0 {kmol/h};
855
856 END values;
857
858 END hydrogenPlant;
859
860 *)
861
862 MODEL test;
863 Q,Q2 IS_A energy_rate;
864
865 pd_w IS_A phases_data('V', 'ideal_vapor_mixture', 'none', 'none');
866 pd_w2 IS_A phases_data('V', 'ideal_vapor_mixture', 'none', 'none');
867 pd_r IS_A phases_data('V', 'ideal_vapor_mixture', 'none', 'none');
868
869 cd_w IS_A components_data(['water'],'water');
870 cd_w2 IS_A components_data(['water'],'water');
871 cd_r IS_A components_data(['hydrogen','oxygen'],'oxygen');
872
873 equil_w IS_A start_false;
874 equil_w2 IS_A start_false;
875 equil_r IS_A start_false;
876
877 reactant IS_A stream(cd_r, pd_r, equil_r);
878 water IS_A stream(cd_w, pd_w, equil_w);
879 water2 IS_A stream(cd_w2, pd_w2, equil_w2);
880
881 reactant.f['oxygen'] = 0.5 {g_mole/s};
882 reactant.f['hydrogen'] = 1 {g_mole/s};
883 water.f['water'] = 1 {g_mole/s};
884 water2.f['water'] = 1 {g_mole/s};
885
886 reactant.flow = reactant.f['oxygen'] + reactant.f['hydrogen'];
887 water.flow = water.f['water'];
888 water2.flow = water.f['water'];
889
890 water.T = 380 {K};
891 reactant.T = water.T;
892 water2.T = water.T + 1 {K};
893
894 water.P = 1 {atm};
895 reactant.P = water.P;
896 water2.P = water.P;
897
898 Q = water.H_flow - reactant.H_flow;
899 Q2 = water2.H_flow - water.H_flow;
900
901 METHODS
902 METHOD default_self;
903 END default_self;
904 METHOD specify;
905 END specify;
906 METHOD values;
907 END values;
908 END test;

Properties

Name Value
svn:executable *

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