[596] | 1 | #*------------------------------------------------------------------- |
---|
| 2 | * EMSO Model Library (EML) Copyright (C) 2004 - 2007 ALSOC. |
---|
| 3 | * |
---|
| 4 | * This LIBRARY is free software; you can distribute it and/or modify |
---|
| 5 | * it under the therms of the ALSOC FREE LICENSE as available at |
---|
| 6 | * http://www.enq.ufrgs.br/alsoc. |
---|
| 7 | * |
---|
| 8 | * EMSO Copyright (C) 2004 - 2007 ALSOC, original code |
---|
| 9 | * from http://www.rps.eng.br Copyright (C) 2002-2004. |
---|
| 10 | * All rights reserved. |
---|
| 11 | * |
---|
| 12 | * EMSO is distributed under the therms of the ALSOC LICENSE as |
---|
| 13 | * available at http://www.enq.ufrgs.br/alsoc. |
---|
| 14 | * |
---|
| 15 | *---------------------------------------------------------------------- |
---|
| 16 | * Authors: Rafael de Pelegrini Soares |
---|
| 17 | * Andrey Copat, Estefane S. Horn, Marcos L. Alencastro |
---|
| 18 | * $Id: turbine.mso 609 2008-08-25 22:10:03Z bicca $ |
---|
| 19 | *--------------------------------------------------------------------*# |
---|
| 20 | |
---|
| 21 | using "streams"; |
---|
| 22 | |
---|
| 23 | #Needs to be reformulated |
---|
| 24 | |
---|
| 25 | Model HidraulicTurbine |
---|
| 26 | ATTRIBUTES |
---|
| 27 | Pallete = true; |
---|
| 28 | Icon = "icon/HidraulicTurbine"; |
---|
| 29 | Brief = "Testing Model of a Hidraulic Turbine."; |
---|
| 30 | |
---|
| 31 | PARAMETERS |
---|
| 32 | outer NComp as Integer (Brief = "Number of chemical components", Lower = 1); |
---|
| 33 | outer PP as Plugin (Brief = "External Physical Properties", Type="PP"); |
---|
| 34 | Mw(NComp) as molweight (Brief = "Molar Weight"); |
---|
| 35 | |
---|
| 36 | VARIABLES |
---|
| 37 | Eff as efficiency (Brief = "Turbine efficiency"); |
---|
| 38 | Meff as efficiency (Brief = "Brake efficiency"); |
---|
| 39 | Beta as positive (Brief = "Volumetric expansivity", Unit = '1/K'); |
---|
| 40 | Head as head (Brief = "Head Developed"); |
---|
| 41 | FPower as power (Brief = "Fluid Power"); |
---|
| 42 | BPower as power (Brief = "Brake Power"); |
---|
| 43 | Pratio as positive (Brief = "Pressure Ratio"); |
---|
| 44 | Pdrop as press_delta (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P"); |
---|
| 45 | Mwm as molweight (Brief = "Mixture Molar Weight"); |
---|
| 46 | rho as dens_mass (Brief = "Specific Mass"); |
---|
| 47 | Cp as cp_mol (Brief = "Heat Capacity"); |
---|
| 48 | in Inlet as stream (Brief = "Inlet stream", PosX=0.05, PosY=0.0, Symbol="_{in}"); |
---|
| 49 | out Outlet as stream (Brief = "Outlet stream", PosX=0.65, PosY=1, Symbol="_{out}"); |
---|
| 50 | out WorkOut as power (Brief = "Work Outlet", PosX=1, PosY=0.46); |
---|
| 51 | |
---|
| 52 | SET |
---|
| 53 | Mw = PP.MolecularWeight(); |
---|
| 54 | |
---|
| 55 | EQUATIONS |
---|
| 56 | #Mixtures Properties |
---|
| 57 | "Calculate Mwm for Inlet Mixture" |
---|
| 58 | Mwm = sum(Mw*Inlet.z); |
---|
| 59 | |
---|
| 60 | "Calculate rho using a External Physical Properties Routine" |
---|
| 61 | rho = PP.LiquidDensity(Inlet.T,Inlet.P,Inlet.z); |
---|
| 62 | |
---|
| 63 | "Calculate Outlet Vapour Fraction" |
---|
| 64 | Outlet.v = PP.VapourFraction(Outlet.T, Outlet.P, Outlet.z); |
---|
| 65 | |
---|
| 66 | "Calculate Cp Using a External Physical Properties Routine" |
---|
| 67 | Cp = PP.LiquidCp(Inlet.T,Inlet.P,Inlet.z); |
---|
| 68 | |
---|
| 69 | "Pressure Ratio" |
---|
| 70 | Outlet.P = Inlet.P * Pratio; |
---|
| 71 | |
---|
| 72 | "Pressure Drop" |
---|
| 73 | Outlet.P = Inlet.P - Pdrop; |
---|
| 74 | |
---|
| 75 | "Calculate Fluid Power" |
---|
| 76 | FPower * rho = -Pdrop * Inlet.F * Mwm; |
---|
| 77 | |
---|
| 78 | "Calculate Brake Power" |
---|
| 79 | BPower = FPower * Eff; |
---|
| 80 | |
---|
| 81 | BPower = WorkOut; |
---|
| 82 | |
---|
| 83 | "Calculate Outlet Temperature" |
---|
| 84 | (Outlet.T - Inlet.T) * rho * Cp = (Outlet.h - Inlet.h) * rho |
---|
| 85 | + Pdrop * Mwm * (1-Beta*Inlet.T); |
---|
| 86 | |
---|
| 87 | "Calculate Outlet Enthalpy" |
---|
| 88 | (Outlet.h - Inlet.h) * rho = -Pdrop * Mwm; |
---|
| 89 | |
---|
| 90 | "Molar Balance" |
---|
| 91 | Outlet.F = Inlet.F; |
---|
| 92 | |
---|
| 93 | "Calculate Outlet Composition" |
---|
| 94 | Outlet.z = Inlet.z; |
---|
| 95 | |
---|
| 96 | "Calculate Head" |
---|
| 97 | Head = Outlet.h - Inlet.h; |
---|
| 98 | end |
---|
| 99 | |
---|
| 100 | Model HidraulicTurbineGenerator as HidraulicTurbine |
---|
| 101 | ATTRIBUTES |
---|
| 102 | Pallete = true; |
---|
| 103 | Icon = "icon/HidraulicTurbine"; |
---|
| 104 | Brief = "Model of a Hidraulic Turbine."; |
---|
| 105 | Info = |
---|
| 106 | "== Assumptions == |
---|
| 107 | * Steady State; |
---|
| 108 | * Only Liquid; |
---|
| 109 | * Adiabatic; |
---|
| 110 | * Isentropic. |
---|
| 111 | |
---|
| 112 | == Specify == |
---|
| 113 | * the inlet stream; |
---|
| 114 | * the Pressure Increase (Pdiff) OR the outlet pressure (Outlet.P); |
---|
| 115 | * the Turbine efficiency (Eff); |
---|
| 116 | * the Brake efficiency (Meff); |
---|
| 117 | * the Volumetric expansivity (Beta). |
---|
| 118 | "; |
---|
| 119 | |
---|
| 120 | VARIABLES |
---|
| 121 | EPower as power (Brief = "Eletrical Potency"); |
---|
| 122 | |
---|
| 123 | EQUATIONS |
---|
| 124 | "Calculate Eletric Power" |
---|
| 125 | EPower = BPower * Meff; |
---|
| 126 | end |
---|
[597] | 127 | |
---|
| 128 | Model expander |
---|
| 129 | |
---|
[604] | 130 | ATTRIBUTES |
---|
[597] | 131 | Pallete = true; |
---|
| 132 | Icon = "icon/HidraulicTurbine"; |
---|
[604] | 133 | Brief = "Model of an expansor."; |
---|
| 134 | Info = |
---|
| 135 | "To be documented"; |
---|
[597] | 136 | |
---|
| 137 | PARAMETERS |
---|
| 138 | |
---|
[604] | 139 | outer PP as Plugin (Brief = "External Physical Properties", Type="PP"); |
---|
| 140 | outer NComp as Integer (Brief = "Number of chemical components", Lower = 1); |
---|
| 141 | Rgas as positive (Brief = "Constant of Gases", Unit= 'kJ/kmol/K', Default = 8.31451,Hidden=true); |
---|
| 142 | Mw(NComp) as molweight (Brief = "Molar Weight"); |
---|
| 143 | |
---|
[597] | 144 | VARIABLES |
---|
[604] | 145 | |
---|
| 146 | IseCoeff as positive (Brief = "Isentropic Coefficient", Lower=0.2); |
---|
| 147 | Pratio as positive (Brief = "Pressure Ratio", Symbol ="P_{ratio}"); |
---|
| 148 | Pdrop as press_delta (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P"); |
---|
| 149 | Pdecrease as press_delta (Brief = "Pressure Decrease", DisplayUnit = 'kPa', Symbol ="P_{decr}"); |
---|
| 150 | |
---|
[609] | 151 | Head as energy_mass (Brief = "Head",Hidden=true); |
---|
[604] | 152 | HeadIsentropic as energy_mass (Brief = "Isentropic Head"); |
---|
| 153 | Tisentropic as temperature (Brief = "Isentropic Temperature"); |
---|
[597] | 154 | |
---|
[604] | 155 | IsentropicEff as efficiency (Brief = "Isentropic efficiency"); |
---|
| 156 | MechanicalEff as efficiency (Brief = "Mechanical efficiency"); |
---|
| 157 | |
---|
| 158 | FluidPower as power (Brief = "Fluid Power"); |
---|
| 159 | BrakePower as power (Brief = "Brake Power"); |
---|
[605] | 160 | PowerLoss as power (Brief = "Power Losses",Lower=0); |
---|
[604] | 161 | Mwm as molweight (Brief = "Mixture Molar Weight"); |
---|
| 162 | rho as dens_mass (Brief = "Mass Density"); |
---|
| 163 | Zfac_in as fraction (Brief = "Compressibility factor at inlet"); |
---|
| 164 | Zfac_out as fraction (Brief = "Compressibility factor at outlet"); |
---|
| 165 | |
---|
[597] | 166 | in Inlet as stream (Brief = "Inlet stream", PosX=0.05, PosY=0.0, Symbol="_{in}"); |
---|
[604] | 167 | out Outlet as streamPH (Brief = "Outlet stream", PosX=0.65, PosY=1, Symbol="_{out}"); |
---|
[597] | 168 | |
---|
[604] | 169 | out WorkOut as power (Brief = "Work Outlet", PosX=1, PosY=0.46); |
---|
| 170 | |
---|
[597] | 171 | SET |
---|
[604] | 172 | |
---|
| 173 | Mw = PP.MolecularWeight(); |
---|
| 174 | |
---|
| 175 | Rgas = 8.31451*'kJ/kmol/K'; |
---|
| 176 | |
---|
[597] | 177 | EQUATIONS |
---|
| 178 | |
---|
[604] | 179 | "Overall Molar Balance" |
---|
| 180 | Outlet.F = Inlet.F; |
---|
| 181 | |
---|
| 182 | "Component Molar Balance" |
---|
| 183 | Outlet.z = Inlet.z; |
---|
| 184 | |
---|
| 185 | "Average Molecular Weight" |
---|
[597] | 186 | Mwm = sum(Mw*Inlet.z); |
---|
| 187 | |
---|
| 188 | "Pressure Ratio" |
---|
| 189 | Outlet.P = Inlet.P * Pratio; |
---|
| 190 | |
---|
| 191 | "Pressure Drop" |
---|
| 192 | Outlet.P = Inlet.P - Pdrop; |
---|
| 193 | |
---|
[604] | 194 | "Pressure Decrease" |
---|
| 195 | Outlet.P = Inlet.P - Pdecrease; |
---|
[597] | 196 | |
---|
[604] | 197 | "Mass Density" |
---|
| 198 | rho = PP.VapourDensity(Inlet.T, Inlet.P, Inlet.z); |
---|
| 199 | |
---|
| 200 | "Compressibility factor at Inlet Conditions" |
---|
| 201 | Zfac_in = PP.VapourCompressibilityFactor(Inlet.T,Inlet.P,Inlet.z); |
---|
| 202 | |
---|
| 203 | "Compressibility factor at Outlet Conditions" |
---|
| 204 | Zfac_out = PP.VapourCompressibilityFactor(Outlet.T,Outlet.P,Outlet.z); |
---|
[597] | 205 | |
---|
[604] | 206 | "Isentropic Head" |
---|
| 207 | HeadIsentropic*Mwm = (PP.VapourEnthalpy(Tisentropic,Outlet.P,Outlet.z)-Inlet.h); |
---|
[597] | 208 | |
---|
[605] | 209 | "Actual Head" |
---|
| 210 | Head*Mwm = (Outlet.h-Inlet.h); |
---|
| 211 | |
---|
| 212 | "Isentropic Coefficient" |
---|
| 213 | 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); |
---|
| 214 | |
---|
[604] | 215 | "Isentropic Outlet Temperature" |
---|
| 216 | PP.VapourEntropy(Tisentropic, Outlet.P, Outlet.z) = PP.VapourEntropy(Inlet.T, Inlet.P, Inlet.z); |
---|
[597] | 217 | |
---|
| 218 | |
---|
[604] | 219 | if IsentropicEff equal 1 |
---|
[597] | 220 | |
---|
[604] | 221 | then |
---|
| 222 | "Discharge Temperature" |
---|
| 223 | Outlet.T = Tisentropic; |
---|
[597] | 224 | |
---|
[604] | 225 | else |
---|
| 226 | |
---|
| 227 | "Discharge Temperature" |
---|
[605] | 228 | (PP.VapourEnthalpy(Outlet.T,Outlet.P,Outlet.z)-Inlet.h)= (PP.VapourEnthalpy(Tisentropic,Outlet.P,Outlet.z)-Inlet.h)*IsentropicEff; |
---|
[604] | 229 | |
---|
[597] | 230 | end |
---|
[604] | 231 | |
---|
| 232 | "Fluid Power" |
---|
[609] | 233 | FluidPower = IsentropicEff*HeadIsentropic*sum(Mw*Inlet.z)*Inlet.F+PowerLoss; |
---|
[604] | 234 | |
---|
| 235 | "Brake Power" |
---|
| 236 | BrakePower = WorkOut; |
---|
| 237 | |
---|
| 238 | "Brake Power" |
---|
[605] | 239 | BrakePower = FluidPower*MechanicalEff; |
---|
[604] | 240 | |
---|
| 241 | "Power Loss" |
---|
| 242 | PowerLoss = BrakePower - FluidPower; |
---|
| 243 | |
---|
| 244 | end |
---|