- Timestamp:
- Apr 16, 2007, 2:19:39 PM (16 years ago)
- Location:
- trunk/eml
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/eml/controllers/PIDs.mso
r176 r243 97 97 if (Parameters.tau equal 0) then 98 98 "Input first order filter" 99 (Parameters.tau + 1e-3* "s")*diff(Internal.inputFilt)= Ports.input - Internal.inputFilt;99 (Parameters.tau + 1e-3*'s')*diff(Internal.inputFilt)= Ports.input - Internal.inputFilt; 100 100 else 101 101 "Input first order filter" … … 105 105 if (Parameters.tauSet equal 0) then 106 106 "setPoint first order filter" 107 (Parameters.tauSet + 1e-3* "s")*diff(Internal.setPointFilt)= Ports.setPoint - Internal.setPointFilt;107 (Parameters.tauSet + 1e-3*'s')*diff(Internal.setPointFilt)= Ports.setPoint - Internal.setPointFilt; 108 108 else 109 109 "setPoint first order filter" … … 132 132 if (Parameters.derivTime equal 0) then 133 133 "Derivative term filter" 134 Parameters.alpha*(Parameters.derivTime + 1e-3* "s")*diff(Internal.dFilt) = Internal.errorD - Internal.dFilt;134 Parameters.alpha*(Parameters.derivTime + 1e-3*'s')*diff(Internal.dFilt) = Internal.errorD - Internal.dFilt; 135 135 else 136 136 "Derivative term filter" -
trunk/eml/stage_separators/column.mso
r210 r243 930 930 Model ReactiveDistillation 931 931 PARAMETERS 932 outer PP as Plugin(Brief = "External Physical Properties", Type="PP"); 933 outer NComp as Integer; 934 NTrays as Integer(Brief="Number of trays", Default=2); 932 outer PP as Plugin(Type="PP"); 933 outer NComp as Integer; 934 NTrays as Integer(Brief="Number of trays", Default=2); 935 topdown as Integer(Brief="Trays counting (1=top-down, -1=bottom-up)", Default=1); 936 top as Integer(Brief="Number of top tray"); 937 bot as Integer(Brief="Number of bottom tray"); 938 alfacond as Real; 939 940 VapourFlow as Switcher(Valid = ["on", "off"], Default = "off"); 941 942 SET 943 top = (NTrays-1)*(1-topdown)/2+1; 944 bot = NTrays/top; 935 945 936 946 VARIABLES … … 942 952 943 953 EQUATIONS 944 if ( reb.OutletV.P > 1 * 'atm' ) then 945 "Pressure Drop through the tray" 946 reb.OutletV.F = trays(1).Ah/reb.vV * sqrt((reb.OutletV.P - 1*'atm') / (0.15*reb.rhoV) ); 947 else 954 955 switch VapourFlow 956 case "on": 957 "Pressure Drop through the condenser" 958 cond.InletV.F*trays(top).vV / 'm^2' = 959 sqrt((trays(top).OutletV.P - cond.OutletL.P + 1e-8 * 'atm')/(trays(top).rhoV*alfacond)); 960 when trays(top).OutletV.P < cond.OutletL.P switchto "off"; 961 962 case "off": 948 963 "Prato selado" 949 reb.OutletV.F = 0.0 * 'mol/s'; 964 cond.InletV.F = 0.0 * 'mol/s'; 965 when trays(top).OutletV.P > cond.OutletL.P + 1e-3 * 'atm' switchto "on"; 950 966 end 951 952 CONNECTIONS 953 #vapor 954 reb.OutletV to trays( [NTrays]).InletV;955 trays([ 2:NTrays]).OutletV to trays([1:NTrays-1]).InletV;956 trays( 1).OutletV to cond.InletV;957 967 968 CONNECTIONS 969 #vapor 970 reb.OutletV to trays(bot).InletV; 971 trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bot-topdown]).InletV; 972 trays(top).OutletV to cond.InletV; 973 958 974 #liquid 959 975 cond.OutletL to sp.Inlet; 960 976 sp.Outlet2 to p.Inlet; 961 p.Outlet to trays(1).InletL; 962 trays([1:NTrays-1]).OutletL to trays([2:NTrays]).InletL; 963 trays(NTrays).OutletL to reb.InletL; 964 end 977 p.Outlet to trays(top).InletL; 978 trays([top:topdown:bot-topdown]).OutletL to trays([top+topdown:topdown:bot]).InletL; 979 trays(bot).OutletL to reb.InletL; 980 981 end -
trunk/eml/stage_separators/condenser.mso
r210 r243 135 135 Model condenserReact 136 136 PARAMETERS 137 outer PP as Plugin( Brief = "External Physical Properties",Type="PP");137 outer PP as Plugin(Type="PP"); 138 138 outer NComp as Integer; 139 139 V as volume (Brief="Condenser total volume"); … … 158 158 Q as heat_rate (Brief="Heat supplied"); 159 159 Vol as volume; 160 r as reaction_mol (Brief = "Specific reaction rate");160 r3 as reaction_mol (Brief = "Reaction resulting ethyl acetate", DisplayUnit = 'mol/l/s'); 161 161 C(NComp) as conc_mol (Brief = "Molar concentration", Lower = -1); 162 162 … … 165 165 OutletL.z = vL * C; 166 166 167 "Reaction" 168 r3 = exp(-7150*'K'/OutletL.T)*(4.85e4*C(1)*C(2) - 1.23e4*C(3)*C(4)) * 'l/mol/s'; 169 167 170 "Component Molar Balance" 168 171 diff(M) = InletV.F*InletV.z - OutletL.F*OutletL.z 169 - OutletV.F*OutletV.z + stoic*r *ML*vL;172 - OutletV.F*OutletV.z + stoic*r3*ML*vL; 170 173 171 174 "Energy Balance" 172 175 diff(E) = InletV.F*InletV.h - OutletL.F*OutletL.h 173 - OutletV.F*OutletV.h + Q + Hr * r * ML*vL;176 - OutletV.F*OutletV.h + Q + Hr * r3 * ML*vL; 174 177 175 178 "Molar Holdup" … … 206 209 207 210 sum(OutletL.z)=sum(OutletV.z); 211 208 212 end -
trunk/eml/stage_separators/reboiler.mso
r210 r243 191 191 Model reboilerReact 192 192 PARAMETERS 193 outer PP as Plugin( Brief = "External Physical Properties",Type="PP");193 outer PP as Plugin(Type="PP"); 194 194 outer NComp as Integer; 195 195 Across as area (Brief="Cross Section Area of reboiler"); … … 217 217 startup as Real; 218 218 rhoV as dens_mass; 219 r as reaction_mol (Brief = "Specific reaction rate");219 r3 as reaction_mol (Brief = "Reaction resulting ethyl acetate", DisplayUnit = 'mol/l/s'); 220 220 C(NComp) as conc_mol (Brief = "Molar concentration", Lower = -1); 221 221 … … 224 224 OutletL.z = vL * C; 225 225 226 "Reaction" 227 r3 = exp(-7150*'K'/OutletL.T)*(4.85e4*C(1)*C(2) - 1.23e4*C(3)*C(4)) * 'l/mol/s'; 228 226 229 "Component Molar Balance" 227 230 diff(M)= Inlet.F*Inlet.z + InletL.F*InletL.z 228 - OutletL.F*OutletL.z - OutletV.F*OutletV.z + stoic*r *ML*vL;231 - OutletL.F*OutletL.z - OutletV.F*OutletV.z + stoic*r3*ML*vL; 229 232 230 233 "Energy Balance" 231 234 diff(E) = Inlet.F*Inlet.h + InletL.F*InletL.h 232 - OutletL.F*OutletL.h - OutletV.F*OutletV.h + Q + Hr * r * vL*ML;235 - OutletL.F*OutletL.h - OutletV.F*OutletV.h + Q + Hr * r3 * vL*ML; 233 236 234 237 "Molar Holdup" … … 260 263 261 264 "Geometry Constraint" 262 V = ML*vL + MV*vV; 265 V = ML*vL + MV*vV; 263 266 264 267 "Chemical Equilibrium" -
trunk/eml/stage_separators/tray.mso
r210 r243 159 159 160 160 PARAMETERS 161 outer PP as Plugin( Brief = "External Physical Properties",Type="PP");161 outer PP as Plugin(Type="PP"); 162 162 outer NComp as Integer; 163 163 V as volume(Brief="Total Volume of the tray"); … … 175 175 Hr as energy_mol; 176 176 Pstartup as pressure; 177 178 VapourFlow as Switcher(Valid = ["on", "off"], Default = "off"); 179 LiquidFlow as Switcher(Valid = ["on", "off"], Default = "off"); 177 180 178 181 VARIABLES … … 197 200 rhoL as dens_mass; 198 201 rhoV as dens_mass; 199 r as reaction_mol (Brief = "Specific reaction rate");202 r3 as reaction_mol (Brief = "Reaction resulting ethyl acetate", DisplayUnit = 'mol/l/s'); 200 203 C(NComp) as conc_mol (Brief = "Molar concentration", Lower = -1); #, Unit = "mol/l"); 201 204 … … 204 207 OutletL.z = vL * C; 205 208 209 "Reaction" 210 r3 = exp(-7150*'K'/OutletL.T)*(4.85e4*C(1)*C(2) - 1.23e4*C(3)*C(4))*'l/mol/s'; 211 206 212 "Component Molar Balance" 207 213 diff(M)=Inlet.F*Inlet.z + InletL.F*InletL.z + InletV.F*InletV.z 208 - OutletL.F*OutletL.z - OutletV.F*OutletV.z + stoic*r *ML*vL;214 - OutletL.F*OutletL.z - OutletV.F*OutletV.z + stoic*r3*ML*vL; 209 215 210 216 "Energy Balance" 211 217 diff(E) = ( Inlet.F*Inlet.h + InletL.F*InletL.h + InletV.F*InletV.h 212 - OutletL.F*OutletL.h - OutletV.F*OutletV.h + Q ) + Hr * r * vL*ML;218 - OutletL.F*OutletL.h - OutletV.F*OutletV.h + Q ) + Hr * r3 * vL*ML; 213 219 214 220 "Molar Holdup" … … 242 248 rhoV = PP.VapourDensity(InletV.T, InletV.P, InletV.z); 243 249 244 if Level > (beta * hw) then 250 switch LiquidFlow 251 case "on": 245 252 "Francis Equation" 246 OutletL.F = (1.84/'s'*lw*((Level-(beta*hw))/(beta))^2/vL); 247 else 253 OutletL.F*vL = 1.84*'1/s'*lw*((Level-(beta*hw)+1e-6*'m')/(beta))^2; 254 when Level < (beta * hw) switchto "off"; 255 256 case "off": 248 257 "Low level" 249 258 OutletL.F = 0 * 'mol/h'; 259 when Level > (beta * hw) + 1e-6*'m' switchto "on"; 250 260 end 251 261 262 switch VapourFlow 263 case "on": 264 #InletV.P = OutletV.P + Level*g*rhoL + rhoV*alfa*(InletV.F*vV/Ah)^2; 265 InletV.F*vV = sqrt((InletV.P - OutletV.P - Level*g*rhoL + 1e-8 * 'atm')/(rhoV*alfa))*Ah; 266 when InletV.P < OutletV.P + Level*g*rhoL switchto "off"; 252 267 253 "Pressure Drop through the tray" 254 OutletV.F = (1 + tanh(1 * (OutletV.P - Pstartup)/'Pa'))/2 * 255 Ah/vV * sqrt(2*(OutletV.P - InletL.P + 1e-8 * 'atm') / (alfa*rhoV) ); 268 case "off": 269 InletV.F = 0 * 'mol/s'; 270 when InletV.P > OutletV.P + Level*g*rhoL + 3e-2 * 'atm' switchto "on"; 271 #when InletV.P > OutletV.P + Level*beta*g*rhoL + 1e-2 * 'atm' switchto "on"; 272 end 256 273 257 274 "Chemical Equilibrium"
Note: See TracChangeset
for help on using the changeset viewer.