Changeset 578 for branches/gui/eml/streams.mso
- Timestamp:
- Jul 25, 2008, 7:24:26 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gui/eml/streams.mso
r577 r578 125 125 pressure '''P''' and the enthalpy '''h'''. 126 126 127 Additionally, the liquid composition '''x''' andthe vapor128 composition '''y''' a re calculated.127 Additionally, the liquid composition '''x''', the vapor 128 composition '''y''' and the stream entropy are calculated. 129 129 "; 130 130 Pallete = false; … … 140 140 "Entropy" 141 141 s = (1-v)*PP.LiquidEntropy(T, P, x) + v*PP.VapourEntropy(T, P, y); 142 143 end144 145 Model source146 ATTRIBUTES147 Pallete = true;148 Icon = "icon/Source";149 Brief = "Material stream source";150 Info = "151 This model should be used for boundary streams.152 Usually these streams are known and come from another process153 units.154 155 The user should specify:156 * Total molar (mass or volumetric) flow157 * Temperature158 * Pressure159 * Molar (mass or volumetric) composition160 161 No matter the specification set, the model will calculate some162 additional properties:163 * Mass density164 * Mass flow165 * Mass compostions166 * Specific volume167 * Vapour fraction168 * Volumetric flow169 * Liquid and Vapour compositions170 ";171 172 PARAMETERS173 outer PP as Plugin (Brief = "External Physical Properties", Type="PP");174 outer NComp as Integer (Brief = "Number of chemical components", Lower = 1);175 M(NComp) as molweight (Brief = "Component Mol Weight");176 rhoModel as Switcher (Brief = "Density model", Valid = ["volume", "correlation"], Default="volume");177 178 SET179 180 M = PP.MolecularWeight();181 182 VARIABLES183 out Outlet as stream (Brief = "Outlet stream", PosX=1, PosY=0.5256, Symbol="_{out}");184 x(NComp) as fraction (Brief = "Liquid Molar Fraction",Hidden=true);185 y(NComp) as fraction (Brief = "Vapour Molar Fraction",Hidden=true);186 hl as enth_mol (Brief = "Liquid Enthalpy");187 hv as enth_mol (Brief = "Vapour Enthalpy");188 s as entr_mol (Brief = "Stream Entropy");189 sl as entr_mol (Brief = "Liquid Entropy");190 sv as entr_mol (Brief = "Vapour Entropy");191 zmass(NComp) as fraction (Brief = "Mass Fraction");192 Mw as molweight (Brief = "Average Mol Weight");193 vm as volume_mol (Brief = "Molar Volume");194 rho as dens_mass (Brief = "Stream Mass Density");195 rhom as dens_mol (Brief = "Stream Molar Density");196 Fw as flow_mass (Brief = "Stream Mass Flow");197 Fvol as flow_vol (Brief = "Volumetric Flow");198 T_Cdeg as temperature (Brief = "Temperature in °C", Lower=-200);199 200 EQUATIONS201 "Flash Calculation"202 [Outlet.v, x, y] = PP.Flash(Outlet.T, Outlet.P, Outlet.z);203 204 "Overall Enthalpy"205 Outlet.h = (1-Outlet.v)*hl + Outlet.v*hv;206 207 "Liquid Enthalpy"208 hl = PP.LiquidEnthalpy(Outlet.T, Outlet.P, x);209 210 "Vapour Enthalpy"211 hv = PP.VapourEnthalpy(Outlet.T, Outlet.P, y);212 213 "Overall Entropy"214 s = (1-Outlet.v)*sl + Outlet.v*sv;215 216 "Liquid Entropy"217 sl = PP.LiquidEntropy(Outlet.T, Outlet.P, x);218 219 "Vapour Entropy"220 sv = PP.VapourEntropy(Outlet.T, Outlet.P, y);221 222 "Average Molecular Weight"223 Mw = sum(M*Outlet.z);224 225 switch rhoModel226 case "volume":227 "Molar Density"228 rhom * vm = 1;229 230 case "correlation":231 "Mass Density"232 rho*((1-Outlet.v)/PP.LiquidDensity(Outlet.T,Outlet.P,x) + Outlet.v/PP.VapourDensity(Outlet.T,Outlet.P,y)) = 1;233 end234 235 "Mass or Molar Density"236 rhom * Mw = rho;237 238 "Flow Mass"239 Fw = Mw*Outlet.F;240 241 "Molar Volume"242 vm = (1-Outlet.v)*PP.LiquidVolume(Outlet.T, Outlet.P, x) + Outlet.v*PP.VapourVolume(Outlet.T,Outlet.P,y);243 244 "Volumetric Flow"245 Fvol = Outlet.F*vm ;246 247 "Mass Fraction"248 zmass = M*Outlet.z / Mw;249 250 "Temperature in °C"251 T_Cdeg = Outlet.T - 273.15 * 'K';252 142 253 143 end … … 532 422 end 533 423 534 Model source _testing424 Model source 535 425 536 426 ATTRIBUTES
Note: See TracChangeset
for help on using the changeset viewer.