/[ascend]/trunk/models/simpleflowsheetrigorous.a4c
ViewVC logotype

Contents of /trunk/models/simpleflowsheetrigorous.a4c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 576 - (show annotations) (download) (as text)
Tue May 9 03:42:08 2006 UTC (18 years, 10 months ago) by johnpye
File MIME type: text/x-ascend
File size: 6849 byte(s)
Changed all cases of *.fixed := {TRUE,FALSE} to 'FIX' and 'FREE' statements.
1 REQUIRE "flash.a4l";
2 REQUIRE "simpleunits.a4c";
3
4 (*
5 * simpleflowsheetrigorous.a4c
6 * by Arthur W. Westerberg
7 * Part of the ASCEND Library
8 * $Date: 2006/04/10 10:08:42 $
9 * $Revision: 1.95 $
10 * $Author: a.westerberg $
11 *
12 * This file is part of the ASCEND Modeling Library.
13 *
14 * Copyright (C) 1998 Carnegie Mellon University
15 *
16 * The ASCEND Modeling Library is free software; you can redistribute
17 * it and/or modify it under the terms of the GNU General Public
18 * License as published by the Free Software Foundation; either
19 * version 2 of the License, or (at your option) any later version.
20 *
21 * The ASCEND Modeling Library is distributed in hope that it
22 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
23 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
24 * See the GNU General Public License for more details.
25 *
26 * You should have received a copy of the GNU General Public License
27 * along with the program; if not, write to the Free Software
28 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139 USA. Check
29 * the file named COPYING.
30 *)
31
32
33 (*
34
35 ------------
36 | |
37 -------------------------->|U4: splitter|---> bleed
38 | | |
39 | ------------
40 | ^
41 V |
42 ----------- ----------- ------------
43 | | | | | |
44 --->|U1: mixer |--->|U2: reactor|--->|U3: flash |
45 | | | | | |
46 ----------- ----------- ------------
47 2C2H6 -->C4H12 |
48 |
49 ---------> product
50
51 *)
52
53
54 MODEL simpleflowsheet;
55 (* this demo is a reproduction of simpleFS using
56 the models in simpleUnits along with a rigorous
57 flash for the separation step *)
58
59 (* Set up the thermo calculations *)
60
61 compsC3, compsAll IS_A set OF symbol_constant;
62 compsC3 :== ['propylene', 'propane'];
63 compsAll :== ['propylene', 'propane', '2_hexene_cis'];
64
65 cdC3 IS_A components_data(compsC3, 'propane');
66 cdAll IS_A components_data(compsAll, 'propane');
67
68 pdV IS_A phases_data('V','Pitzer_vapor_mixture','none','none');
69 pdL IS_A phases_data('L', 'none', 'UNIFAC_liquid_mixture','none');
70 pdVL IS_A phases_data('VL','Pitzer_vapor_mixture',
71 'UNIFAC_liquid_mixture','none');
72
73 equil IS_A boolean;
74
75 (* define feed streams *)
76 S01C3Feed IS_A stream(cdC3, pdV, equil);
77
78 (* define units and their output streams *)
79
80 (* U1: feed mixer and heater *)
81 Qmix IS_A energy_rate;
82 S12reactFeed IS_A stream(cdAll, pdVL, equil);
83 U1feedMixer IS_A unitTwoInOneOut(Qmix, S01C3Feed, S51recycle, S12reactFeed);
84
85 (* U2: reactor *)
86 Qreactor IS_A energy_rate;
87 S23reactProd IS_A stream(cdAll, pdV, equil);
88 U2reactor IS_A unitOneInOneOut(Qreactor, S12reactFeed, S23reactProd);
89 conv IS_A fraction;
90 U2reactor.product.f['propylene'] = (1-conv)*U2reactor.feed.f['propylene'];
91
92 (* U3: flash *)
93 Qflash IS_A energy_rate;
94 S34flashV IS_A stream(cdAll, pdV, equil);
95 S30flashL IS_A stream(cdAll, pdL, equil);
96 U3flash IS_A vapor_liquid_flash(
97 Qflash, equil, S23reactProd, S34flashV, S30flashL);
98
99 (* U4: splitter *)
100 Qsplitter IS_A energy_rate;
101 S40bleed IS_A stream(cdAll, pdV, equil);
102 S45compFeed IS_A stream(cdAll, pdV, equil);
103 U4splitter IS_A unitOneInTwoOut(Qsplitter, S34flashV, S45compFeed, S40bleed);
104 (* merge all splits for simple stream splitter *)
105 splitRecycle IS_A fraction;
106 splitRecycle, U4splitter.split[compsAll] ARE_THE_SAME;
107
108 (* U5: compressor *)
109 Qcomp IS_A energy_rate;
110 effU5 IS_A fraction;
111 compRatioU5 IS_A factor;
112 S51recycle IS_A stream(cdAll, pdV, equil);
113 U5compressor IS_A simpleCompressor(Qcomp, compRatioU5, effU5, S45compFeed, S51recycle);
114
115 (* recycle pressure should be that of the feed *)
116 U5compressor.product.P = U1feedMixer.feed1.P;
117
118
119 (* various objectives we can optimize *)
120 MaxHexeneProd: MAXIMIZE S30flashL.f['2_hexene_cis'];
121
122 METHODS
123
124 METHOD default_self;
125 RUN U1feedMixer.default_self;
126 RUN U2reactor.default_self;
127 RUN U3flash.default_self;
128 RUN U4splitter.default_self;
129 RUN U5compressor.default_self;
130 END default_self;
131
132 METHOD values;
133 equil := FALSE;
134
135 (* feed streams *)
136 S01C3Feed.f['propylene'] := 0.98 {mol/s};
137 S01C3Feed.f['propane'] := 0.02 {mol/s};
138 S01C3Feed.T := 423.15 {K}; (* 150 degC *)
139 S01C3Feed.P := 20 {bar};
140
141 (* U1 feed mixer *)
142 (* set a pressure drop for the unit *)
143 U1feedMixer.delP1 := -5.0 {psia};
144
145 (* U2 reactor *)
146 U2reactor.delP := -5.0 {psia};
147 U2reactor.stoichCoef['propylene'] := -2;
148 U2reactor.stoichCoef['2_hexene_cis'] := 1;
149 conv := 0.8;
150
151 (* U3 flash *)
152 U3flash.liqout.P := 10 {bar};
153 U3flash.liqout.T := 400 {K};
154 U3flash.alpha['propylene'] := 7;
155 U3flash.alpha['propane'] := 8;
156 U3flash.alpha['2_hexene_cis'] := 1;
157 U3flash.state.phase_fraction['vapor'] := 0.5;
158
159 (* U4 splitter *)
160 splitRecycle := 0.98;
161
162 (* U5 compressor *)
163 U5compressor.efficiency := 0.95;
164 END values;
165
166 METHOD specify;
167 (* Each unit runs the specify method for each of its
168 streams. It then releases the fixed flags for
169 the component flows, T and P of its product
170 streams.
171
172 Only the recycle stream is overspecified
173 after running the unit specify methods if
174 we run them in the reverse order *)
175
176 RUN U5compressor.specify;
177 RUN U4splitter.specify;
178 RUN U3flash.specify;
179 RUN U2reactor.specify;
180 RUN U1feedMixer.specify;
181
182 (* release specs set by splitter for flash vapor *)
183 FREE S34flashV.f[compsAll];
184
185 (* release specs for recycle stream *)
186 FREE S51recycle.f[compsAll];
187 FREE S51recycle.T;
188 FREE S51recycle.P;
189
190 (* U1: feed mixer *)
191 (* fix product temperature of feed mixer *)
192 FIX U1feedMixer.delT1;
193 FREE U1feedMixer.Qin;
194
195 (* U2: reactor *)
196 (* fix conversion *)
197 FIX conv;
198 FREE U2reactor.turnover;
199 (* product temperature is same as that of feed *)
200 FIX U2reactor.delT;
201 FREE U2reactor.Qin;
202
203 (* U3: flash *)
204 (* flash P and vapor fraction already fixed *)
205
206 (* U4: splitter *)
207
208 (* U5: compressor *)
209 FREE U5compressor.compressionRatio;
210
211 END specify;
212
213 END simpleflowsheet;

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