 Timestamp:
 Mar 2, 2007, 10:06:53 AM (16 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

branches/newlanguage/sample/reactors/fogler/chap2/series_reactors.mso
r82 r171 58 58 59 59 Model stream 60 PARAMETERS 60 61 PARAMETERS 61 62 NComp as Integer (Brief="Number of components", Default=1); 62 VARIABLES 63 F(NComp)as flow_mol (Brief="Molar flow", Unit="mol/s"); 64 X(NComp)as fraction (Brief="Molar conversion"); 65 end 66 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 67 69 68 70 #* … … 71 73 72 74 Model cstr 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", Unit="mol/l/s"); 77 V as volume (Brief="Volume", Unit="l", Upper=2e3); 78 79 EQUATIONS 80 "Component molar balance" 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" 81 87 Inlet.F  Outlet.F = (r)*V; 82 88 83 89 "Outlet molar flow" 84 90 Outlet.F = Inlet.F*(1  Outlet.X); 91 85 92 end 86 93 … … 91 98 92 99 Model pfr 93 VARIABLES 94 in Inlet as stream; # Inlet stream 95 out Outlet as stream; # Outlet stream 96 V as volume (Brief="Volume", Unit="l", Upper=2e3); 97 r as reaction_mol(Brief="Rate of reaction", Unit="mol/l/s"); 98 99 EQUATIONS 100 "Molar balance" 101 diff(V) = Inlet.F/(r)*"1/s"; 102 103 "Change time in X" 104 Outlet.X = time*"1/s"; 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'; 105 115 106 116 "Molar flow" … … 120 130 in Inlet as stream; # Inlet stream 121 131 out Outlet as stream; # Outlet stream 122 V(N) as volume (Brief="Volume", Unit= "l", Upper=2e3);132 V(N) as volume (Brief="Volume", Unit='l', Upper=2e3); 123 133 X(N) as fraction (Brief="Molar conversion"); 124 134 dx as fraction (Brief="Conversion increment"); 125 r(N) as reaction_mol (Brief="Rate of reaction", Unit= "mol/l/s");126 F(N) as flow_mol (Brief="Molar flow", Unit= "mol/s");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'); 127 137 128 138 EQUATIONS … … 154 164 FlowSheet cstr_sample 155 165 PARAMETERS 156 R as Real (Brief="Universal gas constant", Unit= "atm*l/mol/K", Default=0.082);157 T as temperature (Brief="Temperatura in the reactor", Unit= "K");158 P as pressure (Brief="Pressure in the reactor", Unit= "atm");166 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'); 159 169 zin as fraction (Brief="Inlet molar fraction"); 160 170 v0 as flow_vol (Brief="Volumetric flow"); 161 171 162 172 VARIABLES 163 Vt as volume (Brief="Total reactor volume", Unit= "l");173 Vt as volume (Brief="Total reactor volume", Unit='l'); 164 174 165 175 DEVICES … … 175 185 176 186 "Rate of reaction" 177 (R1.r) = (0.0092*R1.Outlet.X^3  0.0153*R1.Outlet.X^2 + 0.0013*R1.Outlet.X + 0.0053)* "mol/l/s";187 (R1.r) = (0.0092*R1.Outlet.X^3  0.0153*R1.Outlet.X^2 + 0.0013*R1.Outlet.X + 0.0053)*'mol/l/s'; 178 188 179 189 "Total reactor volume" … … 187 197 188 198 SET 189 v0 = 6.0* "l/s";190 T = 422.2* "K";191 P = 10* "atm";199 v0 = 6.0*'l/s'; 200 T = 422.2*'K'; 201 P = 10*'atm'; 192 202 zin = 0.5; 193 203 194 204 OPTIONS 195 mode = "steady";205 Dynamic = false; 196 206 end 197 207 … … 202 212 203 213 FlowSheet pfr_sample 204 DEVICES 205 Inlet as stream; # Inlet stream 214 215 DEVICES 216 Inlet as stream; 206 217 R1 as pfr; 207 218 208 219 CONNECTIONS 209 220 Inlet to R1.Inlet; 210 221 211 EQUATIONS 212 "Rate of reaction" 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"; 214 215 SPECIFY 216 "Inlet molar flow" 217 Inlet.F = 0.866541*"mol/s"; 218 "Inlet conversion" 222 EQUATIONS 223 224 "Rate of reaction" 225 (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 227 SPECIFY 228 229 "Inlet molar flow" 230 Inlet.F = 0.866541*'mol/s'; 231 232 "Inlet conversion" 219 233 Inlet.X = 0.0; 220 234 221 INITIAL 222 "Reactor volume" 223 R1.V = 0.0*"l"; 224 225 OPTIONS 226 time = [0:0.004:0.8]; 235 INITIAL 236 237 "Reactor volume" 238 R1.V = 0.0*'l'; 239 240 OPTIONS 241 242 Dynamic = true; 243 TimeStep = 0.004; 244 TimeEnd = 0.8; 245 TimeUnit = 's'; 246 227 247 end 228 248 … … 234 254 FlowSheet pfr_d_sample 235 255 VARIABLES 236 Vt as volume (Brief="Total reactor volume", Unit= "l");256 Vt as volume (Brief="Total reactor volume", Unit='l'); 237 257 238 258 DEVICES … … 245 265 EQUATIONS 246 266 "Rate of reaction" 247 (R1.r) = (0.0092*R1.X^3  0.0153*R1.X^2 + 0.0013*R1.X + 0.0053)* "mol/l/s";267 (R1.r) = (0.0092*R1.X^3  0.0153*R1.X^2 + 0.0013*R1.X + 0.0053)*'mol/l/s'; 248 268 249 269 "Total reactor volume" … … 255 275 SPECIFY 256 276 "Inlet molar flow" 257 Inlet.F = 0.866541* "mol/s";277 Inlet.F = 0.866541*'mol/s'; 258 278 "Inlet conversion" 259 279 Inlet.X = 0.0; … … 262 282 R1.Outlet.X = 0.8; 263 283 "Initial volume" 264 R1.V(1) = 0.0* "l";265 266 OPTIONS 267 mode = "steady";284 R1.V(1) = 0.0*'l'; 285 286 OPTIONS 287 Dynamic = false; 268 288 end 269 289 … … 275 295 FlowSheet comparative 276 296 VARIABLES 277 V_cstr as volume (Brief="CSTR volume", Unit="l");278 V_pfr as volume (Brief="PFR volume", Unit= "l");297 V_cstr as volume (Brief="CSTR volume",Unit='l'); 298 V_pfr as volume (Brief="PFR volume", Unit='l'); 279 299 280 300 DEVICES … … 289 309 EQUATIONS 290 310 "Rate of reaction in CSTR" 291 (CSTR.r) = (0.0092*CSTR.Outlet.X^3  0.0153*CSTR.Outlet.X^2 + 0.0013*CSTR.Outlet.X + 0.0053)* "mol/l/s";311 (CSTR.r) = (0.0092*CSTR.Outlet.X^3  0.0153*CSTR.Outlet.X^2 + 0.0013*CSTR.Outlet.X + 0.0053)*'mol/l/s'; 292 312 "Rate of reaction in PFR" 293 (PFR.r) = (0.0092*PFR.X^3  0.0153*PFR.X^2 + 0.0013*PFR.X + 0.0053)* "mol/l/s";313 (PFR.r) = (0.0092*PFR.X^3  0.0153*PFR.X^2 + 0.0013*PFR.X + 0.0053)*'mol/l/s'; 294 314 295 315 "CSTR volume" … … 303 323 SPECIFY 304 324 "Inlet molar flow" 305 Inlet.F = 5.0* "mol/s";325 Inlet.F = 5.0*'mol/s'; 306 326 "Inlet conversion" 307 327 Inlet.X = 0.0; … … 313 333 314 334 "Initial volume in PFR" 315 PFR.V(1) = 0.0* "l";316 317 OPTIONS 318 mode = "steady";335 PFR.V(1) = 0.0*'l'; 336 337 OPTIONS 338 Dynamic = false; 319 339 end 320 340 … … 326 346 FlowSheet cstr_cstr 327 347 VARIABLES 328 V1 as volume (Brief="1st reactor volume", Unit= "l");329 V2 as volume (Brief="2nd reactor volume", Unit= "l");330 Vt as volume (Brief="Total reactor volumes", Unit= "l");331 332 DEVICES 333 Inlet as stream; # Inlet stream348 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; 334 354 R1 as cstr; 335 355 R2 as cstr; … … 341 361 EQUATIONS 342 362 "Rate of reaction in 1st reactor" 343 (R1.r) = (0.0092*R1.Outlet.X^3  0.0153*R1.Outlet.X^2 + 0.0013*R1.Outlet.X + 0.0053)* "mol/l/s";363 (R1.r) = (0.0092*R1.Outlet.X^3  0.0153*R1.Outlet.X^2 + 0.0013*R1.Outlet.X + 0.0053)*'mol/l/s'; 344 364 "Rate of reaction in 2nd reactor" 345 (R2.r) = (0.0092*R2.Outlet.X^3  0.0153*R2.Outlet.X^2 + 0.0013*R2.Outlet.X + 0.0053)* "mol/l/s";365 (R2.r) = (0.0092*R2.Outlet.X^3  0.0153*R2.Outlet.X^2 + 0.0013*R2.Outlet.X + 0.0053)*'mol/l/s'; 346 366 347 367 "1st volume reactor" … … 354 374 SPECIFY 355 375 "Inlet molar flow" 356 Inlet.F = 0.866541* "mol/s";376 Inlet.F = 0.866541*'mol/s'; 357 377 "Inlet conversion" 358 378 Inlet.X = 0.0; … … 364 384 365 385 OPTIONS 366 mode = "steady"; 386 Dynamic=false; 387 367 388 end 368 389 … … 374 395 FlowSheet pfr_pfr 375 396 VARIABLES 376 V1 as volume (Brief="1st reactor volume", Unit= "l");377 V2 as volume (Brief="2nd reactor volume", Unit= "l");378 Vt as volume (Brief="Total reactor volumes", Unit= "l");379 380 DEVICES 381 Inlet as stream; # Inlet stream397 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; 382 403 R1 as pfr_d; 383 404 R2 as pfr_d; … … 389 410 EQUATIONS 390 411 "Rate of reaction in 1st reactor" 391 (R1.r) = (0.0092*R1.X^3  0.0153*R1.X^2 + 0.0013*R1.X + 0.0053)* "mol/l/s";412 (R1.r) = (0.0092*R1.X^3  0.0153*R1.X^2 + 0.0013*R1.X + 0.0053)*'mol/l/s'; 392 413 "Rate of reaction in 2nd reactor" 393 (R2.r) = (0.0092*R2.X^3  0.0153*R2.X^2 + 0.0013*R2.X + 0.0053)* "mol/l/s";414 (R2.r) = (0.0092*R2.X^3  0.0153*R2.X^2 + 0.0013*R2.X + 0.0053)*'mol/l/s'; 394 415 395 416 "1st reactor volume" … … 402 423 SPECIFY 403 424 "Inlet molar flow" 404 Inlet.F = 0.866541* "mol/s";425 Inlet.F = 0.866541*'mol/s'; 405 426 "Inlet conversion" 406 427 Inlet.X = 0.0; … … 412 433 413 434 "Initial 1st reactor volume" 414 R1.V(1) = 0.0* "l";435 R1.V(1) = 0.0*'l'; 415 436 "Initial 2nd reactor volume" 416 R2.V(1) = 0.0* "l";417 418 OPTIONS 419 mode = "steady";437 R2.V(1) = 0.0*'l'; 438 439 OPTIONS 440 Dynamic = false; 420 441 end 421 442 … … 427 448 FlowSheet pfr_cstr 428 449 VARIABLES 429 V1 as volume (Brief="1st reactor volume", Unit= "l");430 V2 as volume (Brief="2nd reactor volume", Unit= "l");431 Vt as volume (Brief="Total reactor volumes", Unit= "l");432 433 DEVICES 434 Inlet as stream; # Inlet stream450 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; 435 456 R1 as pfr_d; 436 457 R2 as cstr; … … 442 463 EQUATIONS 443 464 "Rate of reaction in 1st reactor" 444 (R1.r) = (0.0092*R1.X^3  0.0153*R1.X^2 + 0.0013*R1.X + 0.0053)* "mol/l/s";465 (R1.r) = (0.0092*R1.X^3  0.0153*R1.X^2 + 0.0013*R1.X + 0.0053)*'mol/l/s'; 445 466 "Rate of reaction in 2nd reactor" 446 (R2.r) = (0.0092*R2.Outlet.X^3  0.0153*R2.Outlet.X^2 + 0.0013*R2.Outlet.X + 0.0053)* "mol/l/s";467 (R2.r) = (0.0092*R2.Outlet.X^3  0.0153*R2.Outlet.X^2 + 0.0013*R2.Outlet.X + 0.0053)*'mol/l/s'; 447 468 448 469 "1st reactor volume" … … 458 479 SPECIFY 459 480 "Inlet molar flow" 460 Inlet.F = 0.866541* "mol/s";481 Inlet.F = 0.866541*'mol/s'; 461 482 "Inlet conversion" 462 483 Inlet.X = 0.0; … … 468 489 469 490 "Initial 1st reactor volume" 470 R1.V(1) = 0.0* "l";471 472 OPTIONS 473 mode = "steady";491 R1.V(1) = 0.0*'l'; 492 493 OPTIONS 494 Dynamic= false; 474 495 end 475 496 … … 481 502 FlowSheet cstr_pfr 482 503 VARIABLES 483 V1 as volume (Brief="1st reactor volume", Unit= "l");484 V2 as volume (Brief="2nd reactor volume", Unit= "l");485 Vt as volume (Brief="Total reactor volumes", Unit= "l");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'); 486 507 487 508 DEVICES … … 496 517 EQUATIONS 497 518 "Rate of reaction in 1st reactor" 498 (R1.r) = (9.2*R1.Outlet.X^3  15.3*R1.Outlet.X^2 + 1.3*R1.Outlet.X + 5.3)*1e3* "mol/l/s";519 (R1.r) = (9.2*R1.Outlet.X^3  15.3*R1.Outlet.X^2 + 1.3*R1.Outlet.X + 5.3)*1e3*'mol/l/s'; 499 520 "Rate of reaction in 2nd reactor" 500 (R2.r) = (9.2*R2.X^3  15.3*R2.X^2 + 1.3*R2.X + 5.3)*1e3* "mol/l/s";521 (R2.r) = (9.2*R2.X^3  15.3*R2.X^2 + 1.3*R2.X + 5.3)*1e3*'mol/l/s'; 501 522 502 523 "1st reactor volume" … … 512 533 SPECIFY 513 534 "Inlet molar flow" 514 Inlet.F = 0.866541* "mol/s";535 Inlet.F = 0.866541*'mol/s'; 515 536 "Inlet conversion" 516 537 Inlet.X = 0.0; … … 522 543 523 544 "Initial 2nd reactor volume" 524 R2.V(1) = 0.0* "l";525 526 OPTIONS 527 mode = "steady";528 end 545 R2.V(1) = 0.0*'l'; 546 547 OPTIONS 548 Dynamic = false; 549 end
Note: See TracChangeset
for help on using the changeset viewer.