Changeset 175 for branches/newlanguage
- Timestamp:
- Mar 2, 2007, 1:57:58 PM (17 years ago)
- Location:
- branches/newlanguage
- Files:
-
- 3 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 -
branches/newlanguage/sample/mixers_splitters/sample_sepComp.mso
r80 r175 27 27 28 28 FlowSheet Sample_sepComp_n 29 PARAMETERS30 PP as CalcObject(Brief="Physical Properties",File="vrpp");31 NComp as Integer;32 29 33 DEVICES 34 stream as stream_therm; 35 sep as sepComp_n; 30 PARAMETERS 36 31 37 CONNECTIONS38 stream to sep.Inlet;32 PP as Plugin (Brief="Physical Properties",File="vrpp"); 33 NComp as Integer; 39 34 40 SET 35 DEVICES 36 Stream as source; 37 sep as sepComp_n; 38 39 CONNECTIONS 40 Stream.Outlet to sep.Inlet; 41 42 SET 41 43 PP.Components = [ "isobutane", "benzene"]; 42 44 PP.LiquidModel = "PR"; 43 45 PP.VapourModel = "PR"; 44 46 NComp = PP.NumberOfComponents; 47 45 48 sep.mainComp = 1; 46 49 sep.NOutlet = 3; 47 50 48 49 stream.F = 30 * "kmol/h";50 stream.P = 120 * "kPa";51 stream.T = 290 * "K";52 stream.z = [0.6, 0.4];53 stream.v = 0;51 SPECIFY 52 Stream.Outlet.F = 30 * 'kmol/h'; 53 Stream.Outlet.P = 120 * 'kPa'; 54 Stream.Outlet.T = 290 * 'K'; 55 Stream.Outlet.z = [0.6, 0.4]; 56 54 57 sep.Outlet(1).z(1) = 0.7; 55 58 sep.Outlet(2).z(1) = 0.1; … … 59 62 # sep.recovery(2) = 0.033333; 60 63 61 62 relativeAccuracy = 1e-7;64 OPTIONS 65 RelativeAccuracy = 1e-7; 63 66 64 67 end … … 67 70 FlowSheet Sample_sepComp 68 71 PARAMETERS 69 PP as CalcObject(Brief="Physical Properties",File="vrpp");72 PP as Plugin(Brief="Physical Properties",File="vrpp"); 70 73 NComp as Integer; 71 74 72 75 DEVICES 73 stream as streamTP;76 Stream as source; 74 77 sep as sepComp; 75 78 76 79 CONNECTIONS 77 streamto sep.Inlet;80 Stream.Outlet to sep.Inlet; 78 81 79 82 SET … … 85 88 86 89 SPECIFY 87 stream.F = 30 * "kmol/h"; 88 stream.P = 120 * "kPa"; 89 stream.T = 290 * "K"; 90 stream.z = [0.6, 0.4]; 90 Stream.Outlet .F = 30 * 'kmol/h'; 91 Stream.Outlet .P = 120 * 'kPa'; 92 Stream.Outlet .T = 290 * 'K'; 93 Stream.Outlet .z = [0.6, 0.4]; 94 91 95 sep.Outlet1.z(1) = 0.7; 92 96 sep.frac = 0.4; … … 94 98 95 99 OPTIONS 96 relativeAccuracy = 1e-7;100 RelativeAccuracy = 1e-7; 97 101 98 102 end -
branches/newlanguage/sample/mixers_splitters/sample_splitter.mso
r80 r175 28 28 FlowSheet TestSplitter 29 29 PARAMETERS 30 PP as CalcObject(Brief="Physical Properties",File="vrpp");30 PP as Plugin (Brief="Physical Properties",File="vrpp"); 31 31 NComp as Integer; 32 32 NOutlet as Integer; 33 33 34 34 DEVICES 35 stream as stream_therm;36 splitter as splitter_n;35 Stream as source; 36 Splitter as splitter_n; 37 37 38 38 CONNECTIONS 39 stream to splitter.Inlet;39 Stream.Outlet to Splitter.Inlet; 40 40 41 41 SET … … 44 44 PP.VapourModel = "PR"; 45 45 NComp = PP.NumberOfComponents; 46 splitter.NOutlet = 3;46 Splitter.NOutlet = 3; 47 47 48 48 SPECIFY 49 stream.F = 153 * "kmol/h";50 stream.P = 150 * "kPa";51 stream.T = 298.6 * "K";52 stream.z = [0.6, 0.4];53 stream.v = 0;54 splitter.frac(1) = 0.4;55 splitter.frac(2) = 0.1;49 Stream.Outlet.F = 153 * 'kmol/h'; 50 Stream.Outlet.P = 150 * 'kPa'; 51 Stream.Outlet.T = 298.6 * 'K'; 52 Stream.Outlet.z = [0.6, 0.4]; 53 54 Splitter.frac(1) = 0.4; 55 Splitter.frac(2) = 0.1; 56 56 57 57 OPTIONS 58 relativeAccuracy = 1e-7;58 RelativeAccuracy = 1e-7; 59 59 60 60 end
Note: See TracChangeset
for help on using the changeset viewer.