Changeset 171 for branches/newlanguage/sample/reactors/fogler
- Timestamp:
- Mar 2, 2007, 10:06:53 AM (17 years ago)
- Location:
- branches/newlanguage/sample/reactors/fogler
- Files:
-
- 11 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)*1e-3* "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)*1e-3*'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)*1e-3* "mol/l/s";521 (-R2.r) = (9.2*R2.X^3 - 15.3*R2.X^2 + 1.3*R2.X + 5.3)*1e-3*'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 -
branches/newlanguage/sample/reactors/fogler/chap3/equilibrium_conversion.mso
r82 r171 54 54 Model stream 55 55 PARAMETERS 56 extNComp as Integer (Brief="Number of chemical components", Lower=1);56 outer NComp as Integer (Brief="Number of chemical components", Lower=1); 57 57 58 58 VARIABLES 59 C(NComp)as conc_mol(Brief="Concentration", Unit= "kmol/l", Lower=0);59 C(NComp)as conc_mol(Brief="Concentration", Unit='kmol/l', Lower=0); 60 60 z(NComp)as fraction(Brief="Molar fraction"); 61 61 end … … 69 69 PARAMETERS 70 70 NComp as Integer (Brief="Number of chemical components", Lower=1); 71 R as Real (Brief="Universal gas constant", Unit= "atm*l/mol/K", Default=0.082);71 R as Real (Brief="Universal gas constant", Unit='atm*l/mol/K', Default=0.082); 72 72 stoic(NComp) as Real(Brief="Stoichiometric coefficients"); 73 73 … … 76 76 Outlet as stream; # Outlet stream 77 77 X as fraction (Brief="Molar conversion", Lower=0); 78 Kc as Real (Brief="Equilibrium constant", Unit= "mol/l");79 C as conc_mol (Brief="Total outlet concentration", Unit= "mol/l", Lower=0);80 Co as conc_mol (Brief="Total inlet concentration", Unit= "mol/l", Lower=0);81 T as temperature (Brief="Temperature", Unit= "K");82 P as pressure (Brief="Pressure", Unit= "atm");78 Kc as Real (Brief="Equilibrium constant", Unit='mol/l'); 79 C as conc_mol (Brief="Total outlet concentration", Unit='mol/l', Lower=0); 80 Co as conc_mol (Brief="Total inlet concentration", Unit='mol/l', Lower=0); 81 T as temperature (Brief="Temperature", Unit='K'); 82 P as pressure (Brief="Pressure", Unit='atm'); 83 83 Theta(NComp) as Real(Brief="Parameter Theta"); 84 84 … … 114 114 115 115 "Inlet pressure" 116 P = 2.0* "atm";116 P = 2.0*'atm'; 117 117 "Inlet temperature" 118 T = 340* "K";118 T = 340*'K'; 119 119 120 120 "Equilibrium constant" 121 Kc = 0.1* "mol/l";121 Kc = 0.1*'mol/l'; 122 122 123 123 OPTIONS 124 mode = "steady";124 Dynamic = false; 125 125 end 126 126 … … 133 133 PARAMETERS 134 134 NComp as Integer (Brief="Number of chemical components", Lower=1); 135 R as Real (Brief="Universal gas constant", Unit= "atm*l/mol/K", Default=0.082);135 R as Real (Brief="Universal gas constant", Unit='atm*l/mol/K', Default=0.082); 136 136 stoic(NComp) as Real(Brief="Stoichiometric coefficients"); 137 137 … … 140 140 Outlet as stream; # Outlet stream 141 141 X as fraction (Brief="Molar conversion", Lower=0); 142 Kc as Real (Brief="Equilibrium constant", Unit= "mol/l");143 C as conc_mol (Brief="Total outlet concentration", Unit= "mol/l", Lower=0);144 Co as conc_mol (Brief="Total inlet concentration", Unit= "mol/l", Lower=0);145 T as temperature (Brief="Temperatura", Unit= "K");146 P as pressure (Brief="Pressure", Unit= "atm");142 Kc as Real (Brief="Equilibrium constant", Unit='mol/l'); 143 C as conc_mol (Brief="Total outlet concentration", Unit='mol/l', Lower=0); 144 Co as conc_mol (Brief="Total inlet concentration", Unit='mol/l', Lower=0); 145 T as temperature (Brief="Temperatura", Unit='K'); 146 P as pressure (Brief="Pressure", Unit='atm'); 147 147 Theta(NComp) as Real(Brief="Parameter Theta"); 148 148 epsilon as Real (Brief="Parameter epsilon"); … … 182 182 183 183 "Inlet pressure" 184 P = 2.0* "atm";184 P = 2.0*'atm'; 185 185 "Inlet temperature" 186 T = 340* "K";186 T = 340*'K'; 187 187 188 188 "Equilibrium constant" 189 Kc = 0.1* "mol/l";189 Kc = 0.1*'mol/l'; 190 190 191 191 OPTIONS 192 mode = "steady";192 Dynamic = false; 193 193 end -
branches/newlanguage/sample/reactors/fogler/chap3/oxidation_of_so2.mso
r82 r171 51 51 Model stream 52 52 PARAMETERS 53 extNComp as Integer (Brief="Number of chemical components", Lower=1);53 outer NComp as Integer (Brief="Number of chemical components", Lower=1); 54 54 55 55 VARIABLES 56 C(NComp)as conc_mol(Brief="Concentration", Unit= "mol/l", Lower=0);56 C(NComp)as conc_mol(Brief="Concentration", Unit='mol/l', Lower=0); 57 57 z(NComp)as fraction(Brief="Molar fraction"); 58 58 end … … 67 67 NComp as Integer; 68 68 stoic(NComp) as Real(Brief="Stoichiometric coefficients"); 69 k as Real (Brief="Specific rate of reaction", Unit= "l/mol/s");70 R as Real (Brief="Universal gas constant", Unit= "atm*l/mol/K", Default=0.082);69 k as Real (Brief="Specific rate of reaction", Unit='l/mol/s'); 70 R as Real (Brief="Universal gas constant", Unit='atm*l/mol/K', Default=0.082); 71 71 72 72 VARIABLES 73 Inlet as stream; # Inlet stream74 Outlet as stream; # Outlet stream73 Inlet as stream; 74 Outlet as stream; 75 75 X as fraction (Brief="Molar conversion", Lower=0); 76 r as reaction_mol (Brief="Rate of reaction of A", Unit= "mol/l/s");77 T as temperature (Brief="Temperature", Unit= "K");78 P as pressure (Brief="Pressure", Unit= "atm");76 r as reaction_mol (Brief="Rate of reaction of A", Unit='mol/l/s'); 77 T as temperature (Brief="Temperature", Unit='K'); 78 P as pressure (Brief="Pressure", Unit='atm'); 79 79 Theta(NComp)as Real (Brief="Parameter Theta"); 80 80 epsilon as Real (Brief="Parameter epsilon"); … … 82 82 EQUATIONS 83 83 "Change time in X" 84 X = time* "1/s";84 X = time*'1/s'; 85 85 86 86 "Outlet molar fraction" … … 105 105 NComp = 4; # A, B, C and I 106 106 stoic = [-1.0, -0.5, 1.0, 0.0]; 107 k = 200* "l/mol/s";107 k = 200*'l/mol/s'; 108 108 109 109 SPECIFY … … 111 111 Inlet.z = [0.28, 0.1512, 0.0, 0.5688]; 112 112 "Inlet pressure" 113 P = 1485* "kPa";113 P = 1485*'kPa'; 114 114 "Inlet temperature" 115 T = (227 + 273.15)* "K";115 T = (227 + 273.15)*'K'; 116 116 117 117 OPTIONS 118 time = [0:0.005:0.995]; 118 TimeStep = 0.005; 119 TimeEnd = 0.995; 120 119 121 end -
branches/newlanguage/sample/reactors/fogler/chap4/membrane_reactor.mso
r82 r171 51 51 NComp as Integer (Brief="Number of chemical components", Lower=1); 52 52 stoic(NComp)as Real (Brief="Stoichiometric number"); 53 Kc as conc_mol (Brief="Equilibrium constant", Unit= "mol/l");54 kc as Real (Brief="Mass transfer coefficient", Unit= "1/min");55 R as Real (Brief="Universal gas constant", Unit= "atm*l/mol/K", Default=0.082);53 Kc as conc_mol (Brief="Equilibrium constant", Unit='mol/l'); 54 kc as Real (Brief="Mass transfer coefficient", Unit='1/min'); 55 R as Real (Brief="Universal gas constant", Unit='atm*l/mol/K', Default=0.082); 56 56 57 57 VARIABLES 58 F(NComp)as flow_mol (Brief="Molar flow", Unit= "mol/min");59 C(NComp)as conc_mol (Brief="Molar concentration", Unit= "mol/l", Lower=0);60 r(NComp)as reaction_mol (Brief="Rate of reaction", Unit= "mol/l/min");61 Cto as conc_mol (Brief="Total inlet concentration", Unit= "mol/l");62 k as Real (Brief="Specific rate of reaction", Unit= "1/min");63 V as volume (Brief="Volume", Unit= "l");58 F(NComp)as flow_mol (Brief="Molar flow", Unit='mol/min'); 59 C(NComp)as conc_mol (Brief="Molar concentration", Unit='mol/l', Lower=0); 60 r(NComp)as reaction_mol (Brief="Rate of reaction", Unit='mol/l/min'); 61 Cto as conc_mol (Brief="Total inlet concentration", Unit='mol/l'); 62 k as Real (Brief="Specific rate of reaction", Unit='1/min'); 63 V as volume (Brief="Volume", Unit='l'); 64 64 65 T as temperature (Brief="Temperatura", Unit= "K");66 P as pressure (Brief="Pressure", Unit= "atm");65 T as temperature (Brief="Temperatura", Unit='K'); 66 P as pressure (Brief="Pressure", Unit='atm'); 67 67 68 68 EQUATIONS 69 69 "Change time in V" 70 V = time* "l/s";70 V = time*'l/s'; 71 71 72 72 "Molar balance for A" 73 diff(F(1))* "s/l"= r(1);73 diff(F(1))*'s/l' = r(1); 74 74 "Molar balance for B" 75 diff(F(2))* "s/l"= r(2) - kc*C(2);75 diff(F(2))*'s/l' = r(2) - kc*C(2); 76 76 "Molar balance for C" 77 diff(F(3))* "s/l"= r(3);77 diff(F(3))*'s/l' = r(3); 78 78 79 79 "Rate of reaction" … … 90 90 stoic = [-1.0, 1.0, 1.0]; # A <-> B + C 91 91 92 kc = 0.20* "1/min";93 Kc = 0.05* "mol/l";92 kc = 0.20*'1/min'; 93 Kc = 0.05*'mol/l'; 94 94 95 95 SPECIFY 96 96 "Pressure" 97 P = 8.2* "atm"; # Isobaric system97 P = 8.2*'atm'; # Isobaric system 98 98 "Temperature" 99 T = 500* "K"; # Isotermic system99 T = 500*'K'; # Isotermic system 100 100 101 101 "Specific rate of reaction" 102 k = 0.7* "1/min";102 k = 0.7*'1/min'; 103 103 104 104 INITIAL 105 105 "Molar flow" 106 F = [10, 0.0, 0.0]* "mol/min";106 F = [10, 0.0, 0.0]*'mol/min'; 107 107 108 108 OPTIONS 109 time =[0:10:500]; 109 TimeStep =10; 110 TimeEnd =500; 110 111 end -
branches/newlanguage/sample/reactors/fogler/chap4/molarflow_pfr.mso
r82 r171 48 48 PARAMETERS 49 49 NComp as Integer; 50 ka as Real (Brief="Specific rate of reaction", Unit= "1/min");50 ka as Real (Brief="Specific rate of reaction", Unit='1/min'); 51 51 Kc as conc_mol (Brief="Equilibrium constant"); 52 52 53 53 VARIABLES 54 F(NComp)as flow_mol (Brief="Molar flow", Unit= "mol/min");55 C(NComp)as conc_mol (Brief="Molar concentration", Unit= "mol/l");56 r(NComp)as reaction_mol (Brief="Reaction rate", Unit= "mol/min/l");57 Fo(NComp) as flow_mol (Brief="Input molar flow of A", Unit= "mol/min");58 Ft as flow_mol (Brief="Total molar flow", Unit= "mol/min");59 Cto as conc_mol (Brief="Initial concentration", Unit= "mol/l");60 V as volume (Brief="Reactor volume", Unit= "l");54 F(NComp)as flow_mol (Brief="Molar flow", Unit='mol/min'); 55 C(NComp)as conc_mol (Brief="Molar concentration", Unit='mol/l'); 56 r(NComp)as reaction_mol (Brief="Reaction rate", Unit='mol/min/l'); 57 Fo(NComp) as flow_mol (Brief="Input molar flow of A", Unit='mol/min'); 58 Ft as flow_mol (Brief="Total molar flow", Unit='mol/min'); 59 Cto as conc_mol (Brief="Initial concentration", Unit='mol/l'); 60 V as volume (Brief="Reactor volume", Unit='l'); 61 61 62 62 EQUATIONS 63 63 "Change time in V" 64 V = time* "l/s";64 V = time*'l/s'; 65 65 66 66 "Molar balance" 67 diff(F(1))= r(1)* "l/s";67 diff(F(1))= r(1)*'l/s'; 68 68 69 69 "Reaction rate of A" … … 84 84 SET 85 85 NComp = 2; # components A and B 86 ka = 2.7* "1/min";87 Kc = 1.2* "mol/l";86 ka = 2.7*'1/min'; 87 Kc = 1.2*'mol/l'; 88 88 89 89 SPECIFY 90 90 "Input total molar concentration" 91 Cto = 0.1* "mol/l";91 Cto = 0.1*'mol/l'; 92 92 93 93 "Input molar flow" 94 Fo = [10, 0]* "mol/min";94 Fo = [10, 0]*'mol/min'; 95 95 96 96 INITIAL 97 97 "Molar flow of A" 98 F(1) = 10* "mol/min";98 F(1) = 10*'mol/min'; 99 99 100 100 OPTIONS 101 time=[0:1:100]; 101 TimeStep=1; 102 TimeEnd=100; 102 103 DAESolver = "dassl"; 103 104 end -
branches/newlanguage/sample/reactors/fogler/chap4/semibatch_reactor.mso
r82 r171 54 54 55 55 VARIABLES 56 C(NComp) as conc_mol (Brief="Concentration", Unit= "mol/l", Lower=0);57 Co(NComp) as conc_mol (Brief="Inlet concentration", Unit= "mol/l", Lower=0);56 C(NComp) as conc_mol (Brief="Concentration", Unit='mol/l', Lower=0); 57 Co(NComp) as conc_mol (Brief="Inlet concentration", Unit='mol/l', Lower=0); 58 58 59 r(NComp) as reaction_mol (Brief="Rate of reaction", Unit= "mol/l/s");60 k as Real (Brief="Specific rate of reaction", Unit= "l/mol/s");61 V as volume (Brief="Volume", Unit= "l");59 r(NComp) as reaction_mol (Brief="Rate of reaction", Unit='mol/l/s'); 60 k as Real (Brief="Specific rate of reaction", Unit='l/mol/s'); 61 V as volume (Brief="Volume", Unit='l'); 62 62 X as fraction (Brief="Molar conversion", Lower=0); 63 63 … … 80 80 stoic = [-1.0, -1.0, 1.0, 1.0]; # A + B -> C + D 81 81 82 Vo = 5.00* "l";83 vo = 0.05* "l/s";84 Cao= 0.05* "mol/l"; # Initial condition82 Vo = 5.00*'l'; 83 vo = 0.05*'l/s'; 84 Cao= 0.05*'mol/l'; # Initial condition 85 85 86 86 SPECIFY 87 87 "Specific rate of reaction" 88 k = 2.2* "l/mol/s";88 k = 2.2*'l/mol/s'; 89 89 90 90 "Inlet concentration" 91 Co = [0.0, 0.025, 0.0, 0.0]* "mol/l";91 Co = [0.0, 0.025, 0.0, 0.0]*'mol/l'; 92 92 93 93 INITIAL 94 94 "Molar concentration" 95 C = [0.05, 0.0, 0.0, 0.0]* "mol/l";95 C = [0.05, 0.0, 0.0, 0.0]*'mol/l'; 96 96 "Volume" 97 97 V = Vo; 98 98 99 99 OPTIONS 100 time =[0:5:500]; 100 TimeStep =5; 101 TimeEnd =500; 101 102 end -
branches/newlanguage/sample/reactors/fogler/chap4/spheric_reactor.mso
r82 r171 51 51 52 52 FlowSheet spheric_reactor 53 PARAMETERS 54 rho_0 as dens_mass (Brief="Initial density"); 55 Dp as length (Brief="Particle diameter"); 56 k_lin as Real (Brief="Specific rate of reaction", Unit="m^3/kg/s"); 57 visc as viscosity (Brief="Flow viscosity"); 58 L as length (Brief="Fixed bed half length"); 59 rho_c as dens_mass (Brief="Catalyser density"); 60 phi as fraction (Brief="Fixed bed porosity"); 61 pi as Real (Brief="Number pi", Default=3.14159); 62 R as length (Brief="Radius reactor"); 53 54 PARAMETERS 55 rho_0 as dens_mass (Brief="Initial density"); 56 Dp as length (Brief="Particle diameter"); 57 k_lin as Real (Brief="Specific rate of reaction", Unit='m^3/kg/s'); 58 visc as viscosity (Brief="Flow viscosity"); 59 L as length (Brief="Fixed bed half length"); 60 rho_c as dens_mass (Brief="Catalyser density"); 61 phi as fraction (Brief="Fixed bed porosity"); 62 pi as Real (Brief="Number pi", Default=3.14159); 63 R as length (Brief="Radius reactor"); 63 64 64 65 VARIABLES 65 66 X as fraction (Brief="Molar conversion"); 66 67 y as Real (Brief="Dimensionless pressure drop (P/P0)", Lower=0); 67 P as pressure (Brief="Output pressure", Unit= "kPa");68 P as pressure (Brief="Output pressure", Unit='kPa'); 68 69 z as length (Brief="Length of reactor"); 69 beta0 as Real (Brief="Parameter beta0 of Ergun equation", Unit= "Pa/m");70 beta0 as Real (Brief="Parameter beta0 of Ergun equation", Unit='Pa/m'); 70 71 Ac as area (Brief="Tranversal section area", Lower=0); 71 72 Ca0 as conc_mol (Brief="Input molar concentration of A"); 72 73 Fa0 as flow_mol (Brief="Input molar flow of A"); 73 P0 as pressure (Brief="Initial pressure", Unit= "kPa");74 P0 as pressure (Brief="Initial pressure", Unit='kPa'); 74 75 m as flow_mass (Brief="Mass flow"); 75 76 76 77 EQUATIONS 77 78 "Change time in z" 78 z = time* "m/s";79 z = time*'m/s'; 79 80 80 81 "Transversal section area" … … 86 87 87 88 "Molar conversion" 88 diff(X) = k_lin*(Ca0*(1 - X)/(1 + X)*y)*rho_c*(1 - phi)*Ac/Fa0* "m/s";89 diff(X) = k_lin*(Ca0*(1 - X)/(1 + X)*y)*rho_c*(1 - phi)*Ac/Fa0*'m/s'; 89 90 90 91 "Pressure drop" 91 diff(y) = -beta0/P0/y*(1 + X)* "m/s";92 diff(y) = -beta0/P0/y*(1 + X)*'m/s'; 92 93 93 94 "Dimensionless pressure drop" … … 95 96 96 97 SET 97 rho_0 = 32* "kg/m^3";98 Dp = 0.002* "m";99 k_lin = 2e-5* "m^3/kg/s";100 visc = 1.5e-5* "kg/m/s";101 L = 2.7* "m";102 rho_c = 2600* "kg/m^3";98 rho_0 = 32*'kg/m^3'; 99 Dp = 0.002*'m'; 100 k_lin = 2e-5*'m^3/kg/s'; 101 visc = 1.5e-5*'kg/m/s'; 102 L = 2.7*'m'; 103 rho_c = 2600*'kg/m^3'; 103 104 phi = 0.4; 104 R = 3* "m";105 R = 3*'m'; 105 106 106 107 SPECIFY 107 108 "Input molar concentration of A" 108 Ca0 = 320* "mol/m^3";109 Ca0 = 320*'mol/m^3'; 109 110 "Input molar flow of A" 110 Fa0 = 440* "mol/s";111 Fa0 = 440*'mol/s'; 111 112 "Initial pressure" 112 P0 = 2000* "kPa";113 P0 = 2000*'kPa'; 113 114 "Input mass flow" 114 m = 44* "kg/s";115 m = 44*'kg/s'; 115 116 116 117 INITIAL … … 121 122 122 123 OPTIONS 123 time =[0:0.1:5.4]; 124 TimeStep =0.1; 125 TimeEnd =5.4; 124 126 end -
branches/newlanguage/sample/reactors/fogler/chap6/hidrodesalkeletion.mso
r82 r171 56 56 NReac as Integer (Brief="Number of reactions"); 57 57 stoic(NComp,NReac) as Real (Brief="Stoichiometric coefficients"); 58 k(NReac) as Real (Brief="Specific velocity reaction", Unit= "(ft^3/lbmol)^.5/h");58 k(NReac) as Real (Brief="Specific velocity reaction", Unit='(ft^3/lbmol)^.5/h'); 59 59 P as pressure (Brief="Pressure of reactor"); 60 60 T as temperature (Brief="Temperature of reactor"); 61 R as Real (Brief="Universal gas constant", Unit= "atm*ft^3/degR/lbmol", Default=0.73);61 R as Real (Brief="Universal gas constant", Unit='atm*ft^3/degR/lbmol', Default=0.73); 62 62 yo(NComp) as fraction (Brief="Input molar fraction"); 63 63 vo as flow_vol (Brief="Input volumetric flow"); 64 64 65 65 VARIABLES 66 F(NComp) as flow_mol (Brief="Molar flow", Unit= "lbmol/h");67 C(NComp) as conc_mol (Brief="Molar concentration", Lower=0, Unit= "lbmol/ft^3");68 Co(NComp) as conc_mol (Brief="Input molar concentration", Lower=0, Unit= "lbmol/ft^3");66 F(NComp) as flow_mol (Brief="Molar flow", Unit='lbmol/h'); 67 C(NComp) as conc_mol (Brief="Molar concentration", Lower=0, Unit='lbmol/ft^3'); 68 Co(NComp) as conc_mol (Brief="Input molar concentration", Lower=0, Unit='lbmol/ft^3'); 69 69 70 r(NComp,NReac) as reaction_mol (Brief="Relative rate of reaction", Unit= "lbmol/h/ft^3");71 rate(NComp) as reaction_mol (Brief="Overall rate of reaction", Unit= "lbmol/h/ft^3");72 tau as time_h (Brief="Residence time", Unit= "h");73 V as volume (Brief="Reactor volume", Unit= "ft^3");70 r(NComp,NReac) as reaction_mol (Brief="Relative rate of reaction", Unit='lbmol/h/ft^3'); 71 rate(NComp) as reaction_mol (Brief="Overall rate of reaction", Unit='lbmol/h/ft^3'); 72 tau as time_h (Brief="Residence time", Unit='h'); 73 V as volume (Brief="Reactor volume", Unit='ft^3'); 74 74 75 75 EQUATIONS … … 108 108 stoic(:,2) = [ 0, -1, -1, 1, 1]; # X + H -> T + Me 109 109 110 vo= 476* "ft^3/h";111 T = 1500* "degR";112 P = 35* "atm";110 vo= 476*'ft^3/h'; 111 T = 1500*'degR'; 112 P = 35*'atm'; 113 113 yo= [1/3, 2/3, 0.0, 0.0, 0.0]; 114 k = [55.2, 30.2]* "(ft^3/lbmol)^.5/h";114 k = [55.2, 30.2]*'(ft^3/lbmol)^.5/h'; 115 115 116 116 INITIAL … … 119 119 120 120 OPTIONS 121 time=[0:0.01:0.5]*"h"; 121 TimeStep =0.01; 122 TimeEnd =0.5; 123 TimeUnit = 'h'; 122 124 end -
branches/newlanguage/sample/reactors/fogler/chap8/acetic_anhydride.mso
r82 r171 61 61 Ta as temperature (Brief="Internal temperature"); 62 62 Hr(NComp) as enth_mol (Brief="Enthalpy of component"); 63 R as Real (Brief="Universal gas constant", Unit= "kPa*m^3/kmol/K", Default=8.314);64 U as Real (Brief="Heat transfer coefficient", Unit= "J/m^2/K/s");65 a as Real (Brief="Heat transfer area per volume of tube", Unit= "1/m");63 R as Real (Brief="Universal gas constant", Unit='kPa*m^3/kmol/K', Default=8.314); 64 U as Real (Brief="Heat transfer coefficient", Unit='J/m^2/K/s'); 65 a as Real (Brief="Heat transfer area per volume of tube", Unit='1/m'); 66 66 alpha(NComp)as cp_mol (Brief="Alpha term of Cp expression"); 67 beta(NComp) as Real (Brief="Beta term of Cp expression", Unit= "J/mol/K^2");68 gamma(NComp)as Real (Brief="Gamma term of Cp expression", Unit= "J/mol/K^3");67 beta(NComp) as Real (Brief="Beta term of Cp expression", Unit='J/mol/K^2'); 68 gamma(NComp)as Real (Brief="Gamma term of Cp expression", Unit='J/mol/K^3'); 69 69 70 70 VARIABLES 71 Ca as conc_mol (Brief="Molar concentration of A", Unit= "kmol/m^3");72 Ca0 as conc_mol (Brief="Inlet molar concentration of A", Unit= "mol/m^3");71 Ca as conc_mol (Brief="Molar concentration of A", Unit='kmol/m^3'); 72 Ca0 as conc_mol (Brief="Inlet molar concentration of A", Unit='mol/m^3'); 73 73 Fa0 as flow_mol (Brief="Inlet molar flow of A"); 74 v0 as flow_vol (Brief="Volumetric flow", Unit= "m^3/s");75 r as reaction_mol (Brief="Rate of reaction", Unit= "kmol/m^3/s");76 k as Real (Brief="Specific rate of reaction", Unit= "1/s");77 T as temperature (Brief="Temperature of reactor", Unit= "K");74 v0 as flow_vol (Brief="Volumetric flow", Unit='m^3/s'); 75 r as reaction_mol (Brief="Rate of reaction", Unit='kmol/m^3/s'); 76 k as Real (Brief="Specific rate of reaction", Unit='1/s'); 77 T as temperature (Brief="Temperature of reactor", Unit='K'); 78 78 X as fraction (Brief="Molar conversion", Lower=0); 79 V as volume (Brief="Volume", Unit= "m^3");79 V as volume (Brief="Volume", Unit='m^3'); 80 80 eps as Real (Brief="Parameter epsilon"); 81 Cp(NComp) as cp_mol (Brief="Molar heat capacity", Unit= "J/mol/K");82 DHr as enth_mol (Brief="Enthalpy of reaction", Unit= "kJ/mol");81 Cp(NComp) as cp_mol (Brief="Molar heat capacity", Unit='J/mol/K'); 82 DHr as enth_mol (Brief="Enthalpy of reaction", Unit='kJ/mol'); 83 83 84 84 EQUATIONS 85 85 "Change time in V" 86 V = time* "m^3/s";86 V = time*'m^3/s'; 87 87 88 88 "Molar balance" 89 diff(X) = (-r)/Fa0* "m^3/s";89 diff(X) = (-r)/Fa0*'m^3/s'; 90 90 91 91 "Rate of reaction" … … 93 93 94 94 "Specific rate of reaction" 95 k = exp(34.34)*exp(-34222* "K"/T)*"1/s";95 k = exp(34.34)*exp(-34222*'K'/T)*'1/s'; 96 96 97 97 "Concentration of component A" … … 108 108 109 109 "Energy balance" 110 diff(T)*(Fa0*(Cp(1) + X*sumt(stoic*Cp))) = (U*a*(Ta - T) + (-r)*(-DHr))* "m^3/s";110 diff(T)*(Fa0*(Cp(1) + X*sumt(stoic*Cp))) = (U*a*(Ta - T) + (-r)*(-DHr))*'m^3/s'; 111 111 112 112 "Enthalpy of reaction" … … 131 131 R.stoic = [-1.0, 1.0, 1.0]; # A -> B + C 132 132 133 R.Pa0 = 162* "kPa";134 135 R.alpha = [26.63, 20.04, 13.39]* "J/mol/K";136 R.beta = [0.183, 0.0945, 0.077]* "J/mol/K^2";137 R.gamma = [-45.86e-6, -30.95e-6, -18.71e-6]* "J/mol/K^3";138 139 R.Hr = [-216.67, -61.09, -74.81]* "kJ/mol";140 R.Tr = 298* "K";141 R.T0 = 1035* "K";142 R.Ta = 1150* "K";143 R.U = 0.0* "J/m^2/K/s";144 R.a = 150* "1/m";133 R.Pa0 = 162*'kPa'; 134 135 R.alpha = [26.63, 20.04, 13.39]*'J/mol/K'; 136 R.beta = [0.183, 0.0945, 0.077]*'J/mol/K^2'; 137 R.gamma = [-45.86e-6, -30.95e-6, -18.71e-6]*'J/mol/K^3'; 138 139 R.Hr = [-216.67, -61.09, -74.81]*'kJ/mol'; 140 R.Tr = 298*'K'; 141 R.T0 = 1035*'K'; 142 R.Ta = 1150*'K'; 143 R.U = 0.0*'J/m^2/K/s'; 144 R.a = 150*'1/m'; 145 145 146 146 SPECIFY 147 147 "Inlet molar flow" 148 R.Fa0 = (8000/58)* "kmol/h";148 R.Fa0 = (8000/58)*'kmol/h'; 149 149 150 150 INITIAL … … 152 152 R.X = 0.0; 153 153 "Temperature" 154 R.T = 1035* "K";154 R.T = 1035*'K'; 155 155 156 156 OPTIONS 157 time = [0:0.05:5]; 157 TimeStep = 0.05; 158 TimeEnd = 5; 158 159 end 159 160 … … 171 172 R.stoic = [-1.0, 1.0, 1.0]; # A -> B + C 172 173 173 R.Pa0 = 162* "kPa";174 175 R.alpha = [26.63, 20.04, 13.39]* "J/mol/K";176 R.beta = [0.183, 0.0945, 0.077]* "J/mol/K^2";177 R.gamma = [-45.86e-6, -30.95e-6, -18.71e-6]* "J/mol/K^3";178 179 R.Hr = [-216.67, -61.09, -74.81]* "kJ/mol";180 R.Tr = 298* "K";181 R.T0 = 1035* "K";182 R.Ta = 1150* "K";183 R.U = 110* "J/m^2/K/s";184 R.a = 150* "1/m";174 R.Pa0 = 162*'kPa'; 175 176 R.alpha = [26.63, 20.04, 13.39]*'J/mol/K'; 177 R.beta = [0.183, 0.0945, 0.077]*'J/mol/K^2'; 178 R.gamma = [-45.86e-6, -30.95e-6, -18.71e-6]*'J/mol/K^3'; 179 180 R.Hr = [-216.67, -61.09, -74.81]*'kJ/mol'; 181 R.Tr = 298*'K'; 182 R.T0 = 1035*'K'; 183 R.Ta = 1150*'K'; 184 R.U = 110*'J/m^2/K/s'; 185 R.a = 150*'1/m'; 185 186 186 187 SPECIFY 187 188 "Inlet molar flow" 188 R.Fa0 = (18.8*2e-3)* "mol/s";189 R.Fa0 = (18.8*2e-3)*'mol/s'; 189 190 190 191 INITIAL … … 192 193 R.X = 0.0; 193 194 "Temperature" 194 R.T = 1035* "K";195 R.T = 1035*'K'; 195 196 196 197 OPTIONS 197 time = [0:1e-5:1e-3]; 198 TimeStep = 1e-5; 199 TimeEnd = 1e-3; 198 200 end -
branches/newlanguage/sample/reactors/fogler/chap8/propylene_glycol.mso
r82 r171 57 57 NComp as Integer (Brief="Number of components", Lower=1); 58 58 stoic(NComp)as Real (Brief="Stoichiometric coefficients"); 59 vo(NComp) as flow_vol (Brief="Total input flow", Unit= "ft^3/h");60 Hro(NComp) as enth_mol (Brief="Enthalpy of formation", Unit= "Btu/lbmol");61 To as temperature (Brief="Initial temperature", Unit= "degR");62 Tr as temperature (Brief="Reference temperature", Unit= "degR");63 Cp(NComp) as Real (Brief="Molar heat capacity", Unit= "Btu/lbmol/degR");64 Fo(NComp) as flow_mol (Brief="Input molar flow of component", Unit= "lbmol/h");59 vo(NComp) as flow_vol (Brief="Total input flow", Unit='ft^3/h'); 60 Hro(NComp) as enth_mol (Brief="Enthalpy of formation", Unit='Btu/lbmol'); 61 To as temperature (Brief="Initial temperature", Unit='degR'); 62 Tr as temperature (Brief="Reference temperature", Unit='degR'); 63 Cp(NComp) as Real (Brief="Molar heat capacity", Unit='Btu/lbmol/degR'); 64 Fo(NComp) as flow_mol (Brief="Input molar flow of component", Unit='lbmol/h'); 65 65 V as volume (Brief="Volume of the reactor"); 66 66 # Rate of reaction 67 67 A as frequency (Brief="Frequency factor"); 68 E as Real (Brief="Energy activation", Unit= "Btu/lbmol");69 R as Real (Brief="Universal gas constant", Unit= "Btu/lbmol/degR", Default=1.987);68 E as Real (Brief="Energy activation", Unit='Btu/lbmol'); 69 R as Real (Brief="Universal gas constant", Unit='Btu/lbmol/degR', Default=1.987); 70 70 71 71 VARIABLES 72 T as temperature (Brief="Temperature", Unit= "degR");73 k as Real (Brief="Specific rate of reaction", Unit= "1/h");72 T as temperature (Brief="Temperature", Unit='degR'); 73 k as Real (Brief="Specific rate of reaction", Unit='1/h'); 74 74 XMB as fraction (Brief="Conversion as Material balance"); 75 75 XEB as fraction (Brief="Conversion as Energy balance"); 76 tau as time_h (Brief="Residence time", Unit= "h");76 tau as time_h (Brief="Residence time", Unit='h'); 77 77 Theta(NComp)as Real (Brief="Molar fraction between components"); 78 78 79 79 EQUATIONS 80 80 "Change time in T" 81 T = time* "degR/s";81 T = time*'degR/s'; 82 82 83 83 "Residence time" … … 101 101 stoic = [-1, -1, 1, 0]; # A + B -> C 102 102 103 V = 300* "gal";104 Hro = [-6.66e4, -1.23e5, -2.26e5, 0]* "Btu/lbmol"; # at Tr105 Cp = [35, 18, 46, 19.5]* "Btu/lbmol/degR";106 vo = [46.62, 233.1, 0, 46.62]* "ft^3/h";103 V = 300*'gal'; 104 Hro = [-6.66e4, -1.23e5, -2.26e5, 0]*'Btu/lbmol'; # at Tr 105 Cp = [35, 18, 46, 19.5]*'Btu/lbmol/degR'; 106 vo = [46.62, 233.1, 0, 46.62]*'ft^3/h'; 107 107 108 Fo = [43.04, 802.8, 0, 71.87]* "lbmol/h";109 To = (75 + 459.69)* "degR";110 Tr = (68 + 459.69)* "degR";108 Fo = [43.04, 802.8, 0, 71.87]*'lbmol/h'; 109 To = (75 + 459.69)*'degR'; 110 Tr = (68 + 459.69)*'degR'; 111 111 112 A = 16.96e12* "1/h";113 E = 32400* "Btu/lbmol";112 A = 16.96e12*'1/h'; 113 E = 32400*'Btu/lbmol'; 114 114 115 115 OPTIONS 116 time=[535:0.45:625];116 # time=[535:0.45:625]; 117 117 end 118 118 … … 126 126 NComp as Integer (Brief="Number of components", Lower=1); 127 127 stoic(NComp)as Real (Brief="Stoichiometric coefficients"); 128 vo(NComp) as flow_vol (Brief="Total input flow", Unit= "ft^3/h");129 Hro(NComp) as enth_mol (Brief="Enthalpy of formation", Unit= "Btu/lbmol");128 vo(NComp) as flow_vol (Brief="Total input flow", Unit='ft^3/h'); 129 Hro(NComp) as enth_mol (Brief="Enthalpy of formation", Unit='Btu/lbmol'); 130 130 To as temperature (Brief="Initial temperature"); 131 131 Tr as temperature (Brief="Reference temperature"); 132 132 Ta as temperature (Brief="Temperature of cooling"); 133 Cp(NComp) as Real (Brief="Molar heat capacity", Unit= "Btu/lbmol/degR");134 Fo(NComp) as flow_mol (Brief="Input molar flow of component", Unit= "lbmol/h");133 Cp(NComp) as Real (Brief="Molar heat capacity", Unit='Btu/lbmol/degR'); 134 Fo(NComp) as flow_mol (Brief="Input molar flow of component", Unit='lbmol/h'); 135 135 V as volume (Brief="Volume of the reactor"); 136 136 U as heat_trans_coeff(Brief="Heat transfer coefficient"); … … 138 138 # Rate of reaction 139 139 A as frequency (Brief="Frequency factor"); 140 E as Real (Brief="Energy Activation", Unit= "Btu/lbmol");141 R as Real (Brief="Universal gas constant", Unit= "Btu/lbmol/degR", Default=1.987);140 E as Real (Brief="Energy Activation", Unit='Btu/lbmol'); 141 R as Real (Brief="Universal gas constant", Unit='Btu/lbmol/degR', Default=1.987); 142 142 143 143 VARIABLES 144 144 XMB as fraction (Brief="Molar conversion as Material balance"); 145 145 XEB as fraction (Brief="Molar conversion as Energy balance", Lower=-0.1, Upper=1.5); 146 k as Real (Brief="Specific rate of reaction", Unit= "1/h");147 T as temperature (Brief="Temperature", Unit= "degR");148 tau as time_h (Brief="Residence time", Unit= "h");146 k as Real (Brief="Specific rate of reaction", Unit='1/h'); 147 T as temperature (Brief="Temperature", Unit='degR'); 148 tau as time_h (Brief="Residence time", Unit='h'); 149 149 Theta(NComp)as Real (Brief="Molar fraction between components"); 150 150 151 151 EQUATIONS 152 152 "Change time in T" 153 T = time* "degR/s";153 T = time*'degR/s'; 154 154 155 155 "Specific rate of reaction" … … 174 174 stoic = [-1, -1, 1, 0]; # A + B -> C 175 175 176 V = 300* "gal";177 U = 100* "Btu/ft^2/h/degR";178 a = 40* "ft^2";176 V = 300*'gal'; 177 U = 100*'Btu/ft^2/h/degR'; 178 a = 40*'ft^2'; 179 179 180 Hro = [-6.66e4, -1.23e5, -2.26e5, 0]* "Btu/lbmol"; # at Tr181 Cp = [35, 18, 46, 19.5]* "Btu/lbmol/degR";182 vo = [46.62, 233.1, 0, 46.62]* "ft^3/h";183 Fo = [43.04, 802.8, 0, 71.87]* "lbmol/h";180 Hro = [-6.66e4, -1.23e5, -2.26e5, 0]*'Btu/lbmol'; # at Tr 181 Cp = [35, 18, 46, 19.5]*'Btu/lbmol/degR'; 182 vo = [46.62, 233.1, 0, 46.62]*'ft^3/h'; 183 Fo = [43.04, 802.8, 0, 71.87]*'lbmol/h'; 184 184 185 To = (75 + 459.69)* "degR";186 Tr = (68 + 459.69)* "degR";187 Ta = (85 + 459.69)* "degR";185 To = (75 + 459.69)*'degR'; 186 Tr = (68 + 459.69)*'degR'; 187 Ta = (85 + 459.69)*'degR'; 188 188 189 A = 16.96e12* "1/h";190 E = 32400* "Btu/lbmol";189 A = 16.96e12*'1/h'; 190 E = 32400*'Btu/lbmol'; 191 191 192 192 OPTIONS 193 time=[535:0.45:625]; 193 # time =[535:0.45:625]; original 194 195 TimeStep =0.45; 196 TimeEnd =625; 194 197 end -
branches/newlanguage/sample/reactors/fogler/chap8/series_reactions.mso
r82 r171 56 56 vo as flow_vol (Brief="Volumetric flow"); 57 57 Cp as cp_mol (Brief="Heat capacity"); 58 UA as Real (Brief="Heat change", Unit= "J/min/K");58 UA as Real (Brief="Heat change", Unit='J/min/K'); 59 59 tau as time_min (Brief="Residence time"); 60 60 … … 62 62 Tr_ko(NReac)as temperature (Brief="Reference temperature for ko"); 63 63 64 ko(NReac) as Real (Brief="Frequency factor", Unit= "1/min");64 ko(NReac) as Real (Brief="Frequency factor", Unit='1/min'); 65 65 E(NReac) as energy_mol (Brief="Activation energy"); 66 R as Real (Brief="Universal gas constant", Unit= "cal/mol/K", Default=1.987);66 R as Real (Brief="Universal gas constant", Unit='cal/mol/K', Default=1.987); 67 67 68 68 VARIABLES … … 73 73 kappa as Real (Brief="Kappa parameter"); 74 74 Tc as temperature (Brief="Temperature of reactor surface"); 75 k(NReac) as Real (Brief="Specific rate of reaction", Unit= "1/min");75 k(NReac) as Real (Brief="Specific rate of reaction", Unit='1/min'); 76 76 Co as conc_mol (Brief="Initial concentration of A"); 77 77 To as temperature (Brief="Initial temperature"); … … 79 79 EQUATIONS 80 80 "Temperature profile" 81 diff(T) = 2* "K/min";81 diff(T) = 2*'K/min'; 82 82 83 83 "Parameter kappa" … … 110 110 NReac = 2; # A->B->C 111 111 112 DH = [-5.50e4, -7.15e4]* "J/mol";113 vo = 1000* "m^3/min";112 DH = [-5.50e4, -7.15e4]*'J/mol'; 113 vo = 1000*'m^3/min'; 114 114 115 ko = [ 3.30, 4.58]* "1/min";116 E = [9.9e3, 2.7e4]* "cal/mol";117 Tr_ko = [300, 500]* "K";115 ko = [ 3.30, 4.58]*'1/min'; 116 E = [9.9e3, 2.7e4]*'cal/mol'; 117 Tr_ko = [300, 500]*'K'; 118 118 119 Cp = 200* "J/mol/K";120 UA = 4e4* "J/min/K";121 tau = 0.01* "min";122 Ta = 330* "K";119 Cp = 200*'J/mol/K'; 120 UA = 4e4*'J/min/K'; 121 tau = 0.01*'min'; 122 Ta = 330*'K'; 123 123 124 124 SPECIFY 125 125 "Inlet temperature" 126 To = 283* "K";126 To = 283*'K' ; 127 127 "Inlet concentration of A" 128 Co= 0.3* "mol/m^3";128 Co= 0.3*'mol/m^3'; 129 129 130 130 INITIAL 131 131 "Temperature" 132 T = 283* "K";132 T = 283*'K'; 133 133 134 134 OPTIONS 135 time = [0:2:225]*"min"; 135 TimeStep = 2; 136 TimeEnd = 225; 137 TimeUnit ='min'; 136 138 end
Note: See TracChangeset
for help on using the changeset viewer.