Changeset 188
- Timestamp:
- Mar 7, 2007, 1:53:12 PM (17 years ago)
- Location:
- branches/newlanguage/sample/reactors/fogler
- Files:
-
- 12 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 -
branches/newlanguage/sample/reactors/fogler/chap3/equilibrium_conversion.mso
r171 r188 41 41 * 42 42 *---------------------------------------------------------------------- 43 * Author: Christiano D. W etzelGuerra and Rodolfo Rodrigues43 * Author: Christiano D. W. Guerra and Rodolfo Rodrigues 44 44 * $Id$ 45 45 *--------------------------------------------------------------------*# … … 54 54 Model stream 55 55 PARAMETERS 56 outer 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", DisplayUnit='kmol/l', Lower=0); 60 60 z(NComp)as fraction(Brief="Molar fraction"); 61 61 end … … 77 77 X as fraction (Brief="Molar conversion", Lower=0); 78 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');79 C as conc_mol (Brief="Total outlet concentration", DisplayUnit='mol/l', Lower=0); 80 Co as conc_mol (Brief="Total inlet concentration", DisplayUnit='mol/l', Lower=0); 81 T as temperature (Brief="Temperature"); 82 P as pressure (Brief="Pressure"); 83 83 Theta(NComp) as Real(Brief="Parameter Theta"); 84 84 … … 141 141 X as fraction (Brief="Molar conversion", Lower=0); 142 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');143 C as conc_mol (Brief="Total outlet concentration", DisplayUnit='mol/l', Lower=0); 144 Co as conc_mol (Brief="Total inlet concentration", DisplayUnit='mol/l', Lower=0); 145 T as temperature (Brief="Temperatura"); 146 P as pressure (Brief="Pressure"); 147 147 Theta(NComp) as Real(Brief="Parameter Theta"); 148 148 epsilon as Real (Brief="Parameter epsilon"); -
branches/newlanguage/sample/reactors/fogler/chap3/oxidation_of_so2.mso
r171 r188 51 51 Model stream 52 52 PARAMETERS 53 outer 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", DisplayUnit='mol/l', Lower=0); 57 57 z(NComp)as fraction(Brief="Molar fraction"); 58 58 end … … 71 71 72 72 VARIABLES 73 Inlet as stream; 74 Outlet as stream; 73 Inlet as stream; # Inlet stream 74 Outlet as stream; # Outlet 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", DisplayUnit='mol/l/s'); 77 T as temperature (Brief="Temperature"); 78 P as pressure (Brief="Pressure"); 79 79 Theta(NComp)as Real (Brief="Parameter Theta"); 80 80 epsilon as Real (Brief="Parameter epsilon"); … … 118 118 TimeStep = 0.005; 119 119 TimeEnd = 0.995; 120 121 120 end -
branches/newlanguage/sample/reactors/fogler/chap4/membrane_reactor.mso
r171 r188 40 40 * 41 41 *---------------------------------------------------------------------- 42 * Author: Christiano D. W etzelGuerra and Rodolfo Rodrigues42 * Author: Christiano D. W. Guerra and Rodolfo Rodrigues 43 43 * $Id$ 44 44 *--------------------------------------------------------------------*# … … 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');53 Kc as conc_mol (Brief="Equilibrium constant", DisplayUnit='mol/l'); 54 54 kc as Real (Brief="Mass transfer coefficient", Unit='1/min'); 55 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');58 F(NComp)as flow_mol (Brief="Molar flow", DisplayUnit='mol/min'); 59 C(NComp)as conc_mol (Brief="Molar concentration", DisplayUnit='mol/l', Lower=0); 60 r(NComp)as reaction_mol (Brief="Rate of reaction", DisplayUnit='mol/l/min'); 61 Cto as conc_mol (Brief="Total inlet concentration", DisplayUnit='mol/l'); 62 62 k as Real (Brief="Specific rate of reaction", Unit='1/min'); 63 V as volume (Brief="Volume", Unit='l');63 V as volume (Brief="Volume", DisplayUnit='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"); 66 P as pressure (Brief="Pressure"); 67 67 68 68 EQUATIONS … … 107 107 108 108 OPTIONS 109 TimeStep =10; 110 TimeEnd =500; 109 TimeStep = 10; 110 TimeEnd = 500; 111 TimeUnit = 's'; 111 112 end -
branches/newlanguage/sample/reactors/fogler/chap4/molarflow_pfr.mso
r171 r188 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", DisplayUnit='mol/min'); 55 C(NComp)as conc_mol (Brief="Molar concentration", DisplayUnit='mol/l'); 56 r(NComp)as reaction_mol (Brief="Reaction rate", DisplayUnit='mol/min/l'); 57 Fo(NComp) as flow_mol (Brief="Input molar flow of A", DisplayUnit='mol/min'); 58 Ft as flow_mol (Brief="Total molar flow", DisplayUnit='mol/min'); 59 Cto as conc_mol (Brief="Initial concentration", DisplayUnit='mol/l'); 60 V as volume (Brief="Reactor volume", DisplayUnit='l'); 61 61 62 62 EQUATIONS … … 99 99 100 100 OPTIONS 101 TimeStep=1; 102 TimeEnd=100; 103 DAESolver = "dassl"; 101 TimeStep = 1; 102 TimeEnd = 100; 104 103 end -
branches/newlanguage/sample/reactors/fogler/chap4/semibatch_reactor.mso
r181 r188 38 38 * 39 39 *---------------------------------------------------------------------- 40 * Author: Christiano D. W etzelGuerra and Rodolfo Rodrigues40 * Author: Christiano D. W. Guerra and Rodolfo Rodrigues 41 41 * $Id$ 42 42 *--------------------------------------------------------------------*# … … 98 98 99 99 OPTIONS 100 TimeStep = 5;101 TimeEnd = 500;100 TimeStep = 5; 101 TimeEnd = 500; 102 102 end -
branches/newlanguage/sample/reactors/fogler/chap4/spheric_reactor.mso
r171 r188 41 41 * 42 42 *---------------------------------------------------------------------- 43 * Author: Christiano D. Wetzel Guerra and Rodolfo Rodrigues 44 * GIMSCOP/UFRGS - Group of Integration, Modeling, Simulation, Control, 45 * and Optimization of Processes 43 * Author: Christiano D. W. Guerra and Rodolfo Rodrigues 46 44 * $Id$ 47 45 *--------------------------------------------------------------------*# … … 51 49 52 50 FlowSheet spheric_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"); 51 PARAMETERS 52 rho_0 as dens_mass (Brief="Initial density"); 53 Dp as length (Brief="Particle diameter"); 54 k_lin as Real (Brief="Specific rate of reaction", Unit='m^3/kg/s'); 55 visc as viscosity (Brief="Flow viscosity"); 56 L as length (Brief="Fixed bed half length"); 57 rho_c as dens_mass (Brief="Catalyser density"); 58 phi as fraction (Brief="Fixed bed porosity"); 59 pi as Real (Brief="Number pi", Default=3.14159); 60 R as length (Brief="Radius reactor"); 64 61 65 62 VARIABLES 66 63 X as fraction (Brief="Molar conversion"); 67 64 y as Real (Brief="Dimensionless pressure drop (P/P0)", Lower=0); 68 P as pressure (Brief="Output pressure", Unit='kPa');65 P as pressure (Brief="Output pressure", DisplayUnit='kPa'); 69 66 z as length (Brief="Length of reactor"); 70 67 beta0 as Real (Brief="Parameter beta0 of Ergun equation", Unit='Pa/m'); … … 72 69 Ca0 as conc_mol (Brief="Input molar concentration of A"); 73 70 Fa0 as flow_mol (Brief="Input molar flow of A"); 74 P0 as pressure (Brief="Initial pressure", Unit='kPa');71 P0 as pressure (Brief="Initial pressure", DisplayUnit='kPa'); 75 72 m as flow_mass (Brief="Mass flow"); 76 73 … … 122 119 123 120 OPTIONS 124 TimeStep = 0.1;125 TimeEnd = 5.4;121 TimeStep = 0.1; 122 TimeEnd = 5.4; 126 123 end -
branches/newlanguage/sample/reactors/fogler/chap6/hidrodesalkeletion.mso
r171 r188 40 40 * 41 41 *---------------------------------------------------------------------- 42 * Author: Christiano D. W etzelGuerra and Rodolfo Rodrigues42 * Author: Christiano D. W. Guerra and Rodolfo Rodrigues 43 43 * $Id$ 44 44 *--------------------------------------------------------------------*# … … 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", DisplayUnit='lbmol/h'); 67 C(NComp) as conc_mol (Brief="Molar concentration", Lower=0, DisplayUnit='lbmol/ft^3'); 68 Co(NComp) as conc_mol (Brief="Input molar concentration", Lower=0, DisplayUnit='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", DisplayUnit='lbmol/h/ft^3'); 71 rate(NComp) as reaction_mol (Brief="Overall rate of reaction", DisplayUnit='lbmol/h/ft^3'); 72 tau as time_h (Brief="Residence time", DisplayUnit='h'); 73 V as volume (Brief="Reactor volume", DisplayUnit='ft^3'); 74 74 75 75 EQUATIONS … … 105 105 # 2: X + H -> T + Me 106 106 107 stoic(:,1) = [-1 , -1, 1, 1,0]; # M + H -> X + Me108 stoic(:,2) = [ 0 , -1, -1, 1, 1]; # X + H -> T + Me107 stoic(:,1) = [-1.0, -1.0, 1.0, 1.0, 0.0]; # M + H -> X + Me 108 stoic(:,2) = [ 0.0, -1.0, -1.0, 1.0, 1.0]; # X + H -> T + Me 109 109 110 110 vo= 476*'ft^3/h'; … … 119 119 120 120 OPTIONS 121 TimeStep = 0.01;122 TimeEnd =0.5;121 TimeStep = 0.01; 122 TimeEnd = 0.5; 123 123 TimeUnit = 'h'; 124 124 end -
branches/newlanguage/sample/reactors/fogler/chap8/acetic_anhydride.mso
r171 r188 56 56 NComp as Integer (Brief="Number of components", Lower=1); 57 57 stoic(NComp)as Real (Brief="Stoichiometric number"); 58 Pa 0as pressure (Brief="Input pressure of A");58 Pao as pressure (Brief="Input pressure of A"); 59 59 Tr as temperature (Brief="Reference temperature"); 60 T 0as temperature (Brief="Inlet temperature");60 To as temperature (Brief="Inlet temperature"); 61 61 Ta as temperature (Brief="Internal temperature"); 62 62 Hr(NComp) as enth_mol (Brief="Enthalpy of component"); … … 69 69 70 70 VARIABLES 71 Ca as conc_mol (Brief="Molar concentration of A", Unit='kmol/m^3');72 Ca 0 as conc_mol (Brief="Inlet molar concentration of A",Unit='mol/m^3');73 Fa 0as flow_mol (Brief="Inlet molar flow of A");74 v 0 as flow_vol (Brief="Volumetric flow",Unit='m^3/s');75 r as reaction_mol (Brief="Rate of reaction", Unit='kmol/m^3/s');71 Ca as conc_mol (Brief="Molar concentration of A", DisplayUnit='kmol/m^3'); 72 Cao as conc_mol (Brief="Inlet molar concentration of A", DisplayUnit='mol/m^3'); 73 Fao as flow_mol (Brief="Inlet molar flow of A"); 74 vo as flow_vol (Brief="Volumetric flow", DisplayUnit='m^3/s'); 75 r as reaction_mol (Brief="Rate of reaction", DisplayUnit='kmol/m^3/s'); 76 76 k as Real (Brief="Specific rate of reaction", Unit='1/s'); 77 T as temperature (Brief="Temperature of reactor" , Unit='K');77 T as temperature (Brief="Temperature of reactor"); 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"); 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", DisplayUnit='J/mol/K'); 82 DHr as enth_mol (Brief="Enthalpy of reaction", DisplayUnit='kJ/mol'); 83 83 84 84 EQUATIONS … … 87 87 88 88 "Molar balance" 89 diff(X) = (-r)/Fa 0*'m^3/s';89 diff(X) = (-r)/Fao*'m^3/s'; 90 90 91 91 "Rate of reaction" … … 96 96 97 97 "Concentration of component A" 98 Ca = Ca 0*(1 - X)/(1 + eps*X)*T0/T;98 Ca = Cao*(1 - X)/(1 + eps*X)*To/T; 99 99 100 100 "Parameter epsilon" … … 102 102 103 103 "Inlet molar concentration of A" 104 Ca 0 = Pa0/(R*T0);104 Cao = Pao/(R*To); 105 105 106 106 "Volumetric flow" 107 Fa 0 = Ca0*v0;107 Fao = Cao*vo; 108 108 109 109 "Energy balance" 110 diff(T)*(Fa 0*(Cp(1) + X*sumt(stoic*Cp))) = (U*a*(Ta - T) + (-r)*(-DHr))*'m^3/s';110 diff(T)*(Fao*(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.Pa 0= 162*'kPa';133 R.Pao = 162*'kPa'; 134 134 135 135 R.alpha = [26.63, 20.04, 13.39]*'J/mol/K'; … … 139 139 R.Hr = [-216.67, -61.09, -74.81]*'kJ/mol'; 140 140 R.Tr = 298*'K'; 141 R.T 0= 1035*'K';141 R.To = 1035*'K'; 142 142 R.Ta = 1150*'K'; 143 143 R.U = 0.0*'J/m^2/K/s'; … … 146 146 SPECIFY 147 147 "Inlet molar flow" 148 R.Fa 0= (8000/58)*'kmol/h';148 R.Fao = (8000/58)*'kmol/h'; 149 149 150 150 INITIAL … … 157 157 TimeStep = 0.05; 158 158 TimeEnd = 5; 159 TimeUnit = 's'; 159 160 end 160 161 … … 172 173 R.stoic = [-1.0, 1.0, 1.0]; # A -> B + C 173 174 174 R.Pa 0= 162*'kPa';175 R.Pao = 162*'kPa'; 175 176 176 177 R.alpha = [26.63, 20.04, 13.39]*'J/mol/K'; … … 180 181 R.Hr = [-216.67, -61.09, -74.81]*'kJ/mol'; 181 182 R.Tr = 298*'K'; 182 R.T 0= 1035*'K';183 R.To = 1035*'K'; 183 184 R.Ta = 1150*'K'; 184 185 R.U = 110*'J/m^2/K/s'; … … 187 188 SPECIFY 188 189 "Inlet molar flow" 189 R.Fa 0= (18.8*2e-3)*'mol/s';190 R.Fao = (18.8*2e-3)*'mol/s'; 190 191 191 192 INITIAL … … 198 199 TimeStep = 1e-5; 199 200 TimeEnd = 1e-3; 201 TimeUnit = 's'; 200 202 end -
branches/newlanguage/sample/reactors/fogler/chap8/propylene_glycol.mso
r171 r188 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');59 vo(NComp) as flow_vol (Brief="Total input flow", DisplayUnit='ft^3/h'); 60 Hro(NComp) as enth_mol (Brief="Enthalpy of formation", DisplayUnit='Btu/lbmol'); 61 To as temperature (Brief="Initial temperature", DisplayUnit='degR'); 62 Tr as temperature (Brief="Reference temperature", DisplayUnit='degR'); 63 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');64 Fo(NComp) as flow_mol (Brief="Input molar flow of component", DisplayUnit='lbmol/h'); 65 65 V as volume (Brief="Volume of the reactor"); 66 66 # Rate of reaction … … 70 70 71 71 VARIABLES 72 T as temperature (Brief="Temperature", Unit='degR');72 T as temperature (Brief="Temperature", DisplayUnit='degR'); 73 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"); 77 77 Theta(NComp)as Real (Brief="Molar fraction between components"); 78 78 … … 114 114 115 115 OPTIONS 116 # time=[535:0.45:625]; 116 TimeStart = 535; 117 TimeStep = 0.45; 118 TimeEnd = 625; 117 119 end 118 120 … … 126 128 NComp as Integer (Brief="Number of components", Lower=1); 127 129 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');130 vo(NComp) as flow_vol (Brief="Total input flow", DisplayUnit='ft^3/h'); 131 Hro(NComp) as enth_mol (Brief="Enthalpy of formation", DisplayUnit='Btu/lbmol'); 130 132 To as temperature (Brief="Initial temperature"); 131 133 Tr as temperature (Brief="Reference temperature"); 132 134 Ta as temperature (Brief="Temperature of cooling"); 133 135 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');136 Fo(NComp) as flow_mol (Brief="Input molar flow of component", DisplayUnit='lbmol/h'); 135 137 V as volume (Brief="Volume of the reactor"); 136 138 U as heat_trans_coeff(Brief="Heat transfer coefficient"); … … 145 147 XEB as fraction (Brief="Molar conversion as Energy balance", Lower=-0.1, Upper=1.5); 146 148 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 T as temperature (Brief="Temperature", DisplayUnit='degR'); 150 tau as time_h (Brief="Residence time"); 149 151 Theta(NComp)as Real (Brief="Molar fraction between components"); 150 152 … … 191 193 192 194 OPTIONS 193 # time =[535:0.45:625]; original 194 195 TimeStep =0.45; 196 TimeEnd =625; 195 TimeStart = 535; 196 TimeStep = 0.45; 197 TimeEnd = 625; 197 198 end -
branches/newlanguage/sample/reactors/fogler/chap8/series_reactions.mso
r171 r188 40 40 * 41 41 *---------------------------------------------------------------------- 42 * Author: Christiano D. W etzelGuerra and Rodolfo Rodrigues42 * Author: Christiano D. W. Guerra and Rodolfo Rodrigues 43 43 * $Id$ 44 44 *--------------------------------------------------------------------*# … … 113 113 vo = 1000*'m^3/min'; 114 114 115 ko = [ 3.30, 4.58] *'1/min';115 ko = [ 3.30, 4.58]/'min'; 116 116 E = [9.9e3, 2.7e4]*'cal/mol'; 117 117 Tr_ko = [300, 500]*'K'; … … 124 124 SPECIFY 125 125 "Inlet temperature" 126 To = 283*'K' 126 To = 283*'K'; 127 127 "Inlet concentration of A" 128 128 Co= 0.3*'mol/m^3'; … … 133 133 134 134 OPTIONS 135 TimeStep = 2;135 TimeStep = 0; 136 136 TimeEnd = 225; 137 TimeUnit = 'min';137 TimeUnit = 'min'; 138 138 end -
branches/newlanguage/sample/reactors/fogler/chap9/cstr_startup.mso
r82 r188 57 57 NComp as Integer (Brief="Number of components"); 58 58 stoic(NComp)as Real (Brief="Stoichiometric number"); 59 UA as Real (Brief="Exchange heat", Unit= "Btu/h/degR");59 UA as Real (Brief="Exchange heat", Unit='Btu/h/degR'); 60 60 V as volume (Brief="Volume of the reactor"); 61 61 Ta1 as temperature (Brief="Cooling temperature"); … … 66 66 ko as frequency (Brief="Frequency factor"); 67 67 E as energy_mol (Brief="Activation energy"); 68 R as Real (Brief="Universal gas constant", Unit= "Btu/lbmol/degR", Default=1.987);68 R as Real (Brief="Universal gas constant", Unit='Btu/lbmol/degR', Default=1.987); 69 69 70 70 VARIABLES 71 C(NComp) as conc_mol (Brief="Molar concentration", Unit="lbmol/ft^3", Lower=0);72 N(NComp) as mol (Brief="Molar holdup", Unit="lbmol");73 Co(NComp) as conc_mol (Brief="Initial molar concentration", Unit="lbmol/ft^3", Lower=0);74 Fo(NComp) as flow_mol (Brief="Initial molar flow", Unit="lbmol/h");75 T as temperature (Brief="Reactor temperature", Unit="degR");76 To as temperature (Brief="Initial reactor temperature", Unit="degR");77 Ta2 as temperature (Brief="Temperature of heat exchange", Unit="degR");78 r(NComp) as reaction_mol (Brief="Rate of reaction", Unit="lbmol/ft^3/h");79 k as frequency (Brief="Specific rate of reaction", Unit="1/h", Upper=1e5);80 mc as flow_mol (Brief="Molar flow of cooling water", Unit="lbmol/h");81 Q as heat_rate (Brief="Heat exchange", Unit="Btu/h");71 C(NComp) as conc_mol (Brief="Molar concentration", DisplayUnit='lbmol/ft^3', Lower=0); 72 N(NComp) as mol (Brief="Molar holdup", DisplayUnit='lbmol'); 73 Co(NComp) as conc_mol (Brief="Initial molar concentration", DisplayUnit='lbmol/ft^3', Lower=0); 74 Fo(NComp) as flow_mol (Brief="Initial molar flow", DisplayUnit='lbmol/h'); 75 T as temperature (Brief="Reactor temperature", DisplayUnit='degR'); 76 To as temperature (Brief="Initial reactor temperature", DisplayUnit='degR'); 77 Ta2 as temperature (Brief="Temperature of heat exchange", DisplayUnit='degR'); 78 r(NComp) as reaction_mol (Brief="Rate of reaction", DisplayUnit='lbmol/ft^3/h'); 79 k as frequency (Brief="Specific rate of reaction", DisplayUnit='1/h', Upper=1e5); 80 mc as flow_mol (Brief="Molar flow of cooling water", DisplayUnit='lbmol/h'); 81 Q as heat_rate (Brief="Heat exchange", DisplayUnit='Btu/h'); 82 82 Theta(NComp)as Real (Brief="Parameter Theta"); 83 vo as flow_vol (Brief="Volumetric flow", Unit="ft^3/h");84 tau as time_h (Brief="Residence time", Unit="h");83 vo as flow_vol (Brief="Volumetric flow", DisplayUnit='ft^3/h'); 84 tau as time_h (Brief="Residence time", DisplayUnit='h'); 85 85 86 86 EQUATIONS … … 122 122 stoic = [-1, -1, 1, 0]; # A + 2B -> C + D 123 123 124 UA = 16000* "Btu/h/degR";125 V = 500* "gal";126 Ta1 = (60 + 460)* "degR";127 DH =-3.6e4* "Btu/lbmol";128 rho = [0.923, 3.45, 1, 1.54]* "lbmol/ft^3";129 cp = [35, 18, 46, 19.5]* "Btu/lbmol/degR";130 131 ko = 16.96e12* "1/h";132 E = -32400* "Btu/lbmol";124 UA = 16000*'Btu/h/degR'; 125 V = 500*'gal'; 126 Ta1 = (60 + 460)*'degR'; 127 DH =-3.6e4*'Btu/lbmol'; 128 rho = [0.923, 3.45, 1, 1.54]*'lbmol/ft^3'; 129 cp = [35, 18, 46, 19.5]*'Btu/lbmol/degR'; 130 131 ko = 16.96e12*'1/h'; 132 E = -32400*'Btu/lbmol'; 133 133 end 134 134 … … 140 140 SPECIFY 141 141 "Inlet molar flow" 142 CSTR.Fo = [80, 1000, 0, 100]* "lbmol/h";142 CSTR.Fo = [80, 1000, 0, 100]*'lbmol/h'; 143 143 "Inlet reactor temperature" 144 CSTR.To = (75 + 460)* "degR";144 CSTR.To = (75 + 460)*'degR'; 145 145 "Molar flow of cooling water" 146 CSTR.mc = 1e3* "lbmol/h";146 CSTR.mc = 1e3*'lbmol/h'; 147 147 148 148 INITIAL 149 149 "Molar concentration" 150 CSTR.C = [0, 3.45, 0, 0]* "lbmol/ft^3";150 CSTR.C = [0, 3.45, 0, 0]*'lbmol/ft^3'; 151 151 "Reactor temperature" 152 152 CSTR.T = CSTR.To; 153 153 154 154 OPTIONS 155 time = [0:0.05:4]*"h"; 155 TimeStep = 0.05; 156 TimeEnd = 4; 157 TimeUnit = 'h'; 156 158 end 157 159 … … 185 187 SPECIFY 186 188 "Inlet molar flow" 187 CSTR.Fo = [80, 1000, 0, 100]* "lbmol/h";189 CSTR.Fo = [80, 1000, 0, 100]*'lbmol/h'; 188 190 "Inlet reactor temperature" 189 CSTR.To = (70 + 460)* "degR"; # Reduction of temperature: 75°F to 70°F191 CSTR.To = (70 + 460)*'degR'; # Reduction of temperature: 75°F to 70°F 190 192 "Molar flow of cooling water" 191 CSTR.mc = 1e3* "lbmol/h";193 CSTR.mc = 1e3*'lbmol/h'; 192 194 193 195 INITIAL 194 196 "Molar concentration" 195 CSTR.C = [0.039, 2.12, 0.143, 0.226]* "lbmol/ft^3"; # Final values of SS in 9-4197 CSTR.C = [0.039, 2.12, 0.143, 0.226]*'lbmol/ft^3'; # Final values of SS in 9-4 196 198 "Reactor temperature" 197 CSTR.T = (138.5 + 460)* "degR"; # Final values of SS in 9-4199 CSTR.T = (138.5 + 460)*'degR'; # Final values of SS in 9-4 198 200 199 201 OPTIONS 200 time = [0:0.05:4]*"h"; 202 TimeStep = 0.05; 203 TimeEnd = 4; 204 TimeUnit = 'h'; 201 205 end 202 206 … … 210 214 Tsp as temperature (Brief="Reference temperature"); 211 215 mco as flow_mol (Brief="Molar flow of cooling water"); 212 kc as Real (Brief="Gain", Unit= "lbmol/degR/h");216 kc as Real (Brief="Gain", Unit='lbmol/degR/h'); 213 217 214 218 VARIABLES 215 I as Real (Brief="Integral action", Unit= "degR*h");219 I as Real (Brief="Integral action", Unit='degR*h'); 216 220 X as fraction (Brief="Fraction conversion", Lower=0); 217 221 … … 233 237 234 238 SET 235 CSTR.mco = 1000* "lbmol/h";236 CSTR.Tsp = (138 + 460)* "degR";237 CSTR.kc = 8.5 ;239 CSTR.mco = 1000*'lbmol/h'; 240 CSTR.Tsp = (138 + 460)*'degR'; 241 CSTR.kc = 8.5*'lbmol/degR/h'; 238 242 239 243 SPECIFY 240 244 "Inlet molar flow" 241 CSTR.Fo = [80, 1000, 0, 100]* "lbmol/h";245 CSTR.Fo = [80, 1000, 0, 100]*'lbmol/h'; 242 246 "Inlet reactor temperature" 243 CSTR.To = (70 + 460)* "degR";247 CSTR.To = (70 + 460)*'degR'; 244 248 245 249 INITIAL 246 250 "Molar concentration" 247 CSTR.C = [0.03789, 2.12, 0.143, 0.2265]* "lbmol/ft^3";251 CSTR.C = [0.03789, 2.12, 0.143, 0.2265]*'lbmol/ft^3'; 248 252 "Reactor temperature" 249 CSTR.T = (138.53 + 460)* "degR";253 CSTR.T = (138.53 + 460)*'degR'; 250 254 "Integral action" 251 CSTR.I = 0 ;255 CSTR.I = 0*'degR*h'; 252 256 253 257 OPTIONS 254 time = [0:0.01:4]*"h"; 255 end 258 TimeStep = 0.01; 259 TimeEnd = 4; 260 TimeUnit = 'h'; 261 end
Note: See TracChangeset
for help on using the changeset viewer.