Changeset 170 for branches/newlanguage/sample
- Timestamp:
- Mar 1, 2007, 3:35:36 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/newlanguage/sample/reactors/sample_pfr.mso
r82 r170 36 36 37 37 FlowSheet PFR_AceticAnhydride 38 PARAMETERS 39 PP as CalcObject(Brief="Physical Properties",File="vrpp"); 40 NComp as Integer; 38 39 PARAMETERS 41 40 42 DEVICES 43 s1 as streamTP; 41 PP as Plugin (Brief="Physical Properties",File="vrpp"); 42 NComp as Integer; 43 44 DEVICES 45 46 s1 as source; 44 47 Reac as pfr; 45 48 46 SET 47 PP.Components = ["acetone", "acetic anhydride", "methane" ]; 48 PP.LiquidModel = "PR"; 49 PP.VapourModel = "PR"; 49 SET 50 51 PP.Components = ["acetone", "acetic anhydride", "methane" ]; 52 PP.LiquidModel = "PR"; 53 PP.VapourModel = "PR"; 50 54 51 55 NComp = PP.NumberOfComponents; 52 56 53 Reac.NDisc = 10;54 Reac.Across = 0.7 * "in^2";55 Reac.L = 2.28 * "m";56 Reac.NReac = 1;57 Reac.NDisc = 10; 58 Reac.Across = 0.7 * 'in^2'; 59 Reac.L = 2.28 * 'm'; 60 Reac.NReac = 1; 57 61 58 62 # Reaction 1: A -> B + C 59 63 Reac.stoic(:,1) = [-1, 1, 1]; 60 64 61 65 EQUATIONS 62 66 63 for z in [1:Reac.NDisc] 64 "Reaction Rate = k*C(1)" 65 Reac.r(1,z) = exp(34.34 - (34222 * "K") / Reac.str(z).T)*"1/s" * Reac.C(1,z); 67 for z in [1:Reac.NDisc] 68 69 "Reaction Rate = k*C(1)" 70 Reac.r(1,z) = exp(34.34 - (34222 * 'K') / Reac.str(z).T)*'1/s' * Reac.C(1,z); 66 71 67 68 Reac.Hr(1,z) = -80.77 * "kJ/mol";72 "Heat of reaction" 73 Reac.Hr(1,z) = -80.77 * 'kJ/mol'; 69 74 70 "Pressure Drop (no pressure drop)" 71 Reac.str(z+1).P = Reac.str(z).P; 72 end 75 "Pressure Drop (no pressure drop)" 76 Reac.str(z+1).P = Reac.str(z).P; 73 77 74 SPECIFY 75 s1.F = 138/1000 * "kmol/h"; 76 s1.T = 1035 * "K"; 77 s1.P = 1.6 * "atm"; 78 s1.z = [1, 0, 0]; 78 end 79 79 80 "Adiabatic" 81 Reac.q = 0 * "J/s"; 80 SPECIFY 81 s1.Outlet.F = 138/1000 * 'kmol/h'; 82 s1.Outlet.T = 1035 * 'K'; 83 s1.Outlet.P = 1.6 * 'atm'; 84 s1.Outlet.z = [1, 0, 0]; 85 86 "Adiabatic" 87 Reac.q = 0 * 'J/s'; 82 88 83 CONNECTIONS 84 s1 to Reac.Inlet; 89 CONNECTIONS 90 91 s1.Outlet to Reac.Inlet; 85 92 86 INITIAL 87 for z in [2:Reac.NDisc+1] 88 Reac.str(z).T = Reac.Inlet.T; 89 Reac.str(z).z(1:NComp-1) = Reac.Inlet.z(1:NComp-1); 90 end 93 INITIAL 94 95 for z in [2:Reac.NDisc+1] 91 96 92 OPTIONS 97 Reac.str(z).T = Reac.Inlet.T; 98 Reac.str(z).z(1:NComp-1) = Reac.Inlet.z(1:NComp-1); 99 100 end 101 102 OPTIONS 93 103 # This model can be solved in both steady or dynamic 94 #mode = "steady"; 95 time = [0:0.05:3] * "s"; 96 NLASolver = "sundials"; 104 Dynamic = true; 105 TimeStep = 0.05; 106 TimeEnd = 3; 107 NLASolver = "sundials"; 97 108 #DAESolver = "dassl"; 98 109 end
Note: See TracChangeset
for help on using the changeset viewer.