source: branches/gui/eml/pressure_changers/compressor.mso @ 597

Last change on this file since 597 was 596, checked in by gerson bicca, 14 years ago

updates

  • Property svn:keywords set to Id
File size: 3.6 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
17* $Id: compressor.mso 596 2008-08-12 03:57:24Z bicca $
18*--------------------------------------------------------------------*#
19
20using "streams";
21
22Model centrifugal_compressor
23
24ATTRIBUTES
25        Pallete         = true;
26        Icon            = "icon/CentrifugalCompressor";
27        Brief           = "Testing Model of a centrifugal compressor.";
28
29       
30PARAMETERS
31
32outer PP                        as Plugin                       (Brief = "External Physical Properties", Type="PP");
33outer 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);
35        Mw(NComp)       as molweight    (Brief = "Molar Weight");
36
37VARIABLES
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");
43        Pratio          as positive             (Brief = "Pressure Ratio", Symbol ="P_{ratio}");       
44        Pdrop           as press_delta  (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P");
45        Wp                      as energy_mol   (Brief = "Politropic Head");
46        Ws                      as energy_mol   (Brief = "Isentropic Head");
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");
52
53in              Inlet           as stream               (Brief = "Inlet stream", PosX=0.35, PosY=1, Symbol="_{in}");
54out     Outlet          as streamPH     (Brief = "Outlet stream", PosX=1, PosY=0.0, Symbol="_{out}");
55
56in      WorkIn          as power                (Brief = "Work Inlet", PosX=0, PosY=0.46);
57
58SET
59
60        Mw = PP.MolecularWeight();
61
62        R       = 8.31451*'kJ/kmol/K';
63
64EQUATIONS
65
66"Calculate Mwm for Inlet Mixture"
67        Mwm = sum(Mw*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 Cp Using a External Physical Properties Routine"
76        Cp = PP.VapourCp(Inlet.T,Inlet.P,Inlet.z);
77       
78"Calculate Cv Using a External Physical Properties Routine"
79        Cv = PP.VapourCv(Inlet.T,Inlet.P,Inlet.z);
80       
81"Calculate Isentropic Coeficient"
82        k * Cv = Cp;
83       
84"Calculate Isentropic Head"
85        Ws = (k/(k-1))*R*Inlet.T*((Outlet.P/Inlet.P)^((k-1)/k) - 1);
86       
87"Calculate Isentropic Outlet Temperature"
88#       Tiso = Inlet.T * (Outlet.P/Inlet.P)^((k-1)/k);
89        PP.VapourEntropy(Tiso, Outlet.P, Outlet.z) = PP.VapourEntropy(Inlet.T, Inlet.P, Inlet.z);
90
91"Calculate Real Outlet Temperature"
92        Effs * (Outlet.T- Inlet.T) = (Tiso - Inlet.T);
93       
94"Calculate Politropic Coefficient"
95        n*(ln(Outlet.T/Inlet.T)) = (n-1)*(ln(Outlet.P/Inlet.P));
96       
97"Calculate Politropic Efficiency"
98        Effp * (n-1) * k = n * (k-1);
99       
100"Calculate Politropic Head"
101        Ws*Effp = Wp*Effs;
102
103"Overall Molar Balance"
104        Outlet.F = Inlet.F;
105
106"Component Molar Balance"
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
117end
Note: See TracBrowser for help on using the repository browser.