Changeset 125 for branches/newlanguage
- Timestamp:
- Jan 22, 2007, 5:57:16 PM (15 years ago)
- Location:
- branches/newlanguage
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/newlanguage/eml/pressure_changers/pump.mso
r75 r125 33 33 34 34 PARAMETERS 35 ext NComp as Integer (Brief = "Number of chemical components", Lower = 1);36 ext PP as CalcObject (Brief = "External Physical Properties");35 outer PP as Plugin (Brief = "External Physical Properties"); 36 outer NComp as Integer (Brief = "Number of chemical components", Lower = 1); 37 37 Mw(NComp) as molweight (Brief = "Molar Weight"); 38 38 Eff as positive (Default = 0.72, Brief = "Pump Efficiency"); … … 147 147 Model pump 148 148 PARAMETERS 149 ext PP as CalcObject;150 extNComp as Integer;149 outer PP as Plugin; 150 outer NComp as Integer; 151 151 152 152 VARIABLES 153 153 in Inlet as stream; 154 out Outlet as stream _therm;154 out Outlet as streamPH; 155 155 156 156 dP as press_delta (Brief="Pump head"); … … 164 164 Outlet.P = Inlet.P + dP; 165 165 166 "Temperature" 167 Outlet.T = Inlet.T; 168 169 "Vapourisation Fraction" 170 Outlet.v = Inlet.v; 166 "FIXME: pump potency" 167 Outlet.h = Inlet.h; 171 168 end -
branches/newlanguage/eml/stage_separators/column.mso
r102 r125 46 46 Model Section_Column 47 47 PARAMETERS 48 ext PP as CalcObject;49 extNComp as Integer;48 outer PP as Plugin; 49 outer NComp as Integer; 50 50 NTrays as Integer(Brief="Number of trays", Default=2); 51 51 topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1); … … 86 86 Model Distillation_kettle_cond 87 87 PARAMETERS 88 ext PP as CalcObject;89 extNComp as Integer;88 outer PP as Plugin; 89 outer NComp as Integer; 90 90 NTrays as Integer(Brief="Number of trays", Default=2); 91 91 topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1); … … 157 157 Model Distillation_thermosyphon_subcooling 158 158 PARAMETERS 159 ext PP as CalcObject;160 extNComp as Integer;159 outer PP as Plugin; 160 outer NComp as Integer; 161 161 NTrays as Integer(Brief="Number of trays", Default=2); 162 162 topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1); … … 233 233 Model Distillation_thermosyphon_cond 234 234 PARAMETERS 235 ext PP as CalcObject;236 extNComp as Integer;235 outer PP as Plugin; 236 outer NComp as Integer; 237 237 NTrays as Integer(Brief="Number of trays", Default=2); 238 238 topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1); … … 305 305 Model Distillation_kettle_subcooling 306 306 PARAMETERS 307 ext PP as CalcObject;308 extNComp as Integer;307 outer PP as Plugin; 308 outer NComp as Integer; 309 309 NTrays as Integer(Brief="Number of trays", Default=2); 310 310 topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1); … … 372 372 Model Rectifier 373 373 PARAMETERS 374 ext PP as CalcObject;375 extNComp as Integer;374 outer PP as Plugin; 375 outer NComp as Integer; 376 376 NTrays as Integer(Brief="Number of trays", Default=2); 377 377 topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1); … … 428 428 Model Rectifier_subcooling 429 429 PARAMETERS 430 ext PP as CalcObject;431 extNComp as Integer;430 outer PP as Plugin; 431 outer NComp as Integer; 432 432 NTrays as Integer(Brief="Number of trays", Default=2); 433 433 topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1); … … 483 483 Model Refluxed_Stripping 484 484 PARAMETERS 485 ext PP as CalcObject;486 extNComp as Integer;485 outer PP as Plugin; 486 outer NComp as Integer; 487 487 NTrays as Integer(Brief="Number of trays", Default=2); 488 488 topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1); … … 539 539 Model Refluxed_Stripping_subcooling 540 540 PARAMETERS 541 ext PP as CalcObject;542 extNComp as Integer;541 outer PP as Plugin; 542 outer NComp as Integer; 543 543 NTrays as Integer(Brief="Number of trays", Default=2); 544 544 topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1); … … 594 594 Model Refluxed_Absorption 595 595 PARAMETERS 596 ext PP as CalcObject;597 extNComp as Integer;596 outer PP as Plugin; 597 outer NComp as Integer; 598 598 NTrays as Integer(Brief="Number of trays", Default=2); 599 599 topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1); … … 651 651 Model Refluxed_Absorption_subcooling 652 652 PARAMETERS 653 ext PP as CalcObject;654 extNComp as Integer;653 outer PP as Plugin; 654 outer NComp as Integer; 655 655 NTrays as Integer(Brief="Number of trays", Default=2); 656 656 topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1); … … 706 706 Model Reboiled_Stripping_kettle 707 707 PARAMETERS 708 ext PP as CalcObject;709 extNComp as Integer;708 outer PP as Plugin; 709 outer NComp as Integer; 710 710 NTrays as Integer(Brief="Number of trays", Default=2); 711 711 topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1); … … 762 762 Model Reboiled_Stripping_thermosyphon 763 763 PARAMETERS 764 ext PP as CalcObject;765 extNComp as Integer;764 outer PP as Plugin; 765 outer NComp as Integer; 766 766 NTrays as Integer(Brief="Number of trays", Default=2); 767 767 topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1); … … 820 820 Model Reboiled_Absorption_kettle 821 821 PARAMETERS 822 ext PP as CalcObject;823 extNComp as Integer;822 outer PP as Plugin; 823 outer NComp as Integer; 824 824 NTrays as Integer(Brief="Number of trays", Default=2); 825 825 topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1); … … 876 876 Model Reboiled_Absorption_thermosyphon 877 877 PARAMETERS 878 ext PP as CalcObject;879 extNComp as Integer;878 outer PP as Plugin; 879 outer NComp as Integer; 880 880 NTrays as Integer(Brief="Number of trays", Default=2); 881 881 topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1); … … 930 930 Model ReactiveDistillation 931 931 PARAMETERS 932 ext PP as CalcObject;933 extNComp as Integer;932 outer PP as Plugin; 933 outer NComp as Integer; 934 934 NTrays as Integer(Brief="Number of trays", Default=2); 935 935 -
branches/newlanguage/eml/stage_separators/condenser.mso
r72 r125 43 43 Model condenser 44 44 PARAMETERS 45 ext PP as CalcObject;46 extNComp as Integer;45 outer PP as Plugin; 46 outer NComp as Integer; 47 47 V as volume (Brief="Condenser total volume"); 48 48 Across as area (Brief="Cross Section Area of reboiler"); 49 49 50 50 VARIABLES 51 in InletV as stream ; #(Brief="Vapour inlet stream");52 out OutletL as stream_therm; #(Brief="Liquid outlet stream");53 out OutletV as stream_therm; #(Brief="Vapour outlet stream");51 in InletV as stream(Brief="Vapour inlet stream"); 52 out OutletL as liquid_stream(Brief="Liquid outlet stream"); 53 out OutletV as vapour_stream(Brief="Vapour outlet stream"); 54 54 in Q as heat_rate (Brief="Heat supplied"); 55 55 … … 101 101 "Level of liquid phase" 102 102 Level = ML*vL/Across; 103 104 "Vapourisation Fraction"105 OutletL.v = 0.0;106 OutletV.v = 1.0;107 103 end 108 104 … … 113 109 Model condenserSteady 114 110 PARAMETERS 115 ext PP as CalcObject;116 extNComp as Integer;111 outer PP as Plugin; 112 outer NComp as Integer; 117 113 118 114 VARIABLES 119 in InletV as stream ; #(Brief="Vapour inlet stream");120 out OutletL as stream_therm; #(Brief="Liquid outlet stream");115 in InletV as stream(Brief="Vapour inlet stream"); 116 out OutletL as liquid_stream(Brief="Liquid outlet stream"); 121 117 in Q as heat_rate (Brief="Heat supplied"); 122 118 DP as press_delta (Brief="Pressure Drop in the condenser"); … … 142 138 Model condenserReact 143 139 PARAMETERS 144 ext PP as CalcObject;145 extNComp as Integer;140 outer PP as Plugin; 141 outer NComp as Integer; 146 142 V as volume (Brief="Condenser total volume"); 147 143 Across as area (Brief="Cross Section Area of reboiler"); … … 152 148 153 149 VARIABLES 154 in InletV as stream ; #(Brief="Vapour inlet stream");155 out OutletL as stream_therm; #(Brief="Liquid outlet stream");156 out OutletV as stream_therm; #(Brief="Vapour outlet stream");150 in InletV as stream(Brief="Vapour inlet stream"); 151 out OutletL as liquid_stream(Brief="Liquid outlet stream"); 152 out OutletV as vapour_stream(Brief="Vapour outlet stream"); 157 153 158 154 M(NComp) as mol (Brief="Molar Holdup in the tray"); … … 208 204 Level = ML*vL/Across; 209 205 210 "Vapourisation Fraction"211 OutletL.v = 0.0;212 OutletV.v = 1.0;213 214 206 "Chemical Equilibrium" 215 207 PP.LiquidFugacityCoefficient(OutletL.T, OutletL.P, OutletL.z)*OutletL.z = … … 217 209 218 210 sum(OutletL.z)=sum(OutletV.z); 219 220 211 end -
branches/newlanguage/eml/stage_separators/reboiler.mso
r72 r125 48 48 Model reboiler 49 49 PARAMETERS 50 ext PP as CalcObject;51 extNComp as Integer;50 outer PP as Plugin; 51 outer NComp as Integer; 52 52 Across as area (Brief="Cross Section Area of reboiler"); 53 53 V as volume (Brief="Total volume of reboiler"); 54 54 55 55 VARIABLES 56 in Inlet as stream ; #(Brief="Feed Stream");57 in InletL as stream ; #(Brief="Liquid inlet stream");58 out OutletL as stream_therm; #(Brief="Liquid outlet stream");59 out OutletV as stream_therm; #(Brief="Vapour outlet stream");56 in Inlet as stream(Brief="Feed Stream"); 57 in InletL as stream(Brief="Liquid inlet stream"); 58 out OutletL as liquid_stream(Brief="Liquid outlet stream"); 59 out OutletV as vapour_stream(Brief="Vapour outlet stream"); 60 60 in Q as heat_rate (Brief="Heat supplied"); 61 61 … … 112 112 "Level of liquid phase" 113 113 Level = ML*vL/Across; 114 115 "vaporization fraction"116 OutletV.v = 1.0;117 OutletL.v = 0.0;118 114 end 119 115 … … 123 119 Model reboilerSteady 124 120 PARAMETERS 125 ext PP as CalcObject;126 extNComp as Integer;121 outer PP as Plugin; 122 outer NComp as Integer; 127 123 DP as press_delta (Brief="Pressure Drop in the reboiler"); 128 124 129 125 VARIABLES 130 in InletL as stream ; #(Brief="Liquid inlet stream");131 out OutletV as stream_therm; #(Brief="Vapour outlet stream");126 in InletL as stream(Brief="Liquid inlet stream"); 127 out OutletV as vapour_stream(Brief="Vapour outlet stream"); 132 128 in Q as heat_rate (Brief="Heat supplied"); 133 129 vV as volume_mol (Brief="Vapour Molar volume"); … … 150 146 "Pressure" 151 147 DP = InletL.P - OutletV.P; 152 153 "Vapourisation Fraction"154 OutletV.v = 1.0;155 148 end 156 149 … … 162 155 Model reboilerSteady_fakeH 163 156 PARAMETERS 164 ext PP as CalcObject;165 extNComp as Integer;157 outer PP as Plugin; 158 outer NComp as Integer; 166 159 DP as press_delta (Brief="Pressure Drop in the reboiler"); 167 160 k as Real (Brief = "Flow Constant", Unit="mol/J"); 168 161 169 162 VARIABLES 170 in InletL as stream ; #(Brief="Liquid inlet stream");171 out OutletV as stream ; #(Brief="Vapour outlet stream");163 in InletL as stream(Brief="Liquid inlet stream"); 164 out OutletV as stream(Brief="Vapour outlet stream"); 172 165 in Q as heat_rate (Brief="Heat supplied"); 173 166 … … 198 191 Model reboilerReact 199 192 PARAMETERS 200 ext PP as CalcObject;201 extNComp as Integer;193 outer PP as Plugin; 194 outer NComp as Integer; 202 195 Across as area (Brief="Cross Section Area of reboiler"); 203 196 V as volume (Brief="Total volume of reboiler"); … … 208 201 209 202 VARIABLES 210 in Inlet as stream ; #(Brief="Feed Stream");211 in InletL as stream ; #(Brief="Liquid inlet stream");212 out OutletL as stream_therm; #(Brief="Liquid outlet stream");213 out OutletV as stream_therm; #(Brief="Vapour outlet stream");203 in Inlet as stream(Brief="Feed Stream"); 204 in InletL as stream(Brief="Liquid inlet stream"); 205 out OutletL as liquid_stream(Brief="Liquid outlet stream"); 206 out OutletV as vapour_stream(Brief="Vapour outlet stream"); 214 207 215 208 Q as heat_rate (Brief="Heat supplied"); … … 260 253 Vol = ML*vL; 261 254 262 "vaporization fraction "263 OutletV.v = 1.0;264 OutletL.v = 0.0;265 266 255 "Mechanical Equilibrium" 267 256 OutletL.P = OutletV.P; … … 271 260 272 261 "Geometry Constraint" 273 V = ML*vL + MV*vV; 262 V = ML*vL + MV*vV; 274 263 275 264 "Chemical Equilibrium" -
branches/newlanguage/eml/stage_separators/tank.mso
r72 r125 39 39 40 40 PARAMETERS 41 ext PP as CalcObject;42 extNComp as Integer;41 outer PP as Plugin; 42 outer NComp as Integer; 43 43 Across as area (Brief="Tank cross section area", Default=2); 44 44 45 45 VARIABLES 46 46 in Inlet as stream; 47 out Outlet as stream_therm;47 out Outlet as liquid_stream; 48 48 49 49 in Q as heat_rate (Brief="Rate of heat supply"); … … 74 74 "Level of liquid phase" 75 75 Level = sum(M)*vL/Across; 76 77 "Vapourisation Fraction"78 Outlet.v = Inlet.v;79 76 end 80 77 … … 87 84 88 85 PARAMETERS 89 ext PP as CalcObject;90 extNComp as Integer;86 outer PP as Plugin; 87 outer NComp as Integer; 91 88 radius as length(Brief="Tank radius"); 92 89 L as length(Brief="Tank length"); … … 94 91 VARIABLES 95 92 in Inlet as stream; 96 out Outlet as stream_therm;93 out Outlet as liquid_stream; 97 94 98 95 in Q as heat_rate (Brief="Rate of heat supply"); … … 128 125 "Level of liquid phase" 129 126 Level = sum(M)*vL/Across; 130 131 "Vapourisation Fraction"132 Outlet.v = Inlet.v;133 127 end 134 128 … … 154 148 155 149 PARAMETERS 156 ext PP as CalcObject;157 extNComp as Integer;150 outer PP as Plugin; 151 outer NComp as Integer; 158 152 Across as area (Brief="Tank cross section area", Default=2); 159 153 … … 161 155 in Feed as stream; 162 156 in Inlet as stream; 163 out Outlet as stream_therm;157 out Outlet as liquid_stream; 164 158 165 159 in Q as heat_rate (Brief="Rate of heat supply"); … … 190 184 "Level of liquid phase" 191 185 Level = sum(M)*vL/Across; 192 193 "Vapourisation Fraction"194 Outlet.v = Inlet.v;195 196 186 end -
branches/newlanguage/eml/streams.mso
r124 r125 81 81 end 82 82 83 Model streamPH as stream 84 PARAMETERS 85 outer PP as Plugin(Brief = "External Physical Properties", Type="PP"); 86 outer NComp as Integer (Brief = "Number of chemical components", Lower = 1); 87 88 VARIABLES 89 x(NComp) as fraction(Brief = "Liquid Molar Fraction"); 90 y(NComp) as fraction(Brief = "Vapour Molar Fraction"); 91 92 EQUATIONS 93 "Flash Calculation" 94 [v, x, y] = PP.FlashPH(P, h, z); 95 "Enthalpy" 96 h = (1-v)*PP.LiquidEnthalpy(T, P, x) + 97 v*PP.VapourEnthalpy(T, P, y); 98 end 99 83 100 Model source 84 101 ATTRIBUTES -
branches/newlanguage/sample/miscellaneous/sample_arrays.mso
r83 r125 40 40 41 41 FlowSheet SampleArrays 42 43 42 DEVICES 44 43 dev1 as Arrays; … … 48 47 49 48 OPTIONS 50 time = [0:0.1:2*3.1415]; 49 TimeStep = 0.1; 50 TimeEnd = 3.1415; 51 51 end -
branches/newlanguage/sample/miscellaneous/sample_if.mso
r124 r125 45 45 y = 0; 46 46 47 OPTIONS 48 TimeStep = 0.1; 49 TimeEnd = 10.0; 50 TimeUnit = "s"; 47 51 end 48 52 -
branches/newlanguage/sample/stage_separators/sample_column.mso
r112 r125 32 32 FlowSheet SectionColumn_Test_with2tray 33 33 PARAMETERS 34 PP as CalcObject(Brief="Physical Properties",File="vrpp");34 PP as Plugin(Brief="Physical Properties",File="vrpp"); 35 35 NComp as Integer; 36 36 … … 43 43 DEVICES 44 44 sec as Section_Column; 45 feed as stream_therm;46 reb as stream_therm;47 cond as stream_therm;45 feed as liquid_stream; 46 reb as vapour_stream; 47 cond as liquid_stream; 48 48 zero as stream; 49 49 … … 59 59 feed.P = 168.3 * "kPa"; 60 60 feed.z = [0.5, 0.5]; 61 feed.v = 0;62 61 63 62 zero.F = 0 * "kmol/h"; … … 71 70 cond.P = 150 * "kPa"; 72 71 cond.T = 281.75 * "K"; 73 cond.v = 0.0;74 72 cond.z = [0.6664, 0.3336]; 75 73 … … 78 76 reb.T = 328.12 * "K"; 79 77 reb.z = [0.001848, 0.9982]; 80 reb.v = 1.0;81 78 82 79 sec.trays.Emv = 1; … … 102 99 #relativeAccuracy = 1e-3; 103 100 NLASolver = "sundials"; 104 time = [0:10:1000]; 101 TimeStep = 10; 102 TimeEnd = 1000; 105 103 106 104 # After running few seconds of transient the steady-state … … 114 112 FlowSheet SectionColumn_Test_with8tray 115 113 PARAMETERS 116 PP as CalcObject(Brief="Physical Properties",File="vrpp");114 PP as Plugin(Brief="Physical Properties",File="vrpp"); 117 115 NComp as Integer; 118 116 … … 126 124 DEVICES 127 125 sec as Section_Column; 128 feed as stream_therm;129 reb as stream_therm;130 cond as stream_therm;126 feed as liquid_stream; 127 reb as vapour_stream; 128 cond as liquid_stream; 131 129 zero as stream; 132 130 … … 145 143 feed.P = 168.3 * "kPa"; 146 144 feed.z = [0.5, 0.5]; 147 feed.v = 0;148 145 149 146 zero.F = 0 * "kmol/h"; … … 157 154 cond.P = 150 * "kPa"; 158 155 cond.T = 281.75 * "K"; 159 cond.v = 0.0;160 156 cond.z = [0.6664, 0.3336]; 161 157 … … 164 160 reb.T = 328.12 * "K"; 165 161 reb.z = [0.001848, 0.9982]; 166 reb.v = 1.0;167 162 168 163 sec.trays.Emv = 1; … … 186 181 187 182 OPTIONS 188 relativeAccuracy = 1e-5; 189 time = [0:1:100]; 183 RelativeAccuracy = 1e-5; 184 TimeStep = 1; 185 TimeEnd = 100; 190 186 #guessFile="SectionColumn_Test_with8tray.rlt"; 191 187 #mode = "steady"; … … 195 191 FlowSheet Distillation_kettle_cond_Test 196 192 PARAMETERS 197 PP as CalcObject(Brief="Physical Properties",File="vrpp");193 PP as Plugin(Brief="Physical Properties",File="vrpp"); 198 194 NComp as Integer; 199 195 … … 212 208 DEVICES 213 209 col as Distillation_kettle_cond; 214 feed as s treamTP;210 feed as source; 215 211 zero as stream; 216 212 … … 224 220 225 221 SPECIFY 226 feed. F = 113.4 * "kmol/h";227 feed. T = 291 * "K";228 feed. P = 168.3 * "kPa";229 feed. z = 1/NComp;222 feed.Outlet.F = 113.4 * "kmol/h"; 223 feed.Outlet.T = 291 * "K"; 224 feed.Outlet.P = 168.3 * "kPa"; 225 feed.Outlet.z = 1/NComp; 230 226 231 227 zero.F = 0 * "kmol/h"; … … 277 273 278 274 OPTIONS 279 relativeAccuracy = 1e-3; 280 time = [0:0.01:1, 2:50]; 275 RelativeAccuracy = 1e-3; 276 TimeStep = 0.01; 277 TimeEnd = 50; 278 #time = [0:0.01:1, 2:50]; 281 279 #guessFile="Distillation_kettle_cond_Test.rlt"; 282 280 #mode = "steady"; … … 285 283 FlowSheet Column_ctrl 286 284 PARAMETERS 287 PP as CalcObject(Brief="Physical Properties",File="vrpp");285 PP as Plugin(Brief="Physical Properties",File="vrpp"); 288 286 NComp as Integer; 289 287 … … 324 322 DEVICES 325 323 col as Distillation_kettle_cond; 326 feed as s treamTP;324 feed as source; 327 325 zero as stream; 328 326 TCcond as PIDIncr_Ideal_AW; … … 421 419 422 420 SPECIFY 423 feed. F = 113.4 * "kmol/h";424 feed. T = 291 * "K";425 feed. P = 168.3 * "kPa";426 feed. z = 1/NComp;421 feed.Outlet.F = 113.4 * "kmol/h"; 422 feed.Outlet.T = 291 * "K"; 423 feed.Outlet.P = 168.3 * "kPa"; 424 feed.Outlet.z = 1/NComp; 427 425 428 426 zero.F = 0 * "kmol/h"; … … 486 484 487 485 OPTIONS 488 relativeAccuracy = 1e-3; 489 time = [0:0.01:0.1, 0.11:0.01:2]*"h"; 486 RelativeAccuracy = 1e-3; 487 TimeStep = 0.01; 488 TimeEnd = 2; 489 TimeUnit = "h"; 490 #time = [0:0.01:0.1, 0.11:0.01:2]*"h"; 490 491 #initialFile = "Column_ctrl.rlt"; 491 492 #guessFile = "Column_ctrl.rlt";
Note: See TracChangeset
for help on using the changeset viewer.