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

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

added expander model (testing)

  • Property svn:keywords set to Id
File size: 5.9 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* Authors: Rafael de Pelegrini Soares
17*          Andrey Copat, Estefane S. Horn, Marcos L. Alencastro
18* $Id: turbine.mso 597 2008-08-12 20:33:05Z bicca $
19*--------------------------------------------------------------------*#
20
21using "streams";
22
23#Needs to be reformulated
24
25Model HidraulicTurbine
26        ATTRIBUTES
27        Pallete         = true;
28        Icon            = "icon/HidraulicTurbine";
29        Brief           = "Testing Model of a Hidraulic Turbine.";
30       
31        PARAMETERS
32outer NComp     as Integer                      (Brief = "Number of chemical components", Lower = 1);
33outer 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");
48in              Inlet           as stream               (Brief = "Inlet stream", PosX=0.05, PosY=0.0, Symbol="_{in}");
49out     Outlet          as stream       (Brief = "Outlet stream", PosX=0.65, PosY=1, Symbol="_{out}");
50out 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;
98end
99
100Model 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;
126end
127
128Model expander
129       
130        ATTRIBUTES
131        Pallete         = true;
132        Icon            = "icon/HidraulicTurbine";
133        Brief           = "Testing Model of a expander.";
134       
135PARAMETERS
136
137outer NComp     as Integer                      (Brief = "Number of chemical components", Lower = 1);
138outer PP                as Plugin                       (Brief = "External Physical Properties", Type="PP");
139        Mw(NComp)       as molweight            (Brief = "Molar Weight");
140       
141VARIABLES
142        Eff     as efficiency           (Brief = "Turbine efficiency");
143        Meff    as efficiency           (Brief = "Brake efficiency");
144        Beta    as positive             (Brief = "Volumetric expansivity", Unit = '1/K');
145        Head    as head                         (Brief = "Head Developed");
146        FPower  as power                        (Brief = "Fluid Power");
147        BPower  as power                        (Brief = "Brake Power");
148        Pratio  as positive                     (Brief = "Pressure Ratio");
149        Pdrop   as press_delta          (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P");
150        Mwm     as molweight            (Brief = "Mixture Molar Weight");
151        rho             as dens_mass            (Brief = "Specific Mass");
152        Cp              as cp_mol                       (Brief = "Heat Capacity");
153       
154in      Inlet           as stream       (Brief = "Inlet stream", PosX=0.05, PosY=0.0, Symbol="_{in}");
155out     Outlet          as stream       (Brief = "Outlet stream", PosX=0.65, PosY=1, Symbol="_{out}");
156out WorkOut             as power        (Brief = "Work Outlet", PosX=1, PosY=0.46);
157
158SET
159        Mw = PP.MolecularWeight();     
160       
161EQUATIONS
162
163"Calculate Mwm for Inlet Mixture"
164        Mwm = sum(Mw*Inlet.z);
165
166"Calculate rho using a External Physical Properties Routine"
167        rho = PP.LiquidDensity(Inlet.T,Inlet.P,Inlet.z);
168       
169"Calculate Outlet Vapour Fraction"
170        Outlet.v = PP.VapourFraction(Outlet.T, Outlet.P, Outlet.z);
171       
172"Calculate Cp Using a External Physical Properties Routine"
173        Cp = PP.LiquidCp(Inlet.T,Inlet.P,Inlet.z);
174       
175"Pressure Ratio"
176        Outlet.P = Inlet.P * Pratio;
177
178"Pressure Drop"
179        Outlet.P  = Inlet.P - Pdrop;
180
181"Calculate Fluid Power"
182        FPower * rho = -Pdrop * Inlet.F * Mwm;
183
184"Calculate Brake Power"
185        BPower = FPower * Eff;
186
187        BPower = WorkOut;
188
189"Calculate Outlet Temperature"
190        (Outlet.T - Inlet.T) * rho * Cp = (Outlet.h - Inlet.h) * rho
191        + Pdrop * Mwm * (1-Beta*Inlet.T);
192
193"Calculate Outlet Enthalpy"
194        (Outlet.h - Inlet.h) * rho =  -Pdrop * Mwm;
195
196"Molar Balance"
197        Outlet.F = Inlet.F;
198"Outlet Composition"
199        Outlet.z = Inlet.z;
200
201"Calculate Head"
202        Head = Outlet.h - Inlet.h;
203
204end
Note: See TracBrowser for help on using the repository browser.