1 | #*---------------------------------------------- |
---|
2 | * FlowSheet generated automaticaly by EMSO-GUI |
---|
3 | *----------------------------------------------*# |
---|
4 | |
---|
5 | using "streams.mso"; |
---|
6 | using "pressure_changers/valve.mso"; |
---|
7 | using "controllers/PIDs.mso"; |
---|
8 | using "stage_separators/tank.mso"; |
---|
9 | using "pressure_changers/pump.mso"; |
---|
10 | |
---|
11 | FlowSheet Sample_TankVL_PID |
---|
12 | PARAMETERS |
---|
13 | PP as Plugin(Brief="Physical Properties", |
---|
14 | Type="PP", |
---|
15 | Components = ["n-butane","benzene","n-octane"], |
---|
16 | LiquidModel = "SRK", |
---|
17 | VapourModel = "SRK" |
---|
18 | ); |
---|
19 | NComp as Integer; |
---|
20 | SET |
---|
21 | NComp = PP.NumberOfComponents; |
---|
22 | |
---|
23 | DEVICES |
---|
24 | Feed as simple_source; |
---|
25 | VaporProduct as sink; |
---|
26 | valve_liquid as valve_flow; |
---|
27 | valve_Vapour as valve_flow; |
---|
28 | PID_LC as PID; |
---|
29 | PID_PC as PID; |
---|
30 | LiquidProduct as simple_sink; |
---|
31 | Heat_Duty as energy_source2; |
---|
32 | V001 as TankVL; |
---|
33 | pump_1 as pump; |
---|
34 | |
---|
35 | CONNECTIONS |
---|
36 | valve_Vapour.Outlet to VaporProduct.Inlet; |
---|
37 | PID_LC.Output to valve_liquid.FlowFraction; |
---|
38 | PID_PC.Output to valve_Vapour.FlowFraction; |
---|
39 | valve_liquid.Outlet to LiquidProduct.Inlet; |
---|
40 | V001.OutletVapour to valve_Vapour.Inlet; |
---|
41 | V001.PI to PID_PC.Input; |
---|
42 | V001.LI to PID_LC.Input; |
---|
43 | Heat_Duty.OutletQ to V001.InletQ; |
---|
44 | V001.OutletLiquid to valve_liquid.Inlet; |
---|
45 | Feed.Outlet to pump_1.Inlet; |
---|
46 | pump_1.Outlet to V001.Inlet; |
---|
47 | |
---|
48 | SET |
---|
49 | valve_liquid.MaxFlow = 2000 * 'kmol/h' ; |
---|
50 | valve_liquid.MinFlow = 0 * 'kmol/h' ; |
---|
51 | valve_Vapour.MinFlow = 0 * 'kmol/h' ; |
---|
52 | valve_Vapour.MaxFlow = 1000 * 'kmol/h' ; |
---|
53 | PID_LC.PID_Select = "Parallel_AWBT" ; |
---|
54 | PID_LC.Action = "Direct" ; |
---|
55 | PID_LC.Mode = "Automatic" ; |
---|
56 | PID_LC.Clip = "Clipped" ; |
---|
57 | PID_LC.alpha = 1 ; |
---|
58 | PID_LC.beta = 1 ; |
---|
59 | PID_LC.bias = 0.5 ; |
---|
60 | PID_LC.derivTime = 19 * 's' ; |
---|
61 | PID_LC.intTime = 76 * 's' ; |
---|
62 | PID_LC.gain = 1.1776 ; |
---|
63 | PID_LC.gamma = 1 ; |
---|
64 | PID_LC.tau = 1 * 's' ; |
---|
65 | PID_LC.tauSet = 1 * 's' ; |
---|
66 | PID_LC.MinInput = 0 ; |
---|
67 | PID_LC.MaxInput = 2 ; |
---|
68 | PID_LC.MinOutput = 0 ; |
---|
69 | PID_LC.MaxOutput = 1 ; |
---|
70 | PID_PC.PID_Select = "Parallel_AWBT" ; |
---|
71 | PID_PC.Action = "Direct" ; |
---|
72 | PID_PC.Mode = "Automatic" ; |
---|
73 | PID_PC.Clip = "Clipped" ; |
---|
74 | PID_PC.alpha = 1 ; |
---|
75 | PID_PC.beta = 1 ; |
---|
76 | PID_PC.bias = 0.5 ; |
---|
77 | PID_PC.derivTime = 18 * 's' ; |
---|
78 | PID_PC.intTime = 72 * 's' ; |
---|
79 | PID_PC.gain = 0.9275 ; |
---|
80 | PID_PC.gamma = 1 ; |
---|
81 | PID_PC.tau = 1 * 's' ; |
---|
82 | PID_PC.tauSet = 1 * 's' ; |
---|
83 | PID_PC.MinInput = 0 ; |
---|
84 | PID_PC.MaxInput = 4 ; |
---|
85 | PID_PC.MinOutput = 0 ; |
---|
86 | PID_PC.MaxOutput = 1 ; |
---|
87 | V001.Levelpercent_Initial = 0.5 ; |
---|
88 | V001.Temperature_Initial = 300 * 'K' ; |
---|
89 | V001.Geometry.Diameter = 2 * 'm' ; |
---|
90 | V001.Geometry.Lenght = 6 * 'm' ; |
---|
91 | V001.Geometry.Heads = "flat" ; |
---|
92 | V001.Geometry.Orientation = "horizontal" ; |
---|
93 | V001.Kfactor = 0.6 ; |
---|
94 | V001.Composition_Initial(1) = 0.3 ; |
---|
95 | V001.Composition_Initial(2) = 0.3 ; |
---|
96 | |
---|
97 | SPECIFY |
---|
98 | Feed.MolarComposition(1) = 0.3 ; |
---|
99 | Feed.MolarComposition(2) = 0.3 ; |
---|
100 | Feed.MolarComposition(3) = 0.4 ; |
---|
101 | Feed.T = 338 * 'K' ; |
---|
102 | Feed.P = 5 * 'atm' ; |
---|
103 | PID_LC.SetPoint = 0.7 ; |
---|
104 | PID_PC.SetPoint = 0.6 ; |
---|
105 | Heat_Duty.OutletQ = 0 * 'kW' ; |
---|
106 | pump_1.Pincrease = 12 * 'kPa' ; |
---|
107 | |
---|
108 | OPTIONS |
---|
109 | Dynamic = true; |
---|
110 | TimeStep = 0.2; |
---|
111 | TimeEnd = 4; |
---|
112 | TimeUnit = 'h'; |
---|
113 | Integration = "original"; |
---|
114 | NLASolver( |
---|
115 | File = "sundials", |
---|
116 | RelativeAccuracy = 1e-3, |
---|
117 | AbsoluteAccuracy = 1e-3, |
---|
118 | MaxIterations = 100 |
---|
119 | ); |
---|
120 | DAESolver( |
---|
121 | File = "dasslc", |
---|
122 | RelativeAccuracy = 1e-2, |
---|
123 | AbsoluteAccuracy = 1e-6, |
---|
124 | EventAccuracy = 1e-2 |
---|
125 | ); |
---|
126 | end |
---|