Changeset 595 for branches/gui/eml/pressure_changers/compressor.mso
- Timestamp:
- Aug 8, 2008, 6:55:17 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gui/eml/pressure_changers/compressor.mso
r393 r595 21 21 22 22 Model centrifugal_compressor 23 ATTRIBUTES 23 24 ATTRIBUTES 24 25 Pallete = true; 25 26 Icon = "icon/CentrifugalCompressor"; 26 Brief = "Model of a centrifugal compressor."; 27 Info = 28 "== Assumptions == 29 * Steady State; 30 * Only Vapor; 31 * Adiabatic. 27 Brief = "Testing Model of a centrifugal compressor."; 28 32 29 33 == Specify == 34 * the inlet stream; 35 * the outlet pressure (Outlet.P); 36 * the Isentropic efficiency (Effs). 37 "; 38 39 PARAMETERS 40 outer PP as Plugin (Brief = "External Physical Properties", Type="PP"); 41 outer NComp as Integer (Brief = "Number of chemical components", Lower = 1); 42 R as positive (Default = 8.31451, Brief = "Constant of Gases", Unit= 'kJ/kmol/K'); 30 PARAMETERS 31 32 outer PP as Plugin (Brief = "External Physical Properties", Type="PP"); 33 outer NComp as Integer (Brief = "Number of chemical components", Lower = 1); 34 R as positive (Brief = "Constant of Gases", Unit= 'kJ/kmol/K', Default = 8.31451,Hidden=true); 43 35 Mw(NComp) as molweight (Brief = "Molar Weight"); 44 36 45 VARIABLES 46 n as positive (Brief = "Politropic Coefficient", Lower=0); 47 k as positive (Brief = "Isentropic Coefficient", Lower=1e-3); 48 Cp as cp_mol (Brief = "Heat Capacity"); 49 Cv as cv_mol (Brief = "Heat Capacity"); 37 VARIABLES 38 39 n as positive (Brief = "Politropic Coefficient", Lower=0); 40 k as positive (Brief = "Isentropic Coefficient", Lower=1e-3); 41 Cp as cp_mol (Brief = "Heat Capacity"); 42 Cv as cv_mol (Brief = "Heat Capacity"); 50 43 Pratio as positive (Brief = "Pressure Ratio", Symbol ="P_{ratio}"); 51 44 Pdrop as press_delta (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P"); 52 45 Wp as energy_mol (Brief = "Politropic Head"); 53 46 Ws as energy_mol (Brief = "Isentropic Head"); 54 Tiso as temperature (Brief = "Isentropic Temperature"); 55 Effp as positive (Brief = "Politropic efficiency"); 56 Effs as efficiency (Brief = "Isentropic efficiency"); 57 FPower as power (Brief = "Fluid Power"); 58 Mwm as molweight (Brief = "Mixture Molar Weight"); 59 in Inlet as stream (Brief = "Inlet stream", PosX=0, PosY=0.5086, Symbol="_{in}"); 60 out Outlet as streamPH (Brief = "Outlet stream", PosX=1, PosY=0.5022, Symbol="_{out}"); 47 Tiso as temperature (Brief = "Isentropic Temperature"); 48 Effp as positive (Brief = "Politropic efficiency"); 49 Effs as efficiency (Brief = "Isentropic efficiency"); 50 FPower as power (Brief = "Fluid Power"); 51 Mwm as molweight (Brief = "Mixture Molar Weight"); 61 52 62 SET 53 in Inlet as stream (Brief = "Inlet stream", PosX=0.35, PosY=0, Symbol="_{in}"); 54 out Outlet as streamPH (Brief = "Outlet stream", PosX=1, PosY=0.85, Symbol="_{out}"); 55 56 in WorkIn as power (Brief = "Work Inlet", PosX=0, PosY=0.55); 57 58 SET 59 63 60 Mw = PP.MolecularWeight(); 64 65 EQUATIONS 66 67 "Calculate Mwm for Inlet Mixture" 61 62 R = 8.31451*'kJ/kmol/K'; 63 64 EQUATIONS 65 66 "Calculate Mwm for Inlet Mixture" 68 67 Mwm = sum(Mw*Inlet.z); 69 68 70 69 "Pressure Ratio" 71 70 Outlet.P = Inlet.P * Pratio; 72 71 73 72 "Pressure Drop" 74 73 Outlet.P = Inlet.P - Pdrop; 75 74 76 75 "Calculate Cp Using a External Physical Properties Routine" 77 76 Cp = PP.VapourCp(Inlet.T,Inlet.P,Inlet.z); 78 77 79 78 "Calculate Cv Using a External Physical Properties Routine" 80 79 Cv = PP.VapourCv(Inlet.T,Inlet.P,Inlet.z); 81 80 82 81 "Calculate Isentropic Coeficient" 83 82 k * Cv = Cp; 84 83 85 84 "Calculate Isentropic Head" 86 85 Ws = (k/(k-1))*R*Inlet.T*((Outlet.P/Inlet.P)^((k-1)/k) - 1); 87 86 88 87 "Calculate Isentropic Outlet Temperature" 89 88 # Tiso = Inlet.T * (Outlet.P/Inlet.P)^((k-1)/k); 90 PP.VapourEntropy(Tiso, Outlet.P, Outlet.z) = 91 PP.VapourEntropy(Inlet.T, Inlet.P, Inlet.z); 89 PP.VapourEntropy(Tiso, Outlet.P, Outlet.z) = PP.VapourEntropy(Inlet.T, Inlet.P, Inlet.z); 92 90 93 91 "Calculate Real Outlet Temperature" 94 92 Effs * (Outlet.T- Inlet.T) = (Tiso - Inlet.T); 95 93 96 94 "Calculate Politropic Coefficient" 97 95 n*(ln(Outlet.T/Inlet.T)) = (n-1)*(ln(Outlet.P/Inlet.P)); 98 96 99 97 "Calculate Politropic Efficiency" 100 98 Effp * (n-1) * k = n * (k-1); 101 99 102 100 "Calculate Politropic Head" 103 101 Ws*Effp = Wp*Effs; 104 102 105 "Calculate Fluid Power" 106 FPower*Effs = Inlet.F*Ws; 107 108 "Overall Molar Balance" 103 "Overall Molar Balance" 109 104 Outlet.F = Inlet.F; 110 105 111 106 "Component Molar Balance" 112 107 Outlet.z = Inlet.z; 108 109 # Testing Equations 110 111 "Fluid Power" 112 FPower*Effs = Inlet.F*Ws; 113 114 "Fluid Power" 115 FPower = WorkIn; 116 113 117 end
Note: See TracChangeset
for help on using the changeset viewer.