PROII User-Added Subroutines User Guide
PROII User-Added Subroutines User Guide
3
User-Added Subroutine User Guide
PRO/II Version 8.3 The software described in this guide is furnished under a written
agreement and may be used only in accordance with the terms and
conditions of the license agreement under which you obtained it.
Thermodynamic Data Copyright © 2009 Invensys Systems, Inc. All rights reserved. The
Keyword Manual material protected by this copyright may be reproduced or utilized
Copyright Notice for the benefit and convenience of registered customers in the
course of utilizing the software. Any other user or reproduction is
prohibited in any form or by any means, electronic or mechanical,
including photocopying, recording, broadcasting, or by any infor-
mation storage and retrieval system, without permission in writing
from Invensys Systems, Inc.
The technical documentation is being delivered to you AS IS and
Invensys Systems, Inc. makes no warranty as to its accuracy or
use. Any use of the technical documentation or the information
contained therein is at the risk of the user. Documentation may
include technical or other inaccuracies or typographical errors.
Invensys Systems, Inc. reserves the right to make changes without
prior notice.
Trademarks PRO/II and Invensys SIMSCI-ESSCOR are trademarks of Inven-
sys plc, its subsidiaries and affiliates.
AMSIM is a trademark of DBR Schlumberger Canada Limited.
RATEFRAC®, BATCHFRAC®, and KOCH-GLITSCH are regis-
tered trademarks of Koch-Glitsch, LP.
Visual Fortran is a trademark of Intel Corporation.
Windows Vista, Windows 98, Windows ME, Windows NT, Win-
dows 2000, Windows XP, Windows 2003, and MS-DOS are trade-
marks of Microsoft Corporation.
Adobe, Acrobat, Exchange, and Reader are trademarks of Adobe
Systems, Inc.
All other trademarks noted herein are owned by their respective
companies.
U.S. GOVERNMENT RESTRICTED RIGHTS LEGEND
The Software and accompanying written materials are provided
with restricted rights. Use, duplication, or disclosure by the Gov-
ernment is subject to restrictions as set forth in subparagraph (c)
(1) (ii) of the Rights in Technical Data And Computer Software
clause at DFARS 252.227-7013 or in subparagraphs (c) (1) and (2)
of the Commercial Computer Software-Restricted Rights clause at
48 C.F.R. 52.227-19, as applicable. The Contractor/Manufacturer
is: Invensys Systems, Inc. (Invensys SIMSCI-ESSCOR) 26561
Rancho Parkway South, Suite 100, Lake Forest, CA 92630, USA.
Chapter 2:
Modular UAS Build Procedures
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-1
User Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-1
Developer Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-17
Chapter 3:
Modular Interface Software
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-1
Contexts in PRO/II . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-3
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-3
ISOLVE Return Values. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-4
Call-back Routines. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-5
Chapter 4:
Modular Utility Subroutines
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-1
User Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-1
Developer Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-2
Definition of class_ UASOBJ.mod . . . . . . . . . . . . . . . . . . . . . .4-10
class_Fluid.mod and class_FluidPhase.mod . . . . . . . . . . . . . .4-30
Chapter 5:
Modular Unit Operations
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-1
Keyword Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-2
Chapter 6:
UAS Modular Fluids
Interface Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-1
Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2
User Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2
Developer Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2
Fluid Guidelines. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-21
class_Fluid.mod . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-25
class_FluidPhase.mod . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-34
Chapter 7:
User-Added Units of Measure
Overview of User Dimensional Units . . . . . . . . . . . . . . . . . . . . . 7-1
UAUTIL User Dimensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-4
UAUOP User Dimensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-5
Definition of class_DMUOM.mod . . . . . . . . . . . . . . . . . . . . . . . 7-6
Chapter 8:
UAUOP AutoGUI
Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-1
Basic XML File Structure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-2
Associating an XML file with a UAUOP Unit Operation . . . . 8-3
XML Schema Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-4
AutoGUI Examples. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-16
Chapter 9:
UAUOP Icons
Icon Data File Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-1
Associating an Icon Data File with a UAUOP Unit Operation9-2
Icon File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-3
Chapter 10:
UAUOP INI File
Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-1
Keyword Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-1
Input Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-3
INI File Usage Information. . . . . . . . . . . . . . . . . . . . . . . . . . . 10-15
Chapter 12:
Binary Mass Transfer Utility
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-1
Available Mass Transfer Data - Developers . . . . . . . . . . . . . .12-2
Chapter 13:
Heat Transfer Utility
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .13-1
Available Heat Transfer Data - Developers. . . . . . . . . . . . . . .13-2
Chapter 14:
Classic UAS Introduction
PRO/II User-Added Subroutines . . . . . . . . . . . . . . . . . . . . . . .14-1
Software Requirements for PRO/II UAS . . . . . . . . . . . . . . . .14-2
Hardware Requirements for PRO/II UAS . . . . . . . . . . . . . . . . .14-3
Program Limits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .14-4
Upgrading Legacy User-Added Subroutines . . . . . . . . . . . . .14-5
Build Procedure for Classic PRO/II UAS . . . . . . . . . . . . . . . .14-6
Customizing a UAS Data Entry Window . . . . . . . . . . . . . . . .14-8
Fortran Coding Standards . . . . . . . . . . . . . . . . . . . . . . . . . . . .14-9
Fortran Programming Guidelines . . . . . . . . . . . . . . . . . . . . .14-10
Source Code Changes for Intel Fortran: . . . . . . . . . . . . . . . .14-11
Chapter 15:
Interfacing Software
Output and Reporting Routines . . . . . . . . . . . . . . . . . . . . . . .15-7
Stream Data Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15-10
Flash Calculation Interfaces . . . . . . . . . . . . . . . . . . . . . . . . .15-16
Property Calculation Interfaces . . . . . . . . . . . . . . . . . . . . . . .15-29
Interfaces for Solids . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15-40
Component Order, Identification, and Data . . . . . . . . . . . . .15-42
User-Defined Data Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15-48
Common Storage Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15-49
Chapter 18:
Classic Unit Operations
Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-1
User Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-2
Developer Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-9
User-Added Pipe Pressure Drop Utility Routines . . . . . . . . 18-32
Chapter 19:
Reaction Kinetic Subroutines
User Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-1
Developer Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-3
Example Problem—Allyl Chloride Production in a PFR . . 19-10
Chapter 20:
UAS Refinery Reactor Simulation
User Utility Subroutines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20-1
Example Input File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20-25
Example of PRO/II User-Added Subroutine . . . . . . . . . . . . 20-28
C *** Example of User’s Reactor Main Subroutine ***. . . . . . . . . . . . . 20-39
Chapter 21:
UAS Solid Components
Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21-1
User Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21-2
Developer Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21-2
Chapter 22:
Pressure Drop Subroutines
PIPE Pressure Drop Subroutines. . . . . . . . . . . . . . . . . . . . . . . 22-1
Appendix A:
Special Property Key Words . . . . . . . . . . . . . . . . . . . . . . . . A-1
Named Special Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-1
Numbered Special Properties . . . . . . . . . . . . . . . . . . . . . . . . . . A-5
General Information
This section presents general introductory information about the
technologies and methodologies used in the modular user-added
interfaces. The next section in this chapter presents information for
end users who wish to use modular user-added subroutines when
running simulations in PRO/II. Instructions for developers imple-
menting modular user-added subroutines appears in separate chap-
ters.
Nomenclature
PRO/II categorizes modular user-added subroutines by function.
Below is a brief summary of some terms used in this manual.
Procedural Interfaces
The older user-added interfaces in PRO/II treat individual data
items as separate entities. Refer to Chapter 14, Classic UAS Intro-
duction. They typically include long lists of arguments in subrou-
tine calls. Enhancing them typically requires changing the number
and type of arguments in the call lists. To maintain backward com-
patibility, all versions of each interface must be supported. This
results in many variations of subroutines that basically perform the
same function, which can be confusing.
Procedural interfaces require changes to user-added routines before
they can use the newer versions of the interfaces. Code must be
rewritten and re-linked with PRO/II; then it must be tested and
debugged. From a maintenance perspective, this is inefficient and
undesirable. The newer user-added interfaces in PRO/II do not use
this paradigm.
Modular Interfaces
This is a short overview of object-oriented programming (OOP)
using Fortran 90. It defines the terminology used throughout the
rest of this manual to describe the modular interfaces in PRO/II. It
is not a tutorial of object-oriented practices, which is beyond the
scope of this manual.
Object-oriented programming treats data in sets. First, a storage
object is created and all related data entities are mapped into it. The
storage object may contain a mixture of scalar and array data of dif-
ferent intrinsic types, such as integer, real, character, and logical
data. Each data entity is a data member of the storage object. Data
members that are arrays typically have a dynamic size. They can be
adjusted to accommodate different amounts of data. In Fortran 90, a
data object having these characteristics is called a defined type.
Program Limits
Every new UAS must be registered with PRO/II before it can be
used. Some benefits of this approach are:
An almost unlimited number of UAUTIL’s and UAUOP’s may be
implemented in PRO/II.
No pre-defined subroutine names. Any subroutine name up to
31 characters is allowed.
\User\Uas\Examples\IF8\ \User\Uas\Examples\VF6\
UasLb.sln uaslb.DSW
UasLb.vfproj UASLB.dsp
\User\Uas\Examples\Exam1\ \User\Uas\Examples\Exam1\
USER42_IF8.INP USER42.INP
USER42.FOR USER42.FOR
U42OUT_IF8.FOR U42OUT.FOR
\User\Uas\Examples\Exam2\ \User\Uas\Examples\Exam2\
UKHS4.INP identical
UKHS4.FOR identical
\User\Uas\Examples\Exam3\ \User\Uas\Examples\Exam3\
USKIN1.INP identical
USKIN1.FOR identical
\User\Uas\Examples\exam4\ \User\Uas\Examples\exam4\
UTRAN2.INP identical
UTRAN2.FOR identical
\User\Uas\Examples\Exam5\ \User\Uas\Examples\Exam5\
UKHS1.INP identical
UKHS1.FOR identical
\User\Uas\Examples\Exam6\ \User\Uas\Examples\Exam6\
UKHS3.INP identical
UKHS3.FOR identical
\User\Uas\UasF90\IVF\ \User\Uas\UasF90\VF6\
ExUasF90.sln ExUasF90.dsw
ExUasF90.vfproj ExUasF90.dsp
ExUop.sln ExUop.dsw
ExUop1.vfproj ExUop1.dsp
\User\Uas\UasF90\ \User\Uas\UasF90\
AreaMain.f90 identical RATEFRAC
AreaCalc.f90 identical Interfacial area
AreaRepo.f90 identical utility
MassMain.f90 identical RATEFRAC
MassCalc.f90 identical Mass Transfer
MassRepo.f90 identical utility
HeatMain.f90 identical RATEFRAC
HeatCalc.f90 identical Heat Transfer
HeatRepo.f90 identical utility
Uop1Main.f90 identical
Uop1Cros.f90 identical Modular
Uop1Calc.f90 identical User-Added
Uop1Repo.f90 identical Unit Operation
FluidOut.f90 identical source code
FluidRep.f90 identical
UdmRepo.f90 identical
Ex1Uop.ini identical Modular UaUop
Ex1UopIcon.dat identical configuration
Ex1Uop.xml identical files
User Information
This chapter explains the steps required to build, register, and use
modular subroutines in PRO/II. It uses a sample project that ships
with PRO/II to illustrate the procedures. Users are encouraged to
use the sample projects to develop their own modular subroutines.
Specific details of writing new user-added subroutines do not
appear here. That information is available elsewhere in this manual.
Separate chapters describe each individual type of UAUTIL and
UAUOP subroutine.
All the examples use Microsoft Visual Studio© for NET 2003 and
Intel Visual Fortran© version 10.1. Developers are expected to be
familiar with these tools; this manual does not describe them fur-
ther.
The procedure for building modular utility subroutines (UAUTIL) is
identical to the procedure for building modular unit operations
(UAUOP). In both cases, source code is processed to create a
dynamic link library. A single DLL may contain both types of user-
added subroutines.
Syntax in P2UasReg
Note: When modifying the registration file to include a new user-
added subroutine, use only a plain-text editor, such as
Notepad or the Visual Studio editor. Do not use a word pro-
cessor which inserts hidden codes that invalidate the entire
registration file.
The P2UasReg.ini file is divided into sections based upon the func-
tional types of user-added subroutines supported by PRO/II.
Section headers are enclosed in square brackets; for example,
[UAUOP] is the header of the section where unit operations are
registered.
The various types of user-added subroutine must be registered
within the appropriate section of the file.
A semicolon (;) is a comment character. Everything to the right
of a semicolon is ignored by the processor.
A Tilde (~) is a place-holder that indicates no entry in a field.
Since entries on each line are position dependent, tildes are
required to indicate where an entry is omitted.
Entries that include embedded blanks must be enclosed in quo-
tation marks.
Example:
This example registers a Mass Transfer utility routine using the
identifier MyMassTr1. Assume the name of the callable interface
routine is MYMASS1, the DLL named MYUAS1.DLL is located in
directory E:\MYDRIVE\MYCODE\, and that this path already is reg-
istered as path 5 in the [UASPATH] section of the registration file.
Data transfer uses the SI system of units.
[UASPATH]
; PathNo Fully justified path (255 characters maximum)
; ------ ----------------------------------------------------
1 "%p2Install%\USER\UAS\EXAMPLES\"
2 "%p2Install%\USER\"
3 "%p2InstallPath%\SYSTEM\"
4 "%p2Install%\USER\UAS\F90\IVF\Debug\"
5 “E:\MYDRIVE\MYCODE\”
. . .
[UAMASSTR] UOM
; UAS identifier PathNo DLL name UAS routine System
; -------------- ------ -------------- ----------- ------
"MassTranUas1" 4 "ExUasF90.dll" "MassMain" Proii
“MyMassTr1” 5 “MYUAS1.DLL” “MYMASS1” SI
Note: The path does not include the name of the DLL file. It ter-
minates with the name of the directory that contains the
DLL. Paths already registered during PRO/II installation
should not be deleted or altered in any manner.
“%p2Install%” is a parameter that expands to be the root directory
where PRO/II is installed. It is defined in the [P2Config] sec-
tion of the PRO/II configuration file PROII.INI.
The PROII.INI file is located in the installed USER directory. This
makes the parameter configurable by each end-user. In a
default installation of PRO/II version 8.3, the full path and file-
name of the PRO/II configuration file is:
C:\SIMSCI\PROII82\USER\PROII.INI
In this file, the parameter is defined as:
P2Install=D:\SIMSCI\PROII82\
Changing the value of the P2Install parameter in the PROII.INI file
dynamically changes the path of the%p2Install% expansion macro.
Example:
A developer wishes to add directory path “E:\MyDrive\MyCode” to
the registration file. Assuming the first four paths (shown
above) already exist in the registration file, the new path is
installed as path 5.
[UASPATH]
; PathNo Fully justified path (255 char max)
; ------ ------------------------------------
1 "%p2Install%\USER\UAS\EXAMPLES\"
2 "%p2Install%\USER\"
3 "%p2InstallPath%\SYSTEM\"
4 "%p2Install%\USER\UAS\F90\VF6\Debug\"
5 “E:\MYDRIVE\MYCODE\”
Example:
When first installed, the [UAUOP] section contains only the
Ex1Uop entry, as shown above. Assume a developer wishes to
register a new user-added unit operation with an ID number of
123 and a UATYPE of ABC. Also assume it has an “INI” file named
“ABC.INI”. After registering this unit operation, the [UAUOP] sec-
tion would include the following information.
; ==============================================================
; Enter User-Added Unit Operations in the [UAUOP] section
[UAUOP]
; IdNo UATYPE INI File Name Help File Name Help Context
; ------ ---------- ------------- -------------- ------------
1 “Ex1Uop” Ex1Uop.ini ~ ~
123 “ABC” ABC.INI ~ ~
Notice in the input listing that the column includes three TRATE sec-
tions. The RFTRANSFER statement applies the user-added subrou-
tines only to TRATE section 2. Additional RFTRANSFER statements
may be added for each section in the column.
Contexts in PRO/II
PRO/II performs a variety of operations to successfully complete a
simulation. Related types of operations are grouped together in con-
texts. When PRO/II calls a user-added subroutine, it expects each
UAUTIL or UAUOP to perform actions appropriate to the current
context, as illustrated in Table 2-3. Yes indicates that PRO/II makes
a call to a UAUTIL or UAUOP. No indicates that PRO/II does not
attempt to call the UAUTIL or UAUOP in that context.
The column of the table titled “Context” lists the exact text of the
context strings. PRO/II passes the context as data member %Context
in the data object argument of the subroutine call. (The context also is passed
as a separate argument in the call list of a UAUOP.) The portion of
the context string in bold type is the minimum character string to
use for testing the context. For example, the first five characters of
context could be tested against literal string CROSS to identify the
CROSSCHECK context; e.g.,
xxxx.INI The INI file of a UAUOP defines all the attributes of the
unit operation that are exposed to PRO/II. The developer of
the UAUOP must write this file. This process is described in
a separate chapter.
xxxxUOPIcon.DAT An optional file that defines the properties of
the icon used in the PROVISION‰ PFD window to repre-
sent the user-added unit operation. The developer of a user-
added unit operation also creates this file. It is described in
a separate chapter.
xxxx.XML An optional file that defines the properties and behavior
of a custom input window for the unit operation. It is used
in conjunction with the xxxxUOPIcon.DAT file. The devel-
oper of a user-added unit operation also creates this file.
Click the down arrow of the Category: list box and highlight
PreProcessor in the list. Enter the following text in the Addi-
tional Include Directories text box:
C:\SIMSCI\PROII82\USER\CMNS
This is the absolute path from the project directory where the
modules are installed.
Click OK to confirm the setting.
When the project is in the default PRO/II install directory path,
a relative path may be used. Refer to Figure 2-4, “Setting the
Fortran USE Module Path”, on page 2-24.
Refer to the On-Line Help in Visual Studio and the Intel Visual For-
tran compiler for more information about using the build tools
effectively.
Overview
This chapter discusses the interfaces available for communicating
between PRO/II and modular user-added subroutines. Table 3-1
shows how the data is organized in this manual.
Table 3-1: Interface Modules and Routines in UserLb6.lib
Name Description See page...
The left-most column of the table lists the exact text of the context
strings passed in from PRO/II in data member DataObj%Context. The
portion of the context string in bold type is the minimum character
string to use for testing the context. For example, the first five char-
acters of context could be tested against literal string CROSS to iden-
tify the CROSSCHECK context; e.g.,
IF( DataObj%Context(1:5) .EQ. “CROSS” ) THEN
Optionally, up to all ten characters in the string could be tested; i.e.,
IF( DataObj%Context(1:10) .EQ. “CROSSCHECK” ) THEN
When performing tests on text strings, always use upper case char-
acters only. Note that Fortran 90 uses a percent sign ( % ) as the
member access operator.
Call-back Routines
In addition to the data modules used to communicate with user-
added subroutines, PRO/II provides additional subroutines and
functions that may be useful to developers. Call-back routines are
used inside user-added subroutines to request data or calculations
from PRO/II. This section describes those routines.
UAOUT
Purpose: Write a single line of text to selected PRO/II output files.
Calling sequence:
SUBROUTINE UAOUT( cFile, cAct, cText )
where:
cFile This option flag selects the files that receive the output data. It
is a character string that may have one of the following values.
Normal Displays the output on the user display terminal,
and writes the data in the PRO/II history file.
Terminal Displays data on the user display terminal only.
History Writes the output to the PRO/II history file only.
Report Writes the output in the PRO/II output report file.
The value of cFile may be truncated to only the first character
of the values listed above (N, T, H, or R).
cAct An option flag that controls line spacing when writing the
output. The character string may have one of the following
values.
Single Single space; simply write the line of output.
Double Double space; write a blank line, then write the
output.
Page Start a new page, then write the output.
This option is active only when writing to the Report file. The
value of cAct may be truncated to only the first character of
the values listed above (S, D, or P).
The cFile option should be set to “Report” only when the user-
added Context also is “Report”. Note that the output report file
normally constrains each line of output to no more than 78 charac-
ters. Using the PRINT WIDTH = 80 or PRINT WIDTH = 120
option extends the output width to include the specified number of
characters. Refer to the PRINT WIDTH option in chapter 5, “Gen-
eral Data”, of the “PRO/II Keyword Input Manual”.
During calculations, when the user-added context is CALCULATION,
use the NORMAL, TERMINAL, or HISTORY option. All these options dis-
regard the cAct flag. They also discard all lines of output that are
completely blank. At the end of execution, PRO/II merges the his-
tory file into the report file to save the calculation history. Any data
written to a display terminal is lost after being displayed. UAOUT
does not write output to any other files.
The following sample code illustrates the proper use of UAOUT.
CHARACTER :: cLine*78
605 FORMAT( " ", A, 1P, 3E13.4 )
. . .
WRITE(cLine, * ) &
" _________ Test Results from UAS MassReport _________"
CALL UAOUT( "REPORT", "DOUBLE", cLine )
WRITE(cLine, * ) &
" ___________________ Column Data ___________________"
CALL UAOUT( "REPORT", "DOUBLE", cLine )
WRITE(cLine,605) " Cross-sectional area = ", MTobj%DS1( 1 )
CALL UAOUT( "REPORT", "SINGLE", cLine )
WRITE(cLine,605) " Weir Height = ", MTobj%DS1( 2 )
CALL UAOUT( "REPORT", "SINGLE", cLine )
WRITE(cLine,605) " Downcomer area = ", MTobj%DS1( 3 )
CALL UAOUT( "REPORT", "SINGLE", cLine )
The ExUasF90 and ExUOP sample projects that ship with PRO/II
include output report subroutines that make extensive use of UAOUT.
Refer to the source code for subroutines in files HEATREPO.f90,
MASSREPO.f90 and AREAREPO.f90 of that project.
Example:
This sample code snippet demonstrates declaring the character vari-
able, populating it with text and numerical values, obtaining a file
unit in variable LFU using FIGETU, and calling UAWRITE.
INTEGER(4) :: LFU, Ival
REAL(8) :: Rval
CHARACTER(LEN=133) :: cLine
. . .
CALL FIGETU( 1, LFU )
Rval = 23.4
Ival = 3
cLIne = “The value of RVAL( ) is:”
WRITE( cline(19,21), “( I3 )” ) Ival
WRITE( cLine(29:39), “(F9.4)” ) Rval
CALL UAWRITE( LFU, TRIM(cLine) )
The single line of output would be:
The value of RVAL( 3) is : 23.4000
Example:
Consider the following utility called from unit operation Ex1Uop:
SUBROUTINE MyUAUtil( ObjUtil )
TYPE( UASOBJ ) :: ObjUtil
INTEGER(4) :: IUNO
CHARACTER(LEN=78) :: Message
IUNO = ObjUtil%UasIdNo
IF( ObjUtil%INTdata( 1 ) .LE. 0 ) THEN
Message = “Default method used when“ &
// “INTdata( 1 ) = 0”
CALL UAERROR( “M”, IUNO, Message )
END IF
The call to UAERROR generates the following message:
** MESSAGE ** In Unit 'EXUOP1',
Default method used when INTData( 1 ) = 0
UAERROR performs all the formatting automatically. In particular,
the “** MESSAGE **” clause in the example corresponds to the
error level specified in the first argument (cELevel). The clause “In
Unit 'EXUOP1'” is an automatic expansion of the second argu-
ment (IUNO). The text of the message is wrapped when it is too long
to fit on a single line. Also, whenever two or more contiguous
blanks appear in the text, they are compressed to a single space.
class_UAUOP.mod
This is the base class used to create modular Unit Operations. It
contains a data structure and accessor functions to access the data.
The data structure is populated and passed from PRO/II in the argu-
ment list in each call to a modular user-added unit operation.
See Chapter 5, Modular Unit Operations for extensive information
about using this module and its members.
class_Fluid.mod
This module makes Fluid data objects available to within modular
user-added subroutines. Modular Utilities such as IFAREA include
fluids within their data structures. Modular unit operations only
identify their feed and product streams and do not provide pre-built
fluids. Member methods of class_Fluid.mod, such as load_fluid, pro-
vide developers the necessary tool to instantiate, manipulate, and
destroy fluid object at will.
See Chapter 6, UAS Modular Fluids for comprehensive informa-
tion about using this module and its members.
class_DMUOM.mod
This module defines a class that provides dimensional units to mod-
ular user-added subroutines. Currently it provides a single user-call-
able function, GetFactor_DmUom, that returns factors to convert
between user-units and PRO/II internal units.
Chapter 7, User-Added Units of Measure, defines the module, its
member functions, and data structure. See Chapter 6, UAS Modular
Fluids for information and examples that use this module and its
members.
Overview
User-added utilities perform specific calculations and return spe-
cific, pre-defined results when called from PRO/II. They serve as
alternatives to existing PRO/II methods.
The first section in this chapter present user information that
describes using modular utilities in PRO/II simulations. The
remainder of the chapter presents developer information that
includes coding requirements, a full description of class_UASOBJ,
and an extensive example of an implementation.
User Information
The RATEFRAC column model in PRO/II is the only unit operation
that supports modular utilities. The following are the only sup-
ported modular utilities.
Interfacial Area methods. RATEFRAC allows a different subroutine
or method on each tray or in each packed section.
Binary Mass Transfer Coefficient methods. RATEFRAC allows
a different subroutine or method on each tray or in each packed
section.
Heat Transfer Coefficient methods. RATEFRAC allows a different
subroutine or method on each tray or in each packed section.
Keyword Summary
RFTRANSFERSECTION = idno,
MTCORR = DEFAULT, or
MTSUBROUTINE = user-added subroutine-name,
HTCORR = CHILTON, or
HTSUBROUTINE = user-added subroutine-name,
Developer Information
The remainder of this chapter is intended for developers of user-
added utilities. Users who merely use pre-built modular utilities in
PRO/II simulations may find some of the material interesting.
Coding Guidelines
Each user-added calculation utility requires an interface routine
written in Fortran 90. This is because PRO/II passes a reference to a
data class in the argument list when it calls the user-added subrou-
tine. A Fortran 90 module is required to “instantiate” the data class,
so data can be accessed from it. Instantiating the class also allows
the user-added routine to store its results in the data class. Earlier
versions for Fortran, such as Fortran 77 or Fortran 66, do not sup-
port this feature.
All PRO/II interfaces conform to the Fortran 90 standard as much
as possible. However, dynamic calls to external DLL’s are outside
the strict domain of the Fortran standard. PRO/II uses extensions to
the Fortran 90 language to accomplish this. In the examples in this
manual, the extensions of Compaq Visual Fortran version 6.6b are
illustrated. These probably will be different if other compilers are
used.
Modern programming practice typically implements “modular cod-
ing” to isolate the call interface from the rest of the code (such as a
calculation algorithm). In addition, “modular coding” typically
“encapsulates” unrelated functionality in different subroutines or
functions. In PRO/II, the interface routine is the single entry and
exit point for a UAS. PRO/II calls the interface routine, and in turn,
it calls appropriate subroutines to perform the desired computa-
tions. When calculations are complete, the calculation routines
return control to the interface routine, which in turn serves as the
return point to PRO/II.
When implementing more than one UAS in a single DLL, the sim-
plest and most intuitive approach probably would be to code a sepa-
rate interface routine for each UAS. Keep in mind that a single UAS
can include more than one subroutine. The examples presented in
this manual all use separate subroutines for the call interface, the
calculation algorithm, the report writer, and other supported func-
tionality. The sample code in Figure 4-1 illustrates the basics of this
approach.
Dimensional Units
Each user-added utility subroutine exchanges data with PRO/II in a
consistent set of dimensional units. The subroutine developer
chooses one of several sets provided by PRO/II. The developer
must inform the end-user of the correct set of units. The end-user
must declare the developer’s set of units when registering the sub-
routine with PRO/II. See “Registering User-Added Utilities” on
page 2-6 of Chapter 2 for a description of the registration process.
The registered set of dimensional units applies to all data exchanged
between PRO/II and a user-added subroutine. This is independent
of the units used for input data in a simulation. Refer to Chapter 7,
”User-Added Units of Measure”, for lists of the available sets of
units, including all dimensional classes. It includes the exact unit of
measure used by each class for each available set of units. PRO/II
does not support changing the unit of measure in each class of a sys-
tem of units for a utility routine.
TYPE(CHARGE) MONTH
This declares MONTH as a CHARGE structure.
Some valid array references for this type follows:
MONTH%PARTS(I) ! An integer array element
MONTH%PARTS(I:K) ! An integer array section
MONTH%LABOR ! A double precision scalar
The “parent % member” construct is extensible to any level in the data
structure. For example, some instances of UASOBJ include a FLUID
structure named FLVAPOR. Each FLUID (including FLVAPOR) has a
member named TEMP for the temperature. The FLVAPOR fluid also
contains an FLPHASE structure named VAPOR.
Finally, the VAPOR phase data structure contains a member array
named XFracM that is dimensioned to NOC, the number of compo-
nents in the simulation. XFracM contains the mole fraction of each
component “i”. To obtain the mole fraction of component 6 from
XFracM, the following code could be used:
TempVap = MtObj%FLVAPOR%TEMP
It is possible to access any data member in any sub-structure of
UASOBJ in this manner. Table 4-2 on page 4-19 lists all data mem-
bers that might be available in the UASOBJ data structure. The first
column, labeled “Member”, is the name of the data member to use
for direct member addressing.
Component Data
Member Type Description
NOC I4 Total number of components in problem
CompIndex(i) I4 Internal component numbers, in input order. I =
1, NOC
Fluid Data
Member Type Description
FlVapor Fluid Vapor phase fluid data object
FlLiquid Fluid Liquid phase fluid data object
FlIface Fluid Interface phase fluid data object
FlFeed Fluid Liquid phase fluid data object
FlProd Fluid Interface phase fluid data object
The following members are validation flags for the fluid data
members immediately above. They take the following values:
1 = Array is allocated and populated with valid data.
0 = allocated but empty.
-1 = missing.
ValidFlVapor I4 Validation flag for fluid FlVapor
ValidFlLiquid I4 Validation flag for fluid FlLiquid
ValidFlIface I4 Validation flag for fluid FlIface
ValidFlIFeed I4 Validation flag for fluid FlFeed
ValidFlProd I4 Validation flag for fluid FlProd
Subroutine-specific Data
Member Type Description
IS1 I4 An array containing scalar integer data. Contents
may change for each type of utility subroutine.
General Data
Data in this section is important, because it includes various flags
that inform the subroutine what PRO/II expects it to do.
Component Data
The component data members in Table 4-2 are generic, since the
same data set is passed to all types of utility routine supported by
PRO/II.
NOC Total number of components in problem
COMPONENT DATA
LIBID 1,EBENZENE / 3, H2
POLY 2,PS
PRO/II internally orders the components as:
1, H2 / 2, EBENZENE / 3, PS
The following table shows the relationship of CompIndex elements to
input order and internal order.
Input Internal
Order Component CompIndex Order
1 EBENZENE (1) = 2
2 PS (2) = 3
3 H2 (3) = 1
Fluid Data
A fluid is the user-added analog of a PRO/II material flow stream.
See “Data Structure of class_Fluid” on page 6-27 for a list of all
available data in each fluid.
Each type of user-added utility subroutine defines its own set of flu-
ids. For example, the interfacial area subroutine includes three sepa-
rate fluids, while an HTC subroutine has none at all. Refer to the
chapters that describe individual types of utility subroutines for the
fluid members available in each specific type of utility routine. The
following discussion lists all fluids supported by the UASOBJ data
object. A typical user-added subroutine does not include every fluid
listed here.
FlVapor A fluid object that contains the data for the stage
bulk vapor phase. It supports data for the total fluid
and for the bulk vapor phase. Since the fluid is all
Subroutine-specific Data
Each type of utility subroutine has its own unique data require-
ments. To provide storage for different data, the UASOBJ data
structure contains several generic arrays that PRO/II resizes and
fills before each call to a user-added utility subroutine. Refer to the
chapters that describe individual types of utility subroutines for list-
ings of available data.
IS1 A one-dimension array containing scalar integer data.
Contents defined by each UAS.
IA2 A two-dimension array for integer array data. Contents
defined by each UAS.
IA3 Another two-dimension array for integer array data.
Contents defined by each UAS.
DS1 A one-dimension array of double precision floating-point
data. Contents defined by each UAS.
DA2 A two-dimension array for floating point array data.
Often contains binary diffusion coefficients. Contents
defined by each UAS.
DA3 A two-dimension array for floating point array data.
Often contains binary mass transfer coefficients. Contents
defined by each UAS.
DA4 A two-dimension array for floating point array data.
Contents defined by each UAS.
DA5 A two-dimension array for floating point array data.
Contents defined by each UAS.
The size and data content for each array are different for each type
of subroutine. Developers should refer to the data listings in the
chapter that describes the particular type of subroutine under devel-
opment. For example, refer to See “Interfacial Area Data Mem-
bers” on page 11-2, when developing an Interfacial Area utility
subroutine.
LfuInput A logical file unit to be used for data input. Not available.
LfuData A logical file unit to be used for intermediate data
storage. Not available.
LfuOutput A logical file unit to be used for writing results outside
the PRO/II output report. Not available.
Overview
Modular user-added unit operations (UAUOP) allow users and other
independent developers to extend PRO/II with their own unit opera-
tions. User-added unit operations are fully integrated into PRO/II,
so their execution is indistinguishable from that of the internal unit
operation models.
Developers define their own data structures using an information
(INI) file associated with each model. Supported data types include
integer, double precision, and character data. The data structures
allow scalar data and single-dimension arrays of almost any reason-
able size. Developers may assign names and units of measure in the
data definition.
PRO/II does not call user-added subroutines during input process-
ing, but UAUOP input processing is based on the data structure
defined by the developer. Both the PRO/II keyword input facilities
and PROVISION support these features. PROVISION provides
basic minimal data entry windows that support all the input data
allowed by key words.
The XML-based AutoGUI allows developers to create a custom
interactive Graphical Interface for each UAUOP. When AutoGUI is
used, PROVISION displays the AutoGUI DEW’s instead of the
default windows. It is much more powerful than the custom inter-
face available for the older procedural user-added unit operations.
In the course of a simulation, PRO/II calls modular user-added unit
operations to perform the following functions.
Validate input data during CROSSCHECK execution.
Perform calculations during the CALCUATION phase, as part of
the flowsheet solution.
Perform post-convergence calculations in the OPASS phase
(after the simulation flowsheet has converged).
Write final results during the REPORT phase of a simulation.
The first section of this chapter present useful information to users
running simulations that include user-added unit operations. Later
sections are intended for developers who create and implement the
user-added unit operation models.
Annotations (optional)
NOTE TEXT= <text>
Integer Data
INT( name or seqno ) intval1 {, intval2, .... }
Parameter Data
PAR( name or seqno ) parval1 {, parval2, .... }
Double Data
DBL( name or seqno ) dblval1 {, dblval2, .... }
Text Data
TEXT( name or idno {, elno}) txtval1 {, txtval2, .... }
Note: At least one side must have at least one FEED. If this
requirement is not satisfied, the unit will be skipped during flow-
sheet convergence calculations.
PROD When this keyword is present, it requires at least one
stream identifier.Products always are optional. Omit this
keyword on sides that do not have products.
METHOD This declares the thermodynamic METHOD set used by
the side. Each side in the unit operation may have a dif-
ferent METHOD. The METHOD must be declared in the
THERMODYNAMIC DATA section of the input file. If
this entry is missing, PRO/II assigns the DEFAULT
METHOD to the side.
Integer Data
INT( name or seqno ) intval1 {, intval2, .... }
Double Data
DBL( name or seqno ) parval1 {, parval2, .... }
Any number of INT, PAR, and DBL statements may appear in an
input file. Data for more than one variable may appear in each
statement. All data for an array should appear in order on a single
statement.
Numeric Data Example:
Consider the following (partial) data storage definition.
Table 5-2: Sample Numeric Data Definition
Type seqno ID Name Size Value
PAR 1 First 1 1.0
PAR 2 Second 3 2.1
3 2.2
4 2.3
PAR 5 Third 2 3.1
6 3.2
7 Fourth 1 4.0
All the data in Table 5-2 may be entered on a single PAR state-
ment:
PAR( First ) 1.1, 2.1, 2.2, 2.3, 3.1. 3.2, 4.0
Alternatively, several PAR statements could be used:
PAR( First ) 1.1
PAR( Second ) 2.1, 2.2, 2.3
PAR( Third ) 3.1, 3.2
PAR( Fourth ) 4.0
Statements may use sequence numbers instead of ID names.
PAR( 1 ) 1.1
PAR( 2 ) 2.1, 2.2, 2.3
PAR( 5 ) 3.1, 3.2
PAR( 7 ) 4.0
Enter all values of an array in order on a single statement. Val-
ues for single elements of arrays should not be entered. For
example, it is invalid to input only element 2 of PAR( 2 ) :
PAR( Second ) , 2.2 ! This is invalid.
However, the following is valid
Text Data
TEXT( name or idno {, elno}) txtval1 {, txtval2, .... }
TEXT statements behave differently than the INT, PAR, and DBL
statements. Text statements use an ID number or name in conjunc-
tion with an element number to identify the first data entry on the
statement.
name or The name of the TEXT variable or array.
idno The unique ID number assigned to the TEXT variable or
array. One or the other must be the first qualifier in the
parenthesis.
elno A TEXT array element number that stores the first data
value. Subsequent data values are stored sequentially in
the next storage elements. This entry is not applicable
for a scalar text item. Element 1 is the default when elno
is omitted for an array item.
Text Data Example:
Consider the following (partial) data storage definition.
Table 5-3: Sample Text Data Definition
Type idno ID Name Size elno Value
TEXT 1 First 1 1 A1
TEXT 2 Tarray 3 1 B2.1
- 2 B2.2
- 3 B2.3
TEXT 3 Third 2 1 C3
Clicking the tabs near the top of the window display additional data
input dialog boxes. Notice the data have been grouped and have
labels. It is even possible to change the units of measure. Chapter 8,
“UAUOP AutoGUI” explains how to create and use AutoGui win-
dows.
Calculation Options
PRO/II provides a CALOPTION flag on the UAUOP statement of
keyword input that allows simulation users to control optional cal-
culations in a UAUOP. Developers may or may not choose to imple-
ment this in their models.
Final Reports
PRO/II calls each UAUOP during the REPORT context to allow it
to generate a report of its results. Interface routine UAOUT may be
used for this purpose. When the UAUOP does not include report-
writing code, PRO/II can write a default report for it. The UAUOP
developer controls whether or not PRO/II writes a default report by
returning an appropriate code in the ISOLVE variable.
Optional Reports
The UAUOP keyword statement provides several flags that devel-
opers may implement to control optional output. Developers should
inform users of any options they implement for the following flags.
DIAGNOSTIC=ival This flag is intended to allow simulation users
to control the generation of trace back and debugging
information. The ival argument accepts any integer
value. The default is ival=0.
PRINT=ival A flag intended to control optional or additional
reports. Typical uses include controlling intermediate
output during calculations, or extended output in the
final report. The ival argument accepts any integer
value. The default is ival=0.
PLOT PRO/II provides a PLOT flag on the UAUOP statement
of keyword input that allows simulation users to control
the generation of plotted results. Developers may or may
not choose to implement this in their models.
CONTEXT This input variable is a flag that tells the UAUOP what
actions PRO/II expects it to perform. A short summary
of these options appears on page 5-13 of this chapter. A
more complete explanation is available in “Contexts in
PRO/II” on page 2-17 of Chapter 2, “Modular UAS
Build Procedures”.
UopObj This argument is the UAUOP data structure that passes
in all unit operation input data and returns all calculated
values. It is discussed extensively in the remainder of
this chapter.
ISOLVE This output variable is the only information PRO/II
requires a UAUOP to return. See “ISOLVE Return Val-
ues” on page 2-18 of Chapter 2, “Modular UAS Build
Procedures”.
Other types of data are accessed through interface classes, such as
class_Fluid (Chapter 6) and class_DMUOM (Chapter 7).
Coding Guidelines
Each user-added unit operation should have its own interface rou-
tine written in Fortran 90. The interface subroutine is called directly
from PRO/II. It includes the branching logic needed to implement
all the different contexts that PRO/II requires it to support. This
facilitates implementing the calculation code, cross-check code, and
report code in separate subroutines. This approach can greatly sim-
plify the coding effort. It also can enhance the portability of the
code by concentrating many (or all) dependencies on PRO/II in the
interface routine. The examples presented in this manual all use
separate subroutines for the call interface, the calculation algorithm,
the report writer, and other supported functionality.
PRO/II passes an instance of the UAUOP data class through the
argument list when it calls a user-added unit operation. This elimi-
nates the need for long argument lists in subroutine call.
A user-added unit operation must “instantiate” the data class so data
can be retrieved and stored. Earlier versions for Fortran, such as
Fortran 77 or Fortran 66, do not provide this capability.
All PRO/II modular interfaces conform to the Fortran 90 standard
as much as possible. However, dynamic calls to external DLL’s are
outside the strict domain of the Fortran standards. PRO/II uses
Line 28 tests for the OPASS context, branching in the same manner
as the previous IF clauses. This example does not support OPASS
calculations, and sets ISOLVE = 0 to indicate this.
Line 30 follows the same pattern, branching on the REPORT
context.
Lines 32 and 33 are the default clause of the “IF” construct. If none
of the preceding clauses evaluate TRUE, control passes to line 33. In
this case, the subroutine does nothing except set the ISOLVE return
variable to 0 to indicate the subroutine did nothing.
Line 36 sets the ISOLVE member of UopObj data structure to match
the ISOLVE variable. This is not required, but is a safe practice.
TYPE UAUOP
INTEGER(4) :: NOC
REAL(8), DIMENSION(30) :: ParValue
INTEGER(4) :: SideCount
CHARACTER(LEN=32) :: SideName( 3 )
TYPE( OneSide ), DIMENSION(3) :: Side
END TYPE UAUOP
TYPE ONESIDE defines one side of a UAUOP, while TYPE
UAUOP defines a UAUOP data structure that allows up to 3 sides.
Module Data
The data in this section allows developers to determine the version
of the UAUOP module being used.
ModType Always identifies the module as “UAUOP’.
General Data
Data in this section includes various flags that inform the subroutine
what actions PRO/II expects it to perform.
Context Context flag (See “Contexts Involving a UAUOP”
on page 5-13 of this chapter.)
“ INPUT” “ CROSSCHECK”
“CALCULATION” “OPASS”
“REPORT”
iContext Integer version of the Context flag. (See“Contexts
Involving a UAUOP” on page 5-13 of this chapter.)
1 = INPUT 2 = CROSSCHECK
3 = CALCULATION 4 = OPASS
5 = REPORT
BypassFL The calculation bypass flag on the UAUOP statement of
keyword input. Refer to Table 5-1, ”Bypass Options,”
on page 3 of this chapter.
CalOpContext An integer flag for the context qualifier of the
CalOption entry on the UAUOP statement of keyword
input. For example,
UAUOP(Ex1Uop) UID-U2, CALOP(Context)=ival
when Context = CALC, CalOpContext = 1
Context = OUT, CalOpContext = 2
CalOpValue An integer flag for the value of the ival argument to the
CalOption entry on the UAUOP statement of keyword
input. For example,
UAUOP(Ex1Uop) UID-U2, CALOP(Context)=ival
where ival is the value of CalOpValue. Developers
define the significance of CalOpValue (if any).
Component Data
NOC Total number of components in a simulation
NOCMW Number of molecular weight components in a
simulation. NMWSolids are excluded. When no
NMWSolids are in the simulation, NOCMW = NOC.
CompIndex(i) Internal component numbers, in input order.
i = 1, NOC.
Side Data
Every UAUOP always contains at least one SIDE. See “Data Struc-
ture of One Side” on page 5-38. The SIDE concept allows logical
partitioning of the functionality and data storage in a unit operation
model. Some information, such as the number of sides, applies to
all the sides as an aggregate. The data members listed here are
members of the UAUOP itself.
IntValue(n) Array of integer values, including all user input and all
calculated results. Individual INT variables and arrays
are mapped into this array using the IntMapNo array
described below. Index n varies from 1 to IntExtent. In
keyword input, users use INT statements to provide
actual data values. The size of this array is declared by:
INTEGER(4) IntValue( IntExtent )
IntSize(i) The number of 32-bit integer words used to store each
INT member. The sizes are defined on INT statements in
the [Data Definition] section of the INI file of the UAUOP.
Index i varies from 1 to IntCount.
IntMapNo(i) Each element i contains the starting storage address of
an INT variable or array in the IntValue array. Index i var-
ies from 1 to IntCount. The value of element i is n, the
position of the data value in IntValue(n). This is gener-
ated from data in the [Data Definition] section of the INI
file.
IntLower(i) The lower limit value of any element of INT scalar or
array i. Limits are defined on INT statements in the INI
file. PRO/II uses this to validate user input data. It
FeedNo(n) This array contains the stream numbers of all the feeds
to the SIDE. Index n is an integer that may vary from 1
to FeedCount.
FeedID(n) An array of stream identifiers for the FEED streams to
this SIDE. Index n is an integer that may vary from 1 to
FeedCount.
ProdNo(n) This array contains the stream numbers of all the prod-
ucts of the SIDE. Index n is an integer that may vary
from 1 to ProdCount.
FeedID(n) An array of stream identifiers for the PROD streams to
this SIDE. Index n is an integer that may vary from 1 to
ProdCount.
Overview
Fluids are modular analogs of PRO/II material streams. They are an
enhanced successor of the older user-added streams. Being object-
oriented constructs, they are compatible with modular utilities and
modular unit operations. They are not generally compatible with the
older procedural user-added subroutines.
User Information
Users do not directly interact with modular fluids when they run
simulations using PRO/II. They still manipulate PRO/II streams as
they always have. Users who merely use pre-built modular utilities
in PRO/II simulations may find some of the material interesting.
However, developers of new modular user-added subroutines use
fluids extensively.
Developer Information
The remainder of this chapter is intended for developers of user-
added utilities. The first section that follow describe the interface
routines that use fluids to communicate with PRO/II. This is fol-
lowed by some guidelines that should be helpful in creating fully
functional modular utilities and unit operations. Next is an extensive
Calculation Subroutines
flash_Fluid
The flash_Fluid function computes essential thermodynamic proper-
ties that determine the equilibrium state of a fluid. All flash condi-
tions are entered in the fluid object (passed in the argument list)
before calling the function. Results return in the same fluid object.
Calling sequence:
iRet = flash_Fluid( cTypeIn, cSrIdIn, FLObj, iErr)
where:
cTypeIn Required input character string indicating the type of
flash calculation requested. Table 6-3 lists the available
flash types.
Table 6-3: Flash types Supported By Function flash_Fluid
cTypeIn Flash Type and Description
“ISO” Temperature and Pressure specified
“TADIA” Adiabatic flash at specified temperature
“PADIA” Adiabatic flash at specified pressure
“TDEW” Dew point flash at specified temperature
“PDEW” Dew point flash at specified pressure
“TBUB” Bubble point flash at specified temperature
“PBUB” Bubble point flash at specified pressure
“TISEN” Isentropic flash at specified temperature and
entropy. See examples below.
“PISEN” Isentropic flash at specified pressure and
entropy. See examples below.
“TWDEW” Water dew point flash at specified temperature
“PWDEW” Water dew point flash at specified pressure
“THCDEW” Hydrocarbon dew point flash at specified
temperature (as opposed to water dew point).
“PHCDEW” Hydrocarbon dew point flash at specified
pressure (as opposed to water dew point).
“TDUTY” Duty (i.e., enthalpy change) flash at specified
temperature and enthalpy change.
Usage Notes
The flash_Fluid function requires a fully populated Fluid data object as
an input argument. See function "load_Fluid" on page 6-16 to learn
about initializing a fluid from a PRO/II stream.
Equilibrium Models
The thermodynamic METHOD set of the fluid determines the equilib-
rium model used by flash_Fluid. Equilibrium models in PRO/II
include VLE, VLE with DECANT, and VLLE. The thermodynamic
set is specified in member TherSetNo of the fluid object. It is set
whenever a fluid is loaded (using load_Fluid) from a PRO/II stream
or is copied from another fluid (using copy_Fluid).
Upon successful completion, the function value of flash_Fluid indi-
cates the equilibrium model used in the calculations. Refer to iRet in
Table 6-4.
Flash Types
In PRO/II, a flash calculation has NOC + 3 state variables, where
NOC is the number of components in the simulation. The compo-
nent compositions in the Total phase always are used for NOC of these
state variables. Specifying two additional state variables essentially
reduces the problem to one degree of freedom with one unknown
and one equation. Set these variables directly in the fluid data object
ISO Flash
An “ISO” flash specifies both temperature and pressure. Set both tem-
perature and pressure before calling flash_Fluid. For example:
FLOBJ%TEMP = 100.0
FLOBJ%PRES = 15.5
iRet = flash_Fluid( “ISO”, “ “, FLOBJ, iERR )
All other flash types specify either temperature or pressure, plus
one other variable.
FLOBJ%DUTY = 2468531.0
FLOBJ%PRES = 15.0
iRet = flash_Fluid(“PDUTY”, “ “, FLOBJ, iERR)
or
FLOBJ%DUTY = 2468531.0
FLOBJ%TEMP = 15.0
iRet = flash_Fluid(“TDUTY”, “ “, FLOBJ, iERR)
The DUTY is applied to the total enthalpy of the fluid and the speci-
fied temperature or pressure is held constant.
TWDEW, PWDET
These flashes compute the conditions at which the first water mole-
cules begin to condense to liquid. In non-rigorous VLE with
DECANT, this is where the DECANT liquid phase first begins to
condense. In rigorous VLLE systems, this is where the L2 (heavy)
liquid sub-phase first begins to condense. The L2 liquid sub-phase
has a flowrate of zero. The resulting fluid may be all vapor, or vapor
with some L1 (hydrocarbon) liquid. Specify only temperature or
pressure for these flashes. The second state variable is implied by
the flash type. For example:
FLOBJ%PRES = 15.0
iRet = flash_Fluid(“PWDEW”,“ ”, FLOBJ, iERR)
The calculated temperature returns in FLOBJ%TEMP.
or
FLOBJ%TEMP = 100.0
iRet = flash_Fluid(“TWDEW”,“ ”, FLOBJ, iERR)
The calculated pressure returns in FLOBJ%PRES.
THCDEW, PHCDEW
These flashes compute the conditions at which the first hydrocarbon
molecules begin to condense to liquid. In non-rigorous VLE with
DECANT, this is where the non-DECANT liquid phase first begins
to condense. In rigorous VLLE systems, this is where the L1 (light)
liquid sub-phase first begins to condense. The L1 liquid sub-phase
has a flowrate of zero. The resulting fluid may be all vapor, or vapor
with some L2 (water, DECANT) liquid. Specify only temperature
or pressure for these flashes. The second state variable is implied by
the flash type. For example:
FLOBJ%PRES = 15.0
iRet = flash_Fluid(“PHCDEW”, “ ”,FLOBJ,iERR)
The calculated temperature returns in FLOBJ%TEMP.
or
FLOBJ%TEMP = 100.0
iRet = flash_Fluid(“THCDEW”, “ ”,FLOBJ, iERR)
The calculated pressure returns in FLOBJ%PRES.
Example:
A fluid initially is ISO-flashed at specified temperature and pressure.
Duty is added that is expected to raise the temperature by 10
degrees. The pressure is incremented by 1.2 pressure units. The new
fluid state is determined by a subsequent DUTY flash. A temperature
estimate is applied before starting the DUTY flash.
FLOBJ%TEMP = 100.0D+0
FLOBJ%PRES = 15.0D+0
iRet = flash_Fluid( “ISO”, “ “, FLOBJ, iErr )
. . .
FLOBJ%DUTY = 1234.5D+0
FLOBJ%EstTEMP = FLOBJ&TEMP + 10.0D+0
FLOBJ%PRES = FLOBJ%PRES + 1.2D+0
iRet = flash_Fluid( “DUTY”, “ “, FLOBJ, iErr )
Retrieving Results
After successfully completing its calculations, function Kcalc_Fluid
returns all results in the fluid data object passed through the argu-
ment list of the call.
Returned data includes K-values, dK/dT values, vapor fugacities,
and either liquid fugacities or liquid activity coefficients, as appro-
Example:
The following illustrates calling Kcalc_Fluid to compute and
retrieve some of the calculated properties. Assume the fluid is the
fluid data object. The blank arguments use the default setting “NONE”
for argument cDeriv and “COMP” for argument cComp.
1 iRet = Kcalc_Fluid(“BULK”, “ “, “ “, &
2 FLOBJ, iErr )
3 . . .
4 Vcompress = FLOBJ%VAPOR%ZKval
5 Comp3FugV = FLOBJ%VAPOR%XFug( 3 )
6 Comp3BulkKval = FLOBJ%LIQUID%KVal( 3 )
7 Comp3BulkdKdT = FLOBJ%LIQUID%dKdT( 3 )
create_Fluid
This function allows user-added subroutines to erect instances of
fluids. It dynamically allocates all arrays and computer resources
needed by a fluid. Call this function before attempting to use the
fluid in any other way. It is intended for use in unit operation sub-
routines. Using it in utility subroutines is possible but more difficult,
since the required FacObj (that defines the user-defined dimensional
units) is not available in a UASOBJ data structure.
Where:
FLObj The new fluid object returned as the value of the func-
tion. It contains all supported phases, including Total,
Vapor, Liquid, L1, L2, Solid, and NMWSolid. However,
almost all data members are initialized to zero. Before
being used here, FLObj must appear in a TYPE( FLUID )
statement.
newID An identifier assigned to the new fluid instance. It is a
required input character string containing up to 12 char-
acters. The first character should be an upper or lower-
case letter (A-Z). The ID should be unique among all
fluid instances in the subroutine.
NOC The total number of components in the current simula-
tion. It is a required integer input argument. This should
be retrieved from the NOC member of a UAUOP or
UASOBJ data structure.
When called, load_Fluid fully populates the fluid with as much data
as possible. This includes generated properties that it derives from
the data in the PRO/II stream. However, when the stream data is not
complete, the resulting fluid data also will be incomplete. Any pre-
existing data in the fluid is overwritten during loading.
During the loading process, load_Fluid associates the fluid with the
PRO/II stream. The ID of the associated stream is stored in data
member P2StreamID of the fluid. For example, for a fluid named
FLObj, access the associated stream ID using FLObj%P2StreamID.
Usage of class_Fluid
After the basic fluid declarations described above are complete, the
fluids are available for use. The basic steps for working with fluids
are:
1. Create Instances of Fluids. Fluids were designed to be created
within UAUOP subroutines. Use function "create_Fluid" on
page 6-14 to allocate the computer resources needed by these
virtual constructs. This step is not required when developing a
UAUTIL subroutine that uses only the fluids that are members of
UASOBJ data structures passed as arguments in the call list.
2. Populate Fluid Instances with Data. The subroutine may ini-
tially populate each fluid in a number of ways:
Use the direct-access method of coding to store data in the
data members. Typically, PRO/II requires the temperature
and pressure in the encompassing fluid object. It also
requires the Total phase molar flowrate in Total%RateM and
molar compositions in array Total%XFracM.
Line 1 brings in a fluid object as the only argument in the call list.
Line 2 “uses” the fluid class module to make fluids available.
Line 3 declares the argument FluidObj as a FLUID.
Lines 4-6 simply declare some local variables in the subroutine.
Referring to Table 6-8 on page 27 of this chapter, note the fluid con-
tains members NOC (number of components), Temp, and Pres
(fluid temperature and pressure).
Lines 8, 9, and 10 retrieve these data values from the fluid storage.
Again from Table 6-8, note each Fluid contains FluidPhase objects
named Total, Vapor, Liquid, L1, and L2. The fluid also includes valid-
ity flags for each phase. (Members Status, VapStatus, and L1Status
are the validity flags for the Total, Vapor, and L1 phases, respec-
tively.)
Line 12 test the status flag for the Total phase in an IF statement.
Now look at Table 6-11 to identify the data members in a Fluid-
Phase object. Among the many properties, each phase has members
named RateM and XFracM. RateM is the total mole rate of the phase.
XFracM is an array containing the component mole fractions in the
phase. It contains NOC elements; one for each component in the
simulation. With this information, we continue interpreting the code
in the example.
Lines 13 and 14 retrieve RateM and the mole fraction of component
6 from the Total fluid phase.
Lines 16 and 17 test for valid data in the Vapor and L1 phases.
Lines 18 and 19 extracts vapor RateM and the mole fraction of com-
ponent 6 from the Vapor phase.
Line 20 computes the mole rate of component 6 in the vapor phase.
Line 21 zeroes the mole fraction of component 6.
Fluid Identification
The data in this section identifies the fluid. PRO/II automatically
generates this information when it creates a UASOBJ. Users cannot
modify or access this information. Developers may find it useful
during the debugging stages of subroutine implementation.
Component Data
Each fluid includes basic information about the components in a
simulation. Since fluids typically are members of a UASOBJ data
structure, the component data of a fluid duplicates the component
data of the parent UASOBJ. Developers usually retrieve component
data from UASOBJ, in which case retrieving component data from
a fluid is not necessary.
Phase Members
Fluids store most of their data in member data structures that repre-
sent different fluid phases. The Total phase stores most of the proper-
ties of the fluid as a whole. Other phase members, Vapor and Liquid in
particular, store properties of each phase present in the fluid.
Fluids created in a user-added subroutine using the create_Fluid
function always include all the phases listed in Table 6-9. This
includes all fluids created in user-added unit operation subroutines.
Table 6-10 does not apply to these fluids.
.
Table 6-9: Phases Available in a Fluid
Total Properties of the overall fluid; i.e., the Total phase. This
phase always is present in a fluid.
Vapor Properties of the Vapor phase of a fluid. This phase may or
may not be present.
Liquid Properties of the bulk Liquid phase in a fluid. This phase
may or may not be present.
L1 Properties of the L1 liquid sub-phase. This phase may or
may not be present.
L2 Properties of the L2 liquid sub-phase. This phase may or
may not be present.
Solid Properties of the molecular-weight solids phase. This
phase may or may not be present.
NMWSolid Properties of the non-molecular-weight solids phase. This
phase is not yet fully supported by PRO/II.
Validation Flags
Fluid validation flags allow developers to test for the existence and
availability of data in a fluid object and its phase members. The
flags should be tested before attempting to access data from fluid
objects.
Usage of class_FluidPhase
FluidPhase data structures are available only as members of
fluids. Developers should adhere to the following guidelines
when writing code to access data from a FluidPhase object.
User-added subroutines do not need a USE statement for
class_FluidPhase, since Class_Fluid automatically does this.
All fluidPhase objects in a fluid have pre-defined names.
Tables 6-9 and 6-10 includes the names of all possible phases
that a fluid might contain.
All references to FluidPhase data should access the phase
as a member of a fluid (e.g., Fluid%Phase%prop).
Only direct member addressing is available for accessing
phase data. The class_FluidPhase module does not implement
accessor functions, so indirect addressing is not available.
Sample code that demonstrates accessing phase data appears in
the section "Fluid Phase Example" on page 6-36.
The sample code (above) retrieves the total fluid mole rate from the
Total phase of the fluid.
While the structure and data content in the UASOBJ’s are identical
for both IFAREA utilities, the numeric values are in different units.
For instance, pressure values in English units are psia, but pressure
in metric units are kg/cm2. Developers and users can be confident
that these conventions apply to every instance of each of these two
utility routines.
Accessor Functions
GetFactor_DmUom( )
This function retrieves one scaling factor and its associated transla-
tion factor to perform a dimensional units conversion. This accessor
function is a member of class_DMUOM. The input arguments spec-
ify which factor to retrieve.
Calling sequence:
iStat = GetFactor_DmUom( cSysIn, cClassIn, &
UomObj, FacOut, OffOut, cIdOut )
Where:
cSysIn Input character keyword that specifies the system of
units from which to convert. Valid entries are:
“USER” Requests a factor to convert from a user unit to a
PRO/II internal unit. May be abbreviated as “U”.
cGetID_DMUOM( )
This function returns the keyword identifier for the units of measure
of a specified dimensional class and system. It is a member function
of class_DMUOM. It supports only PRO/II internal units and user
units.
Calling sequence:
Where:
cSysIn Input character keyword that specifies the system of
units from which to convert. Valid entries are:
Examples
The following illustrates the proper usage for class_DMUOM using
the recommended accessor functions. The sample code represents a
subroutine within a user-added unit operation model where a
UAUOP object is passed in through the argument list.
Example 16-1
Subroutine MyCode( Context, UaUopObj, ISOLVE )
USE class_UAUOP
CHARACTER(LEN=*) :: Context
TYPE(UAUOP) :: MyUop
INTEGER(4), INTENT(OUT) :: ISOLVE
Notes:
The statement “TYPE(UAUOP): MyUop“ declares the UAUOP data
object which includes “myUop%Factors“, an instance of
class_DMUOM.
Local variable PresUA is set to any value (here, 14.6959). All cal-
culations are assumed to be in user units, so PresUA is user units.
The call to GetFactor_DmUom retrieves the factor and offset to
convert pressure from user units to PRO/II internal units. The con-
version factor returns in variable FacUA with the associated transla-
tion factor returned in OffUA. The unit identifier returned in
cIdUomUA is the user unit for pressure.
Overview
Each modular user-added unit operation allows developers to create
a custom data entry window (DEW). Simulation users use the win-
dow to enter and modify input data for the UAUOP. The window is a
dialog box with one or more tabs. Users click a tab to display a pane
of data. The infrastructure in PRO/II that provides this support is
called the AutoGUI.
The AutoGUI reads an XML text file that specifies the unit operation
data to display in the tabbed dialog box. The AutoGUI tool then cre-
ates and positions the data in the tabbed dialog box. Simple interac-
tions can be specified in the XML file, with no GUI programming
required.
This chapter provides details about using the AutoGUI to create
tabbed data entry dialog boxes for PRO/II UAUOP units. It specifies
the syntax of the XML used for creating the dialog boxes, and
shows some sample screens using AutoGUI.
Notes
Client
The <Client> element is a child element of <Image>. Refer to the
topic "Image" on page 8-10 for details.
Constraint
The <Constraint> element is used to display static text on the tab.
The <Desc> child element specifies the text to display.
Count
The <Count> element is a child of <Parameter> or <Variable>.
When used as a child element of a vector variable or vector parame-
ter, it defines the number of rows to display. When used as a child
element of a scalar variable or scalar parameter, it defines the width
(approximate number of characters) to display.
CreateSideBySide
The <CreateSideBySide> child element is used to modify the
default positioning of a control. Normally, controls are stacked ver-
tically in the tabbed dialog box. In some cases however, it is more
intuitive to place two controls side-by-side. For example, if a check
box is used to enable/disable a single edit control, the <NoLabel>
and <CreateSideBySide> elements can be used to place the edit
control next to the controlling check box.
DependentGroup
The <DependentGroup> element is a child of the <Value> element
and is used to specify interactions between controls. See the
<Value> element for a detailed description.
FileName
The <FileName> element is a child element of <Image>. Refer to
the topic "Image" on page 8-10 for details.
Group
The <Group> element is used to group one or more items for pur-
poses of display or control. A group can be displayed in a group box
or grid. A group can also be enabled (or shown) based on the state
of a parent control (a check box, radio button, or drop-down list
box). The <Group> element supports the following attributes.
Name= This attribute specifies the text identifier for the group.
This text identifier is used in the <DependentGroup>
child element to associate the parent control (such as a
check box) with this dependent group of controls.
Type= This attribute specifies the type of display to be used for
the group and can have the following values:
“Weak” Displays the controls normally (without a
group box or a grid).
“Normal” Creates a group box around the controls speci-
fied as child elements of this <Group> element.
The text of the <Desc> child element is dis-
played as group box title.
“Strong” Creates the child controls in a grid. The child
controls must be one of the following types:
Scalar Variables: The grid is row-based; each
variable is displayed in its own row.
Scalar Parameters: The grid is row-based;
each parameter is displayed in its own row.
Image
The <Image> element is used to display image files in the tabbed
dialog box. The image formats supported are BMP, JPEG, and GIF.
The <FileName> child element specifies file name of the image file.
The <Client> child element specifies whether the file is located in
the client side; for PRO/II, this element. If <Client> is not
specified, the file location is considered to be a Server.
The image file should be located in \simsci\proiiNN\resource. The
display size of the image also can be specified through the <Height>
and <Width> child elements. If not specified, the image will be dis-
played in its actual size.
MilanoAttribute
The <MilanoAttribute> element is a child of the <Variable> element.
The text value of this element can be:
I (Capital I) If the <MilanoAttribute> element is not
present, or the text value is I, then the user input value of
the parent variable element will be displayed in the
tabbed dialog box.
NoLabel
The <NoLabel> element can be used to suppress the display of the
text label in front of the edit control. This element is typically used
with the <CreateSideBySide> element in an interaction scenario.
For example, to configure a check box to enable/disable a target edit
field,
1. Create the edit field in a <Group> element, so the group name
can be specified as the dependent group of the check box.
2. In the edit field, include the elements <CreateSideBySide> and
<NoLabel> with values of true to display the edit field next to
the controlling check box.
Parameter
The <Parameter> element is used to create a check box, radio but-
ton, combo box, or edit field, depending on the type. A vector
parameter will automatically be created as a grid, with each element
of the vector appearing in its own row. Attributes include:
Name= The name of the PRO/II database attribute associated
with this parameter element is specified using the
Name= attribute. See “Variable and Parameter Names”
on page 14 for more details.
Type= The type of parameter is specified using the Type=
attribute. The valid parameter types are:
“Choice” Creates a check box. The PRO/II database
attribute must be an integer (INT) value. By
default, a value of 0 means unchecked and a value
of 1 means checked.
This element can contain one or more <Value>
child elements which can be used to control the
show/hide or enable/disabled status of dependent
groups of controls. Control groups are defined
using the <Group> element. There can be only one
dependent group which will be enabled if the check
box is checked and disabled if unchecked.
ReadOnly
The <ReadOnly> element can be used to display information while
preventing the user from modifying it. Set the text value of this ele-
ment to true to create a read-only control.
Required
The <Required> element sets the required/optional state of the con-
trol. The valid values are
req Indicates that an input user value is required. If the user
does not supply a value, the border will be red.
opt Indicates that an input user value is optional. If the user
does not supply a value, the border will be green.
none Indicates that no border color will be used.
ShowTitleHeader
The <ShowTitleHeader> element specifies text to be displayed in
cell (0,0) of a grid when displaying an array parameter or an array
variable.
SpecList
The <SpecList> element is the top-level element in the XML file.
There is only one <SpecList> element in an AutoGUI XML file.
This element will contain one or more <Spec> elements.
ToolTip
The <ToolTip> element specifies the text to be displayed as a tooltip
when the mouse hovers over the control. Tooltips are not supported
in a grid.
Value
One or more <Value> elements may be specified as a child element
of a <Parameter> element if its Type= attribute is “Choice”,
“Option”, or “Selection”. The purposes of the <Value> element are:
Variable
The <Variable> element creates a double precision edit field that
supports the PRO/II DEFINE construct. The PRO/II database
attribute must be a parameter (PAR) value. A vector variable will
automatically be created as a grid, with each element of the vector
appearing in its own row. The name of the PRO/II database attribute
associated with this variable element is specified using the Name=
attribute. See “Variable and Parameter Names” (below) for more
detail.
The child elements <Required>, <NoLabel>, <ReadOnly>,
and <CreateSideBySide> may be used to specify additional
characteristics.
Table 8-4 shows the proper Name= syntax for referring to the
UAUOP data attributes declared in Figure 8-1.
Width
The <Width> element is a child element of <Image>. Refer to the
topic "Image" on page 8-10 for details.
.ini file
[Data Definition]
MAXINT = 1
TOTINT = 1
MAXPAR = 1
TOTPAR = 1
MAXDBL = 1
TOTDBL = 1
MAXTEX = 1
TOTTEX = 2
.xml file
<SpecList Name=”AutoGUI Ex01">
<Variable Name=”ScalarPAR”>
<Desc>Scalar Parameter:</Desc>
<Required>req</Required>
</Variable>
</SpecList>
The <Variable> element is used to display the PAR attribute Scrap-
per (PAR 1 in the INI file listing). The 3 <Parameter> elements are
used to display INT, DBL, and TEXT attributes. If the unit-of-mea-
sure is specified for a PAR or DBL attribute (see PAR 1 in the INI file
listing), it will be used in the tabbed dialog box. The <Required>
element is used to specify the border color convention for missing
data.
Result
The resulting AutoGUI display is shown in Figure 8-2.
Figure 8-2: Example 1 AutoGUI Display
.ini file
[Data Definition]
MAXINT = 1
TOTINT = 10
MAXPAR = 1
TOTPAR = 10
MAXDBL = 0
TOTDBL = 0
MAXTEX = 0
TOTTEX = 0
.xml file
<SpecList Name=”AutoGUI Ex02”>
<Variable Name=”ArrayPAR”>
<Desc>Array Parameter:</Desc>
</Variable>
</Spec>
<Variable Name=”ArrayPAR”>
<Desc>Array Parameter:</Desc>
</Variable>
</Group>
</Spec>
</SpecList>
Fields bordered in red indicate required but missing data that the
user must supply.
.ini file
[Data Definition]
MAXINT = 3
TOTINT = 3
MAXPAR = 0
TOTPAR = 0
MAXDBL = 0
TOTDBL = 0
MAXTEX = 0
TOTTEX = 0
INT 1 “CheckINT” 1 None -2111111111 -2111111111 -2111111111
INT 2 “RadioINT” 1 None -2111111111 -2111111111 -2111111111
INT 3 “LBoxINT” 1 None -2111111111 -2111111111 -2111111111
.xml file
<SpecList Name=”AutoGUI Ex03">
<Spec Name=”Integers” Type=”Normal”>
<Parameter Name=”CheckINT” Type=”Choice”>
<Desc>Checkbox:</Desc>
</Parameter>
<Parameter Name="RadioINT" Type="Option">
<Desc>Radio Buttons:</Desc>
<Value Name="0" Type="Integer">
<Desc>Option 0</Desc>
</Value>
<Value Name="1" Type="Integer">
<Desc>Option 1</Desc>
</Value>
</Parameter>
Result
Figure 8-5: AutoGUI Tab of Example 3
.ini file
[Data Definition]
MAXINT = 4
TOTINT = 4
MAXPAR = 4
TOTPAR = 8
MAXDBL = 0
TOTDBL = 0
MAXTEX = 0
TOTTEX = 0
.xml file
<SpecList Name="AutoGUI Ex04">
Result
The first tab demonstrates interaction with a check box. If the check
box is checked, then the dependent edit field is enabled.
.ini file
[Sides]
MAXSides = 2
SIDE 1 Side_1 1 1 1 1
SIDE 2 Side_2 1 1 1 1
[Data Definition]
MAXINT = 1
TOTINT = 1
MAXPAR = 0
TOTPAR = 0
MAXDBL = 0
TOTDBL = 0
MAXTEX = 0
TOTTEX = 0
.xml file
<SpecList Name="AutoGUI Ex04">
<Spec Name="Thermodynamics" Type="Normal">
<Parameter Name="MethodData[0]" Type="Selection">
<Desc>Thermodynamic Set Side 1</Desc>
<ValueDomain>THERMOSETS</ValueDomain>
</Parameter>
Notes:
Each ICON section is terminated by the next ICON statement or
an end-of-file.
The shape keyword can be any of a number of geometrical
shapes, such as LINE, CIRCLE, and POLY, as listed in Table 9-7,
”Shape Table”, on page 9-7.
The BEGOUTLINE and ENDOUTLINE statements are used to
define a general enclosed shape that is typically filled with the
user-defined preferred fill color and gradient.
The order of the FORM, shape, BEGOUTLINE/ENDOUTLINE,
PORT, and PLIN statements is not significant as long as each
shape, PORT, and PLIN is followed by its appropriate DATA
statement(s). The shape, PORT, and PLIN statements can
appear in any order. Within a BEGOUTLINE/ENDOUTLINE
sequence, however, the statements should be entered such that
they define an enclosed figure with the items drawn in the order
presented.
DATA statements contain one or more numeric values. Multiple
DATA statements act as continuations for the first DATA state-
ment. For example the statement DATA 1 2 3 on one line fol-
lowed by DATA 4 5 6 on the next line is equivalent to DATA 1
2 3 4 5 6 all on one line.
A line beginning with // is a comment line.
GROUP Statement
The GROUP statement defines the description of the icon and iden-
tifies which UAUOP in the p2uasreg.ini file is associated with this
icon. The format of this statement is:
GROUP 420001 <desc> "UAUOP" <show> <uauop>
Where:
420001 This code number is required to identify the icon as
being a UAUOP icon.
<desc> Text description for the icon. This text will be displayed
beneath the icon on the icon palette if the “large buttons”
option is used.
"UaUOP" This text string is required to identify the icon as being a
UAUOP icon.
<show> This value will typically be 1, which means that the icon
is displayed in the icon palette. 0 means the icon is not
shown in the icon palette.
<uauop> Text string identifying the type of UAUOP unit. This
text string must match the text string used in the
p2uasreg.ini file.
ICON Statement
Each ICON section starts with an ICON statement and ends with
another ICON statement, an END statement, or an end-of-file.
The format of the ICON statement (with all values on one line) is:
ICON <text> 60 <rflag> <sfac> <dform>
<dstart> <input>
Where:
<text> Descriptive text associated with this icon. If multiple
icons are supplied for a UAUOP unit, each icon can have
its own descriptive text.
60 This is the routing logic code and must be 60 for
UAUOP unit operations.
FORM Statement
This statement defines the XML file to be used for data entry. The
format is:
FORM <dll_name> <xml_name>
where:
<dll_name> The name of the DLL used to process the XML file.
For UAUOP units, this should be P2GenericUnit.dll
<xml_name> The name of the XML file used to define the tabbed
dialog box for the UAUOP unit operation.
<fill> Fill flag, -1 for default. See Table 9-5, ”Fill Style
Codes”.
Table 9-5: Fill Style Codes
Value Fill Style
-1 Default
0 Hollow
1 Solid
PORT statement
The PORT statement defines a stream connection point on the icon.
The format is:
PORT <id> <color> <type> <unused>
<width> <style> <name> <tooltip>
Where:
<id> The port identifier. If there are several ICONs in a
GROUP, they must have the same number of ports, and
the ports must have the same sequence of ID numbers.
Within each ICON, the port ID must be unique.
<color> Color. This value is not used, specify -1.
<type> Port type. Specify a value of 0, which signifies a PRO/II
process stream.
<unused> Not used. Specify -1.
BEGOUTLINE Statement
The BEGOUTLINE statement defines the start of an arbitrary
enclosed region.
BEGOUTLINE
ENDOUTLINE Statement
The ENDOUTLINE statement defines the end of an enclosed region
which was initialized by the BEGOUTLINE statement.
The syntax is:
.dat file
1 // Single side, point ports
2 GROUP 420001 "IconEx1" "UaUOP" 1 "ICONEXAMPLE01"
3 ICON "IconEx1" 60 0 20.0 "UOP%d" 1 0
4 FORM P2GenericUnit.dll ICONEXAMPLE01.xml
5 POLY -1 -1 -1 -1 -1 -1
6 DATA 0 0 10 0 10 2 0 2
7 PORT 101 -1 0 -1 -1 -1 "FEEDID" "Feed Port"
8 DATA 1 0 0 2 0 0 0 0 0 1 0 1 0
9 DATA 0 1
10 PORT 102 -1 0 -1 -1 -1 "PRODID" "Product Port"
11 DATA 0 1 0 0 0 0 0 0 0 0 1 1 0
12 DATA 10 1
13 ID -1 -1 -1 -1 -1 -1
14 DATA 11 3
On the DATA statement at line 8, the first integer sets the maximum
allowed number of feeds to 1, while the second integer sets the
maximum number of products to zero. Compare this to the data
statement at line 11, where the first integer sets the maximum feeds
to zero, while the second integer sets the maximum allowed prod-
ucts to 1.
Feed ports are displayed whenever the user places the cursor on the
terminal end of a stream, as shown in Figure 9-1. Product ports are
displayed when the originating end of a stream is selected. The next
example shows modified port behavior.
.dat file
1 // Single side, line ports
2 GROUP 420001 "IconEx4" "UaUOP" 1 "ICONEXAMPLE04"
3 ICON "IconEx4" 60 0 20.0 "UOP%d" 1 0
4 FORM P2GenericUnit.dll ICONEXAMPLE04.xml
5 BEGOUTLINE
6 LINE -1 -1 -1 -1 -1 -1
7 DATA 10 0 0 0
8 PLIN 101 -1 0 -1 -1 -1 "FEEDID" "Feed Port"
9 DATA 1 0 0 2 0 1 0 0 0 1 0 1 0
10 DATA 0 0 0 2
11 LINE -1 -1 -1 -1 -1 -1
12 DATA 0 2 10 2
13 PLIN 102 -1 0 -1 -1 -1 "PRODID" "Product Port"
14 DATA 0 1 0 0 0 1 0 0 0 0 1 1 0
15 DATA 10 2 10 0
16 ENDOUTLINE -1 -1 -1 -1 -1 -1
17 ID -1 -1 -1 -1 -1 -1
18 DATA 11 3
The first entry on the DATA statement at line 9 of the listing defines
the left line port to accept a single feed. Similarly, the second entry
on the DATA statement at line 14 configures the right line port to
accept a single product.
Result
The screen shot in Figure 9-4 shows the icon after it has been added
to the flowsheet and as a new feed stream is being attached to the
icon. Notice that the left line port is highlighted in red, indicating
that it requires a feed stream connection.
.dat file
1 // Single side
2 GROUP 420001 "IconEx5" "UaUOP" 1 "ICONEXAMPLE05"
3 ICON "IconEx5" 60 0 20.0 "UOP%d" 1 0
4 FORM P2GenericUnit.dll ICONEXAMPLE05.xml
5 BEGOUTLINE
6 ARC -1 -1 -1 -1 -1 -1
7 DATA 5 2 5 2 0 180
8 PLIN 101 -1 0 -1 -1 -1 "FEEDID" "Feed"
9 DATA 1 0 0 2 0 1 0 0 0 1 0 1 0
10 DATA 0 2 0 10
11 ARC -1 -1 -1 -1 -1 -1
12 DATA 5 10 5 2 180 0
13 PLIN 102 -1 0 -1 -1 -1 "PRODID" "Product"
14 DATA 0 1 0 0 0 1 0 0 0 0 1 1 0
15 DATA 10 10 10 2
16 ENDOUTLINE -1 -1 -1 -1 -1 -1
17 LINE -1 -1 -1 -1 -1 -1
18 DATA 0 2 10 2
19 LINE -1 -1 -1 -1 -1 -1
20 DATA 0 10 10 10
21 ID -1 -1 -1 -1 -1 -1
22 DATA 5 14
.dat file
1 // Two sides, point ports
2 GROUP 420001 "IconEx6" "UaUOP" 1 "ICONEXAMPLE06"
PRO/II User-Added Subroutine User Guide 9-17
3 ICON "IconEx6" 60 0 20.0 "UOP%d" 1 0
4 FORM P2GenericUnit.dll ICONEXAMPLE06.xml
5 POLY -1 -1 -1 -1 -1 -1
6 DATA 0 0 10 0 10 4 0 4
7 PORT 101 -1 0 -1 -1 -1 "FEEDID1" "Feed Side 1"
8 DATA 1 0 0 2 0 1 0 0 0 1 0 1 0
9 DATA 0 1
10 PORT 102 -1 0 -1 -1 -1 "PRODID1" "Prod Side 1"
11 DATA 0 1 0 0 0 1 0 0 0 0 1 1 0
12 DATA 10 1
13 PORT 201 -1 0 -1 -1 -1 "FEEDID2" "Feed Side 2"
14 DATA 1 0 0 2 0 2 0 0 0 1 0 2 0
15 DATA 0 3
16 PORT 202 -1 0 -1 -1 -1 "PRODID2" "Prod Side 2"
17 DATA 0 1 0 0 0 2 0 0 0 0 1 2 0
18 DATA 10 3
19 ID -1 -1 -1 -1 -1 -1
20 DATA 11 5
abc
Keyword Summary
Access Data Summary
DLLNAME Statement
DLLNAME=libraryname
This statement identifies the dynamic link library file that contains
the executable code. It is required when the PROTOCOL statement
declares PROTOCOL=DLL (currently, the only protocol supported
for a UAUOP). Otherwise, it is ignored. Keyword DLLNAME may
be abbreviated to simply DLL.
libraryname This is the exact name of the DLL, including any suffix
such as “.DLL”. The name does not include any path
information. Embedded blanks are allowed when the
libraryname is enclosed in quotation marks. Trailing
blanks are discarded.
Whether or not the DLL name is case sensitive is determined by the
operating system used to run PRO/II. The libraryname entry should
exactly duplicate the upper and lower case characters used by the
file system to store the DLL. PRO/II tries to access the DLL using
the libraryname as entered. If that fails, the name is converted to all
upper case and re-tried. If the second attempt fails, PRO/II issues an
error message.
ROUTINENAME Statement
ROUTINENAME=routinename
UATYPE Statement
UATYPE=uoptype
This statement is required to declare the unique identifier for the
UAUOP.
PATH Statement
PATH=%P2Install%\SYSTEM
The PATH statement declares the installed location of the library
file that contains the executable UAUOP code.
%P2Install%\SYSTEM This represents the default path when the
PATH statement is omitted. It assumes the library has
been installed in the SYSTEM directory of the PRO/II
installation. See “Registering a Path to a User-Added
DLL” on page 9 of Chapter 2 for a more detailed dis-
cussion.
In practice, developers almost never install their executable code in
the SYSTEM directory. Consequently, this statement is almost
always required. Any directory may be specified so long as PRO/II
is able to use the path to access the directory containing the execut-
able library file. For example, one UAUOP sample file shipped with
PRO/II creates an executable library in:
PATH=%P2Install%\User\Uas\UasF90\VF6\Release
PROTOCOL Statement
PROTOCOL=DLL { | STATIC | UASLB | COM |
GCOCOM | DCOM | CORBA |
GCOCORBA | UNIX }
The PROTOCOL statement defines the access mechanism used by
PRO/II to access the UAUOP. Only the DLL (Dynamic Link Library)
option is supported for user-added unit operations. The other proto-
cols are used by other PRO/II add-ons, and are listed only for clar-
ity. Because PROTOCOL=DLL is the default, the PROTOCOL
statement is not required. However, it is recommended to explicitly
declare the protocol.
SYNTAX Statement
SYNTAX=FORTRAN{ CPP | VB }
This statement declares the syntax used when PRO/II calls the user-
added unit operation.
FORTRAN Use Fortran calling conventions when calling a user-
added unit operation. This is the default and the only
syntax supported for calling a UAUOP.
CPP Not supported. This is intended to use C++ calling con-
ventions to access a user-added subroutine.
VB Not supported. This is intended to use Visual Basic call-
ing conventions to access a UAUOP.
PRO/II always calls the Fortran interface routine of a UAUOP.
Developers may code calculations, reports, and other subroutines in
other languages. To do this, modifications would be needed in the
interface routine to call the other subroutines and functions using
appropriate calling conventions. Additionally, data exchanged with
PRO/II may need to be stored locally by the interface routine, since
storage formats may be different in other languages.
DESCRIPTION Statement
DESC=description
This allows the developer to enter a comment in the INI file. It is
allowed by PRO/II, but it is not available from a UAUOP.
description Up to 40 characters of any text. Enclose the descrip-
tion in quotation marks when embedded blank spaces
are present.
Unsupported Statements
CLASS=classid
Not supported for a UAUOP. This statement allows entering the
class identifiers required by other add-ons that interface with
PRO/II through a COM server.
PROGID=identifier
Not supported for a UAUOP. This statement allows entering the
Program ID required by other add-ons that interface with
PRO/II through a COM server.
MAXSIDES Statement
MAXSIDES =nsides
This statement declares the maximum number of sides in a UAUOP.
When this statement is omitted, the model contains one side.
nsides The number of sides to configure. This integer allows
any value between 1 and 50.
Any specific SIDE may have both feeds and products, feeds and no
products, products and no feeds, or neither feeds nor products.
However, at least one side must have at least one feed. If no SIDE
has a feed, the PRO/II calculation sequencer will skip the UAUOP
during flowsheet convergence calculations. Products always are
optional.
See the example at the end of the next section, “Variable Definition
Statements”.
PAR PAR
1 TempIn 1 Temperature 70 32 212
,F
2 TempOut 1 Temperature none 70 212
,F
3 PresIn 1 Pressure, 14.6959 1.0 50.0
psia
PresOut 1 Pressure, none 14.0 50.0
psia
DBL DBL
1 Xval 3 Duty, Watt 0.0 None None
2 Yval 3 Surf. Tens, None None None
N/m
3 CalcOut 3 n/a none None None
TEXT TEXT Element maxchar minnam
1 Mytext1 3 12 7 n/a n/a
2 MyText2 1 16 7
TEXT 1 “Mytext1” 3 12 7
TEXT 2 “MyTEXT2” 1 16 7
Placeholders
Every entry on each statement is required. Missing entries must be
indicated by using the designated placeholder.
~ The tilde (~) is a placeholder that indicates an omitted
entry.
Use only one tilde for each omitted entry. To omit contiguous
entries, use one tilde for each omitted entry, with a blank space
between each tilde. Note: most numeric data use numeric values for
“missing” values, and do not support use of the tilde.
Quotation Marks
“, ‘ Full (“) and single (‘) quotation marks (i.e., apostrophes)
may be used in pairs to enclose text entries that include
embedded blanks. They are never part of a variable
name.
Any data that includes embedded blank spaces must appear in quo-
tation marks.
Variable Names
The ID names of variables on INT, PAR, DBL, and TEXT statements
must begin with an alphabetic character A-Z or a-z. Names may
contain embedded blanks, but are not recommended, because they
require users to enclose the name in quotation marks in keyword
input files.
Packing Data
IS1(2) I4 Packing type (use only with PTYPE
IS1(3), packing
arrangement, below)
IS1(3) I4 Packing arrangement PARRANGE
1 = random
2 = structured
IS1(4) I4 Packed stage number PSECTION
DS1(5) DP Packed section diameter, PDIAM
fine length
DS1(6) DP Packed section height, PHEI
length
DS1(7) DP Size of packing, fine PSIZE
length.
DS1(8) DP Packing specific area, area. PSPAR
DS1(9) DP Packing critical surface PSURC
tension, SurfTens
DS1(10) DP Packing factor, 1/length. PFAC
Tray Data
IS1(6) I4 Tray type TTYPE
1 = bubble cap
2 = valve
3 = sieve
IS1(8) I4 Stage number of stage with TRAYNO
trays
IS1(10) I4 Number of passes per tray, TPASS
currently always 1
DS1(11) DP Tray diameter, fine length TDIAM
DS1(12) DP Tray height, fine length THEI
Fluid Data
The data object for interfacial area includes three separate fluids.
Each is a partial analog of a PRO/II stream. See Chapter 6, ”UAS
Modular Fluids” for a list of all available data.
FlVapor A fluid object that contains the data for the stage
bulk vapor phase. It supports data for the total
fluid and for the bulk vapor phase. Since the
fluid is all vapor, the data for the total fluid and
the vapor phase are identical.
FlLiquid A fluid object that contains the data for the stage
bulk liquid phase. It supports data for the total
fluid and for the bulk Liquid phase. Since the
fluid is all liquid, the data for the total fluid and
bulk liquid phase are identical. It does not
include any data for possible liquid sub-phases.
Packing Data
This section contains packing data when the current stage is a
packed stage. This data is available only when the Column Type
flag indicates a packed stage (IS1(1) = 1). Do not use this data when
IS1(1) has a different value.
Only the packing types listed in Tables 12-7.9 and 12-7.10 of the
PRO/II Keyword Manual are available for use with an interfacial
area subroutine. This is due to the additional data required by the
rate-based calculations that only the RATEFRAC Column algorithm
performs. The additional data for other packing types are propri-
etary and not available.
DS1(8) Specific area of the packing. This is the area per unit
volume of the packing on the stage. The dimensional
class is area. Multiply the specific area by the vol-
ume of packing to obtain total packing area.
IS1(3) Packing 1 2
Arrangement
IS1(1)=2 Column Type Flag that indicates the stage has trays.
DS1(13) Active tray area. This is the tray area that participates
in the separation process. It usually is a fraction of
the total tray area. The dimensional class is fine area.
The following two data members are not return values, but are
included here to complete the documentation.
Overview
The rate-based calculations in PRO/II compute the mass transfer
between the liquid and vapor phases on each separation stage. The
calculations require binary mass transfer coefficients for each
binary pair of components on the separation stage. This mass
transfer utility allows third-party developers to compute the binary
coefficients using their own user-added subroutines. Only the
RATEFRAC algorithm of the Column model supports this. A sam-
ple project that includes an implementation of a working mass
transfer subroutine is available. Refer to “Using a User-Added
Modular Utility in PRO/II” in Chapter 2,“Modular UAS Build Pro-
cedures”.
In rate-based calculations, the vapor and liquid phases are not in
equilibrium. The rate-based calculations in PRO/II do not support
liquid sub-phases at this time. Only bulk liquid properties are avail-
able to this subroutine.
While all fluids on a stage usually have the same pressure, the vapor
and liquid usually are at different temperatures. These two phases
are in contact with each other at the vapor-liquid interface. PRO/II
passes the interfacial area of the stage into this routine. (A user-
added subroutine may be used to compute the interfacial area. Refer
to Chapter 11,“Interfacial Area Utility”). No other properties of the
interface are available.
PRO/II calls the mass transfer subroutine for each individual stage
during calculations. On each call, the calculation subroutine should
compute the mass transfer coefficients of all component pairs for a
single separation stage. The computed coefficients must return as a
two dimensional matrix in the Results array. The Results array is a
member of the data object passed through the argument list of the
call to the subroutine. Also, the calculation routine must return
ISOLVE = 1 for each call. Any other value causes RATEFRAC to
terminate the problem with a fatal error.
Component Data
For a binary mass transfer subroutine, binary diffusion coefficients
for every pair of components are available in the DA2 array of the
UaObj data object.
Stage Data
This section contains general data about the distillation column that
requests the binary mass transfer coefficients. This information
includes flags that characterize the column configuration.
Packing Data
This section contains packing data when the current stage is a
packed stage. This data is available only when the Column Type
flag indicates a packed stage (IS1(1) = 1). Do not use this data when
IS1(1) has a different value.
Only the packing types listed in Tables 12-7.9 and 12-7.10 of the
PRO/II Keyword Manual are available for use with a binary mass
transfer subroutine. This is due to the additional data required by
the rate-based calculations that only the RATEFRAC Column algo-
rithm performs. The additional data for other packing types are pro-
prietary and not available.
DS1(8) Specific area of the packing. This is the area per unit
volume of the packing on the stage. The dimensional
class is area. Multiply the specific area by the vol-
ume of packing to obtain total packing area.
Packing Type
Random Pall Structured
Data Member Rings (plastic) M250Y
DS1(13) Active tray area. This is the tray area that par-
ticipates in the separation process. It is usually
a fraction of the total tray area. The dimen-
sional class is fine area.
The following two data members are not return values, but are
included here to complete the documentation.
Overview
PRO/II supports user-added utility subroutines to compute the heat
transfer coefficient (HTC) between the liquid and vapor phases on
each separation stage. Only the RATEFRAC algorithm of the Col-
umn model supports this. A sample project that includes a working
heat transfer subroutine is available. See “Using a User-Added
Modular Utility in PRO/II” on page 14 of chapter 2 of this manual.
The heat transfer coefficient subroutine uses only average proper-
ties of the total bulk fluid on the stage. No liquid or vapor phase
data is available. Binary diffusion coefficients and binary mass
transfer coefficients are passed in by PRO/II. The mass transfer
coefficients already incorporate fluid properties. They also incorpo-
rate the effects of the mechanical configuration of the separation
stage. Consequently, a very limited set of stage, packing, and tray
data is available.
The HTC calculations do not depend upon the mechanical configu-
ration of the stage. This means a single correlation often is adequate
for all stage configurations. Flags for column stage type (packed or
with trays), packing arrangement, packing type, and tray type are
available if the developer chooses to include logical branching in
the code.
PRO/II calls the heat transfer subroutine for each individual stage
during calculations. On each call, the calculation subroutine should
compute the heat transfer coefficient for a single separation stage.
The computed value must return in element Results(1,1) of the data
object passed through the argument list of the call to the subroutine.
Also, the calculation routine must return ISOLVE = 1 for each call.
Any other value causes RATEFRAC to terminate the problem with
a fatal error.
Component Data
For a heat transfer coefficient subroutine, binary diffusion coeffi-
cients for every pair of components are available in the DA2 array
of the UASOBJ data object.
Fluid Data
The data object passed to a heat transfer coefficient subroutine does
not include any fluid data structures. Only a few average bulk fluid
properties are available as individual members.
Packing Data
This section contains packing data when the current stage is a
packed stage. This data is available only when the Column Type
flag indicates a packed stage (IS1(1) = 1). Do not use this data when
IS1(1) has a different value.
Only the packing types listed in Tables 12-7.9 and 12-7.10 of the
PRO/II Keyword Manual are available for use with an HTC subrou-
tine. This is due to the additional data required by the rate-based
calculations that only the RATEFRAC Column algorithm performs.
The additional data for other packing types are proprietary and not
available.
IS1(1)=2 Column Type Flag that indicates the stage has trays.
Note: Before copying the file, you must close PRO/II if it is open,
UAERR
Purpose: Register an error, warning, or message in the PRO/II error
subsystem and write a user-defined message to a standard output
file.
Calling sequence:
UAERR( cELevel, IUNO, MESSAGE )
Where:
Example:
The sample code snippet demonstrates declaring the character vari-
able, populating it with text and numerical values, and calling
PAWRITE. It assumes the file is open and the logical file unit is avail-
able in variable LFU.
. . .
INTEGER(4) :: LFU, Ival
REAL(8) :: Rval
CHARACTER(LEN=133) :: cLine
. . .
Rval = 23.4
Ival = 3
cLIne = “The value of RVAL( ) is :”
WRITE( cline(19,21), “( I3 )” ) Ival
WRITE( cLine(29:39), “(F9.4)” ) Rval
CALL PAWRITE( LFU, TRIM(cLine) )
The single line of output would be:
The value of RVAL( 3) is : 23.4000
Vector
Position Description
1 Total molar flow in input units of rate
2 Temperature in input units of temperature
3 Pressure in input units of pressure
4 Total enthalpy in 103 input energy units per time
5 Total liquid mole fraction including liquid water
6 Liquid water mole fraction (dimensionless)
7 Compressibility factor (Z) computed from the K-
value or enthalpy method, enthalpy having
preference (dimensionless)
8-10 Reserved for PRO/II
11-NOC Individual component molar flow rates in PRO/II
internal component order and input dimensional
units of molar flow rate. (NOC = number of
components)
INCLUDE PMXUSR.CMN
REAL(8) :: DStrVec( MAXCN + 10 )
REAL(4) :: StrVec( MAXCN + 10 )
The error flag always should be checked after calling this routine.
Stream flow is computed by summing component mole rates in
STREAM(10+1) through StrVec(10+NOC). When storing data, total
stream rate in StrVec(1) is required. When the summation of compo-
nent rates differs from the value supplied in StrVec(1) by a relative
error greater than 1.0e-6, an error message is generated, the stream
rate specified in StrVec(1) is stored, and the component rates in
StrVec(11) to StrVec(NOC+1) are normalized so they sum to the rate
specified in StrVec(1).
Note: Except for the XK1OUT and XK2OUT arrays, the call is very
similar to the call to UFLSH described previously,
Note: For dew point flashes (types 4 and 5), this flash method is the
same as UFLSH since, by definition, no liquids can exist.
This routine does not support any isentropic flashes.
Calling sequence:
Usage (double precision):
CALL DTTPROP( ITYPE, IPHASE, DPrOut, &
DStVecIn, IERR )
Usage (single precision):
CALL TTPROP( ITYPE, IPHASE, SPrOut, &
SStVecIn, IERR )
Where:
The phase enthalpy values return in element (4) of the user stream
vectors. Element (7) returns the compressibility factors as calcu-
lated from the K/H method. Element (8) returns the derivative of
enthalpy with respect to temperature (dH/dT).
Although CO2 is the 2nd component as far as the input file and
printed reports are concerned (i.e., Print Order), it is the 7th compo-
nent in Internal Order because the SIMSCI bank designation indi-
cates that it is a VLS component, while the other components from
the PROCESS databank have VL phase availability. For ease of
internal calculation, the VL components are grouped ahead of VLS
components.
You can see the phase availability from the component PRO/II out-
put report by using the keywords INPUT=ALL on the PRINT statement
in the General Data category of input. You can also force the phase
designation to be uniform by using a PHASE statement in the Com-
ponent Data category of input (see Chapter 1 of the SIMSCI Com-
ponent Manual). Thus, in the above illustration, the user could force
the internal order to match the input order by using the PHASE state-
ment:
PHASE VL=1,7 or PHASE VL=2
CONAME
This function retrieves the text ID of a given component. The
returned value of the function is a character string of up to 16 char-
acters in length.
Calling sequence:
COMPID = CONAME( iSlate, iCint )
Where:
iSlate Integer input indicating the component slate to use:
1 = Normal Component, including solid components
2 = Ionic component (used only for electrolytes)
iCint Integer input of the internal order number of the
component of interest.
COMPID The returned 16 character component ID
/PMXUSR/
This include file contains a single parameter - MAXCN - that defines
the maximum number of components supported by user-added sub-
routines in PRO/II. Starting with PRO/II version 8.0, MAXCN =
2500. In earlier versions, MAXCN was limited to 300. MAXCN is an
invariant parameter that cannot be altered by a user.
Usage:
INCLUDE ‘PMXUSR.CMN’
Where:
Example:
The following code snippet demonstrates the proper ordering
of INCLUDE statements in a user-added subroutine.
INCLUDE ‘PMXUSR.CMN’ ! Required to use others below
INCLUDE ‘UTHERX.CMN’ ! Always after PMXUSR
INCLUDE ‘XPROPX.CMN’ ! Always after PMXUSR
INCLUDE ‘XPROPY.CMN’ ! Always after PMXUSR
There should be no compelling reason for the user to use MAXCN
directly. Instead, call interface routine GETNCOMP to obtain cur-
rent component counts in a problem.
Note: User-added subroutines must include PMXUSR.CMN before
they include UTHERX.CMN, XPROPX.CMN, or XPROPY.CMN.
Note: When the unit dimension does not require all non-
blank positions as shown above, it is spaced accord-
ingly. For example, a pressure unit of Pascals would
be represented bPAb.
KDCALL This flag controls whether or not PRO/II stores data returned
in the common block. PRO/II initializes this flag to zero just
prior to each call to a user-added subroutine. When a user-
added subroutine alters data in this common with the intent
of having PRO/II store it, that user-added subroutine must set
KDCALL = 1. Upon return to PRO/II, all data is stored when
KDCALL = 1. For any other returned value of KDCALL,
any and all returned data are discarded.
Note: The property values must not be altered in any way by user-
added subroutines.
Note: Never attempt to use both /DXPROPX/ and /XPROPX/ in the
same subroutine or function.
Usage (double precision):
INCLUDE ‘PMXUSR.CMN’ ! Required to use DXPROPX
INCLUDE ‘DXPROPX.CMN’
or (single precision):
INCLUDE ‘PMXUSR.CMN’ ! Required to use XPROPX
INCLUDE ‘XPROPX.CMN’
This INCLUDE file contains the following common block:
COMMON /DXPROPX/
& XMW(MAXCN), BP(MAXCN), DENS(MAXCN),
& TC(MAXCN), PC(MAXCN), VC(MAXCN),
& ZC(MAXCN), OMEGA(MAXCN), HFORM(MAXCN),
& GFORM(MAXCN),
& LIBNO(MAXCN), KOCMOL, KOCTOT,
& KOCVL, KOCVLS, KOCLS,
& KOCV, KOCL, KOCS
Where:
/CUSPEC/
Common block /CUSPEC/ is required only in any subroutine calling
UFLSH to perform an isentropic flash. This common transfers the
stream entropy to the UFLSH call interface program for use in the
isentropic flash.
INCLUDE ‘CUSPEC.CMN’
This INCLUDE file contains the following common block:
COMMON/CUSPEC/ IX1(10),SISENV,RX1(7)
Where:
KDCALL This flag controls whether or not PRO/II stores data returned
in the common block. PRO/II initializes this flag to zero just
prior to each call to a user-added subroutine. When a user-
added subroutine alters data in this common with the intent
of having PRO/II store it, that user-added subroutine must set
KDCALL = 1. Upon return to PRO/II, all data is stored when
KDCALL = 1. For any other returned value of KDCALL,
any and all returned data are discarded.
Note: The size of the arrays dimensioned above (by MAXCN from
PMXUSR.CMN) corresponds to the 2500 component maxi-
mum limit discussed in “/PMXUSR/” on page 49 of Chap-
ter 15.
The input variables passed into the user-added subroutine routine
from PRO/II depend on what thermodynamic property is being cal-
culated by that routine and are shown in Table 16-1.
Table 16-1: UTHERX Input Variables Passed Into UKHSxx (xx = 1-15)
K-
Name Description Value H S rho
IXXFLG Flag indicating what data is requested valid valid valid valid
by PRO/II (see below).
JXXFLG Returned flag conveying information
back to PRO/II based on IXXFLG valid valid valid valid
request. IXXFLG and JXXFLG are
discussed below.
NOCZ Number of components in problem— valid valid valid valid
must not exceed MAXCN
IFPHZ Phase Flag n/a valid valid valid
KUOUT FORTRAN file unit number for writing valid valid valid valid
to default output file.
n/a Not applicable
TEMPX, PRESX and TDELTX are all in input units, i.e., their tempera-
ture and pressure units correspond to the choices made on the
DIMENSION statement in the General Data Category of input. If con-
version to another system of units is required by the user-added
methods, then this can be accomplished using values available in
the common block FACTOR (see “/DFACTOR/ double precision” on
page 50 of Chapter 15).
The output variables passed from the user-added subroutine into
PRO/II also depend on what thermodynamic property is being cal-
culated by that routine and are shown in Table 16-2.
Table 16-2: UTHERX Output Variables Passed From UKHSxx. (xx = 1-15)
K-
Name Description Value H S rho
YXSAT Saturated vapor mole fraction for water
at TEMPX and PRESX. Required if valid n/a n/a n/a
water decant is ON (KDECNT > 0).
XXSOL Solubility of water in the non-aqueous
liquid phase expressed as molal fraction
of water at saturation. Required if water valid n/a n/a n/a
decant is ON. May be set equal to 1.0 if
decant is OFF.
n/a Not applicable
After JXXFLG is set, the user-added routine should return to the call-
ing routine as illustrated below for a routine UKHS1 calculating
K-values using an equation of state method:
SUBROUTINE UKHS1
. . .
INCLUDE ‘PMXUSR.CMN’
INCLUDE ‘UTHERX.CMN’
. . .
IF ( IXXFLG .LE. -1 ) THEN
JXXFLG = 2
GO TO 9999
ENDIF
. . .
9999 CONTINUE
END SUBROUTINE UKHS1
In this example, IXXFLG is equal to -1, indicating a request from
PRO/II for the user-added subroutine to specify the degree of com-
positional dependency. In this case the subroutine sets and returns
JXXFLG equal to 2. This indicates the user-added subroutine imple-
ments a composition-dependent equation of state method.
SUBROUTINE UKHS1
. . .
INCLUDE ‘PMXUSR.CMN’
INCLUDE ‘UTHERX.CMN’
INCLUDE ‘CUDATA.CMN’
By adding two lines of code to echo the values in CUDATA:
1001 FORMAT( “ TDATA = “, 5F10.4 )
WRITE(IOUT, 1001)( TDATA(I), I = 1, 5 )
The following results could be written to the output file:
TDATA = 0.5000 1.0000 1.5000 . . .
FORTRAN Listing
!
ELSE IF( IXXFLG .NE. 1 ) THEN
JXXFLG = 99 ! fatal error return flag
GO TO 999
END IF
!
! Case 1: PRO/II requested K-values
! First fetch Component Vapor Pressures
! from PRO/II.
!
STREAM(1) = 1.0D+0 ! Initialize STREAM
STREAM(2) = TEMPX
STREAM(3) = PRESX
DO I = 4, 10
STREAM(I) = 0.0D+0
END DO
DO I = 1, NOCZ
STREAM(I+10) = 1.0D+0
END DO
ITYPE = 1
IFAZE = 1
!
CALL TTPROP( ITYPE,IFAZE,VPS,STREAM, IERR )
!
! Compute Mixture Properties
!
SOLM = 0.0D+0
VOLM = 0.0D+0
DO I=1,NOCZ
VOLI = XLL(I) * VMOLE(I)
VOLM = VOLM + VOLI
SOLM = SOLM + VOLI * SOLU(I)
END DO
IF( VOLM .GT. 0.0D+0 ) SOLM = SOLM / VOLM
PPHC = PRESX
!
! - If WATER DECANT = ON, subtract the partial
! pressure of the free water
!
IF( KDECNT .GT. 0 ) THEN
CALL H2OP( 4, 1, TEMPX, PRESX,
& TDELTX, VPS(KDECNT), TDERIV )
PPHC = PRESX * (1.0D+0 - XVV(KDECNT))
END IF
!
! Compute K-values
No. Comps.
* *
H = ∑ xi Hi (16-7)
i=1
and
xi = mole fraction for component
Hi* = ideal gas enthalpy for component
Two enthalpy values must be computed, with one at a temperature
increment above the stated temperature, where the increment is
passed through a common block. These two values are used by
PRO/II to calculate the heat capacity for the stream at the stated
temperature.
User-computed enthalpies may be used for any unit operation cal-
culation, either user- or PRO/II defined. When rigorous distillation
is to be used in conjunction with user-computed enthalpies, it is
mandatory that dimensionless partial derivatives of enthalpy with
respect to composition be computed for each component:
ΔH ⁄ Δx i
-------------------
RT
Entropies may also be computed for streams based on temperature,
pressure, and composition. Calculated values are returned on a per
mole basis in dimensionless form, that is, divided by the gas con-
stant, R.
Entropies may be computed in two forms (similar to enthalpies):
*
ΔS ⁄ Δx Si – S
------------------i = -------------
- (16-8)
RT RT
where:
S*= ideal gas entropy
or
S/R (16-9)
No. Comps.
* *
S = ∑ xi Si (16-10)
i=1
where:
xi = mole fraction for component i
Si* = ideal gas entropy for component i
T = temperature, °F
ABP = average boiling point, R
The latent heat at the normal boiling point is calculated using the
following:
λb = NBP (8.75 + 4.571 log (NBP)) (16-12)
where:
λb = latent heat, cal/g-mole
NBP = normal boiling point, K
where:
Tc = critical temperature, R
T = temperature, R
Tb = normal boiling point, R
Liquid enthalpies are calculated by integration of equation (16-11)
from 32°F to the desired temperature. Vapor enthalpies are derived
by adding the latent heat to the liquid enthalpies.
The mixture critical temperature and normal boiling point are calcu-
lated as mole-average properties.
The Watson K factor is computed based on the average normal boil-
ing point of the mixture.
PRO/II furnishes (ΔH/Δxi) terms based on the calculated enthalpy
and the component ideal gas enthalpies as supplied from the library
(for defined components) or generated by PRO/II’s petroleum char-
acterization methods. Allowance has been made to calculate water
as a separate phase.
FORTRAN Listing
(1) STANDARD VAPOR VOLUME IS 379.49 FT3/LB-MOLE (60 F AND 14.696 PSIA)
V- = -----
C-
---- (16-14)
Vr Cr
where:
V, Vr=volume at desired and reference temperatures
C, Cr=density factors at desired and reference temperatures
and
(0)
C = V T r ( 1 – ωΓT r ) (16-15)
where:
2
Γ = 0.29607 – 0.09045T r – 0.04842T r (16-16)
Tr = reduced temperature
ω = acentric factor
and (for 0.2 ≤ Tr ≤ 0.8)
(0) 2
V = 0.33593 – 0.33953T r + 1.51941T r
3 4 (16-17)
– 2.02512T r + 1.11422T r
Mixture critical temperatures are evaluated with Kay’s rule, and the
method is limited to a range: 0.2 ≤ Tr ≤ 0.99. Reference densities
are computed using the pure component specific gravities at 60°F,
as provided in the component data.
Reference: Gunn, R. D. and Yamada, T., 1971, AIChE J., 17:1341
(1) STANDARD VAPOR VOLUME IS 379.49 FT3/LB-MOLE (60 F AND 14.696 PSIA)
FORTRAN Listing
Keyword Input
Typical Usage
...
COMPONENT DATA
LIBID 1,IC4/ 2,NC4/ 3,NC5
THERMO DATA
(Input statements for special property Index Method)
METHOD SYSTEM=setid, &
SPROP( idno ) = USINDEX, or PROPID= USINDEX
and
SPROP(M or WT or LV, idno) GAMMA=value, &
REFINDEX=value, REFVALUE=value {, NAME=text}
or
PROPID(M or WT or LV)GAMMA=value, &
REFINDEX=value, REFVALUE=value
and
INDEX ixno, rvalue/ ...
or DATA icno, rvalue/...
where:
Subroutine CVUSER
This subroutine performs conversion between property values and
property index values. Indexes typically are logarithmic forms of
property values. Being logarithmic, they tend to linearize the behav-
ior when combining properties. When coding this routine, it should
be capable of converting index values to property values; and con-
versely, be capable of converting property values to index values. It
is called once for each value to convert. All data input by the appro-
priate DATA, UIDATA, and URDATA statements is available to the
subroutine.
Calling sequence:
SUBROUTINE CVUSER( iOptCvt, VIndex, VProp, GAMMA, &
CONST, IDProp )
where:
iOptCvt This input integer flag indicates the conversion to
perform. Set iOptCvt to one of these two values to
convert a (pre-defined) named property:
1 Convert the Index value (of a named special
property) passed as input in argument VIndex to a
property value returned in VProp.
2 Convert the property value (of a named special
property) passed as input input in argument
VProp to an index value returned in VIndex.
1.0
log ( Index ) = ⎛ -------------------⎞ log10 ( VProp ) + CONST
10 ⎝ Gamma⎠
(17-1)
CONST This input argument represents the Index value at
reference conditions as determined by input values
REFINDEX and REFVALUE.
IDProp This input integer value identifies the special property
to compute. For user-defined properties, this
maps to SPROP(IDProp).
For pre-defined special properties, IDProp may be
found in Table 17-3. For Example, “Vanadium
Content” is number 26 in the table.
After determining whether the property is an SPROP
or a named property, use this argument to
branch to process different properties.
User Information
Keyword Summary
Unit Identification (required)
USn UID=uid, {NAME=text}, {BYPASS=1}
General Information
User input data are supplied to user-added unit operations using
PRO/II keyword statements or the ProVision GUI. From a users’
perspective, there is not a lot of difference between setting up a
user-added unit or one of PRO/II’s internal unit operations.
The operating parameters for these user-added units may be input
by the user or derived from previous unit operations through the
DEFINE feature of PRO/II. See chapter 10.5 in the PRO/II Keyword
Manual, or the PRO/II User’s Guide for more information. Input
processing facilities are included in PRO/II for user-written unit
operations. However, routines for optional output reports must
always be written by the user.
Input Description
Unit Identification (required)
USnn UID=uid, {NAME=text}, {BYPASS=1}
Note: For bypass units (BYPASS = 2), the product streams cannot
be stored with URXSTR or other stream storage routines.
Thermal Conditions
The thermal conditions for feed streams to user-added unit opera-
tions are defined by PRO/II. There are no provisions for the user to
specify them.
CALCULATOR UID=C1
PROCEDURE
R(1) = 13.376
R(2) = 52800
RETURN
US2 UID=USER2
FEED ...
PROD ...
DEFINE RPARM(1) AS CALC=C1, RESULT(2)
Control Variable
Syntax:
CONTROLLER UID=C1
SPEC ...
VARY <utype>=<uid>, PARA(elno)
where:
Sample Code:
To control RPARM(5) for unit C11, defined by user-added subrou-
tine US2, the following VARY statement could be used:
VARY US2=C11, PARA(5)
Specification
Syntax:
CONTROLLER UID=C1
SPEC <utype>=<uid>, PARA(elno), VALUE= rval
VARY ...
where:
Developer Information
Guidelines
Developers should acquire a reasonably thorough understanding of
using user-added subroutines before beginning code development.
All the previous information for users is relevant. This section high-
lights areas of concern that developers may encounter.
Integer Inputs
IPARM integer,.... (Up to 250 values)
Heater/Cooler duties
HEAT duty x 10-6,.... (Up to 10 values)
When designing the storage requirements of a user-added unit oper-
ation, a developer should first characterize the data as input data,
calculated results, or other data used internally by the unit operation
(such as flags and counters).
Generally, user input data should be mapped at the beginning of
storage arrays. If used, the HEAT array typically contains only user
input data. Leave some empty elements after the end of input data
and map in the internal variables. After leaving a few more empty
elements, map calculated results towards the end of the array. The
empty elements leave room for later additions.
Separate integer data from floating-point data and map it into the
IPARM array.
Decide whether or not to store any data in the HEAT array and map it
there as desired.
The remaining data should be mapped to the SUPPLEMENTAL array.
This is where the larger blocks of data should be stored. Determine
whether or not some of the data constitute sub-arrays. For example,
multiple temperatures and multiple pressures routinely are needed.
where:
Output Subroutines
Output subroutines for the user-written unit operations are optional.
Their purpose is to report the results of user-added unit operation
calculations. PRO/II associates one output subroutine with each for
user-added unit operation calculation routine. These associations
are maintained through the subroutine naming conventions. Devel-
opers of user-added output routines must obey the naming conven-
tions listed previously in Table 18-2. For example, use output
routine U59OUT to generate a report for calculation routine USER59.
As delivered, PRO/II includes an output routine for each user-added
unit operation. Most of them contain no active code, so they do not
produce any reports. The intent is for developers to write appropri-
ate code to accurately report the results of their unit operations.
When an output routine is called without first replacing it with user-
written code, PRO/II typically generates the following message:
*** WARNING *** USER-ADDED SUBROUTINE ******
IS CALLED IN THIS PROBLEM BUT NO CODE WAS
SUPPLIED BY THE USER.
Example:
Assume RPARM(26-30) contains temperatures. The following
partial code sample demonstrates using the /OUTFAC/ common
to convert and print values in output units from a UxxOut
routine.
Availability of Data
PRO/II delivers the calculated results from a user-added unit opera-
tion to the corresponding output subroutine in two ways:
Arguments in the subroutine call list. These include the IPARM,
RPARM, SUPPLE, and HEAT arrays (described earlier).
Product streams.
The output subroutine for each user unit operation in the flowsheet
is called at printout time.
All output values must be multiplied by the appropriate output con-
version factors available in common block /OUTFAC/ (see Chapter
15, "Interfacing Software") to ensure that the multiple output
dimension and scaling features of PRO/II execute properly for user-
written output subroutines.
where:
ΔP = pressure drop, psi
ρ = density, lb/ft3
v = mean velocity, ft/sec
L = length, ft
d = inside diameter, in.
gc = gravitational constant, 32.2 ft/sec2
f = friction factor
Friction factors are calculated using mathematical equivalents for
the charts presented by L. F. Moody.
For laminar flow,
f = 64 ⁄ N Re (18-2)
where:
Developer Information
Of course, the intended purpose is to allow you to implement and
use your own pressure drop correlation(s) instead of using those
provided by SIMSCI. To create your own pressure drop correlation
routine, you must replace the subroutine supplied by SIMSCI with
one that contains your own code. Custom routines must include the
following argument list:
SUBROUTINE PIPUS2(
& HLNS, AINCL, DIAM, AREA, RUFF,
& RNUMB, FRICT, FROUDE, NOACCL, PRES,
& RLVELN, VELSL, VELSG, QLI, QGI,
& RLDENS, VISL, RLSTEN, RVDENS, VISV,
& HL, IREG, FRGR, ELGR, ACCGR,
& DPINCR, NFOUT, IDG, NUIDD, NSAVE,
& INTAB )
The 31 arguments are defined as follows:
User Information
Input Description
Reaction Kinetic subroutines must be selected in each unit opera-
tion that uses them. Only the CSTR and PLUGFLOW unit operations
support their use. See the PRO/II Keyword Manual for further infor-
mation about CSTR and PLUGFLOW input data requirements.
Developer Information
Guidelines
Most data is communicated to the user-added kinetics subroutine
through the argument list. There are no streams, although the input
includes data that defines the thermal condition of the reacting
fluid.
Developers may wish to retrieve pure component data from com-
mon block /XPROPX/ or /XPROPY/, dimensional unit conversion fac-
tors from /FACTOR/, and stream properties through subroutine
TTPROP (see Chapter 15, ”Interfacing Software”).
The data shown in Table 19-2 are supplied by PRO/II through the
argument list and should not be altered in subroutine USKINn. Many
of the variables in the argument list for routines USKINn are accessi-
ble through in-line kinetic procedure variables (see Chapter 10.7,
Procedure Data, in the PRO/II Keyword Manual). Also see
Table 19-3 for additional data that may be required by individual
kinetics routines.
Table 19-2: USKINn Input Data Supplied by PRO/II
Input In-Line
Argument Description Procedure
RSDAT1( 1-50 )
Element Reacting Fluid Properties Variable
RSDAT2( 1-300 )
Element Reacting Fluid Component Data Variable
1-50 Total stream fractions for components 1-50 of XTOTAL
reacting fluid
51-100 Concentrations for components 1-50 in the XCONC
reacting fluid (weight-moles/liquid volume for
OPERATION PHASE=L else weight moles/vapor
volume)
101-150 Vapor fugacities for components 1-50 in the XVFUG
reacting fluid
151-200 Liquid phase activities XLACT
201-250 Vapor phase component mole fractions XVAP
251-300 Liquid phase component mole fractions XLIQ
RRDAT1( 1-10 )
Element Reactor Configuration Data Variable
1 Tube diameter, in. (English) or mm (metric, TDIAM
SI). (PLUGFLOW only)
2 Total tube length, ft. (English) or m (metric, TLEN
SI). (PLUGFLOW only)
3 Cumulative tube length (position of finite CUMLEN
element from reactor front end), ft. (English)
or m (metric, SI). (PLUGFLOW only)
4 Current step size (delta X), in. (English) or DELX
mm (metric, SI). (PLUGFLOW only)
IRDAT1( 1-10 )
Element Miscellaneous Integer Data Variable
1 Number of components NOC
2 Number of reactions (stoichiometric NOR
equations)
3 OPERATION PHASE flag: IRPHAS
0 No errors
1 V
2 L
4 CALCULATION flag: ICPF
0 Concentration
1 Partial Pressure
2 Fugacity
3 Activity
5 Current integration step number ISTEP
6 Standard output file Fortran unit number IOUT
7 Index file Fortran unit number INDX
8-10 Not used
Coding Guidelines
Use the following type declaration statements inside the kinetics
subroutine for variables in the argument list.
REAL(4), INTENT(IN) :: &
& RSDAT1(100), RSDAT2(300), RRDAT1(10)
& STOICH(50,15), ORDER(50,15), ACTIVE(15),
& PREEXP(15), RATES(15)
!
INTEGER(4), INTENT(IN) ::
& IRDAT1(10), IDBASE(15)
!
INTEGER(4), INTENT(INOUT) :: IPARM(10)
REAL(4), INTENT(INOUT) ::
& RPARM(70), SUPPLE(200
Output Reports
PRO/II does not provide any mechanism to report the results from
user-added kinetics subroutines. Typically, users inspect the results
of the unit operations that employ user-added kinetics to validate
the calculations. Developers may designate an element of the IPARM
array as a print flag, and use it to write intermediate output from the
kinetics calculation routine.
REACTION DATA
--------- Rates, LB-MOL/HR ----------
Fraction
Component Feed Change Product Converted
-------------------- ----------- ----------- ----------- -----------
1 CL2 17.0000 -16.9929 7.095E-03 0.9996
2 PRLN 68.0000 -16.9929 51.0071 0.2499
3 ACL 0.0000 11.3335 11.3335
4 12PR 0.0000 5.6594 5.6594
5 HCL 0.0000 11.3335 11.3335
REACTOR PROFILES
Reacting Side Cold
Distance Temp Pres Temp
FT F PSIA F
----------- ----------- ----------- -----------
0 0.0000 450.00 29.4000 400.00
1 2.0000 565.61 28.4000 394.17
2 4.0000 703.25 27.4000 380.22
3 6.0000 822.73 26.4000 357.23
4 8.0000 868.01 25.4000 327.09
5 10.0000 862.72 24.4000 293.19
6 12.0000 842.55 23.4000 256.94
7 14.0000 818.20 22.4000 218.49
8 16.0000 792.05 21.4000 177.61
9 18.0000 764.60 20.4000 133.83
10 20.0000 735.91 19.4000 86.53
-- Component Mole Fractions vs. Distance from Inlet
Distance 1 3 4 2 5
FT CL2 ACL 12PR PRLN HCL
--------- ----------- ----------- ----------- ----------- -----------
0 0.0000 0.20000000 0.00000000 0.00000000 0.80000000 0.00000000
1 2.0000 0.16379562 0.01328580 0.02864823 0.78098455 0.01328580
2 4.0000 0.10707946 0.05075851 0.05270253 0.73870098 0.05075851
3 6.0000 0.04383621 0.10352300 0.06580099 0.68331680 0.10352300
4 8.0000 0.01198179 0.13208931 0.06991112 0.65392846 0.13208931
5 10.0000 0.00330047 0.13997237 0.07090894 0.64584584 0.13997237
6 12.0000 0.00110792 0.14194970 0.07117797 0.64381470 0.14194970
7 14.0000 0.00045995 0.14252608 0.07126746 0.64322043 0.14252608
8 16.0000 0.00023015 0.14272677 0.07130384 0.64301246 0.14272677
9 18.0000 0.00013461 0.14280830 0.07132136 0.64292743 0.14280830
10 20.0000 0.00008943 0.14284574 0.07133104 0.64288805 0.14284574
Calling sequence:
CALL UPSEUC( IDATA, BP, IBEGIN, IEND, &
& BPTIP, BPTEP, IERR )
Example:
INCLUDE ‘PMXUSR.CMN’
INCLUDE ‘XPROPY.CMN’
...
REAL BPTIP(MAXCN), BPTEP(MAXCN)
...
CALL UPSEUC( IDATA, BP, IBEGIN, IEND, &
BPTIP,
BPTEP, IERR)
Example:
CHARACTER*12 CID
CHARACTER*40 CNAME
...
CALL URXINF(‘FEED’, 1, CID, CNAME, IERR)
...
ISETUP = 1
CALL USTHER( CID, ISETUP, JMETHD, IERR )
Example:
CHARACTER(LEN=12) :: cSID, cPhase, cProp
CHARACTER(LEN=40) :: cName
REAL(8) :: DValue
... ! obtain ID of first feed stream
CALL URXINF( ‘FEED’, 1, cSID, cName, IERR )
... ! DValue returns total stream molecular weight
cPhase = ‘TOTAL’
cProp = ‘MW’
CALL DUSTPRP( cSID, cPhase, cProp, DValue, IERR )
Example:
...
CHARACTER*12 CID, ATEXT
CHARACTER*40 CNAME
...
CALL URXINF(‘FEED’, 1, CID, CNAME, IERR)
...
ATEXT = ‘SULF’
ISPROP = 0
CALL USTRIP( CID, ATEXT, ISPROP, VALUE, IERR)
Example:
...
INCLUDE ‘…\PMXUSR.CMN’
INCLUDE ‘…\XPROPY.CMN’
...
REAL STREAM(10+MAXCN), TDIST(21)
CHARACTER*12 CID, ATEXT
CHARACTER*40 CNAME
...
NUMCOP = IDATA(4)
CALL URXINF(‘FEED’, 1, CID, CNAME, IERR)
CALL URXSTR(CID, STREAM, 1, IERR)
...
ITYPE = 1
ICONV = 2
IBASIS = 1
WVIP = 0.2
WVEP = 99.0
Example:
...
INCLUDE ‘PMXUSR.CMN’
INTEGER(4), PARAMETER :: NCPSEU=7
INTEGER(4) :: IMAPED(MAXCN)
REAL(4) :: TVEC(NCPSEU), YVEC(NCPSEU)
REAL(4) :: FRATE(MAXCN), BPTIP(MAXCN),
REAL(4) :: BPTEP(MAXCN), FOUT
...
TVEC(1) = 15
TVEC(2) = 100
TVEC(3) = 350
TVEC(7) = 680
YVEC(1) = 0.0
YVEC(2) = 10.0
YVEC(3) = 30.0
YVEC(7) = 100.0
ICUMUL = 0
FOUT = 100.0
IMETHD = 3
CALL URATE( TVEC, YVEC, NCPSEU, ICUMUL,
& FOUT, IBEGIN, IEND, BPTIP,
& BPTEP, IMETHD, IMAPED, FRATE,
& IERR )
Example:
INCLUDE 'PMXUSR.CMN'
INCLUDE 'XPROPY.CMN'
INTEGER(4), PARAMETER :: NCPSEU=7
CHARACTER(LEN=12) :: cProp
REAL(8) :: DTVEC(NCPSEU), DCPROP(NCPSEU)
REAL(8) :: DFRATE(MAXCN), DSTGYV(MAXCN)
REAL(8) :: IMAPED(MAXCN), DBP(MAXCN)
REAL(8) :: DTMINI, DTMAXI, DSCALE
…
! Variables DTVEC, DCPROP, NCPSEU are from
! reactor module
! BP is from XPROPY common block
! BEGIN and IEND are from UPSEUC()
! FRATE is from URATE()
…
cProp = 'MW'
ISPROP = 0
DTMINI = 350.0D0
DTMAXI = 575.0D0
DYLOW = 0.0D0
DYHIGH = 1000.0D0
IFILL = 0
ITREND = 0
IMETHD = 3
IUPDAT = 1
DSCALE = 1.0D0
DBP(1:MAXCN) = BP(1:MAXCN)
…
CALL DUCURVE( cProp, ISPROP, DTVEC, &
DCPROP, NCPSEU, BP, DFRATE, &
IBEGIN, IEND, DTMINI, DTMAXI, &
DYLOW, DYHIGH, IFILL, &
ITREND, IMETHD, IUPDAT, DSCALE, &
IMAPED, DSTGYV, DSUMPRP, IERR )
INCLUDE '…\PMXUSR.CMN'
INCLUDE '…\XPROPY.CMN'
Example:
...
CHARACTER(LEN=12) :: cProp(3)
INTEGER(4) :: nProps, iErr
...
cProp(1) = ‘NBP’
cProp(2) = ‘MW’
cProp(3) = ‘SPGR’
Except for the fact that the input data are entered through the IPARM,
RPARM and SUPPLE vectors in accordance with the UAS structure,
the interfaced reactor unit in every sense behaves like a regular
PRO/II unit.
Note that the reactor feed stream need not be an external source
stream. It can be the product stream of a distillation column. Simi-
larly, the reactor product stream can be a final product or a feed to
other units in the flowsheet. Once the refinery inspection properties
are assigned to a stream at input time or generated by the reactor
simulation at the calculation time, they can be carried with the
stream to other units.
COMPONENT DATA
LIBID 1,H2/2,H2S/3,NH3/4,H2O/5,C1/ *
6,C2/7,C3/8,IC4/9,NC4/10,IC5/ *
11,ETLN/12,PRLN/13,1BUTENE/14,1PENTENE/ *
15,BENZENE
CUTPOINT TBPCUTS=0,1600,80, BLEND=BLEND1
$ Paraffin
PARA(LV) DATA= *
1,0/2,0/3,0/4,0/5,100/ *
6,100/7,100/8,100/9,100/10,100/ *
11,0/12,0/13,0/14,0/15,0
$ Olefin
SPROP(50,LV) DATA= *
1,0/2,0/3,0/4,0/5,100/ *
6,0/7,0/8,0/9,0/10,0/ *
11,100/12,100/13,100/14,100/15,0
$ Naphthene
NAPH(LV) DATA= *
1,0/2,0/3,0/4,0/5,0/ *
6,0/7,0/8,0/9,0/10,0/ *
11,0/12,0/13,0/14,0/15,0
$ Aromatics
AROM(LV) DATA= *
1,0/2,0/3,0/4,0/5,0/ *
6,0/7,0/8,0/9,0/10,0/ *
11,0/12,0/13,0/14,0/15,100
THERMODYNAMIC DATA
METHODS SYSTEM= GS,COND=PETR, VISC(V)=PETR, VISC(L)=API,
SET=GS-1, DEFAULT, &
SULFUR(WT)= SUM, NITR(TOTA,WT)= SUM, &
BROM(WT)= SUM, REFR(WT)= SUM, &
CCR(WT)= SUM, NICK(WT)= SUM, &
VANA(WT)= SUM
STREAM DATA
$ Crude feed
PROP STREAM=1,TEMP=450,PRES=14,PHASE=L,RATE(V)=12075, &
ASSAY=LV, BLEND=BLEND1, SET=GS-1
TBP STREAM=1,PRES(MMHG)=760, &
DATA=3,97/5,149/10,208/20,330/30,459/40,590/ &
50,690/60,770/70,865/80,980/100,1600
API STREAM=1,AVG=29.2
LIGHT STREAM=1,PERCENT(V)=3, &
COMP(V)=6,0.1/7,0.2/8,0.3/9,0.7/10,1.7,NORMALIZE
SULF STREAM=1, DATA= 10,0.1/50,1.4/90,3.3
NITR STREAM=1, DATA= 10,0.005/50,0.03/90,0.09
BROM STREAM=1, DATA= 10,1.5/50,2.8/90,4.5
REFR STREAM=1, DATA= 10,1.41/50,1.47/90,1.58
CCR STREAM=1, DATA= 10,0.01/50,0.05/90,0.24
$
PROP STREAM=2,TEMP=600,PRES=60,PHASE=V,RATE(W)=24151, &
COMP=4,100
PROP STREAM=3,TEMP=600,PRES=60,PHASE=V,RATE(W)=3623, &
COMP=4,100
PROP STREAM=4,TEMP=600,PRES=60,PHASE=V,RATE(W)=10868, &
COMP=4,100
PROP STREAM=5,TEMP=600,PRES=60,PHASE=V,RATE(W)=9660, &
COMP=4,100
$ Vacuum tower
PROP STREAM=R1B,TEMP=330,PRES=8000,RATE(V)=138.4, &
COMP=6,75/7,25
PROP
STREAM=R1C,TEMP=330,PRES=8000,RATE(W)=5154,COMP=4,100
PROP
STREAM=W1,TEMP=355,PRES=8500,RATE(W)=14718,COMP=4,100
$ Recycle gas initial guess
PROP STRM=RECYCLE, TEMP=100.0000, PRES=244.6959, &
COMP= 1,25000/2,2000/3,2000/4,2000/5,500/ &
6, 500/7, 500/8, 500
UNIT OPERATIONS
$
$ Crude process
$
.....
$
$ Refinery Reactor
$
US10 UID=RX1, NAME=BLEND1
FEED F1,RECYCLE
PROD REACT
$ Description of input data is shown in the reactor program
IPARM 1, , , , , &
, , , , , &
51, 52, 50
FLASH UID=FLA1
FEED REACT
PROD V=VAPPRD, L=LIQPRD
ISOTHERMAL TEMP=100, PRES=244.696
METHOD SET= GS-2
SPLITTER UID=SPL1
FEED VAPPRD
PRODUCT V=V_SPL1, V=H2OUT
SPEC STREAM= V_SPL1, RATE(GV,FT3/D), RATIO, &
STREAM=F1, RATE(TS/D), VALUE=56294
METHOD SET= GS-2
COMPRESSOR UID=CMP1
FEED V_SPL1
PROD V=RECYCLE
OPER PRES=315, EFF=92
METHOD SET= GS-2
$
$ Purification
COLUMN UID=COL1
PARAM TRAY=21
FEED LIQPRD,17
PROD OVHD=OVERHEAD, BTMS= BOTTOM,80000
COND TYPE=PART, PRESS=65
HEAT 1,1/2,21
PRESS 1,65/2,70/21,75
ESTI MODEL=CONVENTION
SPEC STREAM= OVERHEAD,RATE,COMP=10, OVER, *
STREAM=LIQPRD, RATE,COMP=10, VALUE=0.1
SPEC STREAM= BOTTOM,RATE,COMP=6, OVER, *
STREAM=LIQPRD, RATE,COMP=6, VALUE=0.1
VARY HEAT=1,2
METHOD SET= GS-2
$
$ Print component properties in each thermo method
CREPORT UID=CREP1
$
$ Recycle algorithm
$
RECYCLE DATA
ACCELERATION TYPE=BROYDEN
END
ATEXT = ''
ISPROP = NSNAPH
TMINI = CTMIN(2)
TMAXI = CTMAX(5)
YLOW = 0.0
YHIGH = 100.0
IFILL = 2
ITREND = 0
IMETHD = 0
IUPDAT = 0
SSCALE = 1.0
CALL UCURVE(ATEXT, ISPROP, CTMID, CNAPH, NCPSEU,
1 BP, FRATE, IBEGIN, IEND, TMINI,
2 TMAXI, YLOW, YHIGH, IFILL, ITREND,
3 IMETHD, IUPDAT, SSCALE, IMAPED, RXNAPH,
4 SUMNAP, IERR)
C
C Similarly for AROMATICS mapping here
C
C Map the component product rate
C
DO 330 J= 1, MAXCN
STREAM(10+J) = ZERO
330 CONTINUE
C
C Match flowrate of defined component
C Assume PDDATA(30-31) store the weight flowrates of H2 and C1
STREAM(10+IDCOMP(1)) = PDDATA(30)
STREAM(10+IDCOMP(2)) = PDDATA(31)
.....
Developer Information
GETNCOMP
Subroutine GETNCOMP retrieves component counts in simulations
that include solid-phase components. Often the first interface used
when dealing with solids components, it allows developers to iden-
tify solids components in the PRO/II component lists.
Calling sequence:
CALL GETNCOMP( NOCR, NOCMOLR, NOCTOTR,
& NOCSR, NOCIR, MICSR,
& MACSR, MICIR, MACIR )
Where the following scalar integers are returned:
NOCR The number of Vapor-Liquid (VL) components
NOCMOLR The number of molecular weight-based components
NOCTOTR The total number of components, including non-
molecular weight solids
NOCSR The number of molecular weight solids components
NOCIR The number of non-molecular weight solids components
MICSR The index to the first molecular weight solid
MACSR The index to the last molecular weight solid
MICIR The index to the first non-molecular weight solid
MACIR The index to the last non-molecular weight solid
Notes:
1 Retrieve NOCTOTR by using routine GETNCOMP.
2 See routine URXSTR for a description of a standard stream array.
Notes:
1 Retrieve NOCTOTR by using routine GETNCOMP.
2 See routine URXSTR for a description of a standard stream array.
Notes:
1 Retrieve NOCTOTR by using routine GETNCOMP.
2 See routine URXSTR for a description of a standard stream array.
USOLCDAT
Subroutine USOLCDAT is used to retrieve these pure solid compo-
nent fixed properties:
Heat of fusion,
Normal melting point temperature,
Triple point temperature, and
Triple point pressure.
All property values return using appropriate units of measure used
for problem input.
Calling sequence:
CALL USOLCDAT( ICNO, IPROP, VALUE, IERR )
Where :
ICNO Input integer component (internal order) sequence
number. (See routines COINUM and COPNUM.)
IPROP Input integer flag indicating the requested property.
1 Heat of fusion, energy / weight
2 Temperature at Normal Melting point
3 Triple point temperature
4 Triple point pressure
VALUE Output property value; a double precision scalar.
IERR Output integer status flag that returns:
0 Success, no errors
1 Failure, requested property not found.
where:
USOLPSD
This subroutine retrieves or stores the Particle Size Distribution
attributes for a solid component in a given stream.
Calling sequence:
CALL USOLPSD( CSID, ICNO, LENPSD, PSD,
& IOTYPE, IERR )
Where
CSID Input character string that identifies a PRO/II stream to
which data is stored or from which data is retrieved. It may
be a quoted literal string or a character variable containing a
maximum of 12 characters.
ICNO Input integer that specifies the internal order number1 of the
component of interest.
LENPSD Input integer that declares the size of argument array PSD.
LENPSD must equal the number of PSD cuts for the
component (NCUTS - 1). Obtain NCUTS by using interface
routine GETPSDC.
PSD Double precision array of PSD values for component ICNO
(in stream CSID). Used to store or retrieve data. Usually,
this as an ALLOCATABLE array.
Example:
Assume we wish to retrieve PSD data for component 3, and the
stream of interest already is declared in variable CSID. SIMSCI
recommends declaring data transfer array PSD as a local ALLO-
CATABLE array.
UPSDCPY
This subroutine copies all particle size distribution data from one
PRO/II stream to another. No data values pass through the argument
list.
Calling sequence:
CALL UPSDCPY( FromSID, ToSID, IERR )
Where:
FromSID Input 12 character stream ID from which data is copied.
ToSID Input 12 character stream ID into which data is copied.
IERR Integer return status flag.
0 = Success, no errors
1 = Failed for unspecified reasons.
Output Reporting
PRO/II does not provide any reporting from user-added pressure
drop subroutines.
Developer Information
Of course, the intended purpose is to allow you to implement and
use your own pressure drop correlation(s) instead of using those
provided by SIMSCI. To create your own pressure drop correlation
routine, you must replace a subroutine supplied by SIMSCI with
one that contains your own code. Sample routines PIPUS1.FOR and
PIPUS2.FOR are made available when the user-added add-on is
installed during PRO/II installation. Replace the code in these rou-
tines with your own code.
Input Variables
HLNS DP1 No slip holdup
≤ 0.0 = Single-phase vapor
0.0<HLNS<1.0 = Mixed phase
(vap+liq)
≥1.0 = Single-phase liquid
AINCL DP Pipe inclination angle radians
DIAM DP Pipe inside diameter feet
AREA DP Pipe inside area square feet2
RUFF DP Pipe roughness/diameter ratio
RNUMB DP Reynolds number
FROUDE DP Froude number
3
NOACCL Integer NOACCELERATION option
flag
0= acceleration APPLIED
1= acceleration OMITTED
PRES DP Input. Absolute pressure psia
RLVELN DP Pipe liquid VELOCITY number
VELSL DP Pipe liquid SUPERFICIAL ft/sec
VELOCITY
VELSG DP Pipe vapor SUPERFICIAL ft/sec
VELOCITY
QLI DP Pipe liquid FLOWRATE cu.ft/sec
QGI DP Pipe vapor FLOWRATE cu.ft/sec
1) DP indicates the argument is a double precision floating point value.
2) Chr*(*) indicates the argument is an inherited-length character string.
3) INT indicates variables are type INTEGER(4)
OUTPUT Variables
FRICT DP Pipe friction factor (Calculated
and returned even when no input
value is supplied)
HL DP Pipe slip holdup
IREG Integer dP method flow regime flag
1= Liquid
2= Vapor
3= Distributed
4= Intermittent
5= Segregated
6= Transition
FRGR DP Friction gradient psi/ft
ELGR DP Elevation gradient psi/ft
ACCGR DP Acceleration gradient psi/ft
DPINCR DP Total gradient FRGR + ELGR + psi/ft
ACCGR
1) DP indicates the argument is a double precision floating point value.
2) Chr*(*) indicates the argument is an inherited-length character string.
3) INT indicates variables are type INTEGER(4)
Availability of Data
The PIPE unit delivers current values of its ongoing calculations to
the subroutine through variables in the call argument list. The argu-
ment list variables essentially constitute the entire universe of PIPE
data available to the subroutine. Other simulation data not specific
to the PIPE unit, such as component data, may be accessed using
any of the interfaces listed in chapter 15, ”Interfacing Software”,
Table 15-1 and Table 15-2. In most cases, stream data is of little use
in pressure drop calculations; so use of stream interfaces probably
should be avoided.
Output Subroutines
PRO/II does not provide any support for output from user-added
pressure drop subroutines.
This example runs two pipe units that are identical except for one
difference: the first uses an internal PRO/II correlation, while the
second uses a user-added subroutine to calculate pressure drop.
OPERATING CONDITIONS
Each PLUG unit in a simulation can access only one of the pressure
drop routines. PRO/II already includes a sample calculation routine,
PACUS1.FOR. That means the DPCORR=DP1 option for a packed-bed
PLUG reactor may be exercised in the version as delivered.
Table 22-4 relates the input options to calculation routines that per-
form the calculations in a PLUG reactor running in PACKING mode:
Table 22-4: UAS Pressure Drop Options In A Packed-Bed
PLUG Unit
PACKING Selects a packed-bed pressure drop correlation.
DPCORR = Arguments DP1 and DP2 select a user-added
subroutine written and built in the User-Added
Library.
DP1 PACUS1.FOR computes packed-bed pressure drop
DP2 PACUS2.FOR computes packed-bed pressure drop
Output Reporting
PRO/II does not provide any reporting from user-added pressure
drop subroutines.
Developer Information
This section discusses implementing user-added pressure drop cor-
relation(s) as alternatives to those within PRO/II. To implement a
pressure drop correlation routine, you must replace a subroutine
supplied by SIMSCI with one that contains your own code.
Guidelines
Refer to the general “Guidelines for Coding” on page 3 of this
chapter. They also apply when coding Plug flow pressure drop
routines.
Input Variables
HLNS DP1 No slip holdup
≤ 0.0 = Single-phase vapor
0.0<HLNS<1.0 = Mixed phase
(vap+liq)
≥1.0 = Single-phase liquid
DIAM DP Packed plug inside diameter feet
AREA DP Packed plug inside area feet2
RNUMB DP Reynolds number of flowing fluid
(using superficial velocity)
FROUDE DP Froude number
PRES DP Absolute pressure psia
VELSL DP Packed plug liquid SUPERFICIAL ft/sec
VELOCITY
VELSG DP Packed plug vapor SUPERFICIAL ft/sec
VELOCITY
QLI DP Packed plug liquid FLOWRATE cu.ft/sec
QGI DP Packed plug vapor FLOWRATE cu.ft/sec
RLDENS DP Packed plug liquid (oil+water) lb/cu.ft
DENSITY
VISL DP Packed plug liquid (oil+water) cP
VISCOSITY
RLSTEN DP Packed plug liquid (oil+water) dyne/cm
SURFACE TENSION
RVDENS DP Packed plug vapor DENSITY lb/cu.ft
VISV DP Packed plug vapor VISCOSITY cP
NFOUT INT Input Fortran File Unit for printing
diagnostic messages
1) DP indicates the argument is a double precision floating point value.
2) CHR* indicates the argument is an automatic-length character string.
3) INT indicates variables are type INTEGER(4)
Output Variables
HL DP Packed plug slip holdup
IREG INT dP method flow regime flag
1= Liquid
2= Vapor
3= Distributed
4= Intermittent
5= Segregated
6= Transition
DPINCR DP Total gradient FRGR + ELGR + psi/ft
ACCGR
ISTOP INT Returned error status flag
0 = Success, no errors
1 = Failure, results may be invalid.
1) DP indicates the argument is a double precision floating point value.
2) CHR* indicates the argument is an automatic-length character string.
3) INT indicates variables are type INTEGER(4)
Availability of Data
Each PLUG reactor that uses the pressure drop subroutine delivers
current values from its ongoing calculations through the subroutine
argument list. Thus, the argument list variables essentially consti-
Returning Results
All calculated results return to PRO/II through the output variables
in the argument list of the subroutine. The 4 required results
include: HL, IREG, DPINCR, and ISTOP. Refer to Output Variables in
Table 22-5 on page 22-13.
Output Subroutines
PRO/II does not provide any support for output from user-added
pressure drop subroutines.
PLUGFLOW UID=Us2Pack
FEED X200
PROD L=USPack
RXCALC KINETIC(SUBROUTINE)=U1, NSTEPS=100
OPER LENG=5.0,DIAM=10.0,PHASE=V,TEMP=850
The second unit is a packed-bed reactor that uses the PACIS1 pres-
sure drop routine.
UNIT 2, 'US2PACK'
Keyword Property
KVIS Kinematic Viscosity
CLOU Cloud Point
POUR Pour Point
FLPC Flash Point (Closed Cup)
SULF Sulfur Content
CETN Cetane Number
SMOK Smoke Point
ARO1 Mono Aromatics
ARO2 Di-Aromatics
ARO3 Tri-Aromatics
ARO4 Tetra-Aromatics
ARO5 Penta-Aromatics
ARO7 Hepta-Aromatics