#*------------------------------------------------------------------- * EMSO Model Library (EML) Copyright (C) 2004 - 2007 ALSOC. * * This LIBRARY is free software; you can distribute it and/or modify * it under the therms of the ALSOC FREE LICENSE as available at * http://www.enq.ufrgs.br/alsoc. * * EMSO Copyright (C) 2004 - 2007 ALSOC, original code * from http://www.rps.eng.br Copyright (C) 2002-2004. * All rights reserved. * * EMSO is distributed under the therms of the ALSOC LICENSE as * available at http://www.enq.ufrgs.br/alsoc. * *---------------------------------------------------------------------- * Authors: Rafael de Pelegrini Soares * Andrey Copat, Estefane S. Horn, Marcos L. Alencastro * $Id: turbine.mso 609 2008-08-25 22:10:03Z bicca $ *--------------------------------------------------------------------*# using "streams"; #Needs to be reformulated Model HidraulicTurbine ATTRIBUTES Pallete = true; Icon = "icon/HidraulicTurbine"; Brief = "Testing Model of a Hidraulic Turbine."; PARAMETERS outer NComp as Integer (Brief = "Number of chemical components", Lower = 1); outer PP as Plugin (Brief = "External Physical Properties", Type="PP"); Mw(NComp) as molweight (Brief = "Molar Weight"); VARIABLES Eff as efficiency (Brief = "Turbine efficiency"); Meff as efficiency (Brief = "Brake efficiency"); Beta as positive (Brief = "Volumetric expansivity", Unit = '1/K'); Head as head (Brief = "Head Developed"); FPower as power (Brief = "Fluid Power"); BPower as power (Brief = "Brake Power"); Pratio as positive (Brief = "Pressure Ratio"); Pdrop as press_delta (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P"); Mwm as molweight (Brief = "Mixture Molar Weight"); rho as dens_mass (Brief = "Specific Mass"); Cp as cp_mol (Brief = "Heat Capacity"); in Inlet as stream (Brief = "Inlet stream", PosX=0.05, PosY=0.0, Symbol="_{in}"); out Outlet as stream (Brief = "Outlet stream", PosX=0.65, PosY=1, Symbol="_{out}"); out WorkOut as power (Brief = "Work Outlet", PosX=1, PosY=0.46); SET Mw = PP.MolecularWeight(); EQUATIONS #Mixtures Properties "Calculate Mwm for Inlet Mixture" Mwm = sum(Mw*Inlet.z); "Calculate rho using a External Physical Properties Routine" rho = PP.LiquidDensity(Inlet.T,Inlet.P,Inlet.z); "Calculate Outlet Vapour Fraction" Outlet.v = PP.VapourFraction(Outlet.T, Outlet.P, Outlet.z); "Calculate Cp Using a External Physical Properties Routine" Cp = PP.LiquidCp(Inlet.T,Inlet.P,Inlet.z); "Pressure Ratio" Outlet.P = Inlet.P * Pratio; "Pressure Drop" Outlet.P = Inlet.P - Pdrop; "Calculate Fluid Power" FPower * rho = -Pdrop * Inlet.F * Mwm; "Calculate Brake Power" BPower = FPower * Eff; BPower = WorkOut; "Calculate Outlet Temperature" (Outlet.T - Inlet.T) * rho * Cp = (Outlet.h - Inlet.h) * rho + Pdrop * Mwm * (1-Beta*Inlet.T); "Calculate Outlet Enthalpy" (Outlet.h - Inlet.h) * rho = -Pdrop * Mwm; "Molar Balance" Outlet.F = Inlet.F; "Calculate Outlet Composition" Outlet.z = Inlet.z; "Calculate Head" Head = Outlet.h - Inlet.h; end Model HidraulicTurbineGenerator as HidraulicTurbine ATTRIBUTES Pallete = true; Icon = "icon/HidraulicTurbine"; Brief = "Model of a Hidraulic Turbine."; Info = "== Assumptions == * Steady State; * Only Liquid; * Adiabatic; * Isentropic. == Specify == * the inlet stream; * the Pressure Increase (Pdiff) OR the outlet pressure (Outlet.P); * the Turbine efficiency (Eff); * the Brake efficiency (Meff); * the Volumetric expansivity (Beta). "; VARIABLES EPower as power (Brief = "Eletrical Potency"); EQUATIONS "Calculate Eletric Power" EPower = BPower * Meff; end Model expander ATTRIBUTES Pallete = true; Icon = "icon/HidraulicTurbine"; Brief = "Model of an expansor."; Info = "To be documented"; PARAMETERS outer PP as Plugin (Brief = "External Physical Properties", Type="PP"); outer NComp as Integer (Brief = "Number of chemical components", Lower = 1); Rgas as positive (Brief = "Constant of Gases", Unit= 'kJ/kmol/K', Default = 8.31451,Hidden=true); Mw(NComp) as molweight (Brief = "Molar Weight"); VARIABLES IseCoeff as positive (Brief = "Isentropic Coefficient", Lower=0.2); Pratio as positive (Brief = "Pressure Ratio", Symbol ="P_{ratio}"); Pdrop as press_delta (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P"); Pdecrease as press_delta (Brief = "Pressure Decrease", DisplayUnit = 'kPa', Symbol ="P_{decr}"); Head as energy_mass (Brief = "Head",Hidden=true); HeadIsentropic as energy_mass (Brief = "Isentropic Head"); Tisentropic as temperature (Brief = "Isentropic Temperature"); IsentropicEff as efficiency (Brief = "Isentropic efficiency"); MechanicalEff as efficiency (Brief = "Mechanical efficiency"); FluidPower as power (Brief = "Fluid Power"); BrakePower as power (Brief = "Brake Power"); PowerLoss as power (Brief = "Power Losses",Lower=0); Mwm as molweight (Brief = "Mixture Molar Weight"); rho as dens_mass (Brief = "Mass Density"); Zfac_in as fraction (Brief = "Compressibility factor at inlet"); Zfac_out as fraction (Brief = "Compressibility factor at outlet"); in Inlet as stream (Brief = "Inlet stream", PosX=0.05, PosY=0.0, Symbol="_{in}"); out Outlet as streamPH (Brief = "Outlet stream", PosX=0.65, PosY=1, Symbol="_{out}"); out WorkOut as power (Brief = "Work Outlet", PosX=1, PosY=0.46); SET Mw = PP.MolecularWeight(); Rgas = 8.31451*'kJ/kmol/K'; EQUATIONS "Overall Molar Balance" Outlet.F = Inlet.F; "Component Molar Balance" Outlet.z = Inlet.z; "Average Molecular Weight" Mwm = sum(Mw*Inlet.z); "Pressure Ratio" Outlet.P = Inlet.P * Pratio; "Pressure Drop" Outlet.P = Inlet.P - Pdrop; "Pressure Decrease" Outlet.P = Inlet.P - Pdecrease; "Mass Density" rho = PP.VapourDensity(Inlet.T, Inlet.P, Inlet.z); "Compressibility factor at Inlet Conditions" Zfac_in = PP.VapourCompressibilityFactor(Inlet.T,Inlet.P,Inlet.z); "Compressibility factor at Outlet Conditions" Zfac_out = PP.VapourCompressibilityFactor(Outlet.T,Outlet.P,Outlet.z); "Isentropic Head" HeadIsentropic*Mwm = (PP.VapourEnthalpy(Tisentropic,Outlet.P,Outlet.z)-Inlet.h); "Actual Head" Head*Mwm = (Outlet.h-Inlet.h); "Isentropic Coefficient" 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); "Isentropic Outlet Temperature" PP.VapourEntropy(Tisentropic, Outlet.P, Outlet.z) = PP.VapourEntropy(Inlet.T, Inlet.P, Inlet.z); if IsentropicEff equal 1 then "Discharge Temperature" Outlet.T = Tisentropic; else "Discharge Temperature" (PP.VapourEnthalpy(Outlet.T,Outlet.P,Outlet.z)-Inlet.h)= (PP.VapourEnthalpy(Tisentropic,Outlet.P,Outlet.z)-Inlet.h)*IsentropicEff; end "Fluid Power" FluidPower = IsentropicEff*HeadIsentropic*sum(Mw*Inlet.z)*Inlet.F+PowerLoss; "Brake Power" BrakePower = WorkOut; "Brake Power" BrakePower = FluidPower*MechanicalEff; "Power Loss" PowerLoss = BrakePower - FluidPower; end