Download - SimApp Tank Level Model
-
7/30/2019 SimApp Tank Level Model
1/19
VentiMar, LLC 1
SimApp IntroductionTank Level Model
Peter Waywww.ventimar.com
-
7/30/2019 SimApp Tank Level Model
2/19
VentiMar, LLC 2
Outline This application note is a tank level model that
can be used in a variety of chemical processes. The nonlinear model for turbulent flow is
developed first
The model is then linearized about an operatingpoint to allow frequency analysis.
Finally, the tank example is extended to two
tanks in series.
-
7/30/2019 SimApp Tank Level Model
3/19
VentiMar, LLC 3
SimApp Process Example
H [m]
Qi
Qo
Control valve flow rate [m^3/s or l/s]
Load valve flow rate
Tank Capacitance C [m^2] (change in volume per change in H) Not tank capacity [m^3]
Units shown in [ ]
Model the level and flow of a water tank that supplies adownstream process.
Volume: 10 m3
Height: 5 m
Radius 0.8 m
Example
-
7/30/2019 SimApp Tank Level Model
4/19
VentiMar, LLC 4
Turbulent vs. Laminar Flow The Reynolds number (Re) is a dimensionless quantity that
determines the type of flow: turbulent or laminar
Re = Dynamic pressure/ Shear stress
Laminar: Re4000, otherwise Transitional
Reference: http://www.engineeringtoolbox.com/reynolds-number-d_237.html
fluidofviscositydynamic-
diameterLpipesection-crosscircularafor
duct)ofeterduct/PerimofArea*(4lengthsticcharacteri-L
speedfluid
densityfluid
Re
=
=
u
uL
-
7/30/2019 SimApp Tank Level Model
5/19
VentiMar, LLC 5
Write the equationsTwo types of flow:
HKQ
KHQ
o
o
=
=
:Turbulent
allyexperimentmeasuredtypicallyisK:Laminar
Flow equation (examine the turbulent case in this example):
Increase of volume as head (level) H changes equals inflow-outflow over time
change. Capacitance of the tank is the cross-sectional area
i
oi
QHKdt
dHC
dtQQCdH
=+
=
iQandHbetweeniprelationshgettoRearrange
)(
Note: the terminology of resistance and capacitance borrowed
from electrical engineering is no accident! Also H Voltage, Q Current
-
7/30/2019 SimApp Tank Level Model
6/19
VentiMar, LLC 6
Make the SimApp model
C
HKQH
QHKHC
i
i
=
=+
.
:SimAppinequationtheimplementtogRearrangin
.
An easy way to make the block diagram model is to solve for the highest derivative.Then the equation is built as a block diagram as shown belowAlso we will use the dot notation for the derivative.
H
Reset
Hold
H
Ti 2 s
I
K(m^2.5/s)
K 0.008944
P
Qo(l/s)
K 1000
SQRT
Qi(l/s)
K 1000
Qi (m^3/s)
H 0.01
TD 0 s
H(m)
.
-
7/30/2019 SimApp Tank Level Model
7/19
VentiMar, LLC 7
Model features
C
HKQH
HKQ
i
o
=
=
.First, integrate thederivative
Each blocks nameis the output
C is the timeconstant of theintegrator. K, C are
example values
This implementsequation from H toQo
The summationcalculates thederivative
For now, we candrive the systemwith 10 l/s flow
These probes are for plotting andscaling the output. In this casefrom m^3/s to l/s
Reset
Hold
H
C 2 s
I
K(m^2.5/s)
K 0.008944
P
Qo(l/s)
K 1000
SQRT
Qi(l/s)
K 1000
Qi (m^3/s)
Qi 0.01
TD 0 s
H(m)
H.
-
7/30/2019 SimApp Tank Level Model
8/19
VentiMar, LLC 8
Time response You can now make a time response plot to the Qi input. Qo eventually reaches Qi (tank does not overflow or empty) At this flow rate the tank fills to 1.24 meters
-200 0 200 400 600 800 1200 1600 2000 2400 2800 3200 3600 3900
0
1
2
3
4
5
6
7
8
9
10
-0.5
0.5
1.5
2.5
3.5
4.5
5.5
6.5
7.5
8.5
9.5
10.5
Source group 0
H(m) 1.2444
Qi(l/s) 10
Qo(l/s) 9.9771
-
7/30/2019 SimApp Tank Level Model
9/19
VentiMar, LLC 9
Simple proportional control
We want to control H (process variable) to 3 m. H is measured, compared
with the Hsp (set point) which drives the proportional valve.
A simple proportional valve is used but other controllers could be applied
The ramp of Hsp (set point) or gain can be selected to determine the time todesired H, and the maximum Qi required to achieve the goal.
Reset
Hold
H
C 2 s
I
K(m^2.5/s)
K 0.008944
P
Qo(l/s)
K 1000
SQRT
Qi(l/s)
K 1000ProportionalValve
K 0.1
P
Ramp
A 0.01 s-1
Ymax 3
Hsp (x10m)
K 10
H(x10 m)
K 10
Controller: Proportional control oftank Height H
Plant
-
7/30/2019 SimApp Tank Level Model
10/19
VentiMar, LLC 10
Controller time responses H values are scaled by 10x to show dynamics better Qi needs to reach over 33 l/s to fill the tank to 3m in 400 seconds Proportional control has some error from the setpoint. Gain could be increased but
then the flow rate to fill the tank would be greater.
-50 0 50 100 150 200 250 300 350 400 450 500-25 25 75 525
0
5
10
15
20
25
30
35
-2.5
2.5
7.5
12.5
17.5
22.5
27.5
32.5
Source group 0
H(x10 m) 28.485
Hsp (x10m) 30
Qi(l/s) 15.154
Qo(l/s) 15.095
-
7/30/2019 SimApp Tank Level Model
11/19
VentiMar, LLC 11
Linearizing the turbulent model
point.setaindicatessubscripttheWhere2
Kforngsubstituti2
valveandpipetheacross
changewChange/FloEffortResistance-RDefine
:rearrange:Turbulent
0
0
0
2
2
Q
HR
K
Q
dQ
dHR
K
Q
HHKQ
=
==
=
==
-
7/30/2019 SimApp Tank Level Model
12/19
VentiMar, LLC 12
Linearizing the turbulent model
2
resistanceforequationtheusingThen
setpointthe
fromanddeviationssmallconsiderNow
0
0
00
Q
H
q
hR
, HQ
qh
==
Nonlinear vs. Linearized
-4.000
-2.000
0.000
2.000
4.000
6.000
8.000
10.000
12.000
14.000
0 5 10 15 20 25 30
Q
H
H Nonlinear [m]
h Linearized [m]
Q0,H0
qh
C
Rhqh
HKh/R
C
HKQH
i
i
/.
:)forngsubstituti(afterbecomes
onsperturbatismallforequationThe
.equation
headtoflowinputthememberingRe
=
=
-
7/30/2019 SimApp Tank Level Model
13/19
VentiMar, LLC 13
Linearized system block diagram Now the nonlinear element has been replaced by a linear resistor.
This makes it possible to calculate a frequency response.
The Height of the tank needs to be biased to 3m since that is the
operating point of the non-linear model. This is only to match timeresponses, and does not affect frequency response.
Reset
Hold
H
C 2 s
I
1/R
K 0.002631
P
Qo(l/s)
K 1000
Qi(l/s)
K 1000ProportionalValve
K 0.1
P
Ramp
A 0.01 s-1Ymax 3
Hsp (x10 m)
K 10
H ( x10 m)
K 10
Controller: Proportional control oftank Height H
Linearized Plant
Frequency
f
H Bias
3
-
7/30/2019 SimApp Tank Level Model
14/19
VentiMar, LLC 14
Time response of linearized system
-50 0 50 100 150 200 250 300 350 400 450 500-25 25 75 525
0
5
10
15
20
25
30
35
-2.5
2.5
7.5
12.5
17.5
22.5
27.5
32.5
37.5
Source group 0
H ( x10 m) 0
Hsp (x10 m) 0
Qi(l/s) 0
Qo(l/s) 7.893
Linearized model agrees quite closely
with the nonlinear model except in startup transient
-
7/30/2019 SimApp Tank Level Model
15/19
VentiMar, LLC 15
Frequency response oflinearized system
-100
-80
-60
-40
-90
-70
-50
[dB] Amplitude
0.01 0.10.02 0.03 0.05 10.2 0.3 0.5 0.7 102 3 4 5 6 7
-80
-60
-40
-20
-70
-50
-30
-10
[] Phase
Frequency
1/R
Amplitude [dB] -55.088
Phase -46.632
-
7/30/2019 SimApp Tank Level Model
16/19
VentiMar, LLC 16
Two tank example
H1 [m]
Qi
Q1
Control valve flow rate [m^3/s or l/s]
Units shown in [ ]
Model the level and flow of a water tank that supplies asecond tank. Control the height of the second tankthrough input Qi. Q2 supplies a downstream process.
H2 [m]Q2
-
7/30/2019 SimApp Tank Level Model
17/19
VentiMar, LLC 17
Two tank modelNote the correspondence between the tank illustration in prior slide and new connections
Reset
Hold
H1
C 2 s
I
K(m^2.5/s)
K 0.008944
PQ1(l/s)
K 1000
SQRT
Qi(l/s)
K 1000Proportional
Valve
K 0.08
P
Ramp
A 0.01 s-1Ymax 3
Hsp (x10m)
K 10
H1 (x10 m)
K 10
Controller: Proportional control oftank Height H
Tank 1
Reset
Hold
H2
C 2 s
I
K(m^2.5/s)
K 0.008944
P
Q2(l/s)
K 1000
SQRT
H2 (x10 m)
K 10
Tank 2
Process variable feedback
H1 - H2 drives the flow Q1 between tanks.
Q1 supplies flowinto tank 2
-
7/30/2019 SimApp Tank Level Model
18/19
VentiMar, LLC 18
Two tank time response Since there are now two lags to control, the simple gain control is no longer sufficient
for good performance.
Note that the height of liquid in tank 1 gets unacceptably large.
-200 0 200 400 600 800 1000 1200 1400 1600 1800 2000100
-60
-40
-20
0
20
40
60
80
100
120
140
-70
-50
-30
-10
10
30
50
70
90
110
130
150
Source group 0
H2 (x10 m) 0
Q2(l/s) 0
H1 (x10 m) 0
Hsp (x10m) 0
Qi(l/s) 0
Q1(l/s) 0
-
7/30/2019 SimApp Tank Level Model
19/19
VentiMar, LLC 19
SimApp Summary You can build simple models for understanding including nonlinear
effects. In this example, the model works for any level and flow
situation. Then you can simulate controllers of increasing sophistication
In the tank example, you could fill the tank to the desired H first, thenmake a linearized version of the model
You could then perform frequency and stability analysis on linearmodels and...
Design better controllers.
The block diagram method promotes understanding and lets youextend the model to new situations.
See the tutorial and design spreadsheet atwww.simapp.com/simulation-tutorials
You can build simple models for understanding including nonlineareffects. In this example, the model works for any level and flow
situation. Then you can simulate controllers of increasing sophistication
In the tank example, you could fill the tank to the desired H first, thenmake a linearized version of the model
You could then perform frequency and stability analysis on linearmodels and...
Design better controllers.
The block diagram method promotes understanding and lets youextend the model to new situations.
See the tutorial and design spreadsheet atwww.simapp.com/simulation-tutorials