Changeset 606 for branches/gui/eml/pressure_changers/compressor.mso
- Timestamp:
- Aug 23, 2008, 5:26:51 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gui/eml/pressure_changers/compressor.mso
r601 r606 31 31 PARAMETERS 32 32 33 outer PP as Plugin(Brief = "External Physical Properties", Type="PP");34 outer NComp as Integer(Brief = "Number of chemical components", Lower = 1);35 Rgas as positive(Brief = "Constant of Gases", Unit= 'kJ/kmol/K', Default = 8.31451,Hidden=true);36 Mw(NComp) as molweight (Brief = "Molar Weight");37 CompressorType as Switcher (Brief = "Compressor Model Type",Valid=["Polytropic Operation","Isentropic Operation"], Default="Isentropic Operation");33 outer PP as Plugin (Brief = "External Physical Properties", Type="PP"); 34 outer NComp as Integer (Brief = "Number of chemical components", Lower = 1); 35 Rgas as positive (Brief = "Constant of Gases", Unit= 'kJ/kmol/K', Default = 8.31451,Hidden=true); 36 Mw(NComp) as molweight (Brief = "Molar Weight"); 37 CompressorType as Switcher (Brief = "Compressor Model Type",Valid=["Polytropic Operation","Isentropic Operation"], Default="Isentropic Operation"); 38 38 39 39 VARIABLES 40 40 41 PolyCoeff as positive (Brief = "Polytropic Coefficient", Lower=1E-6); 42 IseCoeff as positive (Brief = "Isentropic Coefficient", Lower=1E-6); 43 Cp as cp_mol (Brief = "Heat Capacity at constant Pressure"); 44 Cv as cv_mol (Brief = "Heat Capacity at constant Volume"); 41 PolyCoeff as positive (Brief = "Polytropic Coefficient", Lower=0.2); 42 IseCoeff as positive (Brief = "Isentropic Coefficient", Lower=0.2); 45 43 Pratio as positive (Brief = "Pressure Ratio", Symbol ="P_{ratio}"); 46 44 Pdrop as press_delta (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P"); 47 45 Pincrease as press_delta (Brief = "Pressure Increase", DisplayUnit = 'kPa', Symbol ="P_{incr}"); 48 46 49 Head as energy_mass (Brief = "Head"); 50 Tiso as temperature (Brief = "Isentropic Temperature"); 47 Head as energy_mass (Brief = "Actual Head"); 48 HeadIsentropic as energy_mass (Brief = "Isentropic Head"); 49 HeadPolytropic as energy_mass (Brief = "Polytropic Head"); 50 Tisentropic as temperature (Brief = "Isentropic Temperature"); 51 51 52 PolytropicEff as efficiency (Brief = "Polytropic efficiency"); 53 IsentropicEff as efficiency (Brief = "Isentropic efficiency"); 54 MechanicalEff as efficiency (Brief = "Mechanical efficiency"); 52 PolytropicEff as efficiency (Brief = "Polytropic efficiency"); 53 IsentropicEff as efficiency (Brief = "Isentropic efficiency"); 54 EfficiencyOperation as efficiency (Brief = "Compressor efficiency - Polytropic or Isentropic (See Compressor Type)"); 55 MechanicalEff as efficiency (Brief = "Mechanical efficiency"); 55 56 56 FluidPower as power (Brief = "Fluid Power");57 BrakePower as power (Brief = "Brake Power");58 PowerLoss as power (Brief = "Power Losses");59 Mwm as molweight (Brief = "Mixture Molar Weight");60 rho as dens_mass (Brief = "Mass Density");61 Zfac_in as fraction (Brief = "Compressibility factor at inlet");62 Zfac_out as fraction (Brief = "Compressibility factor at outlet");57 FluidPower as power (Brief = "Fluid Power"); 58 BrakePower as power (Brief = "Brake Power"); 59 PowerLoss as power (Brief = "Power Losses"); 60 Mwm as molweight (Brief = "Mixture Molar Weight"); 61 rho as dens_mass (Brief = "Mass Density"); 62 Zfac_in as fraction (Brief = "Compressibility factor at inlet"); 63 Zfac_out as fraction (Brief = "Compressibility factor at outlet"); 63 64 64 in Inlet 65 out Outlet 65 in Inlet as stream (Brief = "Inlet stream", PosX=0.437, PosY=1, Symbol="_{in}"); 66 out Outlet as streamPH (Brief = "Outlet stream", PosX=0.953, PosY=0.0, Symbol="_{out}"); 66 67 67 in WorkIn 68 in WorkIn as power (Brief = "Work Inlet", PosX=0, PosY=0.45); 68 69 69 70 SET … … 95 96 "Mass Density" 96 97 rho = PP.VapourDensity(Inlet.T, Inlet.P, Inlet.z); 97 98 "Heat Capacity at Constant Pressure" 99 Cp = PP.VapourCp(Inlet.T,Inlet.P,Inlet.z); 100 101 "Heat Capacity at Constant Volume" 102 Cv = PP.VapourCv(Inlet.T,Inlet.P,Inlet.z); 103 98 104 99 "Compressibility factor at Inlet Conditions" 105 100 Zfac_in = PP.VapourCompressibilityFactor(Inlet.T,Inlet.P,Inlet.z); 106 101 107 102 "Compressibility factor at Outlet Conditions" 108 103 Zfac_out = PP.VapourCompressibilityFactor(Outlet.T,Outlet.P,Outlet.z); 109 110 "Isentropic Coeficient"111 IseCoeff * Cv = Cp;112 104 113 switch CompressorType114 115 case "Isentropic Operation":116 117 105 "Isentropic Head" 118 Head = (0.5*Zfac_in+0.5*Zfac_out)*(1/Mwm)*(IseCoeff/(IseCoeff-1.001))*Rgas*Inlet.T*((Outlet.P/Inlet.P)^((IseCoeff-1.001)/IseCoeff) - 1); 106 HeadIsentropic*Mwm = (PP.VapourEnthalpy(Tisentropic,Outlet.P,Outlet.z)-Inlet.h); 107 108 "Actual Head" 109 Head*Mwm = (Outlet.h-Inlet.h); 110 111 "Isentropic Outlet Temperature" 112 PP.VapourEntropy(Tisentropic, Outlet.P, Outlet.z) = PP.VapourEntropy(Inlet.T, Inlet.P, Inlet.z); 119 113 120 114 "Fluid Power" 121 FluidPower*IsentropicEff = Head*sum(Mw*Inlet.z)*Inlet.F; 122 123 "Discharge Temperature" 124 Outlet.T = Inlet.T*((Outlet.P/Inlet.P)^((IseCoeff-1.001)/IseCoeff)); 125 126 case "Polytropic Operation": 127 128 "Polytropic Head" 129 Head = (0.5*Zfac_in+0.5*Zfac_out)*(1/Mwm)*(PolyCoeff/(PolyCoeff-1.001))*Rgas*Inlet.T*((Outlet.P/Inlet.P)^((PolyCoeff-1.001)/PolyCoeff) - 1); 130 131 "Fluid Power" 132 FluidPower*PolytropicEff = Head*sum(Mw*Inlet.z)*Inlet.F; 133 134 "Discharge Temperature" 135 Outlet.T = Inlet.T*((Outlet.P/Inlet.P)^((PolyCoeff-1.001)/PolyCoeff)); 136 137 end 138 139 "Isentropic Outlet Temperature" 140 PP.VapourEntropy(Tiso, Outlet.P, Outlet.z) = PP.VapourEntropy(Inlet.T, Inlet.P, Inlet.z); 141 142 "Polytropic Efficiency" 143 PolytropicEff * (PolyCoeff-1) * IseCoeff = PolyCoeff * (IseCoeff-1); 115 FluidPower = Head*sum(Mw*Inlet.z)*Inlet.F; 144 116 145 117 "Brake Power" … … 147 119 148 120 "Brake Power" 149 BrakePower = (FluidPower/MechanicalEff)-PowerLoss;121 BrakePower = FluidPower/MechanicalEff; 150 122 151 123 "Power Loss" 152 124 PowerLoss = BrakePower - FluidPower; 153 125 126 "Isentropic Efficiency" 127 IsentropicEff*(PP.VapourEnthalpy(Outlet.T,Outlet.P,Outlet.z)-Inlet.h) = (PP.VapourEnthalpy(Tisentropic,Outlet.P,Outlet.z)-Inlet.h); 128 129 "Polytropic-Isentropic Relation" 130 PolytropicEff*HeadIsentropic = HeadPolytropic*IsentropicEff; 131 132 "Polytropic Efficiency" 133 PolytropicEff*IseCoeff*(PolyCoeff-1) = PolyCoeff*(IseCoeff-1); 134 135 "Isentropic Coefficient" 136 HeadIsentropic = (0.5*Zfac_in+0.5*Zfac_out)*(1/Mwm)*(IseCoeff/(IseCoeff-1.001))*Rgas*Inlet.T*((Outlet.P/Inlet.P)^((IseCoeff-1.001)/IseCoeff) - 1); 137 138 "Polytropic Coefficient" 139 HeadPolytropic = (0.5*Zfac_in+0.5*Zfac_out)*(1/Mwm)*(PolyCoeff/(PolyCoeff-1.001))*Rgas*Inlet.T*((Outlet.P/Inlet.P)^((PolyCoeff-1.001)/PolyCoeff) - 1); 140 141 switch CompressorType 142 143 case "Isentropic Operation": 144 145 "Discharge Temperature" 146 EfficiencyOperation = IsentropicEff; 147 148 case "Polytropic Operation": 149 150 "Discharge Temperature" 151 EfficiencyOperation = PolytropicEff; 152 154 153 end 154 155 156 end
Note: See TracChangeset
for help on using the changeset viewer.