Using Flowsheet Toolkit

  PMSolver Flowsheet Toolkit (FT) is used to generate flowsheet simulation programs for the DMSolver simultaneous equation solver package (formerly PMSolver), thereby allowing true simultaneous-modular flowsheet simulation modelling on 32-bit PC's. Currently it is restricted to steady-state modelling, although it is conceptually possible to create a similar toolkit used with DMSolver to provide unsteady-state simulation.

  In FT problems all nonlinear simultaneous relationships are converged simultaneously by the same Newton's algorithm, except for cubic equations of state (which use a special efficient side-calculation to ensure getting the correct root) and in certain cases, flash calculations, which use the Flash Calculator routines. The user need make no special considerations involving recycle stream tearing, etc. The internal Solver algorithms automatically handle all considerations related to order of calculations, and Newton's algorithm normally gives very "robust" convergence behavior, in which equation residual errors drop very rapidly once the general neighborhood of the solution point is reached. See DMSolver---Technical for a discussion of the underlying equation solver package.

  All simultaneous solution variables and all problem parameters can be called up within menu windows on the screen and changed by cursoring and editing them (as in spreadsheets). Since there can be thousands of simultaneous variables, you can choose not to display all of them and can select the solution variables to display/edit either by number or name or by several other criteria.

  DMSolver organization is such that you can compute a solution with one set of parameters, call up a selected set of variables to see their values, rapidly change one or more parameters, rapidly recompute the solution, and look at the same set of variables to see the effect of the parameter change. The goal which we have achieved is highly interactive operation of the system with easy performance of parametric case studies.

Physical Properties Database Preparation

 We provide a master database file for individual compounds, which are identified by alphanumeric names. You can add compounds or change values in the master database through a data entry form. In addition to a single-component property database, binary (two-component) parameters are frequently needed. We provide programs to derive binary parameters by fitting experimental data for the Peng-Robinson and Wilson vapor-liquid equilibrium methodologies, and the UNIFAC routines present in DBSET and elsewhere automatically generate the UNIFAC binary parameters. 

Properties generally follow the 1987 monograph by Reid, Prausnitz, and Polling, The Properties of Gases and Liquids, with some use of the DIPPR Data Compilation, and use of the 1993 (Gmehling et al) version of the UNIFAC model. We provide programs for obtaining binary coefficients by fitting Wilson and Peng-Robinson models to equilibrium data. Database size is currently very small (somewhat more than 100 compounds) but can be added to easily. Units are the metric ones in Reid et al. Starting point for user addition of compounds is the appendix of Reid et al. which has a database of 618 compounds for potential addition to the FT database.

Starting with Version 5.0 the Peng-Robinson alpha-function for hydrogen has been modified to give a better fit to VLE data. All Peng-Robinson binary coefficients involving hydrogen must be obtained from the FT fitting program or the database which we supply. If hydrogen is not present in the mixture, FT Peng-Robinson calculations use industry-standard methods and literature values.

Specifying the Flowsheet

  Specification of a flowsheet program using standard modules is done from the menus of a program, FTGuide, which calls various subordinate programs to present the user with a tree of menus for the available module choices (there are more than a thousand combinations) and automatically collect from the library files or generate the Solver source code which describes the modules and their interconnection through streams, control feedback, etc. After you have specified the modules and their interconnections, the Solver software automatically comes up with the count of variables and equations, defining values as either variable or constant so that the number of variables is always equal to the number of equations, and preparing the complete list of variable names which appear in the solution display/edit screens.

  Typically, there are process modules, such as reactors, which are relatively unique to each problem. You write Solver procedures yourself to define these. User-written module definitions and other user-coded items are inserted at designated positions within the automatically-generated code. The concept of Solver is such that the source code is very compact -- only code to evaluate the equations is needed (plus perhaps error-trapping statements -- see below).

Getting Starting Estimates

Once a totally new flowsheet simulation program has been created and compiled, an initial starting estimate for the simultaneous solution must be obtained. We provide general methods for developing this. The user is queried for estimates of temperatures, pressures, flowrates, and compositions, and the system computes initial estimates for the many items for which he/she may not have an intuitive feel, such as enthalpy per mole. For completely new, exploratory problems, the recommended approach is to start small, building separate programs for individual modules or small groups of modules. Later, after the behavior of these is better-understood, you can easily combine them, using the solutions of the smaller problems together to initialize the combined problem.

Distillation column solutions are fully integrated with the overall flowsheet Newton's algorithm calculations, but it is normally impossible for a user to make initial estimates for distillation module variable values satisfactorily. We provide the special program, Distillation Guide, which automatically develops distillation solutions. It is also available as a separate product since it is "self-contained".

Error Handling

  DMSolver provides an effective error-trapping method which is utilized by FT modules. If, for example, the conditions in a distillation module are such that one of the two phases cannot possibly exist, then all equations cannot be evaluated, and the Newton's iteration must be aborted. An error message appears identifying the module. If there is a previous iteration which WAS successful in computing all the equations, the trial point will be backed up toward the previous point, and the iteration retried. In user-written module code you should test for errors (such as a zero divisor) and place a call to DMSolver's error-trapping procedure if the fatal error would otherwise occur.

  Each equation in the system is associated with a particular displayable variable and its residual error appears in the display. The user can display a non-converged solution and determine which equations have the worst error, and how manually changing the variable estimates affects errors. Being able to interactively select, display, and adjust variable estimates (and receive error messages telling which errors are occurring in which modules) allows the user to identify mis-specified portions of a problem and initial variable estimates which are grossly incorrect.

Example Problems

 The most complex example problem currently included with FT is the classic benzene-by-hydrodealkylation-of-toluene problem involving adiabatic reaction, heat exchange, and distillation.

This is actually a very challenging problem for vapor-liquid equilibrium routines since a very light component, hydrogen, is present along with a very heavy one, biphenyl. We are currently revising our approach to this problem for version 5.0. The description below is for the original version of this problem, which will be changed in future.

Hydrodealkyation of Toluene

  The EDTECH drawing shows the highest-level module blocks and streams in this problem (networks of internal streams exist inside the reactor and distillation modules). This problem uses about 1100 simultaneous equations out of DMSolver's current 10000-equation capacity. The problem shows an example reactor module. We approximate the traditional plug flow reactor concept by a set of perfectly mixed reactors in series. The Solver source code for this problem is 76 procedures occupying about 1050 lines of which 16 procedures (200 lines) are user-written (for the reactor, etc.) and the rest generated or fetched automatically from the library by the Toolkit.

   With FT problems there is the ability to fix a value provided some other value is free to be adjusted to control the fixed value. In the flowsheet the temperature of stream 11 is fixed by adjusting the split of stream 19 to 20 versus 21. Also, the mole fraction of methane in stream 26 is fixed by adjusting the heat input to 'StabCol'. The toluene mole fraction in stream 35 is fixed by adjusting the heat input to the reboiler of 'TOLCOL'.

  We also provide a light hydrocarbon separation example problem containing 3 distillation columns and having about 2900 simultaneous variables.

  At the moment, the largest problem which we have run with a Solver is an experimental one which is not yet an official part of FT. This is a refinery atmospheric crude column, currently with 19 hydrocarbon components and diluent H2O. The current version uses 4272 simultaneous equations out of the Solver's capacity of 10,000. In future we will add some pseudo-components and details to produce a larger test of DMSolver's capabilities.

Home | Chemical Engineering Applications--Summary