source: trunk/eml/pressure_changers/expander.mso @ 996

Last change on this file since 996 was 739, checked in by gerson bicca, 15 years ago

updates (changes in icons/models/samples)

File size: 4.8 KB
Line 
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* Author: Marcos L. Alencastro,  Estefane S. Horn (Revised Gerson B. Bicca)
17* $Id: expander.mso 687 2008-11-20 19:42:33Z bicca $
18*--------------------------------------------------------------------*#
19
20using "streams";
21
22Model expander
23       
24ATTRIBUTES
25        Pallete         = true;
26        Icon            = "icon/expander";
27        Brief           = "Model of an expander.";
28        Info            =
29"To be documented
30
31== References ==
32
33[1] GPSA, 1979, Engineering Data Book, Chapter 4, 5-9 - 5-10.
34
35[2] Bloch, Heinz P., A Practical Guide to Compressor Technology, John Wiley & Sons, Incorporate, 2006.";
36       
37PARAMETERS
38
39outer PP                                        as Plugin                       (Brief = "External Physical Properties", Type="PP");
40outer NComp                     as Integer              (Brief = "Number of chemical components", Lower = 1);
41        Rgas                                            as positive             (Brief = "Constant of Gases", Unit= 'kJ/kmol/K', Default = 8.31451,Hidden=true);
42        Mw(NComp)                       as molweight    (Brief = "Molar Weight",Hidden=true);
43MechanicalEff                   as positive     (Brief = "Mechanical efficiency",Lower=1E-3);
44        IsentropicEff   as positive     (Brief = "Isentropic efficiency",Lower=1E-3);
45VARIABLES
46
47        Pratio          as positive             (Brief = "Pressure Ratio", Lower = 1E-6, Symbol ="P_{ratio}"); 
48        Pdrop           as press_delta  (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P");
49        Pdecrease       as press_delta  (Brief = "Pressure Decrease", DisplayUnit = 'kPa', Symbol ="P_{incr}");
50        PowerLoss       as power        (Brief = "Power Losses",Lower=0);
51        Head                                    as energy_mass  (Brief = "Actual Head", Protected=true);
52        HeadIsentropic  as energy_mass  (Brief = "Isentropic Head", Protected=true);
53       
54        FluidPower      as power        (Brief = "Fluid Power", Protected=true);
55        BrakePower      as power        (Brief = "Brake Power", Protected=true);
56
57        IseCoeff                        as positive     (Brief = "Isentropic Coefficient", Lower=0.2,Protected=true);
58
59
60        Tisentropic     as temperature          (Brief = "Isentropic Temperature",Protected=true);
61        hise                    as enth_mol             (Brief = "Enthalpy at constant entropy",Hidden=true);
62        Mwm                     as molweight            (Brief = "Mixture Molar Weight",Hidden=true);
63        rho_in                  as dens_mass            (Brief = "Mass Density at inlet conditions", Lower = 1E-6, Protected=true);
64        rho_out         as dens_mass            (Brief = "Mass Density at outlet conditions", Lower = 1E-6, Protected=true);
65        Zfac_in                 as fraction             (Brief = "Compressibility factor at inlet", Lower = 1E-3, Protected=true);
66        Zfac_out                as fraction             (Brief = "Compressibility factor at outlet", Lower = 1E-3, Protected=true);
67
68in      Inlet           as stream       (Brief = "Inlet stream", PosX=0.14, PosY=0.0, Symbol="_{in}");
69out     Outlet          as streamPH     (Brief = "Outlet stream", PosX=0.83, PosY=1, Symbol="_{out}");
70
71out     WorkOut as power        (Brief = "Work Outlet", PosX=1, PosY=0.45, Protected=true);
72
73SET
74
75        Mw = PP.MolecularWeight();
76
77        Rgas    = 8.31451*'kJ/kmol/K';
78
79EQUATIONS
80
81"Overall Molar Balance"
82        Outlet.F = Inlet.F;
83
84"Component Molar Balance"
85        Outlet.z = Inlet.z;
86
87"Average Molecular Weight"
88        Mwm = sum(Mw*Inlet.z);
89
90"Pressure Ratio"
91        Outlet.P = Inlet.P * Pratio;
92
93"Pressure Drop"
94        Outlet.P  = Inlet.P - Pdrop;
95
96"Pressure Decrease"
97        Outlet.P  = Inlet.P - Pdecrease;
98
99"Mass Density at inlet conditions"
100        rho_in = PP.VapourDensity(Inlet.T, Inlet.P, Inlet.z);
101
102"Mass Density at outlet conditions"
103        rho_out= PP.VapourDensity(Outlet.T, Outlet.P, Outlet.z);
104
105"Enthalpy at isentropic conditions"
106        hise = PP.VapourEnthalpy(Tisentropic, Outlet.P, Outlet.z);
107       
108"Compressibility factor at Inlet Conditions"
109        Zfac_in = PP.VapourCompressibilityFactor(Inlet.T,Inlet.P,Inlet.z);
110
111"Compressibility factor at Outlet Conditions"
112        Zfac_out = PP.VapourCompressibilityFactor(Outlet.T,Outlet.P,Outlet.z);
113
114"Actual Head"
115        Head*Mwm = (Outlet.h-Inlet.h);
116
117if IsentropicEff >= 1
118
119        then
120"Discharge Temperature"
121        Outlet.T = Tisentropic;
122
123        else
124
125"Discharge Temperature"
126        (Outlet.h-Inlet.h)= (hise-Inlet.h)*IsentropicEff;
127
128end
129
130"Isentropic Outlet Temperature"
131        PP.VapourEntropy(Tisentropic, Outlet.P, Outlet.z) = PP.VapourEntropy(Inlet.T, Inlet.P, Inlet.z);
132
133"Brake Power"
134        BrakePower = WorkOut;
135
136"Brake Power"
137        BrakePower = FluidPower*MechanicalEff;
138
139"Power Loss"
140        PowerLoss = BrakePower - FluidPower;
141
142"Fluid Power"
143        FluidPower = HeadIsentropic*Mwm*Inlet.F*IsentropicEff;
144
145"Isentropic Coefficient"
146        HeadIsentropic*Mwm*((IseCoeff-1.001)/IseCoeff) = (0.5*Zfac_in+0.5*Zfac_out)*Rgas*Inlet.T*((Pratio)^((IseCoeff-1.001)/IseCoeff) - 1);
147
148"Isentropic Head"
149        HeadIsentropic*Mwm = (hise -Inlet.h);
150
151end
152
153
Note: See TracBrowser for help on using the repository browser.