- Timestamp:
- Nov 19, 2007, 11:52:18 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sample/miscellaneous/sample_gibbs_reactor_simple.mso
r402 r407 43 43 outer NComp as Integer (Brief="Number of components", Default=1); 44 44 45 stoic(NComp) as Real;45 nu(NComp) as Real; 46 46 47 47 R as Real(Brief="Universal gas constant", Unit='J/mol/K', Default=8.314); … … 58 58 T as temperature; 59 59 P as pressure; 60 ni(NComp) as positive(Brief="Initial number of mols", Unit='mol'); 61 n(NComp) as positive(Brief="Number of mols at equilibrium", Unit='mol', Upper=10); 62 advance as Real(Unit='mol', Lower=-10, Upper=10); 63 64 K as Real(Brief="Reaction equilibrium constant at T"); 65 K0 as Real(Brief="Reaction equilibrium constant at T0"); 66 K1 as Real(Brief="Reaction equilibrium constant correction from T0 to T"); 60 n0(NComp) as positive(Brief="Initial number of mols", Unit='mol'); 61 n(NComp) as positive(Brief="Number of mols at equilibrium", Unit='mol'); 62 advance as Real(Unit='mol'); 63 64 K as positive(Brief="Reaction equilibrium constant at T"); 65 K0 as positive(Brief="Reaction equilibrium constant at T0"); 67 66 68 67 phi(NComp) as fugacity(Brief="Fugacity coefficient", Default=1); … … 70 69 EQUATIONS 71 70 "Equilibrium constant at 298 K" 72 K0 = exp(-sum(stoic*G0)/(R*T0)); 73 "Equilibrium constant temperature correction" 74 K1 = exp(sum(stoic*H0)/(R*T0) * (1- T0/T)); 71 K0 = exp(-sum(nu*G0)/(R*T0)); 75 72 "Equilibrium constant at T" 76 K = K 1*K0;77 73 K = K0 * exp(-sum(nu*H0)/R*(1/T - 1/T0)); 74 78 75 "Equilibrium rule" 79 K = prod( (n/sum(n)*phi*P/P0) ^ stoic);76 K = prod( (n/sum(n)*phi*P/P0) ^ nu); 80 77 81 78 "Reaction advance" 82 n = n i + stoic* advance;79 n = n0 + nu * advance; 83 80 84 81 "Fugacity coefficient" … … 99 96 SET 100 97 NComp = PP.NumberOfComponents; 101 stoic= [-1, 1, 1];98 nu = [-1, 1, 1]; 102 99 103 100 SPECIFY 104 101 T = (1000 + 273.15) * 'K'; 105 102 P = 1 * 'atm'; 106 n i= [1, 0, 0] * 'mol';103 n0 = [1, 0, 0] * 'mol'; 107 104 108 105 # Expected results: … … 128 125 SET 129 126 NComp = PP.NumberOfComponents; 130 stoic= [-1, -1, 1];127 nu = [-1, -1, 1]; 131 128 132 129 SPECIFY 133 130 T = (250 + 273.15) * 'K'; 134 131 P = 35 * 'atm'; 135 n i= [1, 5, 0] * 'mol';132 n0 = [1, 5, 0] * 'mol'; 136 133 137 134 # Expected results: … … 155 152 SET 156 153 NComp = PP.NumberOfComponents; 157 stoic= [-1, -1, 1, 1];154 nu = [-1, -1, 1, 1]; 158 155 159 156 SPECIFY 160 157 T = 1100 * 'K'; 161 158 P = 1 * 'bar'; 162 n i= [1, 1, 0, 0] * 'mol';159 n0 = [1, 1, 0, 0] * 'mol'; 163 160 164 161 # Expected results: … … 183 180 SET 184 181 NComp = PP.NumberOfComponents; 185 stoic= [-1, -1, 1, 1];182 nu = [-1, -1, 1, 1]; 186 183 187 184 SPECIFY 188 185 T = 1100 * 'K'; 189 186 P = 1 * 'bar'; 190 n i= [1, 1, 0, 0] * 'mol';187 n0 = [1, 1, 0, 0] * 'mol'; 191 188 192 189 # Expected results: … … 211 208 SET 212 209 NComp = PP.NumberOfComponents; 213 stoic= [-1, -1, 1, 1];210 nu = [-1, -1, 1, 1]; 214 211 215 212 SPECIFY 216 213 T = 1100 * 'K'; 217 214 P = 1 * 'bar'; 218 n i= [1, 2, 0, 0] * 'mol';215 n0 = [1, 2, 0, 0] * 'mol'; 219 216 220 217 # Expected results: … … 238 235 SET 239 236 NComp = PP.NumberOfComponents; 240 stoic= [-1, -1, 2];237 nu = [-1, -1, 2]; 241 238 242 239 SPECIFY 243 240 T = (500 + 273.15) * 'K'; 244 241 P = 1 * 'bar'; 245 n i= [1, 3, 0] * 'mol';242 n0 = [1, 3, 0] * 'mol'; 246 243 247 244 # Expected results: … … 265 262 SET 266 263 NComp = PP.NumberOfComponents; 267 stoic= [-1, -3, 2];264 nu = [-1, -3, 2]; 268 265 269 266 SPECIFY 270 267 T = (500 + 273.15) * 'K'; 271 268 P = 300 * 'bar'; 272 n i= [1, 3, 0] * 'mol';269 n0 = [1, 3, 0] * 'mol'; 273 270 274 271 # Expected results:
Note: See TracChangeset
for help on using the changeset viewer.