source: trunk/sample/controllers/Sample_flash_pid.mso @ 960

Last change on this file since 960 was 941, checked in by mamuller, 11 years ago

updated samples

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.3 KB
Line 
1#*-------------------------------------------------------------------
2* EMSO Model Library (EML) Copyright (C) 2004 - 2008 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 - 2008 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* Flash separator sample file.
17*--------------------------------------------------------------------
18*
19* This sample file needs VRTherm (www.vrtech.com.br) to run.
20*
21*--------------------------------------------------------------------
22* Author: Rafael de Pelegrini Soares
23* $Id: Sample_flash_pid.mso 941 2011-07-15 18:44:52Z mamuller $
24*------------------------------------------------------------------*#
25
26using "stage_separators/flash";
27using "pressure_changers/valve.mso";
28using "controllers/PIDIncr";
29
30FlowSheet Flash_Dynamic
31       
32        PARAMETERS
33        PP      as Plugin(Brief="Physical Properties",Type="PP",
34                Components = ["n-butane", "benzene", "n-octane"],
35                LiquidModel = "PR",
36                VapourModel = "PR");
37        NComp   as Integer;
38
39        VARIABLES
40        Q       as energy_source (Brief="Heat supplied");
41       
42        DEVICES
43        pidL as PIDIncr; #Level controller
44        pidP as PIDIncr; #Pressure controller
45        fl as flash;
46        s1 as source;
47        valve_top as valve_flow;
48        valve_bot as valve_flow;
49
50        SET
51        NComp = PP.NumberOfComponents;
52       
53        pidL.PID_Select = "Parallel_AWBT";
54        pidP.PID_Select = "Parallel_AWBT";
55       
56        #Flash model parameters
57        fl.Lenght = 10 * 'm';
58        fl.Diameter = 1 * 'm';
59        fl.Orientation = "vertical";
60       
61        #Maximum and minimum values
62        pidP.MaxInput=2.36;
63        pidP.MinInput=0;
64        pidL.MaxInput=2;
65        pidL.MinInput=0;
66        valve_top.MaxFlow=300*'kmol/h';
67        valve_top.MinFlow=0*'kmol/h';
68        valve_bot.MaxFlow=692.7*'kmol/h';
69        valve_bot.MinFlow=0*'kmol/h';
70
71        CONNECTIONS
72        s1.Outlet to fl.Inlet;
73        Q.OutletQ to fl.InletQ;
74        fl.OutletLiquid to valve_bot.Inlet;
75        fl.OutletVapour to valve_top.Inlet;
76        fl.LI to pidL.Input;
77        fl.PI to pidP.Input;
78        pidP.Output to valve_top.FlowFraction;
79        pidL.Output to valve_bot.FlowFraction;
80
81        SET
82        #Level controller configuration
83        pidL.bias=0.5;
84        pidL.gain=1.1776;
85        pidL.derivTime=19*'s';
86        pidL.intTime=76*'s';
87        pidL.tau=1*'s';
88        pidL.tauSet=1*'s';
89        pidL.alpha =1;
90        pidL.beta =1;
91    pidL.gamma =1;
92        pidL.Mode = "Automatic";
93        pidL.Clip = "Clipped";
94        pidL.Action = "Direct";
95       
96        #Pressure controller parameters
97        pidP.bias=0.5; 
98        pidP.gain=0.9275;
99        pidP.derivTime=18*'s';
100        pidP.intTime=72*'s';
101        pidP.tau=1*'s';
102        pidP.tauSet=1*'s';
103        pidP.alpha =1;
104        pidP.beta =1;
105        pidP.gamma =1;
106        pidP.Mode = "Automatic";               
107        pidP.Clip = "Clipped";
108        pidP.Action = "Direct";
109
110        #Initial conditions
111        fl.Levelpercent_Initial = 0.5;
112        fl.Temperature_Initial = 340 * 'K';
113        fl.Composition_Initial = [0.1, 0.1, 0.8];
114
115        SPECIFY
116
117        Q.OutletQ = 1026.32 * 'kJ/s';
118
119        #Level controller parameters
120        pidL.SetPoint=0.5;
121
122        EQUATIONS
123        #Feed stream
124        s1.Composition = [0.3, 0.3, 0.4];       
125        s1.P = 5 * 'atm';       
126       
127        #Disturbance
128        if time < 0.5*'h' then
129                s1.T = 338 * 'K';
130                s1.F = 496.3 * 'kmol/h';
131        else
132                s1.T = 360 * 'K';
133                s1.F = 450 * 'kmol/h';
134        end
135       
136        #Setpoint change
137        if time < 2*'h' then
138                pidP.SetPoint=1;
139        else
140                pidP.SetPoint=2;
141        end     
142       
143        OPTIONS
144        TimeStep = 0.02;
145        TimeEnd = 3;
146        TimeUnit = 'h';
147        DAESolver(File="dassl");
148end
149
150
151
Note: See TracBrowser for help on using the repository browser.