source: mso/eml/pressure_changers/valve.mso @ 57

Last change on this file since 57 was 57, checked in by Paula Bettio Staudt, 16 years ago

Added new pressure_changers models

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.2 KB
Line 
1#*-----------------------------------------------------------------------------
2* Author:       Estefane Horn                                   Date:06/10/2006
3*                       
4*$Id:$                                                                 
5*-----------------------------------------------------------------------------
6* Assumptions
7* -> Steady State
8* -> Isentalpic
9* -> Liquid
10*
11*#
12
13using "streams";
14using "pressure_changers/flux_machine_basic";
15       
16
17Model valve_basic as flux_machine_basic_TP
18       
19        PARAMETERS
20ext PP                  as CalcObject   (Brief = "External Physical Properties", File = "vrpp");
21ext NComp       as Integer              (Brief = "Number of chemical components", Lower = 1);
22        rho60F  as dens_mass;
23
24        VARIABLES
25        Pdiff   as press_delta          (Brief = "Pressure Increase", Unit = "kPa");
26        Qv              as flow_vol                     (Brief = "Volumetric Flow");
27        fc              as positive                     (Brief = "Opening Function");
28        cv              as positive                     (Brief = "Valve Coefficient", Unit = "m^3/h/kPa^0.5");
29        Gf              as positive                     (Brief = "Specific Gravity");
30        rho     as dens_mass;   
31        vm              as vol_mol                      (Brief = "Mixture Molar Volume", Unit = "m^3/kmol");   
32       
33        SET
34        rho60F = 99.022 * "kg/m^3";
35       
36        EQUATIONS
37        "Calculate Outlet Stream Pressure"
38        Inlet.P - Outlet.P = Pdiff;
39       
40        "Enthalpy Balance"
41        Outlet.h = Inlet.h;
42       
43        "Molar Balance"
44        Outlet.F = Inlet.F;
45       
46        "Calculate Outlet Composition"
47        Outlet.z = Inlet.z;
48
49        "Valve Equation"
50        Qv = fc*cv*sqrt(Pdiff/Gf);
51       
52        "Calculate Gf"
53        Gf = rho/rho60F;
54       
55        "Calculate Specific Mass"
56        rho = PP.LiquidDensity(Inlet.T,Inlet.P,Inlet.z);
57       
58        "Calculate Mass Flow"
59        Qv = Inlet.F*vm;       
60       
61        "Calculate Liquid Molar Volume"
62        vm = PP.LiquidVolume(Inlet.T,Inlet.P,Inlet.z);
63       
64end
65
66Model valve_linear as valve_basic
67
68        VARIABLES
69        x               as fraction (Brief = "Opening");
70
71        EQUATIONS
72       
73        "Opening Equation"
74        fc = 100*x;
75
76end
77
78Model valve_parabolic as valve_basic
79
80        PARAMETERS
81        n               as positive (Brief = "Constant", Lower = 1.4, Upper = 2.6);
82
83        VARIABLES
84        x               as fraction (Brief = "Opening");
85       
86        EQUATIONS
87       
88        "Opening Equation"
89        fc = 100*x^n;
90
91end
92
93Model valve_equal as valve_basic
94
95        PARAMETERS
96        a               as Real (Brief = "Constant", Default = 100);
97
98        VARIABLES
99        x               as fraction (Brief = "Opening");
100
101        EQUATIONS
102       
103        "Opening Equation"
104        fc = 100*a^(x-1);
105
106end
107
108Model valve_quick as valve_basic
109
110        PARAMETERS
111        a               as positive     (Brief = "Constant", Default = 0.05);
112        n               as positive (Brief = "Constant", Default = 5);
113
114        VARIABLES
115        x               as fraction (Brief = "Opening");
116
117        EQUATIONS
118       
119        "Opening Equation"
120        fc = 100*(1-(a*(1-x)-(a-1)*(1-x)^n));
121
122end
123
124#*-------------------------------------------------------------------
125* Model of a valve
126*--------------------------------------------------------------------
127*
128*       Streams:
129*               * an  inlet stream
130*               * an  outlet stream
131*
132*       Assumptions:
133*               * no flashing liquid in the valve
134*               * the flow in the valve is adiabatic
135*               * dynamics in the valve are neglected
136*               * linear flow type
137*
138*       Specify:
139*               * the inlet stream
140*               * one of: plug position (x), outlet temperature (Outlet.T) or
141*                                                               outlet pressure (Outlet.P)
142*       or             
143*               * the inlet stream excluding its flow (Inlet.F)
144*               * the outlet pressure (Outlet.P) OR outlet flow (Outlet.F)
145*               * the plug position (x)
146*
147*
148*----------------------------------------------------------------------
149* Author: Paula B. Staudt
150* $Id: valve.mso 57 2006-11-16 16:46:48Z paula $
151*--------------------------------------------------------------------*#
152
153Model valve
154        PARAMETERS
155ext PP as CalcObject;
156ext NComp as Integer;
157       
158        VARIABLES
159in      Inlet as stream;
160out     Outlet as stream_therm;
161        x as fraction (Brief="Plug Position");
162        rho as dens_mass (Brief="Fluid Density", Default=1e3);
163        v as vol_mol (Brief="Specific volume", Default=1e3);
164
165        PARAMETERS
166        rho_ref as dens_mass (Brief="Reference Density", Default=1e4);
167        k as Real (Brief="Valve Constant", Unit="gal/min/psi^0.5");
168
169        EQUATIONS
170        "Molar Balance"
171        Inlet.F = Outlet.F;
172        Inlet.z = Outlet.z;
173       
174        "Energy Balance"
175        Inlet.h = Outlet.h;
176
177        "Vapourisation Fraction"
178        Outlet.v = Inlet.v;
179       
180        "Density"
181        rho = Inlet.v*PP.VapourDensity((Inlet.T+Outlet.T)/2, (Inlet.P+Outlet.P)/2, Outlet.z) +
182                (1-Inlet.v)*PP.LiquidDensity((Inlet.T+Outlet.T)/2, (Inlet.P+Outlet.P)/2, Outlet.z);
183
184        "Volume"
185        v = Inlet.v*PP.VapourVolume((Inlet.T+Outlet.T)/2, (Inlet.P+Outlet.P)/2, Outlet.z) +
186                (1-Inlet.v)*PP.LiquidVolume((Inlet.T+Outlet.T)/2, (Inlet.P+Outlet.P)/2, Outlet.z);
187
188        #if Inlet.P > Outlet.P then
189        #       "Flow"
190                Outlet.F * v = k*x*sqrt((Inlet.P - Outlet.P)*rho_ref / rho ) ;
191        #else
192        #       "Closed"
193        #       Outlet.F = 0 * "kmol/h";
194        #end
195end
Note: See TracBrowser for help on using the repository browser.