Changeset 170 for branches/newlanguage
- Timestamp:
- Mar 1, 2007, 3:35:36 PM (17 years ago)
- Location:
- branches/newlanguage
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/newlanguage/eml/reactors/pfr.mso
r77 r170 30 30 31 31 Model pfr 32 PARAMETERS 33 ext PP as CalcObject (Brief = "External Physical Properties"); 34 ext NComp as Integer(Brief="Number of components"); 35 NReac as Integer(Brief="Number of reactions"); 36 stoic(NComp, NReac) as Real (Brief = "Stoichiometric Matrix"); 37 NDisc as Integer(Brief="Number of points of discretization", Default=10); 38 Mw(NComp) as molweight (Brief="Component Mol Weight"); 32 33 ATTRIBUTES 34 Pallete = true; 35 Brief = "Brief"; 36 Info = 37 "write some information"; 38 39 PARAMETERS 40 41 outer PP as Plugin (Brief = "External Physical Properties"); 42 outer NComp as Integer (Brief="Number of components"); 43 NReac as Integer (Brief="Number of reactions"); 44 stoic(NComp, NReac) as Real (Brief = "Stoichiometric Matrix"); 45 NDisc as Integer (Brief="Number of points of discretization", Default=10); 46 Mw(NComp) as molweight (Brief="Component Mol Weight"); 47 L as length (Brief="Reactor Length"); 48 Across as area (Brief="Cross section area"); 49 50 SET 39 51 40 L as length(Brief="Reactor Length");41 Across as area(Brief="Cross section area");42 43 SET44 52 Mw = PP.MolecularWeight(); 45 53 46 VARIABLES 47 in Inlet as stream; 48 out Outlet as stream; 49 str(NDisc+1) as stream_therm; 54 VARIABLES 55 56 in Inlet as stream (Brief = "Inlet Stream"); 57 out Outlet as stream (Brief = "Outlet Stream"); 58 59 str(NDisc+1) as streamPH; 50 60 vel(NDisc+1) as velocity; 51 61 vol(NDisc+1) as vol_mol; 52 62 rho(NDisc+1) as dens_mass; 53 63 54 q(NDisc) as heat_rate; 55 M(NComp, NDisc) as mol (Brief = "Molar holdup"); 56 Mt(NDisc) as mol (Brief = "Molar holdup"); 57 C(NComp, NDisc) as conc_mol(Brief="Components concentration", Lower=-1e-6); 58 E(NDisc) as energy (Brief="Total Energy Holdup on element"); 59 60 r(NReac, NDisc) as reaction_mol; 61 Hr(NReac, NDisc) as heat_reaction; 64 q(NDisc) as heat_rate; 65 M(NComp, NDisc) as mol (Brief = "Molar holdup"); 66 Mt(NDisc) as mol (Brief = "Molar holdup"); 67 C(NComp, NDisc) as conc_mol (Brief="Components concentration", Lower=-1e-6); 68 E(NDisc) as energy (Brief="Total Energy Holdup on element"); 69 r(NReac, NDisc) as reaction_mol; 70 Hr(NReac, NDisc) as heat_reaction; 62 71 63 EQUATIONS 64 "Vapourisation Fraction" 72 EQUATIONS 73 74 "Vapourisation Fraction" 65 75 str.v = Inlet.v; 66 76 67 77 "Inlet boundary" 68 78 str(1).F = Inlet.F; 69 79 str(1).T = Inlet.T; … … 71 81 str(1).z = Inlet.z; 72 82 73 83 "Outlet boundary" 74 84 Outlet.F = str(NDisc+1).F; 75 85 Outlet.T = str(NDisc+1).T; -
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.