From: henley@eng.auburn.edu (James Paul Henley)
Subject: Chemical Engineering and OOP (was: Is Borland the leader in OOP)
Keywords: engineering
Organization: Auburn University Engineering
Date: Mon, 14 Dec 1992 15:01:11 GMT


I suppose that yak yak is getting me nowhere, so let's cut to the chase.

Take a tray in a distillation column:


    L0, X0       V1, Y1          L is liquid stream flow rate down
    -------------------          V is vapor stream flow rate up
   |                  |          X is liquid fraction of light component
   |  Vh    Y1        |          Y is vapor fraction of light component
   |~~~~~~~~~~~~~~~~~~|          Vh is height of Vapor
   |  Lh    X1        |          Lh is height of Liquid
   |                  |          rhoV is density of Vapor
    ------------------           rhoL is density of Liquid
    L1, X1      V2, Y2           A is effective cross sectional area
                                 t is time
Mass balances:

   (L0 + V2) - (L1 + V1) = A*rhoV*d(Vh)/dt + A*rhoL*d(Lh)/dt
  (X0*L0 + Y2*V2) - (X1*L1 + Y1*V1) = Y1*A*rhoV*d(Vh)/dt + X1*A*rhoL*d(Lh)/dt

At steady state:

   (L0 + V2) - (L1 + V1) = 0
   (X0*L0 + Y2*V2) - (X1*L1 + Y1*V1) = 0

For binary distillation (two components):

    Y1 = f(X1)      this function may requre iterative calculations to solve.
                    To make things worse, the liquid and vapor usually don't
                    actually reach equilibrium.  A heuristic method is used
                    determine the psuedo-equilibrium relation, such as 
                    Murphree tray efficiency.

For multicomponent distillation, it gets much more difficult to express
the relationship mathematically.

For steady state, there are 8 variables:

L0, L1, V1, V2, X0, X1, Y1, Y2

But there are only three equations - two mass balances and an equilibrium
relationship.  And the equilibrium relationship may not be a simple equation.

That means that we have 5 degrees of freedom for this object. Yet, at steady
state, all 8 variables will be fixed.

So, to represent this tray as an object, it is impossible to determine the
steady state values of the variables from the mathematical description of this
one object alone.  So the equations for *all* of the trays are combined and
solved simultaneously.  But in so doing, we are no longer looking at each
tray individually.

If we use the unsteady state model, we will have to solve differential
equations in the mass balances for each tray.  We will have to do this 
in each tray, and it will have to be done simultaneously for all the trays
for the results to be accurate.  So, what we have is a number of autonomous
objects, each doing its own calculations for unsteady state response to 
changes in the input streams, and all of these objects communicating with
the other objects about the composition and flow rate of the streams leaving.
All of the objects must be running simultaneously, or at least time sharing,
and the inter-object communications has to be as fast and efficient as
possible.

In effect, what this will be is a distributed mathematical inference engine.
It will solve simultaneous differential equations in a natural order, rather
than in an artificial order.  Currently, matrix methods are used to solve the
simultaneous equations, but the matrix methods suffer from combinatorial
explosion.  There is a whole field of Chemical Engineering devoted exclusively
to finding more powerful methods of solving these simultaneous equations -
High Performance Computing.

Industry relies primarily on heuristic methods, and in the undergraduate
courses, that is what we teach.  But the heuristic methods are limited
to correlating parameters with experimental results.  In other words, they
are a sort of 20/20 hindsight.  Thus, they limit problem solutions to what
has already been done rather than what could be done.

Now,  all I need is the ability to design and implement an object that will
communicate dynamically with other objects that are running concurrently on
either the same processor, or on other processors.  That sounds just like
what a lot of people are already doing - no?  Yes, no, and maybe.

To be really valuable (and I mean $$$$$ valuable),  the design and
implementation of objects at different levels - for example a distillation
column at one level, and the components of the distillation column at a
lower level - needs to be as flexible as possible, and may require several
models for behavior.  A distillation column, for example, may have a heuristic
model based on empirical correlations, a steady state model based on Lewis
method tray by tray calculations (the simplest model), and a dynamic model
that is actually calculated by the individual tray objects themselves.
By having multiple models, any of the models may be developed after the
object has already been implemented.  This would be a valuable tool for 
model refinement.  Not only that, it would allow an object to be implemented
without being fully specified.  That is a common situation - incomplete
specification.  Also it would give a means of identifying and correcting
inconsistent specifications.  The *REAL* bonus of this approach is that
when rigorous calculations are *not* necessary, they aren't performed!
Since it is a distributed system, that decision is handled locally.

For multicomponent distillation, it may be necessary to use heuristic models
to describe the phase equilibria - that is, how the fraction of a component in
one phase is related to the fraction of the same component in another phase.
And that may require a database.  Obviously, we would want a shared database, 
and fast access to the database.

Dr. James P. Henley Jr.
Visiting Assistant Professor
Department of Chemical Engineering
Auburn University


Newsgroups: comp.object