Changeset 175 for branches/newlanguage/eml
- Timestamp:
- Mar 2, 2007, 1:57:58 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/newlanguage/eml/mixers_splitters/sepComp.mso
r76 r175 52 52 Model sepComp_n 53 53 54 PARAMETERS 54 55 55 PARAMETERS 56 ext PP as CalcObject (Brief = "External Physical Properties"); 57 ext NComp as Integer (Brief = "Number of chemical components", Lower = 1); 58 NOutlet as Integer (Brief = "Number of Outlet Streams", Lower = 1); 59 mainComp as Integer (Brief = "Component specified", Default = 1, Lower = 1); 56 outer PP as Plugin (Brief = "External Physical Properties"); 57 outer NComp as Integer (Brief = "Number of chemical components", Lower = 1); 58 NOutlet as Integer (Brief = "Number of Outlet Streams", Lower = 1); 59 mainComp as Integer (Brief = "Component specified", Default = 1, Lower = 1); 60 60 61 VARIABLES 62 in Inlet as stream; 63 out Outlet(NOutlet) as stream; 64 frac(NOutlet) as fraction (Brief = "Distribution of the Outlet streams"); 65 recovery(NOutlet) as fraction (Brief = "Recovery of the component specified"); 61 VARIABLES 66 62 67 EQUATIONS 63 in Inlet as stream; 64 out Outlet(NOutlet) as stream; 65 66 frac(NOutlet) as fraction (Brief = "Distribution of the Outlet streams"); 67 recovery(NOutlet) as fraction (Brief = "Recovery of the component specified"); 68 69 EQUATIONS 68 70 69 71 "Flow" 70 72 sum(Outlet.F) = Inlet.F; 71 73 72 74 73 for i in [1:NOutlet-1] 74 75 "Mol fraction normalisation" 76 sum(Outlet(i).z) = 1; 77 end 75 for i in [1:NOutlet-1] 76 77 "Mol fraction normalisation" 78 sum(Outlet(i).z) = 1; 79 80 end 78 81 79 82 80 83 for i in [1:NComp] 81 84 82 83 85 "Composition" 86 sum(Outlet.F*Outlet.z(i)) = Inlet.F*Inlet.z(i); 84 87 85 88 end 86 89 87 90 88 for i in [1:NOutlet] 89 90 "Flow" 91 Outlet(i).F = Inlet.F*frac(i); 92 93 "Recovery" 94 recovery(i)*Inlet.z(mainComp) = frac(i)*Outlet(i).z(mainComp); 91 for i in [1:NOutlet] 95 92 96 "Pressure"97 Outlet(i).P = Inlet.P;93 "Flow" 94 Outlet(i).F = Inlet.F*frac(i); 98 95 99 "Enthalpy" 100 Outlet(i).h = (1-Outlet(i).v)*PP.LiquidEnthalpy(Outlet(i).T, Outlet(i).P, Outlet(i).z) + 96 "Recovery" 97 recovery(i)*Inlet.z(mainComp) = frac(i)*Outlet(i).z(mainComp); 98 99 "Pressure" 100 Outlet(i).P = Inlet.P; 101 102 "Enthalpy" 103 Outlet(i).h = (1-Outlet(i).v)*PP.LiquidEnthalpy(Outlet(i).T, Outlet(i).P, Outlet(i).z) + 101 104 Outlet(i).v*PP.VapourEnthalpy(Outlet(i).T, Outlet(i).P, Outlet(i).z); 102 105 103 "Temperature" 104 Outlet(i).T = Inlet.T; 105 106 "Vapourization Fraction" 107 Outlet(i).v = PP.VapourFraction(Outlet(i).T, Outlet(i).P, Outlet(i).z); 108 end 106 "Temperature" 107 Outlet(i).T = Inlet.T; 108 109 "Vapourization Fraction" 110 Outlet(i).v = PP.VapourFraction(Outlet(i).T, Outlet(i).P, Outlet(i).z); 111 112 end 113 109 114 end 110 115 … … 112 117 Model sepComp 113 118 114 PARAMETERS 115 ext PP as CalcObject (Brief = "External Physical Properties"); 116 ext NComp as Integer (Brief = "Number of chemical components", Lower = 1); 117 mainComp as Integer (Brief = "Component specified", Default = 1, Lower = 1); 119 PARAMETERS 120 121 outer PP as Plugin (Brief = "External Physical Properties"); 122 outer NComp as Integer (Brief = "Number of chemical components", Lower = 1); 123 mainComp as Integer (Brief = "Component specified", Default = 1, Lower = 1); 118 124 119 VARIABLES 120 in Inlet as stream; 121 out Outlet1 as stream; 122 out Outlet2 as stream; 123 frac as fraction (Brief = "Fraction to Outlet 1"); 124 recovery as fraction (Brief = "Recovery of the component specified"); 125 VARIABLES 126 127 in Inlet as stream; 128 out Outlet1 as stream; 129 out Outlet2 as stream; 130 131 frac as fraction (Brief = "Fraction to Outlet 1"); 132 recovery as fraction (Brief = "Recovery of the component specified"); 125 133 126 134 EQUATIONS 127 135 128 136 "Flow" 129 137 Outlet1.F = Inlet.F * frac; 130 138 Outlet1.F + Outlet2.F = Inlet.F; … … 134 142 sum(Outlet1.z) = 1; 135 143 136 for i in [1:NComp] 137 138 "Composition" 139 Outlet1.F*Outlet1.z(i) + Outlet2.F*Outlet2.z(i) = Inlet.F*Inlet.z(i); 140 end 144 for i in [1:NComp] 141 145 142 "Pressure" 146 "Composition" 147 Outlet1.F*Outlet1.z(i) + Outlet2.F*Outlet2.z(i) = Inlet.F*Inlet.z(i); 148 149 end 150 151 "Pressure" 143 152 Outlet1.P = Inlet.P; 144 153 Outlet2.P = Inlet.P; 145 154 146 155 "Enthalpy" 147 156 Outlet1.h = (1-Outlet1.v)*PP.LiquidEnthalpy(Outlet1.T, Outlet1.P, Outlet1.z) + 148 157 Outlet1.v*PP.VapourEnthalpy(Outlet1.T, Outlet1.P, Outlet1.z); … … 150 159 Outlet2.v*PP.VapourEnthalpy(Outlet2.T, Outlet2.P, Outlet2.z); 151 160 152 161 "Temperature" 153 162 Outlet1.T = Inlet.T; 154 163 Outlet2.T = Inlet.T; 155 164 156 165 "Vapourization Fraction" 157 166 Outlet1.v = PP.VapourFraction(Outlet1.T, Outlet1.P, Outlet1.z); 158 167 Outlet2.v = PP.VapourFraction(Outlet2.T, Outlet2.P, Outlet2.z); 168 159 169 end 160 170
Note: See TracChangeset
for help on using the changeset viewer.