Changeset 185 for branches/newlanguage/sample
- Timestamp:
- Mar 6, 2007, 2:25:34 PM (16 years ago)
- Location:
- branches/newlanguage/sample/optimization
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/newlanguage/sample/optimization/ammonia.mso
r85 r185 31 31 Model Compressor 32 32 PARAMETERS 33 ext PP as CalcObject;34 extNComp as Integer;33 outer PP as Plugin; 34 outer NComp as Integer; 35 35 36 36 VARIABLES 37 37 in Inlet as stream; 38 out Outlet as stream _therm;38 out Outlet as streamPH; 39 39 40 40 EQUATIONS … … 47 47 "Component Molar Balance" 48 48 Inlet.z = Outlet.z; 49 50 "vaporization fraction "51 Outlet.v = 1.0;52 49 end 53 50 … … 55 52 Model Mixer 56 53 PARAMETERS 57 ext PP as CalcObject;58 extNComp as Integer;54 outer PP as Plugin; 55 outer NComp as Integer; 59 56 60 57 VARIABLES 61 58 in Inlet1 as stream; 62 59 in Inlet2 as stream; 63 out Outlet as stream _therm;60 out Outlet as streamPH; 64 61 65 62 EQUATIONS … … 73 70 "Component Molar Balance" 74 71 Inlet1.z*Inlet1.F + Inlet2.z*Inlet2.F = Outlet.F * Outlet.z; 75 "vaporization fraction"76 Outlet.v = Inlet1.v;77 72 end 78 73 … … 80 75 Model Reactor 81 76 PARAMETERS 82 ext PP as CalcObject;83 extNComp as Integer;77 outer PP as Plugin; 78 outer NComp as Integer; 84 79 NReac as Integer(Default=1); 85 80 stoic(NComp, NReac) as Real (Brief = "Stoichiometric Matrix"); … … 88 83 VARIABLES 89 84 in Inlet as stream; 90 out Outlet as stream _therm;85 out Outlet as streamPH; 91 86 Outletz(NComp) as fraction; 92 87 X(NReac) as fraction(Brief="Convertion of the key component"); … … 108 103 109 104 Outlet.P = Inlet.P; 110 111 "vaporization fraction"112 Outlet.v = Inlet.v;113 105 end 114 106 … … 116 108 FlowSheet Ammonia 117 109 PARAMETERS 118 PP as CalcObject(Brief="Physical Properties", File="vrpp");110 PP as Plugin(Brief="Physical Properties", File="vrpp"); 119 111 NComp as Integer; 120 112 SET … … 125 117 126 118 DEVICES 127 FEED as s treamTP;119 FEED as source; 128 120 C101 as Compressor; 129 121 R101 as Reactor; 130 F101 as flash_ Steady;131 F102 as flash_ Steady;122 F101 as flash_steady; 123 F102 as flash_steady; 132 124 S101 as splitter; 133 125 M101 as Mixer; … … 137 129 VARIABLES 138 130 purity as fraction(Brief="Purity of the product"); 139 production as flow_mol( Unit = "lbmol/h", Brief="Ammonia in the product");140 loose as flow_mol( Unit = "lbmol/h", Brief="Ammonia in the purge");131 production as flow_mol(DisplayUnit = 'lbmol/h', Brief="Ammonia in the product"); 132 loose as flow_mol(DisplayUnit = 'lbmol/h', Brief="Ammonia in the purge"); 141 133 Q1 as heat_rate; 142 134 Q2 as heat_rate; 143 135 144 136 CONNECTIONS 145 FEED 137 FEED.Outlet to M101.Inlet1; 146 138 M101.Outlet to C101.Inlet; 147 139 C101.Outlet to M102.Inlet1; … … 162 154 163 155 SPECIFY 164 FEED. F = 2000 * "lbmol/h";165 FEED. T = (27 + 273.15) * "K";166 FEED. P = 10 * "atm";167 FEED. z = [0.74, 0.24, 0.01, 0.01, 0.0];156 FEED.Outlet.F = 2000 * 'lbmol/h'; 157 FEED.Outlet.T = (27 + 273.15) * 'K'; 158 FEED.Outlet.P = 10 * 'atm'; 159 FEED.Outlet.z = [0.74, 0.24, 0.01, 0.01, 0.0]; 168 160 169 C101.Outlet.P = 200 * "atm";170 C102.Outlet.P = 200 * "atm";161 C101.Outlet.P = 200 * 'atm'; 162 C102.Outlet.P = 200 * 'atm'; 171 163 172 164 R101.X = 0.4; # Convertion of the reactor 173 165 174 F101.OutletV.P = 199 * "atm";175 F101.OutletV.T = (-34 + 273.15) * "K";166 F101.OutletV.P = 199 * 'atm'; 167 F101.OutletV.T = (-34 + 273.15) * 'K'; 176 168 177 F102.OutletV.P = 10 * "atm";178 F102.Q = 0 * "kJ/h";169 F102.OutletV.P = 10 * 'atm'; 170 F102.Q = 0 * 'kJ/h'; 179 171 180 172 # We can choose between one of the following specs 181 173 S101.frac = 0.78; # Recycle fraction 182 #loose = 1 * "lbmol/h"; # Ammonia in the purge174 #loose = 1 * 'lbmol/h'; # Ammonia in the purge 183 175 184 176 EQUATIONS … … 188 180 189 181 OPTIONS 190 mode = "steady";191 relativeAccuracy = 1e-5;182 Dynamic = false; 183 RelativeAccuracy = 1e-5; 192 184 end 193 185 -
branches/newlanguage/sample/optimization/ammonia_opt.mso
r85 r185 42 42 43 43 OPTIONS 44 relativeAccuracy = 1e-1;44 RelativeAccuracy = 1e-1; 45 45 end
Note: See TracChangeset
for help on using the changeset viewer.