- Timestamp:
- Mar 7, 2007, 1:53:12 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/newlanguage/sample/reactors/fogler/chap2/series_reactors.mso
r178 r188 58 58 59 59 Model stream 60 61 PARAMETERS 60 PARAMETERS 62 61 NComp as Integer (Brief="Number of components", Default=1); 63 64 VARIABLES 65 F(NComp) as flow_mol (Brief="Molar flow", Unit='mol/s'); 66 X(NComp) as fraction (Brief="Molar conversion"); 67 68 end 62 VARIABLES 63 F(NComp)as flow_mol (Brief="Molar flow", DisplayUnit='mol/s'); 64 X(NComp)as fraction (Brief="Molar conversion"); 65 end 66 69 67 70 68 #*--------------------------------------------------------------------- … … 73 71 74 72 Model cstr 75 76 VARIABLES 77 78 in Inlet as stream (Brief="Inlet stream"); 79 out Outlet as stream (Brief="Outlet stream"); 80 81 r as reaction_mol (Brief="Rate of reaction", Unit='mol/l/s'); 82 V as volume (Brief="Volume", Unit='l', Upper=2e3); 83 84 EQUATIONS 85 86 "Component molar balance" 73 VARIABLES 74 in Inlet as stream; # Inlet stream 75 out Outlet as stream; # Outlet stream 76 r as reaction_mol(Brief="Rate of reaction", DisplayUnit='mol/l/s'); 77 V as volume (Brief="Volume", DisplayUnit='l', Upper=2e3); 78 79 EQUATIONS 80 "Component molar balance" 87 81 Inlet.F - Outlet.F = (-r)*V; 88 82 89 "Outlet molar flow"83 "Outlet molar flow" 90 84 Outlet.F = Inlet.F*(1 - Outlet.X); 91 92 85 end 93 86 … … 98 91 99 92 Model pfr 100 101 VARIABLES 102 in Inlet as stream (Brief="Inlet stream"); 103 out Outlet as stream (Brief="Outlet stream"); 104 105 V as volume (Brief="Volume", Unit='l', Upper=2e3); 106 r as reaction_mol (Brief="Rate of reaction", Unit='mol/l/s'); 107 108 EQUATIONS 109 110 "Molar balance" 111 diff(V) = Inlet.F/(-r)*'1/s'; 112 113 "Change time in X" 114 Outlet.X = time*'1/s'; 93 VARIABLES 94 in Inlet as stream; # Inlet stream 95 out Outlet as stream; # Outlet stream 96 V as volume (Brief="Volume", DisplayUnit='l', Upper=2e3); 97 r as reaction_mol(Brief="Rate of reaction", DisplayUnit='mol/l/s'); 98 99 EQUATIONS 100 "Molar balance" 101 diff(V) = Inlet.F/(-r)/'s'; 102 103 "Change time in X" 104 Outlet.X = time/'s'; 115 105 116 106 "Molar flow" … … 130 120 in Inlet as stream; # Inlet stream 131 121 out Outlet as stream; # Outlet stream 132 V(N) as volume (Brief="Volume", Unit='l', Upper=2e3);122 V(N) as volume (Brief="Volume", DisplayUnit='l', Upper=2e3); 133 123 X(N) as fraction (Brief="Molar conversion"); 134 124 dx as fraction (Brief="Conversion increment"); 135 r(N) as reaction_mol (Brief="Rate of reaction", Unit='mol/l/s');136 F(N) as flow_mol (Brief="Molar flow", Unit='mol/s');125 r(N) as reaction_mol (Brief="Rate of reaction", DisplayUnit='mol/l/s'); 126 F(N) as flow_mol (Brief="Molar flow", DisplayUnit='mol/s'); 137 127 138 128 EQUATIONS … … 165 155 PARAMETERS 166 156 R as Real (Brief="Universal gas constant", Unit='atm*l/mol/K', Default=0.082); 167 T as temperature (Brief="Temperatura in the reactor" , Unit='K');168 P as pressure (Brief="Pressure in the reactor" , Unit='atm');157 T as temperature (Brief="Temperatura in the reactor"); 158 P as pressure (Brief="Pressure in the reactor"); 169 159 zin as fraction (Brief="Inlet molar fraction"); 170 160 v0 as flow_vol (Brief="Volumetric flow"); 171 161 172 162 VARIABLES 173 Vt as volume (Brief="Total reactor volume", Unit='l');163 Vt as volume (Brief="Total reactor volume", DisplayUnit='l'); 174 164 175 165 DEVICES … … 212 202 213 203 FlowSheet pfr_sample 214 215 DEVICES 216 Inlet as stream; 204 DEVICES 205 Inlet as stream; # Inlet stream 217 206 R1 as pfr; 218 207 219 CONNECTIONS208 CONNECTIONS 220 209 Inlet to R1.Inlet; 221 210 222 EQUATIONS 223 224 "Rate of reaction" 211 EQUATIONS 212 "Rate of reaction" 225 213 (-R1.r) = (0.0092*R1.Outlet.X^3 - 0.0153*R1.Outlet.X^2 + 0.0013*R1.Outlet.X + 0.0053)*'mol/l/s'; 226 214 227 SPECIFY 228 229 "Inlet molar flow" 215 SPECIFY 216 "Inlet molar flow" 230 217 Inlet.F = 0.866541*'mol/s'; 231 232 "Inlet conversion" 218 "Inlet conversion" 233 219 Inlet.X = 0.0; 234 220 235 INITIAL 236 237 "Reactor volume" 221 INITIAL 222 "Reactor volume" 238 223 R1.V = 0.0*'l'; 239 224 240 OPTIONS 241 242 Dynamic = true; 243 TimeStep = 0.004; 244 TimeEnd = 0.8; 245 TimeUnit = 's'; 246 225 OPTIONS 226 TimeStep = 0.004; 227 TimeEnd = 0.8; 247 228 end 248 229 … … 254 235 FlowSheet pfr_d_sample 255 236 VARIABLES 256 Vt as volume (Brief="Total reactor volume", Unit='l');237 Vt as volume (Brief="Total reactor volume", DisplayUnit='l'); 257 238 258 239 DEVICES … … 295 276 FlowSheet comparative 296 277 VARIABLES 297 V_cstr as volume (Brief="CSTR volume" );298 V_pfr as volume (Brief="PFR volume", Unit='l');278 V_cstr as volume (Brief="CSTR volume", DisplayUnit='l'); 279 V_pfr as volume (Brief="PFR volume", DisplayUnit='l'); 299 280 300 281 DEVICES … … 346 327 FlowSheet cstr_cstr 347 328 VARIABLES 348 V1 as volume (Brief="1st reactor volume", Unit='l');349 V2 as volume (Brief="2nd reactor volume", Unit='l');350 Vt as volume (Brief="Total reactor volumes", Unit='l');351 352 DEVICES 353 Inlet as stream; 329 V1 as volume (Brief="1st reactor volume", DisplayUnit='l'); 330 V2 as volume (Brief="2nd reactor volume", DisplayUnit='l'); 331 Vt as volume (Brief="Total reactor volumes", DisplayUnit='l'); 332 333 DEVICES 334 Inlet as stream; # Inlet stream 354 335 R1 as cstr; 355 336 R2 as cstr; … … 384 365 385 366 OPTIONS 386 Dynamic=false; 387 367 Dynamic = false; 388 368 end 389 369 … … 395 375 FlowSheet pfr_pfr 396 376 VARIABLES 397 V1 as volume (Brief="1st reactor volume", Unit='l');398 V2 as volume (Brief="2nd reactor volume", Unit='l');399 Vt as volume (Brief="Total reactor volumes", Unit='l');400 401 DEVICES 402 Inlet as stream; 377 V1 as volume (Brief="1st reactor volume", DisplayUnit='l'); 378 V2 as volume (Brief="2nd reactor volume", DisplayUnit='l'); 379 Vt as volume (Brief="Total reactor volumes", DisplayUnit='l'); 380 381 DEVICES 382 Inlet as stream; # Inlet stream 403 383 R1 as pfr_d; 404 384 R2 as pfr_d; … … 448 428 FlowSheet pfr_cstr 449 429 VARIABLES 450 V1 as volume (Brief="1st reactor volume", Unit='l');451 V2 as volume (Brief="2nd reactor volume", Unit='l');452 Vt as volume (Brief="Total reactor volumes", Unit='l');453 454 DEVICES 455 Inlet as stream; 430 V1 as volume (Brief="1st reactor volume", DisplayUnit='l'); 431 V2 as volume (Brief="2nd reactor volume", DisplayUnit='l'); 432 Vt as volume (Brief="Total reactor volumes", DisplayUnit='l'); 433 434 DEVICES 435 Inlet as stream; # Inlet stream 456 436 R1 as pfr_d; 457 437 R2 as cstr; … … 492 472 493 473 OPTIONS 494 Dynamic = false;474 Dynamic = false; 495 475 end 496 476 … … 502 482 FlowSheet cstr_pfr 503 483 VARIABLES 504 V1 as volume (Brief="1st reactor volume", Unit='l');505 V2 as volume (Brief="2nd reactor volume", Unit='l');506 Vt as volume (Brief="Total reactor volumes", Unit='l');484 V1 as volume (Brief="1st reactor volume", DisplayUnit='l'); 485 V2 as volume (Brief="2nd reactor volume", DisplayUnit='l'); 486 Vt as volume (Brief="Total reactor volumes", DisplayUnit='l'); 507 487 508 488 DEVICES
Note: See TracChangeset
for help on using the changeset viewer.