/[ascend]/trunk/models/kchittur/eos.a4c
ViewVC logotype

Contents of /trunk/models/kchittur/eos.a4c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1612 - (show annotations) (download) (as text)
Thu Aug 30 19:36:25 2007 UTC (11 years, 11 months ago) by kchittur
File MIME type: text/x-ascend
File size: 14128 byte(s)


1 REQUIRE "thermodynamics.a4l";
2
3 ATOM vdwa REFINES solver_var
4 DIMENSION M*L^5/Q^2/T^2
5 DEFAULT 0.1 {kg*m^5/mole^2/sec^2};
6 lower_bound := 0.0 {kg*m^5/mole^2/sec^2};
7 upper_bound := 10.0 {kg*m^5/mole^2/sec^2};
8 nominal := 0.1 {kg*m^5/mole^5/sec^2};
9 END vdwa;
10
11 ATOM virialC REFINES solver_var
12 DIMENSION L^6/Q^2
13 DEFAULT 7000.0 {cm^6/mol^2};
14 lower_bound := 0.0 {cm^6/mol^2};
15 upper_bound := 1.0 {m^6/mol^2};
16 nominal := 7000.0 {cm^6/mol^2};
17 END virialC;
18
19 ATOM virialB REFINES solver_var
20 DIMENSION L^3/Q
21 DEFAULT 1.0 {m^3/mol};
22 lower_bound := -1000.00 {m^3/mol};
23 upper_bound := 1000.0 {m^3/mol};
24 nominal := 1.0 {m^3/mol};
25 END virialB;
26
27
28 MODEL idealgas(P WILL_BE pressure;
29 T WILL_BE temperature;
30 V WILL_BE molar_volume;);
31
32 R IS_A gas_constant;
33
34 eq: P*V = R*T;
35
36 METHODS
37 METHOD default_self;
38 RUN ClearAll;
39 RUN specify;
40 RUN values;
41 END default_self;
42 METHOD specify;
43 P.fixed := TRUE;
44 T.fixed := TRUE;
45 V.fixed := FALSE;
46 END specify;
47 METHOD values;
48 P := 1.0 {atm};
49 T := 298.0 {K};
50 END values;
51
52 END idealgas;
53
54 MODEL vanderwaals(P WILL_BE pressure;
55 T WILL_BE temperature;
56 V WILL_BE molar_volume;
57 Z WILL_BE factor;
58 data WILL_BE td_component_constants;);
59
60 R IS_A gas_constant;
61 b IS_A molar_volume;
62 a IS_A vdwa;
63 Pc IS_A pressure;
64 Tc IS_A temperature;
65
66 eq: (P*V^2 + a)*(V - b) = R*T*V^2;
67 eqb: b*8.0*data.Pc = R*data.Tc;
68 eqa: a*64.0*data.Pc = 27.0*R^2*(data.Tc)^2;
69 eqc: Z*R*T = P*V;
70
71 METHODS
72 METHOD default_self;
73 RUN ClearAll;
74 RUN specify;
75 RUN values;
76 END default_self;
77 METHOD specify;
78 P.fixed := TRUE;
79 T.fixed := TRUE;
80 V.fixed := FALSE;
81 Z.fixed := FALSE;
82 END specify;
83 METHOD values;
84 P := 12.0 {atm};
85 T := 298.15 {K};
86 V := 0.075 {m^3/mole};
87 V.nominal := 0.05 {m^3/mole};
88 V.upper_bound := 100 {m^3/mole};
89 END values;
90
91 END vanderwaals;
92
93 MODEL truncated_virial_equation (P WILL_BE pressure;
94 T WILL_BE temperature; V WILL_BE molar_volume; Z WILL_BE factor;
95 data WILL_BE td_component_constants;);
96
97 R IS_A gas_constant;
98 Pc IS_A pressure;
99 Tc IS_A temperature;
100 T_degC IS_A factor;
101 omega IS_A factor;
102 Tr, Pr IS_A factor;
103 B IS_A virialB;
104 C IS_A virialC;
105
106 Bhat, B0, B1 IS_A factor;
107
108 Pc = data.Pc;
109 Tc = data.Tc;
110 omega = data.omega;
111
112 eq1: Tr = T/Tc;
113 eq2: Pr = P/Pc;
114 eq3: T_degC = T/1{K} - 273.15;
115
116 eq4: Bhat = B0 + omega*B1;
117 eq5: B0*Tr^(1.6) = 0.083*Tr^(1.6) - 0.422;
118 eq6: B1*Tr^(4.2) = 0.139*Tr^(4.2) - 0.172;
119
120 eq7: Z = 1.0 + B0*Pr/Tr + omega*B1*Pr/Tr;
121
122 eq8: Z*R*T = P*V;
123 eq9: B = Bhat*1.0{m^3/mol};
124
125 METHODS
126 METHOD default_self;
127 RUN ClearAll;
128 RUN specify;
129 RUN values;
130 END default_self;
131 METHOD specify;
132 P.fixed := TRUE;
133 T_degC.fixed := FALSE;
134 T.fixed := TRUE;
135 END specify;
136 METHOD values;
137 P := 12.0 {bar};
138 T := 298.15 {K};
139 END values;
140
141 END truncated_virial_equation;
142
143 MODEL rk(P WILL_BE pressure;
144 T WILL_BE temperature;
145 V WILL_BE molar_volume;
146 Z WILL_BE factor;
147 data WILL_BE td_component_constants;);
148
149 R IS_A gas_constant;
150 Pc IS_A pressure;
151 Tc IS_A temperature;
152 T_degC IS_A factor;
153 alpha, beta, q,Tr, Pr, omega IS_A factor;
154
155 PSI, OMEGA, sigma, eps IS_A real_constant;
156
157 PSI :== 0.42748;
158 OMEGA :== 0.08664;
159 sigma :== 1.0;
160 eps :== 0.0;
161
162 Pc = data.Pc;
163 Tc = data.Tc;
164 omega = data.omega;
165
166 eq1: Tr = T/Tc;
167 eq2: Pr = P/Pc;
168 eq3: T_degC = T/1{K} - 273.15;
169
170 eq4: alpha = Tr^(0.5);
171 eq5: q = PSI*alpha/(OMEGA*Tr);
172 eq6: beta = OMEGA*Pr/Tr;
173 eq7: Z = 1.0 + beta - q*beta*(Z - beta)/((Z + eps*beta)*(Z + sigma*beta));
174 eq8: P*V = Z*R*T;
175 METHODS
176 METHOD default_self;
177 RUN ClearAll;
178 RUN specify;
179 RUN values;
180 END default_self;
181 METHOD specify;
182 P.fixed := TRUE;
183 T_degC.fixed := FALSE;
184 T.fixed := TRUE;
185 END specify;
186 METHOD values;
187 P := 12.0 {bar};
188 T := 298.15 {K};
189 Z.lower_bound := 0.0;
190 Z.upper_bound := 10.0;
191 Z.nominal := 1.0;
192 END values;
193
194 END rk;
195
196 MODEL srk(P WILL_BE pressure;
197 T WILL_BE temperature;
198 V WILL_BE molar_volume;
199 Z WILL_BE factor;
200 data WILL_BE td_component_constants;);
201
202 R IS_A gas_constant;
203 Pc IS_A pressure;
204 Tc IS_A temperature;
205 T_degC IS_A factor;
206 alpha, beta, q,Tr, Pr, omega IS_A factor;
207
208 PSI, OMEGA, sigma, eps IS_A real_constant;
209
210 PSI :== 0.42748;
211 OMEGA :== 0.08664;
212 sigma :== 1.0;
213 eps :== 0.0;
214
215 Pc = data.Pc;
216 Tc = data.Tc;
217 omega = data.omega;
218
219 eq1: Tr = T/Tc;
220 eq2: Pr = P/Pc;
221 eq3: T_degC = T/1{K} - 273.15;
222
223 eq4: alpha = (1.0 + (0.480+1.574*omega-0.176*omega^2)*(1.0-Tr^(0.5)))^2;
224 eq5: q = PSI*alpha/(OMEGA*Tr);
225 eq6: beta = OMEGA*Pr/Tr;
226 eq7: Z = 1.0 + beta - q*beta*(Z - beta)/((Z + eps*beta)*(Z + sigma*beta));
227 eq8: P*V = Z*R*T;
228
229
230 METHODS
231 METHOD default_self;
232 RUN ClearAll;
233 RUN specify;
234 RUN values;
235 END default_self;
236
237 METHOD specify;
238 P.fixed := TRUE;
239 T.fixed := TRUE;
240 T_degC.fixed := FALSE;
241 END specify;
242 METHOD values;
243 P := 12.0 {bar};
244 T := 298.15 {K};
245 Z.lower_bound := 0.0;
246 Z.upper_bound := 10.0;
247 Z.nominal := 1.0;
248 END values;
249
250 END srk;
251
252 MODEL pengrobinson(P WILL_BE pressure;
253 T WILL_BE temperature;
254 V WILL_BE molar_volume;
255 Z WILL_BE factor;
256 data WILL_BE td_component_constants;);
257
258 R IS_A gas_constant;
259 Pc IS_A pressure;
260 Tc IS_A temperature;
261 T_degC IS_A factor;
262 alpha, beta, q,Tr, Pr, omega IS_A factor;
263
264 PSI, OMEGA, sigma, eps IS_A real_constant;
265
266 PSI :== 0.45724;
267 OMEGA :== 0.07780;
268 sigma :== 2.414213562;
269 eps :== 0.414213562;
270
271 Pc = data.Pc;
272 Tc = data.Tc;
273 omega = data.omega;
274
275 eq1: Tr = T/Tc;
276 eq2: Pr = P/Pc;
277 eq3: T_degC = T/1{K} - 273.15;
278
279 eq4: alpha = (1.0 + (0.37464+1.54226*omega-0.26992*omega^2)*(1.0-Tr^(0.5)))^2;
280 eq5: q = PSI*alpha/(OMEGA*Tr);
281 eq6: beta = OMEGA*Pr/Tr;
282 eq7: Z = 1.0 + beta - q*beta*(Z - beta)/((Z + eps*beta)*(Z + sigma*beta));
283 eq8: P*V = Z*R*T;
284
285
286 METHODS
287 METHOD default_self;
288 RUN ClearAll;
289 RUN specify;
290 RUN values;
291 END default_self;
292
293 METHOD specify;
294 P.fixed := TRUE;
295 T.fixed := TRUE;
296 T_degC.fixed := FALSE;
297 END specify;
298 METHOD values;
299 P := 12.0 {bar};
300 T := 298.15 {K};
301 Z.lower_bound := 0.0;
302 Z.upper_bound := 10.0;
303 Z.nominal := 0.1;
304 END values;
305
306 END pengrobinson;
307
308 MODEL vdw(P WILL_BE pressure;
309 T WILL_BE temperature;
310 V WILL_BE molar_volume;
311 Z WILL_BE factor;
312 data WILL_BE td_component_constants;);
313
314 R IS_A gas_constant;
315 Pc IS_A pressure;
316 Tc IS_A temperature;
317 T_degC IS_A factor;
318 beta, q,Tr, Pr, omega IS_A factor;
319
320 alpha, PSI, OMEGA, sigma, eps IS_A real_constant;
321
322 PSI :== 27.0/64.0;
323 OMEGA :== 1.0/8.0;
324 sigma :== 0.0;
325 eps :== 0.0;
326 alpha :== 1.0;
327
328 Pc = data.Pc;
329 Tc = data.Tc;
330 omega = data.omega;
331
332 eq1: Tr = T/Tc;
333 eq2: Pr = P/Pc;
334 eq3: T_degC = T/1{K} - 273.15;
335
336 eq5: q = PSI*alpha/(OMEGA*Tr);
337 eq6: beta = OMEGA*Pr/Tr;
338 eq7: Z = 1.0 + beta - q*beta*(Z - beta)/((Z + eps*beta)*(Z + sigma*beta));
339 eq8: P*V = Z*R*T;
340
341 METHODS
342 METHOD default_self;
343 RUN ClearAll;
344 RUN specify;
345 RUN values;
346 END default_self;
347
348 METHOD specify;
349 P.fixed := TRUE;
350 T.fixed := TRUE;
351 T_degC.fixed := FALSE;
352 END specify;
353 METHOD values;
354 P := 12.0 {bar};
355 T := 298.15 {K};
356 Z.lower_bound := 0.0;
357 Z.upper_bound := 10.0;
358 Z.nominal := 0.1;
359 END values;
360
361 END vdw;
362
363 MODEL testidealgas;
364
365 ig IS_A idealgas(P,T,V);
366 P IS_A pressure;
367 T IS_A temperature;
368 V IS_A molar_volume;
369
370 METHODS
371 METHOD default_self;
372 RUN ClearAll;
373 RUN specify;
374 RUN values;
375 END default_self;
376
377 METHOD specify;
378 P.fixed := TRUE;
379 T.fixed := TRUE;
380 V.fixed := FALSE;
381 RUN ig.specify;
382 END specify;
383 METHOD values;
384 P := 1.0 {atm};
385 T := 800.0 {K};
386 RUN ig.values;
387 END values;
388
389 END testidealgas;
390
391 MODEL testvanderwaals;
392
393 c1 IS_A symbol_constant;
394 vd IS_A vanderwaals(P,T,V,Z,cd.data[c1]);
395 Tr, Pr IS_A factor;
396 P IS_A pressure;
397 T IS_A temperature;
398 V IS_A molar_volume;
399 Z IS_A factor;
400
401 c1 :== 'ethylene';
402 cd IS_A components_data([c1],c1);
403
404 eqTr: Tr = T/cd.data[c1].Tc;
405 eqPr: Pr = P/cd.data[c1].Pc;
406
407 METHODS
408 METHOD default_self;
409 RUN ClearAll;
410 RUN specify;
411 RUN values;
412 END default_self;
413
414 METHOD specify;
415 P.fixed := TRUE;
416 V.fixed := FALSE;
417 T.fixed := TRUE;
418 Z.fixed := FALSE;
419 RUN vd.specify;
420 END specify;
421 METHOD values;
422 P := 12.0 {bar};
423 T := 298.15 {K};
424 RUN vd.values;
425 END values;
426
427 END testvanderwaals;
428
429 MODEL testtruncatedvirial;
430
431 c1 IS_A symbol_constant;
432 c1 :== 'acetonitrile';
433 cd IS_A components_data([c1],c1);
434 Tr, Pr IS_A factor;
435 P IS_A pressure;
436 T IS_A temperature;
437 V IS_A molar_volume;
438 Z IS_A factor;
439 tve IS_A truncated_virial_equation(P,T,V,Z,cd.data[c1]);
440
441 eqTr: Tr = T/cd.data[c1].Tc;
442 eqPr: Pr = P/cd.data[c1].Pc;
443
444 METHODS
445 METHOD default_self;
446 RUN ClearAll;
447 RUN specify;
448 RUN values;
449 END default_self;
450
451 METHOD specify;
452 P.fixed := TRUE;
453 V.fixed := FALSE;
454 Z.fixed := FALSE;
455 T.fixed := TRUE;
456 RUN tve.specify;
457 END specify;
458 METHOD values;
459 P := 12.0 {bar};
460 T := 298.15 {K};
461 RUN tve.values;
462 END values;
463
464 END testtruncatedvirial;
465
466 MODEL testrk;
467
468 c1 IS_A symbol_constant;
469 c1 :== 'ethylene';
470 cd IS_A components_data([c1],c1);
471 Tr, Pr IS_A factor;
472 P IS_A pressure;
473 T IS_A temperature;
474 V IS_A molar_volume;
475 Z IS_A factor;
476 trk IS_A rk(P,T,V,Z,cd.data[c1]);
477
478 eqTr: Tr = T/cd.data[c1].Tc;
479 eqPr: Pr = P/cd.data[c1].Pc;
480
481 METHODS
482 METHOD default_self;
483 RUN ClearAll;
484 RUN specify;
485 RUN values;
486 END default_self;
487
488 METHOD specify;
489 P.fixed := TRUE;
490 V.fixed := FALSE;
491 Z.fixed := FALSE;
492 T.fixed := TRUE;
493 RUN trk.specify;
494 END specify;
495 METHOD values;
496 P := 12.0 {bar};
497 T := 298.15 {K};
498 RUN trk.values;
499 END values;
500
501 END testrk;
502
503 MODEL testsrk;
504
505 c1 IS_A symbol_constant;
506 c1 :== 'ethylene';
507 cd IS_A components_data([c1],c1);
508 Tr, Pr IS_A factor;
509 P IS_A pressure;
510 T IS_A temperature;
511 V IS_A molar_volume;
512 Z IS_A factor;
513 tsrk IS_A srk(P,T,V,Z,cd.data[c1]);
514
515 eqTr: Tr = T/cd.data[c1].Tc;
516 eqPr: Pr = P/cd.data[c1].Pc;
517
518 METHODS
519 METHOD default_self;
520 RUN ClearAll;
521 RUN specify;
522 RUN values;
523 END default_self;
524
525 METHOD specify;
526 P.fixed := TRUE;
527 V.fixed := FALSE;
528 Z.fixed := FALSE;
529 T.fixed := TRUE;
530 RUN tsrk.specify;
531 END specify;
532 METHOD values;
533 P := 12.0 {bar};
534 T := 298.15 {K};
535 RUN tsrk.values;
536 END values;
537
538 END testsrk;
539
540 MODEL testpengrobinson;
541
542 c1 IS_A symbol_constant;
543 c1 :== 'ethylene';
544 cd IS_A components_data([c1],c1);
545 Tr, Pr IS_A factor;
546 P IS_A pressure;
547 T IS_A temperature;
548 V IS_A molar_volume;
549 Z IS_A factor;
550 tpeng IS_A pengrobinson(P,T,V,Z,cd.data[c1]);
551
552 eqTr: Tr = T/cd.data[c1].Tc;
553 eqPr: Pr = P/cd.data[c1].Pc;
554
555 METHODS
556 METHOD default_self;
557 RUN ClearAll;
558 RUN specify;
559 RUN values;
560 END default_self;
561
562 METHOD specify;
563 P.fixed := TRUE;
564 V.fixed := FALSE;
565 Z.fixed := FALSE;
566 T.fixed := TRUE;
567 RUN tpeng.specify;
568 END specify;
569 METHOD values;
570 P := 12.0 {bar};
571 T := 298.15 {K};
572 RUN tpeng.values;
573 END values;
574
575 END testpengrobinson;
576
577 MODEL testvdw;
578
579 c1 IS_A symbol_constant;
580 c1 :== 'ethylene';
581 cd IS_A components_data([c1],c1);
582 Tr, Pr IS_A factor;
583 P IS_A pressure;
584 T IS_A temperature;
585 V IS_A molar_volume;
586 Z IS_A factor;
587 tvdw IS_A vdw(P,T,V,Z,cd.data[c1]);
588
589 eqTr: Tr = T/cd.data[c1].Tc;
590 eqPr: Pr = P/cd.data[c1].Pc;
591
592 METHODS
593 METHOD default_self;
594 RUN ClearAll;
595 RUN specify;
596 RUN values;
597 END default_self;
598
599 METHOD specify;
600 P.fixed := TRUE;
601 V.fixed := FALSE;
602 Z.fixed := FALSE;
603 T.fixed := TRUE;
604 RUN tvdw.specify;
605 END specify;
606 METHOD values;
607 P := 12.0 {bar};
608 T := 298.15 {K};
609 RUN tvdw.values;
610 END values;
611
612 END testvdw;
613
614 MODEL testall;
615
616 P IS_A pressure;
617 T IS_A temperature;
618 Vvanderwaals, Vvdw, Videal, Vtruncvirial, Vrk, Vsrk, Vpeng IS_A molar_volume;
619 Zvanderwaals, Zvdw, Ztruncvirial, Zrk, Zsrk, Zpeng IS_A factor;
620
621 c1 IS_A symbol_constant;
622 c1 :== 'acetonitrile';
623 cd IS_A components_data([c1],c1);
624 Tr, Pr IS_A factor;
625 ig IS_A idealgas(P,T,Videal);
626 vd IS_A vanderwaals(P,T,Vvanderwaals,Zvanderwaals,cd.data[c1]);
627 vdd IS_A vdw(P,T,Vvdw,Zvdw,cd.data[c1]);
628 tve IS_A truncated_virial_equation(P,T,Vtruncvirial,Ztruncvirial,cd.data[c1]);
629 trk IS_A rk(P,T,Vrk,Zrk,cd.data[c1]);
630 tsrk IS_A srk(P,T,Vsrk,Zsrk,cd.data[c1]);
631 tpeng IS_A pengrobinson(P,T,Vpeng,Zpeng,cd.data[c1]);
632
633 eqTr: Tr = T/cd.data[c1].Tc;
634 eqPr: Pr = P/cd.data[c1].Pc;
635
636 METHODS
637 METHOD default_self;
638 (* RUN ClearAll; *)
639 RUN specify;
640 RUN values;
641 END default_self;
642 METHOD specify;
643 P.fixed := TRUE;
644 T.fixed := TRUE;
645 Videal.fixed := FALSE;
646 Vvanderwaals.fixed := FALSE;
647 Vvdw.fixed := FALSE;
648 Vtruncvirial.fixed := FALSE;
649 Vrk.fixed := FALSE;
650 Vsrk.fixed := FALSE;
651 Vpeng.fixed := FALSE;
652 Zvanderwaals.fixed := FALSE;
653 Zvdw.fixed := FALSE;
654 Ztruncvirial.fixed := FALSE;
655 Zrk.fixed := FALSE;
656 Zsrk.fixed := FALSE;
657 Zpeng.fixed := FALSE;
658 RUN ig.specify;
659 RUN vd.specify;
660 RUN vdd.specify;
661 RUN tve.specify;
662 RUN trk.specify;
663 RUN tsrk.specify;
664 RUN tpeng.specify;
665 END specify;
666 METHOD values;
667 P := 306.12 {atm};
668 T := 561 {K};
669 RUN ig.values;
670 RUN vd.values;
671 RUN vdd.values;
672 RUN tve.values;
673 RUN trk.values;
674 RUN tsrk.values;
675 RUN tpeng.values;
676 END values;
677
678 END testall;

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