#*-------------------------------------------------------------------
* 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.
*
*----------------------------------------------------------------------
* Author: Marcos L. Alencastro, Estefane S. Horn (Revised Gerson B. Bicca)
* $Id: compressor.mso 608 2008-08-25 05:11:12Z bicca $
*--------------------------------------------------------------------*#
using "streams";
Model centrifugal_compressor
ATTRIBUTES
Pallete = true;
Icon = "icon/CentrifugalCompressor";
Brief = "Model of a centrifugal compressor.";
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");
CompressorType as Switcher (Brief = "Compressor Model Type",Valid=["Polytropic Operation","Isentropic Operation"], Default="Isentropic Operation");
VARIABLES
Pratio as positive (Brief = "Pressure Ratio", Symbol ="P_{ratio}");
Pdrop as press_delta (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P");
Pincrease as press_delta (Brief = "Pressure Increase", DisplayUnit = 'kPa', Symbol ="P_{incr}");
Head as energy_mass (Brief = "Actual Head",Hidden=true);
HeadIsentropic as energy_mass (Brief = "Isentropic Head");
HeadPolytropic as energy_mass (Brief = "Polytropic Head");
EfficiencyOperation as positive (Brief = "Compressor efficiency - Polytropic or Isentropic (See Compressor Type)",Lower=1E-3,Upper=1);
MechanicalEff as positive (Brief = "Mechanical efficiency",Lower=1E-3,Upper=1);
FluidPower as power (Brief = "Fluid Power");
BrakePower as power (Brief = "Brake Power");
PowerLoss as power (Brief = "Power Losses");
PolyCoeff as positive (Brief = "Polytropic Coefficient", Lower=0.2,Protected=true);
IseCoeff as positive (Brief = "Isentropic Coefficient", Lower=0.2,Protected=true);
PolytropicEff as positive (Brief = "Polytropic efficiency",Lower=1E-3,Upper=1,Protected=true);
IsentropicEff as positive (Brief = "Isentropic efficiency",Lower=1E-3,Upper=1,Protected=true);
Tisentropic as temperature (Brief = "Isentropic Temperature",Protected=true);
Mwm as molweight (Brief = "Mixture Molar Weight",Protected=true);
rho as dens_mass (Brief = "Mass Density",Protected=true);
Zfac_in as fraction (Brief = "Compressibility factor at inlet",Protected=true);
Zfac_out as fraction (Brief = "Compressibility factor at outlet",Protected=true);
in Inlet as stream (Brief = "Inlet stream", PosX=0.437, PosY=1, Symbol="_{in}");
out Outlet as streamPH (Brief = "Outlet stream", PosX=0.953, PosY=0.0, Symbol="_{out}");
in WorkIn as power (Brief = "Work Inlet", PosX=0, PosY=0.45);
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 Increase"
Outlet.P = Inlet.P + Pincrease;
"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 Outlet Temperature"
PP.VapourEntropy(Tisentropic, Outlet.P, Outlet.z) = PP.VapourEntropy(Inlet.T, Inlet.P, Inlet.z);
"Brake Power"
BrakePower = -WorkIn;
"Brake Power"
BrakePower*MechanicalEff = FluidPower;
"Power Loss"
PowerLoss = BrakePower - FluidPower;
"Isentropic Efficiency"
IsentropicEff*(PP.VapourEnthalpy(Outlet.T,Outlet.P,Outlet.z)-Inlet.h) = (PP.VapourEnthalpy(Tisentropic,Outlet.P,Outlet.z)-Inlet.h);
"Polytropic-Isentropic Relation"
PolytropicEff*HeadIsentropic = HeadPolytropic*IsentropicEff;
"Polytropic Efficiency"
PolytropicEff*IseCoeff*(PolyCoeff-1) = PolyCoeff*(IseCoeff-1);
"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);
"Polytropic Coefficient"
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);
"Fluid Power"
FluidPower = Head*sum(Mw*Inlet.z)*Inlet.F*EfficiencyOperation+PowerLoss;
switch CompressorType
case "Isentropic Operation":
"Efficiency"
EfficiencyOperation = IsentropicEff;
case "Polytropic Operation":
"Efficiency"
EfficiencyOperation = PolytropicEff;
end
end