Changeset 612 for branches/gui
 Timestamp:
 Aug 27, 2008, 7:31:54 PM (15 years ago)
 Location:
 branches/gui
 Files:

 3 edited
Legend:
 Unmodified
 Added
 Removed

branches/gui/eml/stage_separators/columnTeste.mso
r611 r612 70 70 NTrays as Integer (Brief="Number of trays", Default=2); 71 71 FeedTray as Integer (Brief="Number of Feed tray", Default=2); 72 topdown as Integer (Brief="Trays counting (1=topdown, 1=bottomup)", Default=1); 73 top as Integer (Brief="Number of top tray"); 74 bot as Integer (Brief="Number of bottom tray"); 72 topdown as Integer (Brief="Trays counting (1=topdown, 1=bottomup)", Default=1,Hidden=true); 73 top as Integer (Brief="Number of top tray",Hidden=true); 74 bot as Integer (Brief="Number of bottom tray",Hidden=true); 75 g as acceleration (Default=9.81,Hidden=true); 76 77 VapourFlow as Switcher (Valid = ["on", "off"], Default = "on",Hidden=true); 78 LiquidFlow as Switcher (Valid = ["on", "off"], Default = "on",Hidden=true); 79 VapourFlowModel as Switcher (Valid = ["Reepmeyer", "Feehery_Fv", "Roffel_Fv", "Klingberg", "Wang_Fv", "Elgue"], Default = "Reepmeyer"); 80 LiquidFlowModel as Switcher (Valid = ["default", "Wang_Fl", "Olsen", "Feehery_Fl", "Roffel_Fl"], Default = "default"); 75 81 76 82 SET … … 80 86 VARIABLES 81 87 zero as stream (Brief="Dummy stream",Hidden=true); 82 cond as liquid_stream; 83 in Inlet as stream (Brief="Feed stream", PosX=0, PosY=0.5); 88 in Inlet as stream (Brief="Feed stream", PosX=0, PosY=0.50); 84 89 trays(NTrays) as trayTeste; 85 reb as vapour_stream; 90 91 in Lin as stream (Brief="Feed stream", PosX=0.75, PosY=0); 92 in Vin as stream (Brief="Feed stream", PosX=0.55, PosY=1); 93 94 out Lout as liquid_stream (Brief="Feed stream", PosX=0.75, PosY=1); 95 out Vout as vapour_stream (Brief="Feed stream", PosX=0.55, PosY=0); 86 96 87 97 CONNECTIONS 88 98 trays([top+topdown:topdown:bot]).OutletV to trays([top:topdown:bottopdown]).InletV; 89 99 trays([top:topdown:bottopdown]).OutletL to trays([top+topdown:topdown:bot]).InletL; 90 91 reb to trays(2).InletV;92 cond to trays(1).InletL;93 100 94 101 EQUATIONS … … 109 116 Inlet.v = trays(FeedTray).Inlet.v; 110 117 Inlet.h = trays(FeedTray).Inlet.h; 111 112 for i in [1:FeedTray1] do # pay atention to index 118 119 if FeedTray equal 1 120 121 then 122 123 for i in [2:NTrays] do 113 124 114 125 zero.F = trays(i).Inlet.F; … … 121 132 end 122 133 123 end 124 134 else 135 136 if FeedTray equal NTrays 137 138 then 139 140 for i in [1:NTrays1] do 141 142 zero.F = trays(i).Inlet.F; 143 zero.T = trays(i).Inlet.T; 144 zero.P = trays(i).Inlet.P; 145 zero.z = trays(i).Inlet.z; 146 zero.v = trays(i).Inlet.v; 147 zero.h = trays(i).Inlet.h; 148 149 end 150 151 else 152 153 for i in [2:FeedTray1] do 154 155 zero.F = trays(i).Inlet.F; 156 zero.T = trays(i).Inlet.T; 157 zero.P = trays(i).Inlet.P; 158 zero.z = trays(i).Inlet.z; 159 zero.v = trays(i).Inlet.v; 160 zero.h = trays(i).Inlet.h; 161 162 end 163 164 for i in [FeedTray+1: NTrays1] do 165 166 zero.F = trays(i).Inlet.F; 167 zero.T = trays(i).Inlet.T; 168 zero.P = trays(i).Inlet.P; 169 zero.z = trays(i).Inlet.z; 170 zero.v = trays(i).Inlet.v; 171 zero.h = trays(i).Inlet.h; 172 173 end 174 175 end 176 177 end 178 179 for i in [1:NTrays] do 180 181 switch LiquidFlow 182 case "on": 183 switch LiquidFlowModel 184 case "default": 185 "Francis Equation" 186 trays(i).OutletL.F*trays(i).vL = 1.84*'1/s'*trays(i).lw*((trays(i).Level(trays(i).beta*trays(i).hw))/(trays(i).beta))^2; 187 188 case "Wang_Fl": 189 trays(i).OutletL.F*trays(i).vL = 1.84*'m^0.5/s'*trays(i).lw*((trays(i).Level(trays(i).beta*trays(i).hw))/(trays(i).beta))^1.5; 190 191 case "Olsen": 192 trays(i).OutletL.F / 'mol/s'= trays(i).lw*trays(i).Np*trays(i).rhoL/sum(trays(i).Mw*trays(i).OutletV.z)/(0.665*trays(i).fw)^1.5 * ((trays(i).ML*sum(trays(i).Mw*trays(i).OutletL.z)/trays(i).rhoL/trays(i).Ap)trays(i).hw)^1.5 * 'm^0.5/mol'; 193 194 case "Feehery_Fl": 195 trays(i).OutletL.F = trays(i).lw*trays(i).rhoL/sum(trays(i).Mw*trays(i).OutletL.z) * ((trays(i).Leveltrays(i).hw)/750/'mm')^1.5 * 'm^2/s'; 196 197 case "Roffel_Fl": 198 trays(i).OutletL.F = 2/3*sqrt(2*g)*trays(i).rhoL/sum(trays(i).Mw*trays(i).OutletL.z)*trays(i).lw*(2*trays(i).btemp1)*(trays(i).ML*sum(trays(i).Mw*trays(i).OutletL.z)/(trays(i).Ap*1.3)/trays(i).rhoL/(2*trays(i).btemp1))^1.5; 199 end 200 when trays(i).Level < (trays(i).beta * trays(i).hw) switchto "off"; 201 202 case "off": 203 "Low level" 204 trays(i).OutletL.F = 0 * 'mol/h'; 205 when trays(i).Level > (trays(i).beta * trays(i).hw) + 1e6*'m' switchto "on"; 206 end 207 208 trays(i).btemp = 1  0.3593/'Pa^0.0888545'*abs(trays(i).OutletV.F*sum(trays(i).Mw*trays(i).OutletV.z)/(trays(i).Ap*1.3)/sqrt(trays(i).rhoV))^0.177709; #/'(kg/m)^0.0888545/s^0.177709'; 209 210 switch VapourFlow 211 case "on": 212 switch VapourFlowModel 213 case "Reepmeyer": 214 trays(i).InletV.F*trays(i).vV = sqrt((trays(i).InletV.P  trays(i).OutletV.P)/(trays(i).rhoV*trays(i).alfa))*trays(i).Ah; 215 216 case "Feehery_Fv": 217 trays(i).InletV.F = trays(i).rhoV/trays(i).Ap/trays(i).w/sum(trays(i).Mw*trays(i).OutletV.z) * sqrt(((trays(i).InletV.P  trays(i).OutletV.P)(trays(i).rhoV*g*trays(i).ML*trays(i).vL/trays(i).Ap))/trays(i).rhoV); 218 219 case "Roffel_Fv": 220 trays(i).InletV.F^1.08 * 0.0013 * 'kg/m/mol^1.08/s^0.92*1e5' = (trays(i).InletV.P  trays(i).OutletV.P)*1e5  (trays(i).beta*sum(trays(i).M*trays(i).Mw)/(trays(i).Ap*1.3)*g*1e5) * (trays(i).rhoV*trays(i).Ah/sum(trays(i).Mw*trays(i).OutletV.z))^1.08 * 'm^1.08/mol^1.08'; 221 222 case "Klingberg": 223 trays(i).InletV.F * trays(i).vV = trays(i).Ap * sqrt(((trays(i).InletV.P  trays(i).OutletV.P)trays(i).rhoL*g*trays(i).Level)/trays(i).rhoV); 224 225 case "Wang_Fv": 226 trays(i).InletV.F * trays(i).vV = trays(i).Ap * sqrt(((trays(i).InletV.P  trays(i).OutletV.P)trays(i).rhoL*g*trays(i).Level)/trays(i).rhoV*trays(i).alfa); 227 228 case "Elgue": 229 trays(i).InletV.F = sqrt((trays(i).InletV.P  trays(i).OutletV.P)/trays(i).btray); 230 end 231 when trays(i).InletV.F < 1e6 * 'kmol/h' switchto "off"; 232 233 case "off": 234 trays(i).InletV.F = 0 * 'mol/s'; 235 when trays(i).InletV.P > trays(i).OutletV.P + trays(i).Level*g*trays(i).rhoL + 1e1 * 'atm' switchto "on"; 236 end 237 238 end 239 240 end 125 241 126 242 #* 
branches/gui/eml/stage_separators/trayTeste.mso
r611 r612 46 46 VARIABLES 47 47 48 #in Inlet as stream (Brief="Feed stream", PosX=0, PosY=0.4932, Symbol="_{in}");49 48 Inlet as stream (Brief="Feed stream", PosX=0, PosY=0.4932, Symbol="_{in}"); 50 49 in InletL as stream (Brief="Inlet liquid stream", PosX=0.5195, PosY=0, Symbol="_{inL}"); … … 53 52 out OutletV as vapour_stream (Brief="Outlet vapour stream", PosX=0.8043, PosY=0, Symbol="_{outV}"); 54 53 55 M(NComp) as mol(Brief="Molar Holdup in the tray");56 ML as mol(Brief="Molar liquid holdup");57 MV as mol(Brief="Molar vapour holdup");58 E as energy(Brief="Total Energy Holdup on tray");59 vL as volume_mol(Brief="Liquid Molar Volume");60 vV as volume_mol(Brief="Vapour Molar volume");61 Level as length(Brief="Height of clear liquid on plate");62 yideal(NComp) as fraction;63 Emv as Real(Brief = "Murphree efficiency");64 65 54 M(NComp) as mol (Brief="Molar Holdup in the tray"); 55 ML as mol (Brief="Molar liquid holdup"); 56 MV as mol (Brief="Molar vapour holdup"); 57 E as energy (Brief="Total Energy Holdup on tray"); 58 vL as volume_mol (Brief="Liquid Molar Volume"); 59 vV as volume_mol (Brief="Vapour Molar volume"); 60 Level as length (Brief="Height of clear liquid on plate"); 61 yideal(NComp) as fraction; 62 Emv as Real (Brief = "Murphree efficiency"); 63 64 EQUATIONS 66 65 "Component Molar Balance" 67 diff(M)=Inlet.F*Inlet.z + InletL.F*InletL.z + InletV.F*InletV.z 68  OutletL.F*OutletL.z  OutletV.F*OutletV.z; 69 70 "Energy Balance" 71 diff(E) = ( Inlet.F*Inlet.h + InletL.F*InletL.h + InletV.F*InletV.h 72  OutletL.F*OutletL.h  OutletV.F*OutletV.h + Q ); 73 74 "Molar Holdup" 66 diff(M)=Inlet.F*Inlet.z + InletL.F*InletL.z + InletV.F*InletV.z OutletL.F*OutletL.z  OutletV.F*OutletV.z; 67 68 "Energy Balance" 69 diff(E) = ( Inlet.F*Inlet.h + InletL.F*InletL.h + InletV.F*InletV.h OutletL.F*OutletL.h  OutletV.F*OutletV.h + Q ); 70 71 "Molar Holdup" 75 72 M = ML*OutletL.z + MV*OutletV.z; 76 73 77 74 "Energy Holdup" 78 75 E = ML*OutletL.h + MV*OutletV.h  OutletL.P*V; 79 76 80 77 "Mol fraction normalisation" 81 78 sum(OutletL.z)= 1.0; 82 79 sum(OutletL.z)= sum(OutletV.z); 83 80 84 81 "Liquid Volume" 85 82 vL = PP.LiquidVolume(OutletL.T, OutletL.P, OutletL.z); 86 "Vapour Volume" 83 84 "Vapour Volume" 87 85 vV = PP.VapourVolume(OutletV.T, OutletV.P, OutletV.z); 88 86 89 "Chemical Equilibrium" 90 PP.LiquidFugacityCoefficient(OutletL.T, OutletL.P, OutletL.z)*OutletL.z = 91 PP.VapourFugacityCoefficient(OutletV.T, OutletV.P, yideal)*yideal; 92 93 "Murphree Efficiency" 87 "Chemical Equilibrium" 88 PP.LiquidFugacityCoefficient(OutletL.T, OutletL.P, OutletL.z)*OutletL.z = PP.VapourFugacityCoefficient(OutletV.T, OutletV.P, yideal)*yideal; 89 90 "Murphree Efficiency" 94 91 OutletV.z = Emv * (yideal  InletV.z) + InletV.z; 95 92 96 93 "Thermal Equilibrium" 97 94 OutletV.T = OutletL.T; 98 95 99 96 "Mechanical Equilibrium" 100 97 OutletV.P = OutletL.P; 101 98 102 99 "Geometry Constraint" 103 100 V = ML* vL + MV*vV; 104 101 105 102 "Level of clear liquid over the weir" 106 103 Level = ML*vL/Ap; 104 107 105 end 108 106 … … 139 137 "; 140 138 141 PARAMETERS 142 Ah as area (Brief="Total holes area"); 143 lw as length (Brief="Weir length"); 144 g as acceleration (Default=9.81); 145 hw as length (Brief="Weir height"); 146 beta as fraction (Brief="Aeration fraction"); 147 alfa as fraction (Brief="Dry pressure drop coefficient"); 148 w as Real (Brief="Feehery's correlation coefficient", Unit='1/m^4', Default=1); 149 btray as Real (Brief="Elgue's correlation coefficient", Unit='kg/m/mol^2', Default=1); 150 fw as Real (Brief = "Olsen's correlation coefficient", Default=1); 151 Np as Real (Brief = "Number of liquid passes in the tray", Default=1); 152 Mw(NComp) as molweight (Brief = "Component Mol Weight"); 153 154 VapourFlow as Switcher(Valid = ["on", "off"], Default = "on"); 155 LiquidFlow as Switcher(Valid = ["on", "off"], Default = "on"); 156 VapourFlowModel as Switcher(Valid = ["Reepmeyer", "Feehery_Fv", "Roffel_Fv", "Klingberg", "Wang_Fv", "Elgue"], Default = "Reepmeyer"); 157 LiquidFlowModel as Switcher(Valid = ["default", "Wang_Fl", "Olsen", "Feehery_Fl", "Roffel_Fl"], Default = "default"); 158 159 SET 139 PARAMETERS 140 Ah as area (Brief="Total holes area"); 141 lw as length (Brief="Weir length"); 142 hw as length (Brief="Weir height"); 143 beta as fraction (Brief="Aeration fraction"); 144 alfa as fraction (Brief="Dry pressure drop coefficient"); 145 w as Real (Brief="Feeherys correlation coefficient", Unit='1/m^4', Default=1); 146 btray as Real (Brief="Elgues correlation coefficient", Unit='kg/m/mol^2', Default=1); 147 fw as Real (Brief="Olsens correlation coefficient", Default=1); 148 Np as Real (Brief="Number of liquid passes in the tray", Default=1); 149 Mw(NComp) as molweight (Brief="Component Mol Weight"); 150 151 # VapourFlow as Switcher (Valid = ["on", "off"], Default = "on",Hidden=true); 152 # LiquidFlow as Switcher (Valid = ["on", "off"], Default = "on",Hidden=true); 153 # VapourFlowModel as Switcher (Valid = ["Reepmeyer", "Feehery_Fv", "Roffel_Fv", "Klingberg", "Wang_Fv", "Elgue"], Default = "Reepmeyer"); 154 # LiquidFlowModel as Switcher (Valid = ["default", "Wang_Fl", "Olsen", "Feehery_Fl", "Roffel_Fl"], Default = "default"); 155 156 SET 160 157 Mw = PP.MolecularWeight(); 161 158 162 159 VARIABLES 163 160 rhoL as dens_mass; 164 161 rhoV as dens_mass; 165 162 166 btemp as Real (Brief="Temporary variable of Roffel's liquid flow equation"); 167 168 EQUATIONS 169 "Liquid Density" 163 btemp as Real (Brief="Temporary variable of Roffels liquid flow equation"); 164 165 EQUATIONS 166 167 "Liquid Density" 170 168 rhoL = PP.LiquidDensity(OutletL.T, OutletL.P, OutletL.z); 171 "Vapour Density" 169 170 "Vapour Density" 172 171 rhoV = PP.VapourDensity(InletV.T, InletV.P, InletV.z); 173 172 174 switch LiquidFlow173 #* switch LiquidFlow 175 174 case "on": 176 175 switch LiquidFlowModel … … 228 227 when InletV.P > OutletV.P + Level*g*rhoL + 1e1 * 'atm' switchto "on"; 229 228 end 230 229 *# 231 230 end 232 231 
branches/gui/sample/stage_separators/sample_columnTeste.mso
r611 r612 43 43 sec as Section_ColumnTeste; 44 44 feed as liquid_stream; 45 reb as vapour_stream; 46 cond as liquid_stream; 45 47 46 48 SET … … 57 59 feed.z = [0.5, 0.5]; 58 60 59 sec.cond.F = 68 * 'kmol/h';60 sec.cond.P = 150 * 'kPa';61 sec.cond.T = 281.75 * 'K';62 sec.cond.z = [0.6664, 0.3336];61 cond.F = 68 * 'kmol/h'; 62 cond.P = 150 * 'kPa'; 63 cond.T = 281.75 * 'K'; 64 cond.z = [0.6664, 0.3336]; 63 65 64 sec.reb.P = 185 * 'kPa';65 sec.reb.T = 328.12 * 'K';66 sec.reb.z = [0.001848, 0.9982];66 reb.P = 185 * 'kPa'; 67 reb.T = 328.12 * 'K'; 68 reb.z = [0.001848, 0.9982]; 67 69 68 70 sec.trays.Emv = 1;
Note: See TracChangeset
for help on using the changeset viewer.