Changeset 374
- Timestamp:
- Sep 26, 2007, 2:10:19 PM (16 years ago)
- Location:
- trunk/sample/reactors/fogler/chap2
- Files:
-
- 10 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sample/reactors/fogler/chap2/series_reactors.mso
r373 r374 54 54 55 55 #*--------------------------------------------------------------------- 56 * Model of a stream57 *--------------------------------------------------------------------*#58 59 Model stream60 VARIABLES61 F as flow_mol (Brief="Molar flow", DisplayUnit='mol/s');62 X as fraction (Brief="Molar conversion");63 end64 65 66 #*---------------------------------------------------------------------67 * Model of a steady-state, isotermic, and isobaric CSTR68 *--------------------------------------------------------------------*#69 70 Model cstr71 VARIABLES72 in Inlet as stream; # Inlet stream73 out Outlet as stream; # Outlet stream74 r as reaction_mol(Brief="Rate of reaction", DisplayUnit='mol/l/s');75 V as volume (Brief="Volume", DisplayUnit='l', Upper=2e3);76 77 EQUATIONS78 "Component molar balance"79 Inlet.F - Outlet.F = (-r)*V;80 81 "Outlet molar flow"82 Outlet.F = Inlet.F*(1 - Outlet.X);83 end84 85 86 #*---------------------------------------------------------------------87 * Model of a steady-state, isotermic, and isobaric PFR88 *--------------------------------------------------------------------*#89 90 Model pfr91 VARIABLES92 in Inlet as stream; # Inlet stream93 out Outlet as stream; # Outlet stream94 V as volume (Brief="Volume", DisplayUnit='l', Upper=2e3);95 r as reaction_mol(Brief="Rate of reaction", DisplayUnit='mol/l/s');96 97 EQUATIONS98 "Molar balance"99 diff(V) = Inlet.F/(-r)/'s';100 101 "Change time in X"102 Outlet.X = time/'s';103 104 "Molar flow"105 Outlet.F = Inlet.F*(1 - Outlet.X);106 end107 108 109 #*---------------------------------------------------------------------110 * Model of a discreted steady-state, isotermic, and isobaric PFR111 *--------------------------------------------------------------------*#112 113 Model pfr_d114 PARAMETERS115 N as Integer (Brief="Number of discrete points", Default=200);116 117 VARIABLES118 in Inlet as stream; # Inlet stream119 out Outlet as stream; # Outlet stream120 V(N) as volume (Brief="Volume", DisplayUnit='l', Upper=2e3);121 X(N) as fraction (Brief="Molar conversion");122 dx as fraction (Brief="Conversion increment");123 r(N) as reaction_mol (Brief="Rate of reaction", DisplayUnit='mol/l/s');124 F(N) as flow_mol (Brief="Molar flow", DisplayUnit='mol/s');125 126 EQUATIONS127 "Discrete interval"128 dx = X(N)/N;129 130 for i in [2:N]131 "Molar balance"132 V(i) - V(i-1) = Inlet.F*dx/(-r(i));133 "Discrete molar conversion"134 X(i-1) = X(i) - dx;135 end136 137 "Molar flow"138 F = Inlet.F*(1 - X);139 140 "Outlet molar flow"141 Outlet.F = F(N);142 143 "Outlet molar conversion"144 Outlet.X = X(N);145 end146 147 148 #*---------------------------------------------------------------------149 56 * Estimation of rate of reaction 150 57 *--------------------------------------------------------------------*# … … 182 89 EXPERIMENTS 183 90 # FILE WEIGTH 184 "raw_data.dat" 1; 91 "raw_data.dat" 1; # Table 2-1 (Fogler,1999) 185 92 186 93 OPTIONS … … 193 100 194 101 #*--------------------------------------------------------------------- 102 * Model of a stream 103 *--------------------------------------------------------------------*# 104 105 Model stream 106 VARIABLES 107 F as flow_mol (Brief="Molar flow", DisplayUnit='mol/s'); 108 X as fraction (Brief="Molar conversion"); 109 end 110 111 Model source_ 112 ATTRIBUTES 113 Pallete = true; 114 Brief = "Simple inlet stream"; 115 Icon = "icon/inlet"; 116 117 VARIABLES 118 out Outlet as stream (Brief="Outlet stream", PosX=1, PosY=0.5); 119 end 120 121 Model sink_ 122 ATTRIBUTES 123 Pallete = true; 124 Brief = "Simple outlet stream"; 125 Icon = "icon/outlet"; 126 127 VARIABLES 128 in Inlet as stream (Brief="Inlet stream", PosX=0, PosY=0.5); 129 end 130 131 132 #*--------------------------------------------------------------------- 133 * Model of a steady-state, isotermic, and isobaric CSTR 134 *--------------------------------------------------------------------*# 135 136 Model simple_cstr 137 ATTRIBUTES 138 Pallete = true; 139 Brief = "Simple model of a steady-state CSTR"; 140 Icon = "icon/simple_cstr"; 141 142 PARAMETERS 143 NT as Integer (Brief="Number of terms of reaction rate expression", Default=4); 144 a(NT) as reaction_mol (Brief="Parameter of reaction rate expression"); 145 146 VARIABLES 147 in Inlet as stream (Brief="Inlet stream", PosX=0, PosY=0); 148 out Outlet as stream (Brief="Outlet stream", PosX=1, PosY=1); 149 r as reaction_mol (Brief="Rate of reaction", DisplayUnit='mol/l/s'); 150 V as volume (Brief="Volume", DisplayUnit='l', Upper=2e3); 151 152 SET 153 a = [0.00526633, 0.00133478, -0.0153321, 0.0092151]*'mol/l/s'; # Estimated 154 155 EQUATIONS 156 "Component molar balance" 157 Inlet.F - Outlet.F = (-r)*V; 158 159 "Outlet molar flow" 160 Outlet.F = Inlet.F*(1 - Outlet.X); 161 162 "Rate of reaction" 163 (-r) = sum(a*Outlet.X^[0:(NT-1)]); 164 end 165 166 167 #*--------------------------------------------------------------------- 168 * Model of a steady-state, isotermic, and isobaric PFR 169 *--------------------------------------------------------------------*# 170 171 Model simple_pfr 172 PARAMETERS 173 NT as Integer (Brief="Number of terms of reaction rate expression", Default=4); 174 a(NT) as reaction_mol (Brief="Parameter of reaction rate expression"); 175 176 VARIABLES 177 in Inlet as stream (Brief="Inlet stream"); 178 out Outlet as stream (Brief="Outlet stream"); 179 V as volume (Brief="Volume", DisplayUnit='l', Upper=2e3); 180 r as reaction_mol (Brief="Rate of reaction", DisplayUnit='mol/l/s'); 181 182 SET 183 a = [0.00526633, 0.00133478, -0.0153321, 0.0092151]*'mol/l/s'; # Estimated 184 185 EQUATIONS 186 "Molar balance" 187 diff(V) = Inlet.F/(-r)/'s'; 188 189 "Change time in X" 190 Outlet.X = time/'s'; 191 192 "Molar flow" 193 Outlet.F = Inlet.F*(1 - Outlet.X); 194 195 "Rate of reaction" 196 # (-r) = sum(a*Outlet.X^[0:(NT-1)]); # NOT CONVERGE 197 (-r) = (a(4)*Outlet.X^3 + a(3)*Outlet.X^2 + a(2)*Outlet.X + a(1)); 198 end 199 200 201 #*--------------------------------------------------------------------- 202 * Model of a discreted steady-state, isotermic, and isobaric PFR 203 *--------------------------------------------------------------------*# 204 205 Model simple_pfr_d 206 ATTRIBUTES 207 Pallete = true; 208 Brief = "Simple model of a steady-state PFR"; 209 Icon = "icon/simple_pfr"; 210 211 PARAMETERS 212 N as Integer (Brief="Number of discrete points", Default=200); 213 NT as Integer (Brief="Number of terms of reaction rate expression", Default=4); 214 a(NT) as reaction_mol (Brief="Parameter of reaction rate expression"); 215 216 VARIABLES 217 in Inlet as stream (Brief="Inlet stream", PosX=0, PosY=0.5); 218 out Outlet as stream (Brief="Outlet stream", PosX=1, PosY=0.5); 219 V(N) as volume (Brief="Volume", DisplayUnit='l', Upper=2e3); 220 r(N) as reaction_mol (Brief="Rate of reaction", DisplayUnit='mol/l/s'); 221 F(N) as flow_mol (Brief="Molar flow", DisplayUnit='mol/s'); 222 X(N) as fraction (Brief="Molar conversion"); 223 dx as fraction (Brief="Conversion increment"); 224 225 SET 226 a = [0.00526633, 0.00133478, -0.0153321, 0.0092151]*'mol/l/s'; # Estimated 227 228 EQUATIONS 229 "Outlet molar flow" 230 Outlet.F = F(N); 231 232 "Outlet molar conversion" 233 Outlet.X = X(N); 234 235 "Discrete interval" 236 dx = Outlet.X/N; 237 238 for i in [2:N] 239 "Molar balance" 240 V(i) - V(i-1) = Inlet.F*dx/(-r(i)); 241 "Discrete molar conversion" 242 X(i-1) = X(i) - dx; 243 end 244 245 "Molar flow" 246 F = Inlet.F*(1 - X); 247 248 for i in [1:N] 249 "Rate of reaction" 250 (-r(i)) = sum(a*X(i)^[0:(NT-1)]); 251 end 252 end 253 254 255 #*--------------------------------------------------------------------- 195 256 * Example 2-2: Scale-up an isotermic CSTR in gaseous phase 196 257 *--------------------------------------------------------------------*# … … 198 259 FlowSheet cstr_sample 199 260 PARAMETERS 200 NT as Integer (Brief="Number of terms of rate of reaction expression", Default=4);201 a(NT) as Real (Brief="Parameter of rate of reaction expression");202 203 261 R as Real (Brief="Universal gas constant", Unit='atm*l/mol/K', Default=0.082); 204 262 T as temperature (Brief="Temperatura in the reactor"); … … 212 270 DEVICES 213 271 Inlet as stream; # Inlet stream 214 R1 as cstr;272 R1 as simple_cstr; 215 273 216 274 CONNECTIONS … … 220 278 "Inlet molar flow" 221 279 Inlet.F = (zin*P/(R*T))*v0; 222 223 "Rate of reaction"224 (-R1.r) = (a(4)*R1.Outlet.X^3 + a(3)*R1.Outlet.X^2 + a(2)*R1.Outlet.X + a(1))*'mol/l/s';225 280 226 281 "Total reactor volume" … … 228 283 229 284 SET 230 a = [0.00526633, 0.00133478, -0.0153321, 0.0092151]; # Estimated231 285 v0 = 6.0*'l/s'; 232 286 T = 422.2*'K'; … … 250 304 251 305 FlowSheet pfr_sample 252 PARAMETERS 253 NT as Integer (Brief="Number of terms", Default=4); 254 a(NT) as Real (Brief="Parameter of rate of reaction expression"); 255 256 DEVICES 257 Inlet as stream; # Inlet stream 258 R1 as pfr; 306 DEVICES 307 Inlet as stream; # Inlet stream 308 R1 as simple_pfr; 259 309 260 310 CONNECTIONS 261 311 Inlet to R1.Inlet; 262 263 EQUATIONS264 "Rate of reaction"265 (-R1.r) = (a(4)*R1.Outlet.X^3 + a(3)*R1.Outlet.X^2 + a(2)*R1.Outlet.X + a(1))*'mol/l/s';266 267 SET268 a = [0.00526633, 0.00133478, -0.0153321, 0.0092151]; # Estimated269 312 270 313 SPECIFY … … 289 332 290 333 FlowSheet pfr_d_sample 291 PARAMETERS292 NT as Integer (Brief="Number of terms", Default=4);293 a(NT) as Real (Brief="Parameter of rate of reaction expression");294 295 334 VARIABLES 296 335 Vt as volume (Brief="Total reactor volume", DisplayUnit='l'); … … 298 337 DEVICES 299 338 Inlet as stream; # Inlet stream 300 R1 as pfr_d;339 R1 as simple_pfr_d; 301 340 302 341 CONNECTIONS … … 304 343 305 344 EQUATIONS 306 "Rate of reaction"307 (-R1.r) = (a(4)*R1.X^3 + a(3)*R1.X^2 + a(2)*R1.X +a(1))*'mol/l/s';308 309 345 "Total reactor volume" 310 346 Vt = R1.V(R1.N); … … 312 348 SET 313 349 # R1.N = 100; 314 a = [0.00526633, 0.00133478, -0.0153321, 0.0092151]; # Estimated315 350 316 351 SPECIFY … … 335 370 336 371 FlowSheet comparative 337 PARAMETERS338 NT as Integer (Brief="Number of terms", Default=4);339 a(NT) as Real (Brief="Parameter of rate of reaction expression");340 341 372 VARIABLES 342 373 V_cstr as volume (Brief="CSTR volume", DisplayUnit='l'); … … 345 376 DEVICES 346 377 Inlet as stream; # Inlet stream 347 CSTR as cstr;348 PFR as pfr_d;378 CSTR as simple_cstr; 379 PFR as simple_pfr_d; 349 380 350 381 CONNECTIONS … … 353 384 354 385 EQUATIONS 355 "Rate of reaction in CSTR"356 (-CSTR.r) = (a(4)*CSTR.Outlet.X^3 + a(3)*CSTR.Outlet.X^2 + a(2)*CSTR.Outlet.X + a(1))*'mol/l/s';357 "Rate of reaction in PFR"358 (-PFR.r) = (a(4)*PFR.X^3 + a(3)*PFR.X^2 + a(2)*PFR.X + a(1))*'mol/l/s';359 360 386 "CSTR volume" 361 387 V_cstr = CSTR.V; 388 362 389 "PFR volume" 363 390 V_pfr = PFR.V(PFR.N); … … 365 392 SET 366 393 # PFR.N = 100; 367 a = [0.00526633, 0.00133478, -0.0153321, 0.0092151]; # Estimated368 394 369 395 SPECIFY … … 391 417 392 418 FlowSheet cstr_cstr 393 PARAMETERS394 NT as Integer (Brief="Number of terms", Default=4);395 a(NT) as Real (Brief="Parameter of rate of reaction expression");396 397 419 VARIABLES 398 420 V1 as volume (Brief="1st reactor volume", DisplayUnit='l'); … … 402 424 DEVICES 403 425 Inlet as stream; # Inlet stream 404 R1 as cstr;405 R2 as cstr;426 R1 as simple_cstr; 427 R2 as simple_cstr; 406 428 407 429 CONNECTIONS … … 410 432 411 433 EQUATIONS 412 "Rate of reaction in 1st reactor"413 (-R1.r) = (a(4)*R1.Outlet.X^3 + a(3)*R1.Outlet.X^2 + a(2)*R1.Outlet.X + a(1))*'mol/l/s';414 "Rate of reaction in 2nd reactor"415 (-R2.r) = (a(4)*R2.Outlet.X^3 + a(3)*R2.Outlet.X^2 + a(2)*R2.Outlet.X + a(1))*'mol/l/s';416 417 434 "1st volume reactor" 418 435 V1 = R1.V; … … 422 439 Vt = V1 + V2; 423 440 424 SET425 a = [0.00526633, 0.00133478, -0.0153321, 0.0092151]; # Estimated426 427 441 SPECIFY 428 442 "Inlet molar flow" … … 446 460 447 461 FlowSheet pfr_pfr 448 PARAMETERS449 NT as Integer (Brief="Number of terms", Default=4);450 a(NT) as Real (Brief="Parameter of rate of reaction expression");451 452 462 VARIABLES 453 463 V1 as volume (Brief="1st reactor volume", DisplayUnit='l'); … … 457 467 DEVICES 458 468 Inlet as stream; # Inlet stream 459 R1 as pfr_d;460 R2 as pfr_d;469 R1 as simple_pfr_d; 470 R2 as simple_pfr_d; 461 471 462 472 CONNECTIONS … … 465 475 466 476 EQUATIONS 467 "Rate of reaction in 1st reactor"468 (-R1.r) = (a(4)*R1.X^3 + a(3)*R1.X^2 + a(2)*R1.X + a(1))*'mol/l/s';469 "Rate of reaction in 2nd reactor"470 (-R2.r) = (a(4)*R2.X^3 + a(3)*R2.X^2 + a(2)*R2.X + a(1))*'mol/l/s';471 472 477 "1st reactor volume" 473 478 V1 = R1.V(R1.N); … … 477 482 Vt = V1 + V2; 478 483 479 SET480 a = [0.00526633, 0.00133478, -0.0153321, 0.0092151]; # Estimated481 482 484 SPECIFY 483 485 "Inlet molar flow" … … 506 508 507 509 FlowSheet pfr_cstr 508 PARAMETERS509 NT as Integer (Brief="Number of terms", Default=4);510 a(NT) as Real (Brief="Parameter of rate of reaction expression");511 512 510 VARIABLES 513 511 V1 as volume (Brief="1st reactor volume", DisplayUnit='l'); … … 517 515 DEVICES 518 516 Inlet as stream; # Inlet stream 519 R1 as pfr_d;520 R2 as cstr;517 R1 as simple_pfr_d; 518 R2 as simple_cstr; 521 519 522 520 CONNECTIONS … … 525 523 526 524 EQUATIONS 527 "Rate of reaction in 1st reactor"528 (-R1.r) = (a(4)*R1.X^3 + a(3)*R1.X^2 + a(2)*R1.X + a(1))*'mol/l/s';529 "Rate of reaction in 2nd reactor"530 (-R2.r) = (a(4)*R2.Outlet.X^3 + a(3)*R2.Outlet.X^2 + a(2)*R2.Outlet.X + a(1))*'mol/l/s';531 532 525 "1st reactor volume" 533 526 V1 = R1.V(R1.N); … … 539 532 SET 540 533 # R1.N = 100; 541 a = [0.00526633, 0.00133478, -0.0153321, 0.0092151]; # Estimated542 534 543 535 SPECIFY … … 565 557 566 558 FlowSheet cstr_pfr 567 PARAMETERS568 NT as Integer (Brief="Number of terms", Default=4);569 a(NT) as Real (Brief="Parameter of rate of reaction expression");570 571 559 VARIABLES 572 560 V1 as volume (Brief="1st reactor volume", DisplayUnit='l'); … … 576 564 DEVICES 577 565 Inlet as stream; # Inlet stream 578 R1 as cstr;579 R2 as pfr_d;566 R1 as simple_cstr; 567 R2 as simple_pfr_d; 580 568 581 569 CONNECTIONS … … 584 572 585 573 EQUATIONS 586 "Rate of reaction in 1st reactor"587 (-R1.r) = (a(4)*R1.Outlet.X^3 + a(3)*R1.Outlet.X^2 + a(2)*R1.Outlet.X + a(1))*'mol/l/s';588 "Rate of reaction in 2nd reactor"589 (-R2.r) = (a(4)*R2.X^3 + a(3)*R2.X^2 + a(2)*R2.X + a(1))*'mol/l/s';590 591 574 "1st reactor volume" 592 575 V1 = R1.V; … … 598 581 SET 599 582 # R2.N = 100; 600 a = [0.00526633, 0.00133478, -0.0153321, 0.0092151]; # Estimated601 583 602 584 SPECIFY
Note: See TracChangeset
for help on using the changeset viewer.