home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / object / 4579 < prev    next >
Encoding:
Text File  |  1992-12-17  |  8.3 KB  |  165 lines

  1. Newsgroups: comp.object
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!uwm.edu!rpi!newsserver.pixel.kodak.com!laidbak!tellab5!balr!clrcom!rapp
  3. From: rapp@clear.com (Chuck Rapp)
  4. Subject: Re: Chemical Engineering and OOP (was: Is Borland the leader in OOP)
  5. Message-ID: <BzCw9D.6zA@clear.com>
  6. Organization: Clear Communications Corporation
  7. Date: Wed, 16 Dec 1992 14:29:36 GMT
  8. Lines: 155
  9.  
  10.  
  11. In article <henley.921214090111@wilbur.eng.auburn.edu>, henley@eng.auburn.edu (James Paul Henley) writes:
  12. |> 
  13. |> I suppose that yak yak is getting me nowhere, so let's cut to the chase.
  14. |> 
  15. |> Take a tray in a distillation column:
  16. |> 
  17. |> 
  18. |>     L0, X0       V1, Y1          L is liquid stream flow rate down
  19. |>     -------------------          V is vapor stream flow rate up
  20. |>    |                  |          X is liquid fraction of light component
  21. |>    |  Vh    Y1        |          Y is vapor fraction of light component
  22. |>    |~~~~~~~~~~~~~~~~~~|          Vh is height of Vapor
  23. |>    |  Lh    X1        |          Lh is height of Liquid
  24. |>    |                  |          rhoV is density of Vapor
  25. |>     ------------------           rhoL is density of Liquid
  26. |>     L1, X1      V2, Y2           A is effective cross sectional area
  27. |>                                  t is time
  28. |> Mass balances:
  29. |> 
  30. |>    (L0 + V2) - (L1 + V1) = A*rhoV*d(Vh)/dt + A*rhoL*d(Lh)/dt
  31. |>   (X0*L0 + Y2*V2) - (X1*L1 + Y1*V1) = Y1*A*rhoV*d(Vh)/dt + X1*A*rhoL*d(Lh)/dt
  32. |> 
  33. |> At steady state:
  34. |> 
  35. |>    (L0 + V2) - (L1 + V1) = 0
  36. |>    (X0*L0 + Y2*V2) - (X1*L1 + Y1*V1) = 0
  37. |> 
  38. |> For binary distillation (two components):
  39. |> 
  40. |>     Y1 = f(X1)      this function may requre iterative calculations to solve.
  41. |>                     To make things worse, the liquid and vapor usually don't
  42. |>                     actually reach equilibrium.  A heuristic method is used
  43. |>                     determine the psuedo-equilibrium relation, such as 
  44. |>                     Murphree tray efficiency.
  45. |> 
  46. |> For multicomponent distillation, it gets much more difficult to express
  47. |> the relationship mathematically.
  48. |> 
  49. |> For steady state, there are 8 variables:
  50. |> 
  51. |> L0, L1, V1, V2, X0, X1, Y1, Y2
  52. |> 
  53. |> But there are only three equations - two mass balances and an equilibrium
  54. |> relationship.  And the equilibrium relationship may not be a simple equation.
  55. |> 
  56. |> That means that we have 5 degrees of freedom for this object. Yet, at steady
  57. |> state, all 8 variables will be fixed.
  58. |> 
  59. |> So, to represent this tray as an object, it is impossible to determine the
  60. |> steady state values of the variables from the mathematical description of this
  61. |> one object alone.  So the equations for *all* of the trays are combined and
  62. |> solved simultaneously.  But in so doing, we are no longer looking at each
  63. |> tray individually.
  64. |> 
  65. |> If we use the unsteady state model, we will have to solve differential
  66. |> equations in the mass balances for each tray.  We will have to do this 
  67. |> in each tray, and it will have to be done simultaneously for all the trays
  68. |> for the results to be accurate.  So, what we have is a number of autonomous
  69. |> objects, each doing its own calculations for unsteady state response to 
  70. |> changes in the input streams, and all of these objects communicating with
  71. |> the other objects about the composition and flow rate of the streams leaving.
  72. |> All of the objects must be running simultaneously, or at least time sharing,
  73. |> and the inter-object communications has to be as fast and efficient as
  74. |> possible.
  75. |> 
  76. |> In effect, what this will be is a distributed mathematical inference engine.
  77. |> It will solve simultaneous differential equations in a natural order, rather
  78. |> than in an artificial order.  Currently, matrix methods are used to solve the
  79. |> simultaneous equations, but the matrix methods suffer from combinatorial
  80. |> explosion.  There is a whole field of Chemical Engineering devoted exclusively
  81. |> to finding more powerful methods of solving these simultaneous equations -
  82. |> High Performance Computing.
  83. |> 
  84. |> Industry relies primarily on heuristic methods, and in the undergraduate
  85. |> courses, that is what we teach.  But the heuristic methods are limited
  86. |> to correlating parameters with experimental results.  In other words, they
  87. |> are a sort of 20/20 hindsight.  Thus, they limit problem solutions to what
  88. |> has already been done rather than what could be done.
  89. |> 
  90. |> Now,  all I need is the ability to design and implement an object that will
  91. |> communicate dynamically with other objects that are running concurrently on
  92. |> either the same processor, or on other processors.  That sounds just like
  93. |> what a lot of people are already doing - no?  Yes, no, and maybe.
  94. |> 
  95. |> To be really valuable (and I mean $$$$$ valuable),  the design and
  96. |> implementation of objects at different levels - for example a distillation
  97. |> column at one level, and the components of the distillation column at a
  98. |> lower level - needs to be as flexible as possible, and may require several
  99. |> models for behavior.  A distillation column, for example, may have a heuristic
  100. |> model based on empirical correlations, a steady state model based on Lewis
  101. |> method tray by tray calculations (the simplest model), and a dynamic model
  102. |> that is actually calculated by the individual tray objects themselves.
  103. |> By having multiple models, any of the models may be developed after the
  104. |> object has already been implemented.  This would be a valuable tool for 
  105. |> model refinement.  Not only that, it would allow an object to be implemented
  106. |> without being fully specified.  That is a common situation - incomplete
  107. |> specification.  Also it would give a means of identifying and correcting
  108. |> inconsistent specifications.  The *REAL* bonus of this approach is that
  109. |> when rigorous calculations are *not* necessary, they aren't performed!
  110. |> Since it is a distributed system, that decision is handled locally.
  111. |> 
  112. |> For multicomponent distillation, it may be necessary to use heuristic models
  113. |> to describe the phase equilibria - that is, how the fraction of a component in
  114. |> one phase is related to the fraction of the same component in another phase.
  115. |> And that may require a database.  Obviously, we would want a shared database, 
  116. |> and fast access to the database.
  117. |> 
  118. |> Dr. James P. Henley Jr.
  119. |> Visiting Assistant Professor
  120. |> Department of Chemical Engineering
  121. |> Auburn University
  122. |> 
  123. |> 
  124.  
  125. The ability to communicate between objects which are running concurrently is
  126. one of the goals of Project DOE (Distributed Objects Everywhere). The Distributed
  127. Object Management Facility (DOMF) underlies DOE and is responsible for
  128. routing messages between objects and providing persistent storage of objects
  129. for future use.
  130.  
  131. For those who can't wait for Project DOE (first release is in late '93),
  132. there is still Unix message queues (for objects on the same platform)
  133. and TCP/IP sockets (inter-platform communication). This means a process
  134. is responsible for reading the queue/socket and routing the message to the
  135. objects which live inside that process. This is how we do object message
  136. in our network monitoring system.
  137.  
  138. As for having an object behave differently in varied circumstances and
  139. allowing this behavior to be incompletely defined, this may be solved
  140. by polymorphism and inheritence. I envision a distillation column
  141. class with three derived classes: heuristic, steady state, and dynamic.
  142. The distillation column class would contain the state variables.
  143.  
  144. The model used in each of these classes would be put into a virtual
  145. method (to borrow a C++ term). The default definition of this model method
  146. would do nothing allowing an object to be incompletely defined. Users who
  147. wish to update the model would create a new class which is derived from one of the above three classes (heuristic, steady state, and dynamic) and the model method would be redefined.
  148.  
  149. As for a shared database, there are many database systems which support the
  150. client/server model in the Unix world (my stomping grounds). This means that
  151. objects can access the DB across multiple platforms. Some of these DBs
  152. use the relational model (e.g. Informix, Oracle, Sybase) and some the
  153. object model (e.g. ObjectStore, Objectivity, Ontos).
  154.  
  155. The one caveat regarding distributed objects is that problems are greatly
  156. reduced when the platforms are the same. Cross-platform communication in
  157. itself is non-trivial.
  158.  
  159. Chuck Rapp
  160. Clear Communications Corporation
  161. rapp@clear.com
  162.  
  163.  
  164.  
  165.