home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Education
/
collectionofeducationcarat1997.iso
/
SCIENCE
/
PROCESS1.ZIP
/
PROCESS1.DOC
< prev
next >
Wrap
Text File
|
1991-06-08
|
8KB
|
192 lines
PROCESS1
A Process Control Simulation of a Gravity Tank
==============================================
I am a chemical engineer major at the University of Wyoming.
Last semester I took a process control class that really blew me
away. Even though I got a B in the class I was not satisfied
with my understanding of the subject. So this Summer I hope to
write several programs to help me understand various processes.
This documentation will explain some of the theory behind the
program. Hopefully, as I try to explain to you the principals
guiding the various processes, I will learn something myself.
I am taking Summer courses and working full time. I am also
a brand new C++ programmer (this is my second program). I am a
little slow at programming right now because 1) it is a new
language for me and 2) I have not programmed for four years.
Because of this I may not get as many programs out as I hope.
A Gravity Flow Tank.
A gravity flow tank is diagramed below:
■ ■
■═════╝ ║
Fo -> ║
■═════╗ ║
║ ║
║ ║
║ ║
╟──────────────────╢
║ ^ ║
║ | ║
║ | ║
║ | ║
║ | ║
║ h ║
║ | ║
║ | ║
║ | ║
║ | ║ L
║ | ╚══════════════════════■
║ | At Ap F ->
╚═════════════════════════════════════════■
Fo is the flow into the tank, h is the height of the fluid,
At is the area of the tank, Ap is the cross sectional area of the
pipe, L is the length of the pipe, and F is the flow out of the
pipe. The density is assumed to be constant for the
incompressible liquid.
The mass in the pipe will be assumed to be constant
throughout the procedures:
M=(Ap)*L*(fluid_density)
The velocity of the fluid in the pipe is assumed to be the
same at every point in the pipe:
velocity*(Ap)=F
In order to change the velocity forces must be applied.
There are two important sources of forces in this set up:
1) The hydraulic force that the fluid in the tank exerts on
the column of fluid in the pipe:
(Hf)=(Ap)*(fluid_density)*h*[g/(gc)]
[g/(gc) is a conversion factor that changes pounds mass
into pounds force. g=the acceleration of gravity=32.2
ft/s^2. (gc)=32.2 lb(mass) *ft/lb(force)/s^2.]
2) The frictional force of the fluid against the pipe:
(Ff)=K*L*v^2
(K is a friction constant)
Force is equal to mass times acceleration. acceleration can
be represented as a small change in velocity over a small length
of time:
Force=Ma=M(dv/dt)
The net force in any direction is the sum of all the forces
acting in that direction. Here we are dealing with the forces on
the column of fluid in the pipe. The (gc) conversion for pounds
mass to pounds force is also included:
M/(gc)*dv/dt=ΣForces=(Hf)-(Ff)
By substituting and simplification we get the following
equation for the small changes in velocity:
dv/dt=g*h/L-K*(gc)*v^2/[(Ap)*fluid_density]
The height of the fluid on the tank is dependant on the
volume of the tank at any given time. Small changes in the
volume are dependant on the difference of the flows into and out
of the tank. Since the area of the tank is constant it is
possible to find small changes in height in relation to the
difference of the flows:
dV/dt=(At)*(dh/dt)=Fo-F
Now we have everything we need to predict small changes in
height and velocity in the system. F is simply v*(Ap). In the
program output this equation is used to define F. I think it is
easier to think of this situation in terms of flow and height.
Since our small changes are in terms of derivatives, we must
have a way of estimating them. The method used here is called
linearization. The estimate change is calculated by assuming
that small steps in a linear fashion can represent a non linear
function. This linearization is represented below:
F(next)=F(now)+[dF(now)/dt]*(delta t)
This simply states that the following value of the function
is approximately the present value of the function plus a small
change related to whether the function is increasing or
decreasing with time. Delta t is the small increment of time
being considered. It is usually a small value.
He heart of the calculations are based on this linearization
method:
height=h+(dh/dt)*(delta t)
and
velocity=v+(dv/dt)*(delta t)
The simulation is made to help you see what happens when
there is a sudden increase or decrease in the Flow into the tank.
The tank starts out at a steady state at the beginning of each
run. Steady state is where Fo and F are the same and there are
no changes in the system. You are allowed to choose values for
the steady state and new flow values. At time zero the flow
suddenly increases from the steady state to the new flow value.
This is known as a "step."
Viewing the data on a screen is not always that helpful. I
have provided two ways to help you study your data better. After
you have run your experiment the program will give you the option
of printing a table or graph.
The table prints all the flow and height values that
appeared on the screen. The graph option prints out a low
resolution graph, but you can see visibly how the height changes
during the adjustment from the steady state to the new flow
value.
The experiment ends itself in one of two ways. If the
values of flow and height have stayed the same (three decimal
places) for 60 delta times, the system is assumed to have reached
a new steady state value. The program will always stop at 4000
delta times. The system may either be slow to reach a new steady
state or will never reach steady state.
Go ahead and experiment with different values.
Since the program is free, there is no warranty or
guaranties (what could I promise anyway?). You can have, use,
copy, and give the program to others. However, the following
regulations must be observed:
1) The disk (or compressearchive) containing the program
must include all the following files in UNMODIFIED form:
PROCESS1.EXE
PROCESS1.DOC
PROCESS1.DSC
NOREADME.DOC
PROGRAM .DOC
2) No more than $5 may be charged for copying services.
The source code is available for $5 at the address given at
the end of this document. I retain the rights to this program
and its source code. Modified versions may not be distributed
without my written consent.
If you have any questions, comments, ideas, etc., just drop
me a line. I would like to know where this program is getting
around to.
BASHER@corral.uwyo.edu
Address:
623 Lewis #B
Laramie, WY 82070