Changeset 711 for branches/gui/eml/stage_separators
 Timestamp:
 Feb 13, 2009, 5:33:49 PM (14 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

branches/gui/eml/stage_separators/flash.mso
r584 r711 20 20 21 21 Model flash 22 ATTRIBUTES 22 23 ATTRIBUTES 23 24 Pallete = true; 24 25 Icon = "icon/Flash"; … … 33 34 34 35 == Initial Conditions == 35 * the flash initial temperature (OutletL.T);36 * the flash initial level (Level);37 * (NoComps  1) OutletL (OR OutletV) compositions.36 * The flash initial temperature (Temperature_Initial); 37 * The flash initial level (Levelpercent_Initial); 38 *The Outlet Liquid Composition (Composition_Initial). 38 39 "; 39 40 40 PARAMETERS 41 outer PP as Plugin (Brief = "External Physical Properties", Type="PP"); 42 outer NComp as Integer (Brief = "Number of chemical components", Lower = 1); 43 V as volume (Brief="Total Volume of the flash"); 44 Mw(NComp) as molweight(Protected=true); 45 orientation as Switcher (Valid=["vertical","horizontal"],Default="vertical"); 46 diameter as length (Brief="Vessel diameter"); 47 48 SET 41 PARAMETERS 42 43 outer PP as Plugin (Brief = "External Physical Properties", Type="PP"); 44 outer NComp as Integer (Brief = "Number of chemical components", Lower = 1); 45 46 VesselVolume as volume (Brief="Total Volume of the flash"); 47 Mw(NComp) as molweight (Hidden=true); 48 Orientation as Switcher (Valid=["vertical","horizontal"],Default="vertical"); 49 Diameter as length (Brief="Vessel diameter"); 50 51 Levelpercent_Initial as positive (Brief="Initial liquid height in Percent", Default = 0.70); 52 Temperature_Initial as temperature (Brief="Initial Liquid Temperature", Default = 330); 53 Composition_Initial(NComp) as fraction (Brief="Initial Composition", Default = 0.10); 54 55 SET 56 49 57 Mw=PP.MolecularWeight(); 50 58 51 VARIABLES 52 in Inlet as stream(Brief="Feed Stream", PosX=0, PosY=0.5421, Symbol="_{in}"); 53 out OutletL as liquid_stream(Brief="Liquid outlet stream", PosX=0.4790, PosY=1, Symbol="_{outL}"); 54 out OutletV as vapour_stream(Brief="Vapour outlet stream", PosX=0.4877, PosY=0, Symbol="_{outV}"); 55 in InletQ as power(Brief="Rate of heat supply", PosX=1, PosY=0.7559, Symbol="_{in}"); 56 57 M(NComp) as mol (Brief="Molar Holdup in the tray", Protected=true); 58 ML as mol (Brief="Molar liquid holdup", Protected=true); 59 MV as mol (Brief="Molar vapour holdup", Protected=true); 60 E as energy (Brief="Total Energy Holdup on tray", Protected=true); 61 vL as volume_mol (Brief="Liquid Molar Volume", Protected=true); 62 vV as volume_mol (Brief="Vapour Molar volume", Protected=true); 63 Level as length (Brief="liquid height"); 64 Across as area (Brief="Flash Cross section area", Protected=true); 65 vfrac as positive (Brief="Vapourization fraction", Symbol="\phi"); 66 Pratio as positive (Brief = "Pressure Ratio", Symbol ="P_{ratio}"); 67 Pdrop as press_delta (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P"); 68 69 out TI as control_signal(Brief="Temperature Indicator", PosX=1, PosY=0.2); 70 out PI as control_signal(Brief="Pressure Indicator", PosX=1, PosY=0.3); 71 out LI as control_signal(Brief="Level Indicator", PosX=1, PosY=0.4); 72 73 EQUATIONS 74 "Component Molar Balance" 75 diff(M)=Inlet.F*Inlet.z  OutletL.F*OutletL.z  OutletV.F*OutletV.z; 76 77 "Energy Balance" 78 diff(E) = Inlet.F*Inlet.h  OutletL.F*OutletL.h  OutletV.F*OutletV.h + InletQ; 79 80 "Molar Holdup" 81 M = ML*OutletL.z + MV*OutletV.z; 82 83 "Energy Holdup" 84 E = ML*OutletL.h + MV*OutletV.h  OutletL.P*V; 85 86 "Mol fraction normalisation" 87 sum(OutletL.z)=1.0; 88 89 "Mol fraction normalisation" 90 sum(OutletL.z)=sum(OutletV.z); 91 92 "Vaporization Fraction" 93 OutletV.F = Inlet.F * vfrac; 94 95 "Liquid Volume" 96 vL = PP.LiquidVolume(OutletL.T, OutletL.P, OutletL.z); 97 98 "Vapour Volume" 99 vV = PP.VapourVolume(OutletV.T, OutletV.P, OutletV.z); 100 101 "Chemical Equilibrium" 102 PP.LiquidFugacityCoefficient(OutletL.T, OutletL.P, OutletL.z)*OutletL.z = 103 PP.VapourFugacityCoefficient(OutletV.T, OutletV.P, OutletV.z)*OutletV.z; 104 105 "Thermal Equilibrium" 106 OutletV.T = OutletL.T; 107 108 "Mechanical Equilibrium" 109 OutletV.P = OutletL.P; 110 111 "Pressure Drop" 112 OutletL.P = Inlet.P  Pdrop; 113 114 "Pressure Ratio" 115 OutletL.P = Inlet.P * Pratio; 116 117 "Geometry Constraint" 118 V = ML * vL + MV * vV; 119 120 "Temperature indicator" 121 TI * 'K' = OutletL.T  273.15*'K'; 122 "Pressure indicator" 123 PI * 'atm' = OutletL.P; 124 "Level indicator" 125 LI*V = Level*Across; 126 127 switch orientation 59 VARIABLES 60 61 in Inlet as stream (Brief="Feed Stream", PosX=0, PosY=0.5421, Symbol="_{in}"); 62 out OutletLiquid as liquid_stream (Brief="Liquid outlet stream", PosX=0.4790, PosY=1, Symbol="_{outL}"); 63 out OutletVapour as vapour_stream (Brief="Vapour outlet stream", PosX=0.4877, PosY=0, Symbol="_{outV}"); 64 in InletQ as power (Brief="Rate of heat supply", PosX=1, PosY=0.7559, Protected =true,Symbol="_{in}"); 65 66 TotalHoldup(NComp) as mol (Brief="Molar Holdup in the Vessel", Protected=true); 67 LiquidHoldup as mol (Brief="Molar liquid holdup", Protected=true); 68 VapourHoldup as mol (Brief="Molar vapour holdup", Protected=true); 69 70 E as energy (Brief="Total Energy Holdup in the Vessel", Protected=true); 71 vL as volume_mol (Brief="Liquid Molar Volume", Protected=true); 72 vV as volume_mol (Brief="Vapour Molar volume", Protected=true); 73 Level as length (Brief="liquid height", Protected=true); 74 Across as area (Brief="Flash Cross section area", Protected=true); 75 vfrac as positive (Brief="Vapourization fraction", Symbol="\phi", Protected=true); 76 Pratio as positive (Brief = "Pressure Ratio", Symbol ="P_{ratio}", Protected=true); 77 Pdrop as press_delta (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P", Protected=true); 78 79 out TI as control_signal (Brief="Temperature Indicator", PosX=1, PosY=0.2, Protected=true); 80 out PI as control_signal (Brief="Pressure Indicator", PosX=1, PosY=0.3, Protected=true); 81 out LI as control_signal (Brief="Level Indicator", PosX=1, PosY=0.4, Protected=true); 82 83 INITIAL 84 85 # initial level Percent 86 LI = Levelpercent_Initial; 87 88 # initial Outlet Liquid Temperature 89 OutletLiquid.T = Temperature_Initial; 90 91 # initial Outlet Liquid Composition Normalized 92 OutletLiquid.z(1:NComp  1) = Composition_Initial(1:NComp  1)/sum(Composition_Initial); 93 94 EQUATIONS 95 96 "Component Molar Balance" 97 diff(TotalHoldup)=Inlet.F*Inlet.z  OutletLiquid.F*OutletLiquid.z  OutletVapour.F*OutletVapour.z; 98 99 "Energy Balance" 100 diff(E) = Inlet.F*Inlet.h  OutletLiquid.F*OutletLiquid.h  OutletVapour.F*OutletVapour.h + InletQ; 101 102 "Molar Holdup" 103 TotalHoldup = LiquidHoldup*OutletLiquid.z + VapourHoldup*OutletVapour.z; 104 105 "Energy Holdup" 106 E = LiquidHoldup*OutletLiquid.h + VapourHoldup*OutletVapour.h  OutletLiquid.P*VesselVolume; 107 108 "Mol fraction normalisation" 109 sum(OutletLiquid.z)=1.0; 110 111 "Mol fraction normalisation" 112 sum(OutletLiquid.z)=sum(OutletVapour.z); 113 114 "Vaporization Fraction" 115 OutletVapour.F = Inlet.F * vfrac; 116 117 "Liquid Volume" 118 vL = PP.LiquidVolume(OutletLiquid.T, OutletLiquid.P, OutletLiquid.z); 119 120 "Vapour Volume" 121 vV = PP.VapourVolume(OutletVapour.T, OutletVapour.P, OutletVapour.z); 122 123 "Chemical Equilibrium" 124 PP.LiquidFugacityCoefficient(OutletLiquid.T, OutletLiquid.P, OutletLiquid.z)*OutletLiquid.z = 125 PP.VapourFugacityCoefficient(OutletVapour.T, OutletVapour.P, OutletVapour.z)*OutletVapour.z; 126 127 "Thermal Equilibrium" 128 OutletVapour.T = OutletLiquid.T; 129 130 "Mechanical Equilibrium" 131 OutletVapour.P = OutletLiquid.P; 132 133 "Pressure Drop" 134 OutletLiquid.P = Inlet.P  Pdrop; 135 136 "Pressure Ratio" 137 OutletLiquid.P = Inlet.P * Pratio; 138 139 "Geometry Constraint" 140 VesselVolume = LiquidHoldup * vL + VapourHoldup * vV; 141 142 "Temperature indicator Celsius Degree" 143 TI * 'K' = OutletLiquid.T  273.15*'K'; 144 145 "Pressure indicator" 146 PI * 'atm' = OutletLiquid.P; 147 148 "Level indicator" 149 LI*VesselVolume= Level*Across; 150 151 switch Orientation 128 152 case "vertical": 129 153 "Cross Section Area" 130 Across = 0.5 * asin(1) * diameter^2;154 Across = 0.5 * asin(1) * Diameter^2; 131 155 132 156 "Liquid Level" 133 ML* vL = Across * Level;157 LiquidHoldup * vL = Across * Level; 134 158 135 159 case "horizontal": 136 160 "Cylindrical Side Area" 137 Across = 0.25* diameter^2 * (asin(1)  asin((diameter  2*Level)/diameter)) +138 (Level  0.5* diameter)*sqrt(Level*(diameter  Level));161 Across = 0.25*Diameter^2 * (asin(1)  asin((Diameter  2*Level)/Diameter)) + 162 (Level  0.5*Diameter)*sqrt(Level*(Diameter  Level)); 139 163 140 164 "Liquid Level" 141 0.5 * asin(1) * diameter^2 * ML* vL = Across * V; 142 end 165 0.5 * asin(1) * Diameter^2 * LiquidHoldup* vL = Across * VesselVolume; 166 end 167 143 168 end 144 169
Note: See TracChangeset
for help on using the changeset viewer.