Aspen Plus Summary File Toolkit Version: V14 Copyright (c) 2022 by Aspen Technology, Inc. All rights reserved. Aspen Plus, aspenONE, the aspen leaf logo and Plantelligence and Enterprise Optimization are trademarks or registered trademarks of Aspen Technology, Inc., Bedford, MA. All other brand and product names are trademarks or registered trademarks of their respective companies. NIST Standard Reference Data (SRD); © Copyright ©2022 by the U.S. Secretary of Commerce on behalf of the United States of America. All rights reserved. This document is intended as a guide to using AspenTech's software. This documentation contains AspenTech proprietary and confidential information and may not be disclosed, used, or copied without the prior consent of AspenTech or as set forth in the applicable license agreement. Users are solely responsible for the proper use of the software and the application of the results obtained. Although AspenTech has tested the software and reviewed the documentation, the sole warranty for the software may be found in the applicable license agreement between AspenTech and the user. ASPENTECH MAKES NO WARRANTY OR REPRESENTATION, EITHER EXPRESSED OR IMPLIED, WITH RESPECT TO THIS DOCUMENTATION, ITS QUALITY, PERFORMANCE, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. Aspen Technology, Inc. 20 Crosby Drive Bedford, MA 01730 USA Phone: (1) (781) 221-6400 Toll Free: (1) (888) 996-7100 URL: http://www.aspentech.com Contents Who Should Read this Guide ...................................................................................1 Introducing Summary File Toolkit ...........................................................................3 Related Documentation ..................................................................................... 3 Technical Support ............................................................................................ 4 1 Getting Started ....................................................................................................5 The Summary File and Toolkit ............................................................................ 6 32-bit and 64-bit Code ...................................................................................... 6 Initializing the Toolkit ....................................................................................... 7 Accessing the Required Files .................................................................... 7 Getting the Summary File Name ........................................................................ 7 Getting Property and Units File Names ...................................................... 7 Defining Units of Measurement ................................................................ 8 Specifying a Value for Missing Results ....................................................... 8 Determining the Data Dimensions ...................................................................... 8 Retrieving Data for an Object............................................................................. 9 Using the Toolkit With a Hierarchical Aspen Plus Run .......................................... 11 Linking Toolkit Subroutines into Your Module ..................................................... 11 Creating a Toolkit Application for Windows ........................................................ 11 About the Windows Version ................................................................... 12 Linker Directive Commands for Windows ........................................................... 12 Calling Summary File Toolkit Routines .............................................................. 13 VBA Calling Fortran Example ................................................................. 14 Opening and Closing Files Using the Summary File Toolkit ......................... 14 Using Fortran to Call Routines ................................................................ 15 Changes in the Toolkit .................................................................................... 15 2 General Subroutines ..........................................................................................17 Initializing the Summary File Toolkit ................................................................. 18 Closing the Summary File Toolkit ..................................................................... 19 Opening and Closing Files................................................................................ 20 Retrieving Run Information ............................................................................. 21 Standard Run Information ..................................................................... 21 Run Titles ............................................................................................ 22 Accounting Information ......................................................................... 23 Retrieving Flowsheet Balance Results................................................................ 23 Units Conversion ............................................................................................ 24 Changing Units Sets ............................................................................. 24 Converting Units for Real Numbers ......................................................... 25 Determining Units Labels ...................................................................... 26 Component Information Retrieval ..................................................................... 26 Number of Components ........................................................................ 26 Contents iii Component IDs .................................................................................... 27 Component Alias Names ....................................................................... 27 Component CAS Numbers ..................................................................... 28 Component Properties .......................................................................... 28 Sensitivity Block Results ................................................................................. 28 Identifying Sensitivity Blocks ................................................................. 29 Determining Sensitivity Dimensions ........................................................ 29 Retrieving Sensitivity Results ................................................................. 30 3 Block Result Subroutines...................................................................................31 Block Identification ......................................................................................... 32 Block IDs ............................................................................................ 32 Next Block ........................................................................................... 32 Block Connectivity Information ........................................................................ 33 Number of Inlet and Outlet Streams ....................................................... 33 Stream Names and Types ..................................................................... 33 Additional Port Information .................................................................... 34 Standard Block Results ................................................................................... 36 Dimensions of Standard Scalar Results ................................................... 36 Standard Scalar Block Results ................................................................ 37 Compressor Results ........................................................................................ 38 Dimensions of Performance Results ........................................................ 38 Stage-by-Stage Performance Results ...................................................... 39 Dimensions of Wheel-by-Wheel Performance Results ................................ 40 Wheel-by-Wheel Performance Results ..................................................... 40 Compressor Profile Results .............................................................................. 41 Dimensions of MCompr Profile Results .................................................... 41 MCompr Profile Results ......................................................................... 41 MCompr Cooler Profile Results ............................................................... 42 Heat Exchanger Results .................................................................................. 42 Number of Detailed Results ................................................................... 43 Detailed Results ................................................................................... 43 Velocity and Pressure Results ................................................................ 44 Heat Exchanger Results Dimensions ....................................................... 44 Heat Exchanger Zone Results ................................................................ 45 Heat Exchanger Shell Results................................................................. 45 Heat Exchanger Tube Results................................................................. 46 Heat Exchanger Baffle Results ............................................................... 47 Heat Exchanger Nozzle Results .............................................................. 47 Heat Exchanger Profiles .................................................................................. 48 Heat Exchanger Profile Size ................................................................... 48 Heat Exchanger Profile Properties ........................................................... 49 Heat Exchanger Profile Results ............................................................... 49 Column Results .............................................................................................. 50 Number of Columns .............................................................................. 50 Column Profile Dimensions .................................................................... 51 Column Profile Properties ...................................................................... 51 Non-Component-Dependent Column Profiles ............................................ 52 Component-Dependent Column Profiles .................................................. 52 RadFrac Thermosiphon Reboiler Results .................................................. 53 Interconnecting Stream and Pumparound Results..................................... 54 Additional Data for PetroFrac Models................................................................. 56 iv Contents Dimensions of Additional Data ............................................................... 56 Additional Scalar Results Data ............................................................... 57 Additional PetroFrac Profile Properties ..................................................... 58 Additional Property Profiles .................................................................... 58 Furnace Data for PETROFRAC ................................................................ 59 Component-Dependent Properties for the PetroFrac Furnace ..................... 60 Pumparound Results for PetroFrac Columns ............................................. 60 Connectivity Data for PetroFrac Strippers ................................................ 61 Additional Data for RateFrac Models ....................................................... 62 Dimensions of Additional Scalar Data ...................................................... 62 Additional Scalar Results Data ............................................................... 62 Dimensions of Component Split Fractions ................................................ 63 Component Split Fractions ..................................................................... 63 Number of Liquid Phases ....................................................................... 64 Tray Reports .................................................................................................. 64 Tray Report Dimensions ........................................................................ 64 Sequential Tray Report Properties .......................................................... 65 Specific Tray Report Properties .............................................................. 66 Tray/Packing Sizing and Rating ........................................................................ 66 Number of Columns .............................................................................. 67 Number of Column Sections .................................................................. 67 Column Section Types and Numbers ....................................................... 67 Size of a Column Section ....................................................................... 68 Scalar Results for a Column Section ....................................................... 69 Column Section Profile Properties ........................................................... 69 Column Section Profiles......................................................................... 70 Reactor Results .............................................................................................. 71 Number of Reactor Substreams.............................................................. 71 Reactor Profile Dimensions .................................................................... 71 Reactor Profile Properties ...................................................................... 72 Non-Component-Dependent Reactor Profiles............................................ 72 Component-Dependent Reactor Profiles .................................................. 73 Number of Components with Component Attribute Results ........................ 74 Number of Attributes for a Component .................................................... 74 Details of a Component Attribute ........................................................... 74 Component Attribute Results ................................................................. 75 Number of Continuous Feed Streams ...................................................... 75 Continuous Feed Stream Results ............................................................ 76 RBATCH Vent Accumulator Results ......................................................... 76 RBatch Vent Profile Results.................................................................... 79 Reaction Data ...................................................................................... 81 Reactor Property Reports ................................................................................ 84 Number of Reports for a Reactor Block.................................................... 84 Size of a Reactor Property Report ........................................................... 84 Sequential Reactor Report Properties ...................................................... 85 Specific Reactor Report Properties .......................................................... 86 Pipeline Results .............................................................................................. 86 Pipeline Results Dimensions ................................................................... 87 Non-Component-Dependent Pipeline Inlet and Outlet Conditions ................ 87 Component-Dependent Pipeline Inlet and Outlet Property Names ............... 88 Component-Dependent Pipeline Inlet and Outlet Conditions ....................... 89 Segment Data Property Names .............................................................. 89 Pipeline Segment Data .......................................................................... 90 Contents v Pipeline Node Property Names ............................................................... 90 Pipeline Node Results............................................................................ 91 Pipeline Profile Property Names .............................................................. 91 Pipeline Profile Results .......................................................................... 92 Pipe Results ................................................................................................... 92 Pipe Standard Profile Dimensions ........................................................... 93 Pipe Standard Profile Property Names ..................................................... 93 Pipe Standard Profile Properties ............................................................. 93 Pipe Property Reports ........................................................................... 94 Block VLE Results ........................................................................................... 96 Heating/Cooling Curves ................................................................................... 96 Number of Heating/Cooling Curves for a Block ......................................... 97 Heating/Cooling Curves for a Block ......................................................... 97 Size of a Heating/Cooling Curve ............................................................. 98 Standard Heating/Cooling Curve Results ................................................. 99 Sequential Heating/Cooling Curve Properties ........................................... 99 Specific Heating/Cooling Curve Properties ............................................. 100 Interconnecting Stream IDs ................................................................. 101 4 Stream Result Subroutines ..............................................................................103 Stream Identification .................................................................................... 103 Listing Stream IDs.............................................................................. 103 Determining the Next Stream .............................................................. 104 Material Stream Results ................................................................................ 104 Retrieving Basic Stream Information..................................................... 104 Listing Substream IDs......................................................................... 105 Retrieving Stream Results ................................................................... 105 Retrieving a Single Stream Property ..................................................... 106 Heat and Work Stream Results ...................................................................... 106 Component Attribute Results ......................................................................... 107 Determining the Number of Components with Attributes ......................... 107 Determining Number of Attributes for a Component ............................... 108 Determining Component Attribute Size ................................................. 108 Retrieving Component Attribute Values ................................................. 109 Substream Attribute Results .......................................................................... 109 Determining the Number of Substream Attributes .................................. 109 Determining Substream Attribute Size .................................................. 110 Retrieving Substream Attribute Values .................................................. 110 Stream Property Set Results .......................................................................... 111 Determining Dimensions of Stream Property Values ............................... 111 Retrieving Stream Property Results ...................................................... 111 5 Physical Property Table Results Subroutines ...................................................113 Property Table Identification .......................................................................... 114 Property and Flashcurve Table Results ............................................................ 114 Determining Property Table Dimensions ................................................ 114 Retrieving Sequential Properties in a Table ............................................ 115 Retrieving Specific Properties from a Table ............................................ 115 Pressure-Temperature Envelope Results.......................................................... 116 Determining Dimensions for Properties in the Envelope ........................... 116 Determining Envelope Dimensions ........................................................ 117 Retrieving Temperature and Pressure for Envelope Branch ...................... 117 vi Contents Retrieving Sequential Envelope Properties ............................................. 118 Retrieving Specific Envelope Properties ................................................. 119 6 Costing Results Subroutines ............................................................................121 Equipment Item Identification ........................................................................ 122 Determining Number of Equipment Items .............................................. 122 Listing Equipment Items ..................................................................... 122 Determining Next Equipment Item ....................................................... 122 Equipment Item Results ................................................................................ 123 Retrieving Equipment Item Costing Results ........................................... 123 Determining Equipment Item Sizing Results .......................................... 123 Retrieving Equipment Item Sizing Results ............................................. 124 7 Pressure Relief Subroutines ............................................................................125 Pressure Relief Block Identification ................................................................. 126 Determining the Number of Pressure Relief Blocks.................................. 126 Listing Pressure Relief Blocks ............................................................... 126 Determining the Next Pressure Relief Block ........................................... 127 Pressure Relief Results .................................................................................. 127 Determining the Number of Substreams................................................ 128 Determining Dimensions of Pressure Relief Arrays .................................. 128 Listing Profile Properties ...................................................................... 129 Retrieving Dynamic Scalar Results........................................................ 130 Retrieving Steady-State Scalar Results ................................................. 131 Retrieving Non-Component-Dependent Dynamic Profiles ......................... 131 Retrieving Dynamic Component-Dependent Profiles ................................ 132 Retrieving Steady-State Profiles ........................................................... 133 Determining Vent Accumulator Profile Dimensions .................................. 133 Listing Vent Accumulator Profile Properties ............................................ 134 Retrieving Non-Component-Dependent Vent Accumulator Profiles ............ 134 Retrieving Component-Dependent Vent Accumulator Profiles ................... 135 Determining Pressure Relief Vent Profile Dimensions .............................. 135 Listing Vent Profile Properties .............................................................. 136 Retrieving Position-Dependent Vent Profiles........................................... 136 Retrieving Component-Dependent Vent Profiles ..................................... 137 8 Examples .........................................................................................................139 Example 1: Stream Heat and Material Balance Table Generation ........................ 139 Declaring Variables and Dimensioning ................................................... 139 Initializing the Toolkit ......................................................................... 140 Finding Number of Streams ................................................................. 141 Finding Component Molecular Weight ................................................... 141 Writing Stream Table .................................................................................... 142 Example 2: Interactive Heating/Cooling Curve Table Generation ........................ 145 Declaring Variables ............................................................................. 145 Initializing the Toolkit ......................................................................... 145 Finding Number of Blocks .................................................................... 145 Finding Blocks with Heating/Cooling Curves ........................................... 146 Prompting for Block Name ................................................................... 147 Finding Heating/Cooling Curves for Selected Block ................................. 147 Finding Dimensions of Heating/Cooling Curve ........................................ 148 Contents vii Retrieving Standard Heating/Cooling Curve Results ................................ 148 Retrieving Property Sets ..................................................................... 149 Example 3: Column Profile Results Written to Plot File ...................................... 152 Opening Files and Initializing Toolkit ..................................................... 152 Finding List of Blocks .......................................................................... 153 Finding List of Properties ..................................................................... 153 Retrieving Selected Property Profile ...................................................... 154 Closing the Application ........................................................................ 154 Example 4: Distillation Column Diagram Generation ......................................... 156 Initializing the Toolkit ......................................................................... 156 Retrieving Basic Block Results .............................................................. 156 Retrieving Inlet and Outlet Stream Flows .............................................. 157 Finding Inlet and Outlet Stream IDs ..................................................... 158 9 XML Summary File ...........................................................................................161 A Units ...............................................................................................................163 B Property Names ..............................................................................................165 Table B.1 - Standard Property Names ............................................................. 166 Table B.2 - Mixture Thermodynamic Properties ................................................ 179 Volume ............................................................................................. 179 Flow Rates, Fractions .......................................................................... 179 Enthalpy, Entropy, Gibbs Energy, Heat Capacity ..................................... 180 Other properties................................................................................. 180 Table B.3 - Thermodynamic Properties of Components in Mixtures ..................... 181 Table B.4 - Pure Component Thermodynamic Property Sets............................... 182 Table B.5 - Electrolyte Property Sets .............................................................. 183 Table B.6 - Transport Properties ..................................................................... 184 Mixture ............................................................................................. 184 Component in a Mixture ...................................................................... 184 Pure Components ............................................................................... 184 Table B.7 - Petroleum-Related Properties for Mixtures ...................................... 184 Distillation Curves .............................................................................. 185 Distillation Temperature ...................................................................... 185 Distillation Volume and Weight Percent ................................................. 186 Bulk Petroleum Property Values from Assay Curves ................................ 186 Petroleum Cuts .................................................................................. 187 Petroleum Property Curves .................................................................. 188 Table B.8 - Elemental Analysis of Mixtures ...................................................... 189 Table B.9 - Nonconventional Component Properties .......................................... 190 Table B.10 - Property Names for Costing Results .............................................. 190 Equipment Type: HEATX ..................................................................... 190 Equipment Type: AIRCOOL .................................................................. 190 Equipment Type: FIRED-HEATER .......................................................... 191 Equipment Type: PUMP ....................................................................... 191 Equipment Type: COMPR..................................................................... 192 Equipment Type: BLOWER................................................................... 192 Equipment Type: TRAY-TOWER ............................................................ 193 Equipment Type: TRAY-TOWER Section Results ..................................... 193 Equipment Type: USER ....................................................................... 193 Equipment Type: V-VESSEL ................................................................. 194 viii Contents Equipment Type: H-VESSEL................................................................. 194 Equipment Type: TANK ....................................................................... 195 Index ..................................................................................................................197 Contents ix x Contents Who Should Read this Guide The intended audience for this toolkit is application developers who need to get information from Aspen Plus simulations into their applications, and prefer a file based data transfer to data transfer through OLE Automation. Who Should Read this Guide 1 2 Who Should Read this Guide Introducing Summary File Toolkit An Aspen Plus summary file is an ASCII file produced by Aspen Plus for every simulation run, containing all the results for that run. The Summary File Toolkit is a set of Fortran subroutines that you can use to build a program to extract results from an Aspen Plus summary file. This reference manual describes the Summary File Toolkit and how to build programs using the toolkit. The manual assumes that you are familiar with Fortran, Aspen Plus, and the results of an Aspen Plus simulation. There is also an XML Results file available from Aspen Plus which can be processed by standard XML tools. See Chapter 9 for some information about this file. Related Documentation Title Content Aspen Plus Getting Started Building and Running a Process Model Tutorials covering basic use of Aspen Plus. A prerequisite for the other Getting Started guides Aspen Plus Getting Started Modeling Processes with Solids Tutorials covering the Aspen plus features designed to handle solids Aspen Plus Getting Started Modeling Processes with Electrolytes Tutorials covering the Aspen plus features designed to handle electrolytes Aspen Plus Getting Started Using Equation-Oriented Modeling Tutorials covering the use of equation-oriented models in Aspen Plus Aspen Plus Getting Started Customizing Unit Operation Models Tutorials covering the development of custom unit operation models in Aspen Plus Aspen Plus Getting Started Modeling Petroleum Processes Tutorials covering the Aspen Plus features designed to handle petroleum Aspen Plus User Guide Procedures for using Aspen Plus Introducing Summary File Toolkit 3 Title Content Aspen Plus Reference Manual Series Detailed information about Aspen Plus Aspen Plus Application Examples A suite of examples illustrating capabilities of Aspen Plus Aspen Engineering Suite Installation Manual Instructions for installing Aspen Plus and other Aspen Engineering Suite products Technical Support AspenTech customers with a valid license and software maintenance agreement can register to access the online AspenTech Support Center at: https://support.aspentech.com This Web support site allows you to: Access current product documentation Search for tech tips, solutions and frequently asked questions (FAQs) Search for and download application examples Search for and download service packs and product updates Submit and track technical issues Send suggestions Report product defects Review lists of known deficiencies and defects Registered users can also subscribe to our Technical Support e-Bulletins. These e-Bulletins are used to alert users to important technical support information such as: Technical advisories Product updates and releases Customer support is also available by phone, fax, and email. The most up-todate contact information is available at the AspenTech Support Center at https://support.aspentech.com. 4 Introducing Summary File Toolkit 1 Getting Started This chapter describes how to build an application program using the Aspen Plus Summary File Toolkit. It contains information on: The summary file and toolkit. Initializing the toolkit. Determining data dimensions. Retrieving data for an object. Using the toolkit with a hierarchical Aspen Plus run. Linking toolkit subroutines into your module. Creating a toolkit application for Windows. Transferring the toolkit to another computer. 1 Getting Started 5 The Summary File and Toolkit The summary file is an ASCII file produced by Aspen Plus for every simulation run. This file contains the summary of simulation results, such as block results, stream values, tray profiles, heating/cooling curves, and property tables. The information in a summary file is also contained within the Aspen Plus backup file. Summary files are named according to the form runid.SUM. Backup files are named according to the form runid.BKP. The summary file toolkit is a set of Fortran subroutines that retrieve results information from the Aspen Plus summary file and backup file. (Use the backup file with results, in place of the summary file, in procedures throughout this manual.) The subroutines are organized around the logical structure of the data. You can retrieve selected results. Or you can retrieve all the results of a simulation or simulation object (such as unit operation blocks or streams). The Fortran source code for the subroutines is provided so that you can build applications on any computer. The Fortran source code is delivered in a self-extracting zip archive named toolkit.exe in the Engine\Utl directory of the Aspen Physical Property System installation (typically C:\Program Files\APrSystem <version>\Engine\Utl\toolkit.exe). The DLL is stored in the Engine\xeq directory of the Aspen Physical Property System installation (typically C:\Program Files\APrSystem <version>\Engine\xeq\zetoolkit.dll). To use the summary file toolkit, an application program must perform three steps: 1 Initialize the toolkit for a summary file. 2 Get the dimensions of the data to be retrieved. 3 Retrieve the data. These three steps are described in the following sections. 32-bit and 64-bit Code The Summary File Toolkit DLL delivered with Aspen Plus is a 64-bit DLL which works with 64-bit code which is commonly used on current platforms. It works with VBA in 64-bit Microsoft Excel. If you need to use the Summary File Toolkit with 32-bit code (including VBA in 32-bit versions of Microsoft Excel), you can get it from article 000097276 in the AspenTech Support knowledgebase. 6 1 Getting Started Initializing the Toolkit You must initialize the toolkit for a summary file before you can retrieve data. The initialization process consists of: 1 Accessing the required files and setting up directories for fast data access. 2 Defining the units of measurement for all values retrieved from the toolkit. 3 Specifying a value to substitute for missing results. Accessing the Required Files You need to include file definitions for the following files during the initialization process. The unit numbers for these files must match those specified in the call to toolkit initialization routine TKINIT or TKINI2. File Description Summary file The summary file Properties file A file defining the names of results within the summary file Units file A file containing units conversion information Scratch file A temporary direct access file for fast access to summary file results Defining the Summary File To define the summary file, use the subroutine TKOPEN. See Chapter 2 for more information. Getting the Summary File Name Because the summary file may be different each time the toolkit application is executed, some input to the program is required to determine the summary file name. If the application program has an existing method of passing information into the program, use this method to pass the summary file name to the program. Otherwise, the three principal ways the program can get the file name are by: 1 Prompting the user at the terminal. 2 Reading the file name from the command line. 3 Reading the file name from a file. Prompting the user is the easiest method for most operating systems. Fortran READ and WRITE statements are used to get the file name. Getting Property and Units File Names The properties file, RCPROPNU.DAT, and the units file, RCUNITS.DAT, are installed in the toolkit subdirectory of the Aspen Plus Simulation Engine installation. The Engine directory should be set as the value of the %asptop% environment variable. 1 Getting Started 7 Example of Environment Variable for Windows When running in an Aspen simulation engine window, the environment variable ASPTOP points to the top level supplementary directory for Aspen Plus. The TOOLKIT directory is a subdirectory of this directory. You can use the following code to expand the file specification: USE IFPORT CALL GETENV('ASPTOP', ASPTOP) DO 50 I = 80, 1, -1 IF (ASPTOP(I:I) .NE. ' ') GO TO 55 50 CONTINUE 55 CONTINUE RCPROP = ASPTOP(1:I) // '\TOOLKIT\RCPROPNU.DAT' RCUNIT = ASPTOP(1:I) // '\TOOLKIT\RCUNITS.DAT' Scratch File Units Number The direct access file is used to provide fast access to data in the summary file after initialization. The units number you specify for this file should not be used by the application program. Defining Units of Measurement As part of the toolkit initialization process, you must specify a base units set in which the results will be returned. The base units set defines the units of measurement for each physical quantity (units type). The base units sets available are SI, ENG, MET, and OUT. To customize a units set to change the output units of measurement for one or more physical quantities, or convert a result to another unit of measurement, use the subroutines described in Chapter 2. See Appendix A for other conversion options. Specifying a Value for Missing Results If you make calls to the toolkit to retrieve results, and a requested result is missing, the toolkit returns a special value in place of the result. As part of the toolkit initialization process, you specify this value by assigning it to the argument RMISS in the call to routine TKINIT or TKINI2. Choose a value that will not be mistaken for a real result. A very large value (greater than 1E20) is recommended. Determining the Data Dimensions The toolkit data retrieval routines require you to know the data dimensions before a retrieval is done. With these dimensions in mind, you must allocate space inside your application program for the data before retrieving it. Determining data dimensions includes: 8 1 Getting Started 1 Querying the summary file for the existence of simulation objects and data within an object. 2 Defining the size of the data for a simulation object. The subroutine TKINFO returns the number of blocks, streams, property tables, and sensitivity tables in the summary file. Each type of simulation object has a subroutine to find the next object in sequence. These subroutines are: Object Type Subroutine to Find Next Object Blocks TKNBLK Streams TKNSTR Property tables TKNPPT Sensitivity tables TKNEXT Equipment item TKNEQP Pressure relief TKNXPR Each of these subroutines has a sequence number as an argument. The sequence number identifies the position of the object within the summary file. For example, a sequence number of five for TKNBLK indicates the fifth unit operation block in the summary file. Except for sensitivity objects and pressure relief, the subroutine also returns information about the type of object: the unit operation model type for a block, the type of stream (MATERIAL, HEAT, or WORK), or the type of property table. The data available for an object are organized by the type of data. For example, block data is organized into a standard results set, connectivity information, heating/cooling curve data, profile data, and property set profile data. Each type of data has a routine that returns the dimensions of the data. Chapters 2 through 7 describe the toolkit routines for determining the dimensions of data and retrieving it. If a type of data is not available for an object, dimension values of zero are returned. Retrieving Data for an Object Once the dimensions for data are known, you can retrieve the data by calling the appropriate routine. Each result returned is identified by a property name. Appendix B contains a list of property names and their descriptions. In addition to property names, some results have qualifiers to further identify the data. For example, for an FSPLIT block, the split fractions for each outlet stream are returned. The stream ID of the outlet stream is returned as a qualifier for the result. You can use single subroutine calls to retrieve standard results for blocks, streams, heating/cooling curves, and pressure-temperature envelopes. Standard tray or reactor profiles are retrieved one profile at a time. You can identify property set results by the property set qualifiers: Qualifier Description PNAME Property name. See Appendix B for a description. SUBSID Substream ID 1 Getting Started 9 Qualifier Description PHASE Phase (VAPOR, LIQUID, LIQUID1, LIQUID2, TOTAL, SOLID) COMPID Component ID WETDRY Wet/dry basis (WET or DRY) † BASIS Unit basis for properties with multiple units †† † Can be left unspecified. †† Valid values for the basis are MOLE, MASS and FLOW. MOLE and MASS apply to density (specifying mole density and mass density), entropy (specifying mole entropy and mass entropy), and heat capacity (specifying mole heat capacity and mass heat capacity). MOLE and FLOW apply to volume (specifying mole volume and volume flow). MOLE, MASS and FLOW apply to enthalpy (specifying mole enthalpy, mass enthalpy, and enthalpy flow). Before calling a subroutine, make sure that all the qualifiers are set to the desired values or unset. If you do not unset a qualifier from a previous value, unexpected results may be returned. All values with physical dimensions are returned in the units you specify during the initialization process. The units label and the units type are usually returned with the value. When the physical dimensions of a property are always known, the units information may not be returned. You can call the utility routine TKLABL to return the units label for a value not returned. In addition, you can use the utility routine TKCNVT to convert a value from default units to user-specified units. Sometimes the retrieved data values are two-dimensional. For example, the column profile routine TKPRO2 returns values for every stage and component combination in a column. The dimension for the results then appears as two dimensions multiplied together. This figure yields the total number of results returned. It also shows the sequence of the results data in the array. The results array is ordered so that the first dimension can scroll before the second dimension. In the TKPRO2 example, the results are returned in RVALS, which is dimensioned as NCP*NSTAGE (the number of components * the number of stages). The values returned in the RVALS array are ordered so that the results for every component on the first stage are given first, followed by all the results for every component on the second stage, and so on. 10 1 Getting Started Using the Toolkit With a Hierarchical Aspen Plus Run Most Aspen Plus objects, including hierarchies, can exist within hierarchies. In such cases it is not sufficient to reference an object by type and eight character ID. The object’s ID must contain the full hierarchical path to the object, with each hierarchy name separated by a period (.). For example, if a run contains hierarchy H1, which contains hierarchy H2, which contains block B1, refer to the block as H1.H2.B1. All toolkit subroutines that accept or return an object ID declare the argument as CHARACTER *(*). When passing such an argument, set up the dimension large enough to hold the hierarchical ID. If referencing a non-hierarchical problem, declaring the ID arguments as CHARACTER*8 is sufficient. Note: The length must be larger for hierarchical problems. A declaration of CHARACTER*128 is always sufficient. The toolkit always returns IDs with full path name. For example, TKNBLK, which lists the blocks in a run, cycles through all blocks in all hierarchy levels, returning IDs with full path name. Block, stream, pressure relief, property table, and sensitivity IDs are hierarchical. Property name, substream, phase, and component IDs are not. Note: It is not possible to cycle through all blocks in a single hierarchy level. Linking Toolkit Subroutines into Your Module After you write or modify your application program to call the appropriate toolkit subroutines to retrieve the data, you must build an executable module, including the toolkit routines. The object code for the toolkit subroutines is stored in a dynamic link library for Windows, which is delivered with Aspen Plus. To link to this library, include %asptop%\toolkit\zetoolkit.lib in the linker directive, where %asptop% represents the Engine installation directory. Creating a Toolkit Application for Windows The source code, in the form of a self-extracting executable, and dynamic link library (DLL) for the summary file toolkit are located in the toolkit directory of the Aspen Plus Simulation Engine installation. 1 Getting Started 11 About the Windows Version The Windows version of the summary file toolkit consists of two files: File Name Description zetoolkit.dll The summary file toolkit dynamic-link library. This file is stored in the Engine\xeq subfolder of the APrSystem installation, typically C:\Program Files\APrSystem <version>\Engine\xeq\zetoolkit.dll zetoolkit.lib Import library. This file contains the external references to the summary file toolkit routines in zetoolkit.dll. This file is stored in the Engine\toolkit subfolder of the Aspen Plus installation, along with the Fortran source files. The DLL and LIB are compiled and linked with Intel Fortran 9.1. If you are using the summary file toolkit as part of a full installation of Aspen Plus, you can compile and link toolkit applications with the Fortran compiler for your Operating System. Make sure you are set up for running Aspen Plus. Aspen Plus provides procedures to help use the Aspen Plus Fortran utilities. The following table summarizes these procedures: To do this Enter these commands Compile a Fortran routine ASPCOMP appname Link an application executable link @appname.opt Run a previously linked executable appname.exe Where: appname = The file name of the main Fortran application. Do not include the file extension when specifying the file name. ASPCOMP will accept Fortran files with the extension .for. appname.opt = Text file containing the linker directive commands. For more information, see the following section, Linker Directive Commands for Windows. Linker Directive Commands for Windows The linker directive file contains a set of commands that control the generation of the linked executable. Any object files or libraries you want to be included in the linked executable must be listed in the linker directive file. The standard set of commands required to link a toolkit application are shown for a toolkit application named tkexampl. Example of Linker Directive File -entry:mainCRTStartup msvcrt.lib -nodefaultlib:libc.lib libifcoremd.lib -nodefaultlib:libifcore.lib 12 1 Getting Started libifportmd.lib -nodefaultlib:libifport.lib libmmd.lib -nodefaultlib:libm.lib -nodefaultlib:libifcoremt.lib -nodefaultlib:libmmt.lib c:\Engine\toolkit\zetoolkit.lib tkexample.obj -out:tkexample.exe Substitute c:\Engine with the appropriate drive and directory location where the Aspen Plus Simulation Engine is installed. Replace tkexample with the name of your application. Add any additional object files and libraries you need to this directive file. After creating the linker directive file for your application, you can use the link and run commands to generate and run your application's executable program. Calling Summary File Toolkit Routines The files are compiled so that the summary file toolkit routines use the default calling and naming conventions for the Fortran compiler. These are similar to the stdcall convention, except: All routine names are in uppercase. All arguments are passed by reference. All integer variables are 64-bit (VBA LongLong). All real variables are 64-bit (VBA Double). There is a hidden string length argument for each character string passed. These arguments are 32-bit integers (VBA Long) and they appear in the same order as the string arguments but appended after all the normal arguments. For character arrays, the single character string passed is broken up into individual elements based on the defined length of each element, which is given by the hidden string length argument. o If the array is defined in the subroutine (see documentation for the specific subroutine) with a fixed element length, such as CHARACTER*8, then this length is what Aspen Plus uses and should be given in the hidden argument. o If it is defined with a variable length as CHARACTER*(*), then the hidden string length argument determines the length of each element; in this case be sure to choose a length long enough to hold whatever data you expect (such as hierarchical IDs). Applications calling the DLL should use this convention. Please see your compiler documentation about calling Fortran routines and hidden string length arguments. Fortran applications can call the routines in the Summary File Toolkit without any code modifications. If you want to call the Summary File Toolkit from 1 Getting Started 13 another language, you will have to modify the code to work with the Fortran conventions adopted, but this is not recommended. Instead, export an XML summary file and use standard XML tools to process it. VBA Calling Fortran Example As an example, here is the argument list as described for Fortran for TKBRES CALL TKBRES (BLKID, NRES, NQUAL, PNAMES, QUALS, ITYPE, IVALS, CVALS, RVALS, TYPES, LABELS) Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID NRES I INTEGER — Number of results NQUAL I INTEGER — Maximum number of qualifiers †† PNAMES O CHARACTER*12 NRES QUALS O CHARACTER*8 NRES* NQUAL Qualifiers †† ITYPE O INTEGER NRES Data type of results (1=Integer, 2=Real, 3=Character) ††† IVALS O INTEGER NRES Integer results ††† CVALS O CHARACTER*8 NRES Character results ††† RVALS O REAL*8 NRES Real results ††† TYPES O CHARACTER*12 NRES Units types LABELS O CHARACTER*16 NRES Units labels Property name. See Appendix B for a description. Here is the equivalent declaration in VBA: Private Declare PtrSafe Sub TKBRES Lib _ "C:\Program Files\AspenTech\AprSystem V11.0\Engine\Xeq\zetoolkit.dll" _ (ByVal BLKID As String, NRES As LongLong, NQUAL As LongLong, _ ByVal PNAMES As String, ByVal quals As String, ITYPE As LongLong, _ IVALS As LongLong, ByVal CVALS As String, RVALS As Double, _ ByVal TYPES As String, ByVal LABELS As String, ByVal nBLKID As Long, _ ByVal nPNAMES As Long, ByVal nQUALS As Long, ByVal nCVALS As Long, _ ByVal nTYPES As Long, ByVal nLABELS As Long) Opening and Closing Files Using the Summary File Toolkit You must be careful with file input and output when using the Summary File Toolkit. You must observe the following practices: 14 Open and close the summary file with TKOPEN and TKCLFL. Open and close the log file optionally used in TKINI2, with TKOPEN and TKCLFL. Close the toolkit with TKCLOS, at the end of each run. Close the summary file and the log file with TKCLFL, at the end of each run. Do not use TKOPEN and TKCLFL for opening and closing the files your application reads from or writes to. 1 Getting Started Using Fortran to Call Routines Use the Fortran default naming and calling conventions for calls to the summary file toolkit shared library, when compiling code. You do not have to carry out any special steps to call the summary file toolkit routines. When linking the application, make sure a reference to the zetoolkit shared library is included in the list of libraries, and that its pathname is included in the list of library directories. You must write your code and any setup procedures so that the zetoolkit shared library is in your run time path. Changes in the Toolkit AspenTech tries to avoid changing the arguments to these routines but occasionally changes are necessary. Sometimes these changes are made to support changes in Aspen Plus; because of this, sometimes old versions of the toolkit will not work with newer summary files. However, the latest version of the toolkit should always work with all older Aspen Plus summary files. The changes likely to affect users are listed here: In version 11.1, all of the arguments holding stream IDs and block IDs (including sensitivity blocks and the like) became variable length, changing from CHARACTER*8 to CHARACTER*(*) to support hierarchy. See Using the Toolkit With a Hierarchical Aspen Plus Run on page 11 for more info. In version 12.1, the filename argument in TKOPEN changed from CHARACTER*80 to CHARACTER*(*) to support using the toolkit with summary files with long file paths, although the documentation was not updated to reflect this change until version 2006. We recommend using a CHARACTER of length 256 to hold this filename, as there may be other problems with a longer file path. 1 Getting Started 15 16 1 Getting Started 2 General Subroutines This chapter describes the purpose and use of subroutines in the Aspen Plus Summary File Toolkit. Use the subroutines described in this chapter for: Initializing the summary file toolkit. Retrieving run information. Retrieving flowsheet balance results. Setting and changing units of measurement. Retrieving component information. Retrieving sensitivity results. 2 General Subroutines 17 Initializing the Summary File Toolkit Before you can retrieve any results from a summary file, you must call subroutine TKINIT or TKINI2 to initialize the summary file toolkit. TKINIT assigns Fortran unit numbers and unit names for files used by the toolkit. See Initializing the Toolkit, Chapter 1, for information on identifying the necessary files. The scratch file is a direct access file used by the toolkit to store intermediate data. You must supply a Fortran unit number for the scratch file. To open the summary file and connect it to a unit number, you can: Use a Fortran OPEN statement in your program. Call TKOPEN routine (see Opening and Closing Files, this chapter), if using the Windows DLL. The property number file and the unit definition file are delivered with Aspen Plus. The file names you specify to call TKINIT depend on the computer and operating system you are using (see Getting Property and Units File Names, Chapter 1). TKINIT sets the default units set for all results data to the value of UNISET. This can be one of four values: SI, ENG, MET, or OUT. The first three values correspond to the Aspen Plus units sets with these names. OUT can be used to retrieve the results from the summary file without any UOM conversion. The data is retrieved in the same units as the Aspen Plus out units for the run. Calling Sequence for TKINIT CALL TKINIT (UNISET, IDIRAC, ISUMMF, IPROPN, RCPROP, IUNITS, RCUNIT, RMISS, IERR) Argument List Descriptions for TKINIT 18 Variable I/O † Type Dimension Description UNISET I CHARACTER*4 — Units set for retrieved values (SI, ENG, MET, or OUT) IDIRAC I INTEGER — Fortran unit number for scratch file ISUMMF I INTEGER — Fortran unit number for summary file IPROPN I INTEGER — Fortran unit number for property numbers file RCPROP I CHARACTER*80 — File name for property numbers file IUNITS I INTEGER Fortran unit number for units definition file RCUNIT I CHARACTER*80 — RMISS I REAL*8 — — File name for units definition file Real value flag for missing values 2 General Subroutines Variable I/O † Type Dimension Description IERR — O INTEGER Error flag (0=No error) † I = Input to subroutine, O = Output from subroutine If you initialize the toolkit with TKINIT, Aspen Plus writes errors or warnings from the toolkit run to the screen. TKINI2 works in the same way as TKINIT, except that it allows you to specify a Fortran unit number for error and warning messages. This is useful for applications where messages should not be written directly to the screen. Like the summary file, this file should already be opened before calling TKINI2. If you specify a negative unit number for the error and warning messages, they are turned off. Calling Sequence for TKINI2 CALL TKINI2 (UNISET, IDIRAC, ISUMMF, IPROPN, RCPROP, IUNITS, RCUNIT, RMISS, IERR, ILOG) Argument List Descriptions for TKINI2 Variable I/O † Type Dimension Description UNISET I CHARACTER*4 — Units set for retrieved values (SI, ENG, MET or OUT) IDIRAC I INTEGER — Fortran unit number for scratch file ISUMMF I INTEGER — Fortran unit number for summary file IPROPN I INTEGER — Fortran unit number for property numbers file RCPROP I CHARACTER*80 — File name for property numbers file IUNITS I INTEGER Fortran unit number for units definition file RCUNIT I CHARACTER*80 — RMISS I REAL*8 — Real value flag for missing values IERR O INTEGER — Error flag (0=No error) ILOG I INTEGER — Fortran Unit number for log file. Negative for no messages. — File name for units definition file † I = Input to subroutine, O = Output from subroutine Closing the Summary File Toolkit Call subroutine TKCLOS to close a summary file toolkit run. TKCLOS closes files opened by TKINIT or TKINI2, so the argument list should use the corresponding values passed to TKINIT or TKINI2. The summary file is not closed by this routine, but is instead rewound to its first record. Use TKCLFL to close it. Calling Sequence for TKCLOS CALL TKCLOS (ISUMMF, IDIRAC, IPROPN, IUNITS) 2 General Subroutines 19 Argument List Descriptions for TKCLOS Variable I/O † Type Dimension Description ISUMMF I INTEGER — Fortran unit number for summary file IDIRAC I INTEGER — Fortran unit number for scratch file IPROPN I INTEGER — Fortran unit number for property numbers file IUNITS I INTEGER — Fortran unit number for units definition file † I = Input to subroutine, O = Output from subroutine Opening and Closing Files Two routines are provided to open and close files with a specified Fortran unit number. If you are using a DLL version of the summary file toolkit, you must use these routines to open and close the summary file, and any log file used by TKINI2. Unless you do so, the summary file toolkit DLL will not recognize the Fortran unit numbers you pass it for these files. When using the DLL, you should not call these routines to open and close files your code accesses. Call subroutine TKOPEN to open the file with the specified Fortran unit number. Calling Sequence for TKOPEN CALL TKOPEN (IUNIT, FILNAM, ACCESS, FORM, IRECL, STATUS, MODE, IERR) Argument List Descriptions for TKOPEN Variable I/O † Type Dimension Description — Unit number of the file being opened IUNIT I INTEGER FILNAM I CHARACTER*(*) — Name of file to open ACCESS I CHARACTER*16 — File access (SEQUENTIAL, DIRECT) FORM I CHARACTER*16 — I/O format (FORMATTED, UNFORMATTED) IRECL I INTEGER Record length STATUS I CHARACTER*16 — File status (SCRATCH, OLD, NEW, UNKNOWN) MODE I CHARACTER*16 — Open mode (READ, WRITE) IERR O INTEGER Error flag (0=No error, 1=Invalid argument, >0= IOSTAT error) — — † I = Input to subroutine, O = Output from subroutine Call subroutine TKCLFL to close the file with the specified Fortran unit number. Calling Sequence for TKCLFL CALL TKCLFL (IUNIT, IERR) 20 2 General Subroutines Argument List Descriptions for TKCLFL Variable I/O IUNIT I INTEGER — Unit number of the file being closed IERR O INTEGER — Error flag (0=No error) † Type Dimension Description † I = Input to subroutine, O = Output from subroutine Retrieving Run Information Use the subroutines in this section to retrieve general information about the run. Call TKINFO to obtain standard information about a run. Call TKTITL to obtain the run title. Call TKACCT to obtain run accounting information. Standard Run Information Call subroutine TKINFO to retrieve the following standard information about a run: Aspen Plus release name. Run ID of the Aspen Plus run. Date of the run. Input file name. Input translator status. Simulation program status. Number of simulation objects (blocks, streams, property tables, sensitivity tables). Calling Sequence for TKINFO CALL TKINFO (VERSN, RUNID, DATE, INFILE, ISSTAT, ISTAT, NBLOCK, NSTRM, NTABLE, NSENS) 2 General Subroutines 21 Argument List Descriptions for TKINFO Variable I/O † Type Dimension Description VERSN O CHARACTER*20 — Aspen Plus release name RUNID O CHARACTER*8 DATE O CHARACTER*80 — Date of Aspen Plus run INFILE O CHARACTER*80 — Aspen Plus input file name ISSTAT O INTEGER — Input translator completion code ISTATF O INTEGER 6 Simulation status flags for each element. See ISTATF, below. NBLOCK O INTEGER — Number of blocks NSTRM O INTEGER — Number of streams NTABLE O INTEGER — Number of property tables NSENS O INTEGER — Number of sensitivity tables — Aspen Plus run ID † I = Input to subroutine, O = Output from subroutine ISTATF The 0= 1= 2= values are: Completed without errors, Completed with errors, None in this simulation, The elements represent: ISTATF(1): Block status, (2): Convergence status, (3): Sensitivity status, (4): Case study status, (5): Stream calculation status, (6): Fortran and transfer status Run Titles Call subroutine TKTITL to retrieve the run title. Calling Sequence for TKTITL CALL TKINFO (TITLE) Argument List Descriptions for TKTITL Variable I/O TITLE O † Type Dimension Description CHARACTER*64 — Run title † I = Input to subroutine, O = Output from subroutine 22 2 General Subroutines Accounting Information Call subroutine TKACCT to obtain accounting information for a run. Accounting information is only available if requested in the Aspen Plus input. Calling Sequence for TKACCT CALL TKACCT (ACCNT, PROJID, PRNAME, USER, IERR) Argument List Descriptions for TKACCT Variable I/O Type Dimension Description ACCNT O CHARACTER*8 — Account number PROJID O CHARACTER*8 — Project ID PRNAME O CHARACTER*32 — Project name USER O CHARACTER*20 — User name IERR O INTEGER — Error flag (0=No error) † † I = Input to subroutine, O = Output from subroutine Retrieving Flowsheet Balance Results Call subroutine TKFLWB to retrieve the absolute and relative differences for: Total mole balance. Total mass balance. Enthalpy balance. Mole balance for each conventional component. Mass balance for each nonconventional component. Calling Sequence for TKFLWB CALL TKFLWB (ABSMOL, RELMOL, ABSMAS, RELMAS, ABSENT, RELENT, NCC, ABSCON, RELCON, NNCC, ABSNC, RELNC, IERR) 2 General Subroutines 23 Argument List Descriptions for TKFLWB Variable I/O Type Dimension Description ABSMOL O REAL*8 — Absolute mole balance difference (UNITS=MOLE-FLOW) RELMOL O REAL*8 — Relative mole balance difference ABSMAS O REAL*8 — Absolute mass balance difference (UNITS=MASS-FLOW) RELMAS O REAL*8 — Relative mass balance difference ABSENT O REAL*8 — Absolute enthalpy balance difference (UNITS=ENTHALPY-FLOW) RELENT O REAL*8 — Relative enthalpy balance difference NCC I INTEGER — Number of conventional components ABSCON O REAL*8 NCC Absolute mole balance difference for each conventional component (UNITS=MOLE-FLOW) RELCON O REAL*8 NCC Relative mole balance for each conventional component NNCC I INTEGER — ABSNC O REAL*8 NNCC Absolute mass balance difference for each nonconventional component (UNITS=MASS-FLOW) RELNC O REAL*8 NNCC Relative mass balance difference for each nonconventional component IERR O INTEGER — † Number of nonconventional components Error flag (0=No error) † I = Input to subroutine, O = Output from subroutine Units Conversion Use the subroutines in this section to: Change the units set for results. Convert units for individual results. Find units labels for results. Changing Units Sets Values retrieved from the summary file are converted to the current units set. The variable SETID takes the same values as UNISET does in TKINIT and TKINI2. The units set is initially defined in the call to subroutine TKINIT or TKINI2. You can change the units set at any point in your program, by calling subroutine TKUNIT. Use TKUNIT to define a new base units set and any units' options that should override the units' options in the base set. 24 2 General Subroutines Calling Sequence for TKUNIT CALL TKUNIT (SETID, NTYPES, TYPES, LABELS, IERR) Argument List Descriptions for TKUNIT Variable I/O Type Dimension Description SETID I CHARACTER*4 — Base units set (SI, ENG, MET, or OUT) NTYPES I INTEGER — Number of units types to change from the base set TYPES I CHARACTER*12 NTYPES List of units' types to change from the base set. See Appendix A for a list of valid units' types. LABELS I CHARACTER*16 NTYPES List of units labels for the units types to change from the base set. See Appendix A for a list of valid units' labels. Note that units labels are case-sensitive. IERR O INTEGER Error flag (0=No error) † — † I = Input to subroutine, O = Output from subroutine Converting Units for Real Numbers Call subroutine TKCNVT to perform units conversion on a result or an array of results. TKCNVT converts values from the current units set to units specified by a unit's label. TKCNVT will not convert a result if the current units set is OUT units. (There is no such thing as a current unit for a particular units type with OUT units.) Calling Sequence for TKCNVT CALL TKCNVT (TYPE, LABEL, NVAL, RVALI, RVALO) Argument List Descriptions for TKCNVT Variable I/O TYPE I CHARACTER*12 — Units type. Valid units' types are shown in Appendix A. LABEL I CHARACTER*16 — Units label for output. See Appendix A for a list of valid units' labels. Note that units labels are case-sensitive. NVAL I INTEGER — Number of values to convert RVALI I REAL*8 NVAL Array of values to be converted. These values are assumed to be in the current units set. RVALO O REAL*8 NVAL Array of converted values † Type Dimension Description † I = Input to subroutine, O = Output from subroutine 2 General Subroutines 25 Determining Units Labels Call subroutine TKLABL to determine the units' labels for a list of units' types in the current units set. TKLABL will not retrieve a label for a type if the current units set is OUT units. (There is no such thing as a current unit for a particular units type with OUT units.) Calling Sequence for TKLABL CALL TKLABL (NTYPES, TYPES, LABELS) Argument List Descriptions for TKLABL Variable I/O Type Dimension Description NTYPES I INTEGER — Number of units types TYPES I CHARACTER*12 NTYPES Units types. See Appendix A for a list of valid units' types. LABELS O CHARACTER*16 NTYPES Units labels † † I = Input to subroutine, O = Output from subroutine Component Information Retrieval Use the subroutines in this section to retrieve information about the components in the simulation: TKCOMP gets the number of components in the simulation. TKCIDS gets the list of component IDs. TKALIS gets lists of conventional components and their aliases. TKCASN gets lists of components and their CAS numbers. TKCPRP retrieves component properties, such as molecular weight, boiling point, and standard volume. Number of Components Call subroutine TKCOMP to determine the number of components in a simulation. TKCOMP returns the number of both conventional and nonconventional components. Calling Sequence for TKCOMP CALL TKCOMP (NCC, NNCC) 26 2 General Subroutines Argument List Descriptions for TKCOMP Variable I/O Type Dimension Description NCC NNCC O INTEGER — Number of conventional components O INTEGER — Number of nonconventional components † † I = Input to subroutine, O = Output from subroutine Component IDs Call subroutine TKCIDS to retrieve the component IDs for conventional and nonconventional components. Calling Sequence for TKCIDS CALL TKCIDS (NCC, NNCC, COMPID, COMPNC) Argument List Descriptions for TKCIDS Variable I/O Type Dimension Description NCC NNCC I INTEGER — Number of conventional components I INTEGER — Number of nonconventional components COMPID O CHARACTER*8NCC Component IDs for conventional components COMPNC O CHARACTER*8NNCC Component IDs for nonconventional components † † I = Input to subroutine, O = Output from subroutine Component Alias Names Call subroutine TKALIS to retrieve conventional component IDs and their aliases. Calling Sequence for TKALIS CALL TKALIS (NCC, COMPID, ALIAS, IERR) Argument List Descriptions for TKALIS Variable I/O Type Dimension Description NCC I INTEGER — Number of conventional components COMPID O CHARACTER*8 NCC Conventional component IDs ALIAS O CHARACTER*12 NCC Alias corresponding to component IDs IERR O INTEGER Error flag (0=No error) † † I = Input to subroutine, 2 General Subroutines — O = Output from subroutine 27 Component CAS Numbers Call subroutine TKCASN to retrieve conventional component IDs and their CAS numbers. CAS numbers will be blank for segments and user-defined components. Calling Sequence for TKCASN CALL TKCASN (NCC, COMPID, CASN, IERR) Argument List Descriptions for TKCASN Variable I/O Type Dimension Description NCC I INTEGER — Number of conventional components COMPID O CHARACTER*8 NCC Conventional component IDs CASN O CHARACTER*12 NCC CAS numbers corresponding to component IDs IERR O INTEGER Error flag (0=No error) † † I = Input to subroutine, — O = Output from subroutine Component Properties Call subroutine TKCPRP to retrieve component properties for conventional components. The properties that you can retrieve are molecular weight, boiling point, and standard volume. Calling Sequence for TKCPRP CALL TKCPRP (PROP, NCC, RVALS, LABEL) Argument List Descriptions for TKCPRP Variable I/O Type Dimension Description PROP I CHARACTER*8 — Property name (MW, TB, or VSTD) NCC I INTEGER — Number of components RVALS O REAL*8 NCC Property values (units are TEMPERATURE for TB and MOLE-VOLUME for VSTD) LABEL O CHARACTER*16 — † Units label † I = Input to subroutine, O = Output from subroutine Sensitivity Block Results You can retrieve sensitivity table results from the summary file, using the following three-step process: 28 1 Call TKNEXT to identify the next sensitivity block. 2 Call TKNSEN to retrieve the number of points and the number of columns in the table. 2 General Subroutines 3 Call TKSENS to retrieve the values for the table and the headers for the columns. Identifying Sensitivity Blocks Call subroutine TKNEXT to find the name of the next sensitivity block. To find the block ID of the first sensitivity block, set IOFF to 1. To find the name of the second block, set IOFF to 2, and so on. Calling Sequence for TKNEXT CALL TKNEXT (TYPE, IOFF, ID1, ID2, IERR) Argument List Descriptions for TKNEXT Variable I/O TYPE I CHARACTER*12 — Object type (set to SENSITIVITY for sensitivity blocks) IOFF I INTEGER Sequence number ID1 O CHARACTER*(*) — First ID of the object. For sensitivity blocks, it is the block ID. Returns complete hierarchy specification. ID2 O CHARACTER*12 — Second ID of the model name, for the object. For sensitivity blocks, it is blank. IERR O INTEGER Error flag (0=No error) † Type Dimension — — Description † I = Input to subroutine, O = Output from subroutine Determining Sensitivity Dimensions Call subroutine TKNSEN to determine the number of points and number of columns in the sensitivity table. Calling Sequence for TKNSEN CALL TKNSEN(SENSID, NPOINT, NCOL, IERR) Argument List Descriptions for TKNSEN Variable I/O Type Dimension Description SENSID I CHARACTER*(*) — Sensitivity block ID NPOINT O INTEGER — Number of points in table NCOL O INTEGER — Number of columns in table IERR O INTEGER — Error flag (0=No error) † † I = Input to subroutine, O = Output from subroutine 2 General Subroutines 29 Retrieving Sensitivity Results Call subroutine TKSENS to retrieve the results for a sensitivity table. The columns are identified by the variable HEADER. The actual argument to RVALS should be declared as a one-dimensional array of length, equal to or greater than (NPOINT * NCOL). The results in each column are stored consecutively. Calling Sequence for TKSENS CALL TKSENS (SENSID, NPOINT, NCOL, HEADER, RVALS, IERFLG, IERR) Argument List Descriptions for TKSENS Variable I/O SENSID I CHARACTER*(*) — Sensitivity block ID (Full hierarchical path) NPOINT I INTEGER — Number of points in table NCOL I INTEGER — Number of columns in table HEADER O CHARACTER*8 6, NCOL Table header of each table column RVALS O REAL*8 NPOINT* NCOL Results for sensitivity table IERFLG O INTEGER NPOINT Error flag for each row of table (0=No error) IERR O INTEGER — Error flag (0=No error) † Type Dimension Description † I = Input to subroutine, O = Output from subroutine 30 2 General Subroutines 3 Block Result Subroutines This chapter describes the use of block result retrieval subroutines in the summary file toolkit. Use the subroutines described in this chapter for: Block identification, connectivity, and results. Compressor results. Heat exchanger results. Column results. Tray reports and tray/packing sizing and rating. Reactor results and property reports. Pipeline results. Block vapor-liquid equilibrium (VLE) results. Heating/cooling curves. 3 Block Result Subroutines 31 Block Identification The following subroutines are used to identify blocks in the summary file: TKBIDS returns a list of blocks in the summary file. TKNBLK retrieves the next block ID in sequence. Both routines return the model type for each block. Block IDs Call subroutine TKBIDS to get the list of blocks and model types. Calling Sequence for TKBIDS CALL TKBIDS (NBLOCK, BLKID, BLKTYP, IERR) Argument List Descriptions for TKBIDS Variable I/O † Type Dimension Description NBLOCK I INTEGER — Number of blocks. You can find the value of NBLOCK by calling TKINFO. BLKID O CHARACTER*(*) NBLOCK Block ID (Full hierarchical path) BLKTYP O CHARACTER*12 NBLOCK Model type IERR O INTEGER Error flag (0=No error) † I = Input to subroutine, — O = Output from subroutine Next Block Call subroutine TKNBLK to find the name of the next unit operation block. To find the block ID of the first block, set IBLOCK to 1. To find the name of the second block, set IBLOCK to 2, and so on. Calling Sequence for TKNBLK CALL TKNBLK (IBLOCK, BLKID, BLKTYP, IERR) Argument List Descriptions for TKNBLK Variable I/O † Type Dimension Description IBLOCK I INTEGER — Block number BLKID O CHARACTER*(*) — Block ID BLKTYP O CHARACTER*12 — Model type IERR O INTEGER — Error flag (0=No error) † I = Input to subroutine, O = Output from subroutine 32 3 Block Result Subroutines Block Connectivity Information Use the subroutines in this section to retrieve the inlet and outlet stream connectivity for a block. Retrieving the inlet and outlet streams of a block is a two-step process: 1 Call subroutine TKCNTN to find the number of inlet and outlet streams. 2 Call subroutine TKCNCT to retrieve the list of inlet and outlet stream names. Some blocks have additional connectivity information, such as stage number and column number. For these blocks you can obtain the additional information by calling TKPORT. Number of Inlet and Outlet Streams Call subroutine TKCNTN to determine the number of inlet streams and outlet streams for a particular block. Calling Sequence for TKCNTN CALL TKCNTN (BLKID, NIN, NOUT, IERR) Argument List Descriptions for TKCNTN Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID NIN O INTEGER — Number of inlet streams NOUT O INTEGER — Number of outlet streams IERR O INTEGER — Error flag (0=No error) † I = Input to subroutine, O = Output from subroutine Stream Names and Types Call subroutine TKCNCT to retrieve the names of the inlet and outlet streams for a block, along with the stream types (MATERIAL, HEAT, or WORK). Calling Sequence for TKCNCT CALL TKCNCT (BLKID, NIN, NOUT, BLKIN, TYPIN, BLKOUT, TYPOUT, IERR) Argument List Descriptions for TKCNCT Variable I/O † Type BLKID I CHARACTER*(*) — Block ID NIN I INTEGER — Number of inlet streams NOUT I INTEGER — Number of outlet streams BLKIN O CHARACTER*(*) NIN TYPIN O CHARACTER*8 3 Block Result Subroutines Dimension NIN Description Inlet stream IDs Stream type of inlet streams (MATERIAL, HEAT, or WORK) 33 Variable I/O † Type Dimension Description BLKOUT O CHARACTER*(*) NOUT Outlet stream IDs TYPOUT O CHARACTER*8 NOUT Stream type of outlet streams (MATERIAL, HEAT, or WORK) IERR O INTEGER — Error flag (0=No error) † I = Input to subroutine, O = Output from subroutine Additional Port Information Call subroutine TKPORT to obtain additional port information on inlet and outlet streams for a block. The additional information includes the port name (for example, F indicating a feed port) and additional identifiers, such as column number and stage number. Only the blocks with the model types shown in Table 3.1 need this subroutine. The outlet types for the other blocks are implicit in the order that the streams are returned by TKCNT. For example, vapor streams are returned before liquid streams. Calling Sequence for TKPORT CALL TKPORT (BLKID, NIN, NOUT, INPORT, IDIN1, IDIN2, IOPORT, IDOUT1, IDOUT2, IERR) Argument List Descriptions for TKPORT Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID NIN I INTEGER — Number of inlet streams NOUT I INTEGER — Number of outlet streams INPORT O CHARACTER*4 NIN Inlet port names IDIN1 O INTEGER NIN ID1 for inlet streams IDIN2 O INTEGER NIN ID2 for inlet streams IOPORT O CHARACTER*4 NOUT Outlet port names IDOUT1 O INTEGER NOUT ID1 for outlet streams IDOUT2 O INTEGER NOUT ID2 for outlet streams IERR O INTEGER — Error flag: 0 = No error 1 = Block ID not found 2 = Block has no port information † I = Input to subroutine, O = Output from subroutine 34 3 Block Result Subroutines Port Information Returned by TKPORT Model Type Port Name Description ID1 Extract TF BF SF TP BP SP Top feed Bottom feed Side feed Top product Bottom product Side product Stage — number HeatX HF CF HP CP HWD CWD Hot feed Cold feed Hot product Cold product Hot water decant Cold water decant — Mcompr S1F IF WS HS FLS LK WD WS HS Stage1 feed Stage feed Work feed Heat feed Product Liquid knockout Water draw Work out Heat out Stage — number MheatX HF CF HP CP HWD CWD Hot feed Cold feed Hot product Cold product Hot water decant Cold water decant Stream — number MultiFrac F HS VD LD R SP CWD HS Feed Heat feed Vapor distillate Liquid distillate Residue Side product Water distillate Heat product Column Stage number number PetroFrac MF SF MHF SHF PHF VD LD B SP CWD SB PS CHS RHS MHP SHP PHP Main column feed Stripper steam feed Main column heat feed Stripper heat feed Pumparound heat feed Main column vapor distillate Main column liquid distillate Main column bottoms product Main column side product Main column condenser water decant Stripper bottom product Pseudo stream Condenser heat stream Reboiler heat stream Main column heat product Stripper heat product Pumparound heat product Column Stage number number † 3 Block Result Subroutines ID2 — 35 Model Type Port Name Description ID1 ID2 RadFrac F HS VD LD R SP WD CHS RHS Feed Heat feed Vapor distillate Liquid distillate Residue Side product Water distillate Condenser heat Reboiler heat Stage — number RateFrac F HS VD LD R SP CWD HS Feed Heat feed Vapor distillate Liquid distillate Residue Side product Water distillate Heat product Column Section number number SCFrac F SF D B SP Feed Steam feed Distillate Bottoms Side product — — † The PetroFrac column number for the main column is one. The strippers are numbered sequentially, starting with two. Standard Block Results All unit operations have standard scalar block results. For example, Flash2 results include the outlet temperature and pressure, the vapor fraction, and the heat duty. You can retrieve standard scalar results using a two-step process: 1 Call subroutine TKNRES to determine the dimensions of the results. 2 Call subroutine TKBRES to retrieve the results. Dimensions of Standard Scalar Results Call subroutine TKNRES to determine the dimensions of the standard results for a block. TKNRES returns the number of results and the maximum number of qualifiers for results. You can use this information to dimension arrays for calling subroutine TKBRES, which retrieves the results. Calling Sequence for TKNRES CALL TKNRES 36 (BLKID, NRES, NQUAL, IERR) 3 Block Result Subroutines Argument List Descriptions for TKNRES Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID NRES O INTEGER — Number of results NQUAL O INTEGER — Maximum number of qualifiers for a result †† IERR O INTEGER — Error flag (0=No error) † I = Input to subroutine, O = Output from subroutine †† Some results have qualifiers needed to identify the result, such as the stream ID or substream ID. NQUAL is the maximum number of qualifiers for the results of a block. Standard Scalar Block Results Call subroutine TKBRES to retrieve the standard scalar results of a block. Treat the QUALS array as a one-dimensional array, with all the values for each qualifier type stored consecutively. Calling Sequence for TKBRES CALL TKBRES (BLKID, NRES, NQUAL, PNAMES, QUALS, ITYPE, IVALS, CVALS, RVALS, TYPES, LABELS) Argument List Descriptions for TKBRES Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID NRES I INTEGER — Number of results NQUAL I INTEGER — Maximum number of qualifiers †† PNAMES O CHARACTER*12 NRES QUALS O CHARACTER*8 NRES* NQUAL Qualifiers †† ITYPE O INTEGER NRES Data type of results (1=Integer, 2=Real, 3=Character) ††† IVALS O INTEGER NRES Integer results ††† CVALS O CHARACTER*8 NRES Character results ††† RVALS O REAL*8 NRES Real results ††† TYPES O CHARACTER*12 NRES Units types LABELS O CHARACTER*16 NRES Units labels Property name. See Appendix B for a description. † I = Input to subroutine, O = Output from subroutine †† Some results have qualifiers needed to identify the result, such as the stream ID or substream ID. NQUAL is the maximum number of qualifiers for the results of a block. ††† For each result, the value in ITYPE specifies which array contains the result (IVALS, CVALS or RVALS). For example, if ITYPE(4) is 2, then IVALS(4) is 0, CVALS(4) is blank and RVALS(4) contains the result. 3 Block Result Subroutines 37 Compressor Results If you use the Compr or MCompr model with scalar specifications, you can retrieve the standard block results. Retrieving these results is described in Standard Block Results, this chapter. If you use Compr with performance curves for a stage, or MCompr with stage-by-stage performance curves, additional results are available. These results include: Percentage above surge. Percentage below stonewall. Speed of compressor shaft. If you use Compr with performance curves for a wheel, or MCompr with wheel-by-wheel performance curves, the following additional results are available: Head coefficient. Flow coefficient. Rotor tip Mach number. You can retrieve compressor performance results from the summary file for the Compr and MCompr models. You can consider Compr results as belonging to a single stage. The MCompr performance results can be retrieved for each stage of the MCompr model. In addition, you can retrieve the performance results for the wheels within each stage of the MCompr model when wheelby-wheel performance is modeled. Use this two-step process to retrieve the stage-by-stage performance results: 1 Call subroutine TKNPER to determine the number of stage-by-stage performance results in the Compr/MCompr model, and the number of stages in the MCompr model. 2 Call subroutine TKPERF to retrieve the stage-by-stage performance data for all stages. Use these additional two steps to retrieve the wheel-by-wheel performance results: 3 Call subroutine TKNWHL to determine the number of wheels and the number of wheel-by-wheel performance results in the MCompr model. 4 Call subroutine TKWHLP to retrieve the wheel-by-wheel performance data for each stage. Dimensions of Performance Results Call subroutine TKNPER to determine the number of properties in the stageby-stage compressor performance results. TKNPER also returns NSTAGE, the number of compressor stages for MCompr. TKNPER returns a NSTAGE value of 1 for Compr. TKNPER returns a NSTAGE value of 0 for all other models. 38 3 Block Result Subroutines When there are no performance results, TKNPER may still return the number of stages. TKNPER will do this if there are wheel-by-wheel performance results available. Use NPROP (not NSTAGE) to check if there any performance results available. Calling Sequence for TKNPER CALL TKNPER (BLKID, NPROP, NSTAGE) Argument List Descriptions for TKNPER Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID NPROP O INTEGER — Number of stage-by-stage performance results properties NSTAGE O INTEGER — Number of compressor stages † I = Input to subroutine, O = Output from subroutine Stage-by-Stage Performance Results Call subroutine TKPERF to retrieve the stage-by-stage compressor performance results. Use 1 as the value of NSTAGE with the Compr model. The results for the MCompr model are ordered in the RVALS array, so that all the properties for a stage are sequential. Calling Sequence for TKPERF CALL TKPERF (BLKID, NPROP, NSTAGE, PNAMES, RVALS, TYPES, LABELS, IERR) Argument List Descriptions for TKPERF Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID NPROP I INTEGER — Number of properties NSTAGE I INTEGER — Number of stages (1 for Compr) PNAMES O CHARACTER*12 NPROP Property name. See Appendix B for a description. RVALS O REAL*8 NPROP* NSTAGE Real results TYPES O CHARACTER*12 NPROP Units types LABELS O CHARACTER*16 NPROP Units labels IERR O INTEGER — Error flag (0=No error) † I = Input to subroutine, O = Output from subroutine 3 Block Result Subroutines 39 Dimensions of Wheel-by-Wheel Performance Results Call subroutine TKNWHL to determine the number of wheels in a particular stage of MCompr. The number of properties in the wheel-by-wheel performance results is also returned. Call TKNPER to find the total number of stages. Calling Sequence for TKNWHL CALL TKNWHL (BLKID, ISTAGE, NWHEEL, NPROP) Argument List Descriptions for TKNWHL Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID ISTAGE I INTEGER — Specified compressor stage NWHEEL O INTEGER — Number of wheels NPROP O INTEGER — Number of wheel-by-wheel performance results properties † I = Input to subroutine, O = Output from subroutine Wheel-by-Wheel Performance Results Call subroutine TKWHLR to retrieve the compressor wheel-by-wheel performance results for the specified stage of the MCompr model. The results are ordered in the RVALS array so that all the properties for a wheel are sequential. Calling Sequence for TKWHLR CALL TKWHLR (BLKID, ISTAGE, NPROP, NWHEEL, PNAMES, RVALS, TYPES, LABELS, IERR) Argument List Descriptions for TKWHLR Variable I/O † Type 40 Dimension Description BLKID I CHARACTER*(*) — Block ID ISTAGE I INTEGER — Stage number NPROP I INTEGER — Number of properties NWHEEL I INTEGER — Number of wheels in stage PNAMES O CHARACTER*12 NPROP Property name. See Appendix B for a description. RVALS O REAL*8 Real results TYPES O CHARACTER*12 NPROP Units types LABELS O CHARACTER*16 NPROP Units labels IERR O INTEGER Error flag (0=No error) NPROP* NWHEEL — 3 Block Result Subroutines † I = Input to subroutine, O = Output from subroutine Compressor Profile Results You can retrieve profile data for each stage and inter-stage cooler of the multi-stage compressor model MCompr. This requires three steps: 1 Call subroutine TKNMCP to determine the number of MCompr stages, cooler stages and profile properties. 2 Call subroutine TKMCPR to retrieve the profile data for the MCompr stages. 3 Call subroutine TKMCCP to retrieve the profile data for the MCompr coolers. Dimensions of MCompr Profile Results Call subroutine TKNMCP to determine the number of stages, cooler stages, stage profile properties and cooler stage profile properties. Calling Sequence for TKNMCP CALL TKNMCP (BLKID, NSTAGE, NPROP, NCOOL, NCPROP) Argument List Descriptions for TKNMCP Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID NSTAGE O INTEGER — Number of compressor stages NPROP O INTEGER — Number of stage profile properties NCOOL O INTEGER — Number of compressor cooler stages NCPROP O INTEGER — Number of cooler stage profile properties † I = Input to subroutine, O = Output from subroutine MCompr Profile Results Call subroutine TKMCPR to retrieve the MCompr profile results. The results are ordered in the RVALS array so that all properties for a stage are sequential. Calling Sequence for TKMCPR CALL TKMCPR 3 Block Result Subroutines (BLKID, NPROP, NSTAGE, PNAMES, RVALS, TYPES, LABELS, IERR) 41 Argument List Descriptions for TKMCPR Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID NPROP I INTEGER — Number of profile properties NSTAGE I INTEGER — Number of stages PNAMES O CHARACTER*12 NPROP Property name. See Appendix B for a description. RVALS O REAL*8 NPROP* NSTAGE Real results TYPES O CHARACTER*12 NPROP* NSTAGE Units types LABELS O CHARACTER*16 NPROP* NSTAGE Units labels IERR O INTEGER — Error flag (0=No error) † I = Input to subroutine, O = Output from subroutine MCompr Cooler Profile Results Call subroutine TKMCCP to retrieve the MCompr profile results for the cooler stage. The results are ordered in the RVALS array so that all the properties for a cooler stage are sequential. Calling Sequence for TKMCCP CALL TKMCCP (BLKID, NCPROP, NCOOL, PNAMES, RVALS, TYPES, LABELS, IERR) Argument List Descriptions for TKMCCP Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID NCPROP I INTEGER — Number of profile properties NCOOL I INTEGER — Number of cooler stages PNAMES O CHARACTER*12 NCPROP RVALS O REAL*8 TYPES O CHARACTER*12 NCPROP* NCOOL Units types LABELS O CHARACTER*16 NCPROP* NCOOL Units labels IERR O INTEGER Property name. See Appendix B for a description. NCPROP* NCOOL Real results — Error flag (0=No error) †I = Input to subroutine, O = Output from subroutine Heat Exchanger Results You can retrieve the standard block results and HCURVE data, if you use the HeatX model in SHORTCUT mode. Retrieving these results is described in 42 3 Block Result Subroutines Standard Block Results and Heating/Cooling Curves, this chapter. Additional data are available, if you use the HeatX model in the RIGOROUS mode. These are more detailed block results, zone, shell, tube, baffle and nozzle data. This section describes how to retrieve these additional rigorous HeatX results. You can retrieve the detailed block results using a three-step process: 1 Call subroutine TKNHXD to determine the HeatX detailed results dimensions. 2 Call subroutine TKHXD1 to retrieve detailed results. 3 Call subroutine TKHXD2 to retrieve the velocity and pressure drop results. You can retrieve the zone, shell, tube, baffle and nozzle data using a six-step process: 1 Call subroutine TKNHXT to determine the sizes of the results. 2 Call subroutine TKHXZO to retrieve the zone results. 3 Call subroutine TKHXSH to retrieve the shell results. 4 Call subroutine TKHXTU to retrieve the tube results. 5 Call subroutine TKHXBA to retrieve the baffle results. 6 Call subroutine TKHXNO to retrieve the nozzle results. Number of Detailed Results Call subroutine TKNHXD to determine the number of HeatX detailed results. If NDET1 is returned as zero, there are no rigorous heat exchanger results for this block ID. Calling Sequence for TKNHXD CALL TKNHXD (BLKID, NDET1, NDET2) Argument List Descriptions for TKNHXD Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID NDET1 O INTEGER — Number of detailed results NDET2 O INTEGER — Number of velocity-DP results † I = Input to subroutine, O = Output from subroutine Detailed Results Call subroutine TKHXD1 to retrieve the first set of detailed results (such as, areas and heat transfer coefficients) for the heat exchanger. Calling Sequence for TKHXD1 CALL TKHXD1 3 Block Result Subroutines (BLKID, NDET1, PNAMES, RVALS, TYPES, LABELS, IERR) 43 Argument List Descriptions for TKHXD1 Variable I/O † Type BLKID Dimension Description I CHARACTER*(*) — Block ID NDET1 I INTEGER Number of detailed results PNAMES O CHARACTER*12 NDET1 RVALS O REAL*8 NDET1 Real results TYPES O CHARACTER*12 NDET1 Units types LABELS O CHARACTER*16 NDET1 Units labels IERR O INTEGER Error flag (0=No error) — — Property name. See Appendix B for a description. † I = Input to subroutine, O = Output from subroutine Velocity and Pressure Results Call subroutine TKHXD2 to retrieve the velocity and pressure drop results for the heat exchanger. Calling Sequence for TKHXD2 CALL TKHXD2 (BLKID, NDET2, PNAMES, RVALS, TYPES, LABELS, IERR) Argument List Descriptions for TKHXD2 Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID NDET2 I INTEGER Number of velocity pressure drop results PNAMES O CHARACTER*12 NDET2 RVALS O REAL*8 NDET2 Real results TYPES O CHARACTER*12 NDET2 Units types LABELS O CHARACTER*16 NDET2 Units labels IERR O INTEGER Error flag (0=No error) — — Property name. See Appendix B for a description. † I = Input to subroutine, O = Output from subroutine Heat Exchanger Results Dimensions Call TKNHXT to retrieve the sizes of the zone, shell, tube, baffle and nozzle results. Because HeatX can be divided into a number of zones, the number of zones together with the number of results in a zone is returned. A single value is returned for the number of shell, tube, baffle and nozzle results. Calling Sequence for TKNHXT CALL TKNHXT 44 (BLKID, NZONE, NZORES, NSHRES, NTURES, NBARES, NNORES) 3 Block Result Subroutines Argument List Descriptions for TKNHXT Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID NZONE O INTEGER — Number of Zones NZORES O INTEGER — Number of Zone results NSHRES O INTEGER — Number of Shell results NTURES O INTEGER — Number of Tube results NBARES O INTEGER — Number of Baffle results NNORES O INTEGER — Number of Nozzle results † I = Input to subroutine, O = Output from subroutine Heat Exchanger Zone Results Call subroutine TKHXZO to retrieve the HeatX zone results. The results for all zones are returned in the RVALS array, with the values for a zone stored at consecutive locations in this array. The first zones results are from element 1 to element NZORES. The second zones results are from NZORES+1 to 2*NZORES, and so on. Calling Sequence for TKHXZO CALL TKHXZO (BLKID, NZONE, NZORES, PNAMES, RVALS, TYPES, LABELS, IERR) Argument List Descriptions for TKHXZO Variable I/O † Type BLKID I CHARACTER*(*) — Block ID NZONE I INTEGER — Number of Zones NZORES I INTEGER — Number of Zone properties PNAMES O CHARACTER*12 NZORES Property name. See Appendix B for a description. RVALS O REAL*8 Real results TYPES O CHARACTER*12 NZORES Unit types LABELS O CHARACTER*16 NZORES Unit labels IERR O INTEGER Error flag (0=No error) † I = Input to subroutine, Dimension NZORES* NZONE — Description O = Output from subroutine Heat Exchanger Shell Results Call subroutine TKHXSH to retrieve the shell results. Calling Sequence for TKHXSH CALL TKHXSH 3 Block Result Subroutines (BLKID, NSHRES, PNAMES, ITYPES, IVALS, CVALS, RVALS, TYPES, LABELS, IERR) 45 Argument List Descriptions for TKHXSH Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID NSHRES I INTEGER Number of Shell properties PNAMES O CHARACTER*12 NSHRES Property name. See Appendix B for a description. ITYPES O INTEGER NSHRES Data type of results (1=Integer 2=Real 3=Character) IVALS O INTEGER NSHRES Integer results CVALS O CHARACTER*12 NSHRES RVALS O REAL*8 TYPES O CHARACTER*12 NSHRES Unit types LABELS O CHARACTER*16 NSHRES Unit labels IERR O INTEGER Error flag (0=No error) — NSHRES — Character results Real results † I = Input to subroutine, O = Output from subroutine Heat Exchanger Tube Results Call subroutine TKHXTU to retrieve the tube results. Calling Sequence for TKHXTU CALL TKHXTU (BLKID, NTURES, PNAMES, ITYPES, IVALS, CVALS, RVALS, TYPES, LABELS, IERR) Argument List Descriptions for TKHXTU Variable I/O † Type BLKID I CHARACTER*(*) — Block ID NTURES I INTEGER Number of Tube properties PNAMES O CHARACTER*12 NTURES Property name. See Appendix B for a description. ITYPES O INTEGER NTURES Data type of results (1=Integer 2=Real 3=Character) IVALS O INTEGER NTURES Integer results CVALS O CHARACTER*12 NTURES Character results RVALS O REAL*8 Real results TYPES O CHARACTER*12 NTURES Unit types LABELS O CHARACTER*16 NTURES Unit labels IERR O INTEGER Error flag (0=No error) † I = Input to subroutine, 46 Dimension — NTURES — Description O = Output from subroutine 3 Block Result Subroutines Heat Exchanger Baffle Results Call subroutine TKHXBA to retrieve the baffle results. Calling Sequence for TKHXBA CALL TKHXBA (BLKID, NBARES, PNAMES, ITYPES, IVALS, CVALS, RVALS, TYPES, LABELS, IERR) Argument List Descriptions for TKHXBA Variable I/O † Type BLKID Dimension Description I CHARACTER*(*) — Block ID NBARES I INTEGER Number of Baffle properties PNAMES O CHARACTER*12 NBARES Property name. See Appendix B for a description. ITYPES O INTEGER NBARES Data type of results (1=Integer 2=Real 3=Character) IVALS O INTEGER NBARES Integer results CVALS O CHARACTER*16 NBARES Character results RVALS O REAL*8 Real results TYPES O CHARACTER*12 NBARES Unit types LABELS O CHARACTER*16 NBARES Unit labels IERR O INTEGER Error flag (0=No error) — NBARES — † I = Input to subroutine, O = Output from subroutine Heat Exchanger Nozzle Results Call subroutine TKHXNO to retrieve the nozzle results. Calling Sequence for TKHXNO CALL TKHXNO (BLKID, NNORES, PNAMES, RVALS, TYPES, LABELS, IERR) Argument List Descriptions for TKHXNO Variable I/O † Type BLKID I CHARACTER*(*) — Block ID NNORES I INTEGER Number of Nozzle properties PNAMES O CHARACTER*12 NNORES RVALS O REAL*8 TYPES O CHARACTER*12 NNORES Unit types LABELS O CHARACTER*16 NNORES Unit labels IERR O INTEGER Error flag 3 Block Result Subroutines Dimension — NNORES — Description Property name. See Appendix B for a description. Real results 47 Variable I/O † Type Dimension Description (0=No error) † I = Input to subroutine, O = Output from subroutine Heat Exchanger Profiles The rigorous HeatX model may have up to four different profiles. They are: Zone profile. Shell profile. Tube profile. Temperature/Duty profile. You can retrieve the HeatX profile results using a three-step process. 1 Call subroutine TKHXPF to determine the size of a profile. 2 Call subroutine TKHXPP to get the names of the properties in a profile. 3 Call subroutine TKHXPR to get the results for a property in a profile. The PRFTYP argument for these functions uses the following profile types: PRFTYP Value Profile Type ZONE_PRF Zone Profile SHEL_PRF Shell Profile TUBE_PRF Tube Profile TQ_PRF Temperature-Duty Profile Heat Exchanger Profile Size Call subroutine TKHXPF to determine the size of a profile. TKHXPF returns the size of the profile for the specified profile type. A size of zero indicates the profile is not present. Calling Sequence for TKHXPF CALL TKHXPF (BLKID, PRFTYP, NPOINT, NPROP) Argument List Descriptions for TKHXPF Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID PRFTYP I CHARACTER*8 — Profile type (see above) NPOINT O INTEGER — Number of profile points NPROP O INTEGER — Number of profile properties † I = Input to subroutine, O = Output from subroutine 48 3 Block Result Subroutines Heat Exchanger Profile Properties Call subroutine TKHXPP to retrieve the names of the properties for the specified profile type. The properties may have additional labels, which further describe them. For example, PNAMES = HX_SMCV, LABEL1 = Crossflow, LABEL2 = Velocity. Calling Sequence for TKHXPP CALL TKHXPP (BLKID, PRFTYP, NPROP, PNAMES, LABEL1, LABEL2, IERR) Argument List Descriptions for TKHXPP Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID PRFTYP I CHARACTER*8 — Profile type (see above) NPROP O INTEGER — Number of profile properties PNAMES O CHARACTER*12 NPROP Property name. See Appendix B for a description. LABEL1 O CHARACTER*12 NPROP First property label LABEL2 O CHARACTER*12 NPROP Second property label IERR O INTEGER Error flag (0=No error) — † I = Input to subroutine, O = Output from subroutine Heat Exchanger Profile Results Call subroutine TKHXPR to retrieve the results for the specified property in a profile. The profile data consists of a number of points within a number of zones. The zone of each value is returned in IZONE, and the point number is returned in IPOINT. The results in RVALS are ordered so that all the points for the first zone are followed by the points for the second zone, and so on. Calling Sequence for TKHXPR CALL TKHXPR (BLKID, PRFTYP, PNAME, NPOINT, IZONE, IPOINT, RVALS, TYPE, LABEL, IERR) Argument List Descriptions for TKHXPR Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID PRFTYP I CHARACTER*8 — Profile type (see above) PNAME I CHARACTER*12 — Property name from TKHXPP NPOINT I INTEGER — Number of profile points IZONE O INTEGER NPOINT Number of zone IPOINT O INTEGER NPOINT Point number within zone RVALS O REAL*8 NPOINT Real results 3 Block Result Subroutines 49 TYPE O CHARACTER*12 — Unit types LABEL O CHARACTER*16 — Unit labels IERR O INTEGER — Error flag (0=No error) † I = Input to subroutine, O = Output from subroutine Column Results You can retrieve column profile results from the summary file for the rigorous distillation models RadFrac, MultiFrac, Extract, PetroFrac, and RateFrac. You can retrieve most column results using the following four-step process. See also RadFrac Thermosiphon Reboiler Results, Additional Data for PetroFrac Models, and Additional Data for RateFrac Models, this chapter. 1 Call subroutine TKNCOL to determine the number of columns for MultiFrac, PetroFrac, and RateFrac. 2 Call subroutine TKPROF to determine the dimensions of the profile. 3 Call subroutine TKPROP to list the properties. 4 Call subroutine TKPRO1 to retrieve the property values for non-component-dependent properties, or subroutine TKPRO2 to retrieve the property values for component-dependent properties. Most of the column subroutines take the argument ICOL, which represents the column number. This is always 1 for RadFrac and Extract. For MultiFrac and RateFrac this is the column number: 1, 2, and so on. With PetroFrac the main column is numbered 1 and the strippers are numbered starting with 2. The actual name of a stripper can be retrieved using TKPTRS. RateFrac models have segments rather than stages. The references to NSTAGE used in the descriptions of the column routines, apply to the number of segments in a RateFrac column. Number of Columns Call subroutine TKNCOL to determine the number of columns in a block using a staged separation model. TKNCOL returns a value of 1 for Aspen Plus models RadFrac and Extract. It returns the number of columns for MultiFrac and RateFrac. For PetroFrac, NCOL equals the number of strippers plus 1 for the main column. All other models return 0. Calling Sequence for TKNCOL CALL TKNCOL (BLKID, NCOL) Argument List Descriptions for TKNCOL Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID NCOL O INTEGER — Number of columns † I = Input to subroutine, O = Output from subroutine 50 3 Block Result Subroutines Column Profile Dimensions Call subroutine TKPROF to determine the sizes of column profile arrays. TKPROF returns the number of: Stages. Components present. Properties. Calling Sequence for TKPROF CALL TKPROF (BLKID, ICOL, NSTAGE, NCP, NPROP) Argument List Descriptions for TKPROF Variable I/O † Type BLKID I CHARACTER*(*) — Block ID ICOL I INTEGER — Column number NSTAGE O INTEGER — Number of stages NCP O INTEGER — Number of components present NPROP O INTEGER — Number of properties † I = Input to subroutine, Dimension Description O = Output from subroutine Column Profile Properties Call subroutine TKPROP to list the profile properties available for a block. Each property is identified as component-dependent or not. Calling Sequence for TKPROP CALL TKPROP (BLKID, ICOL, NPROP, ITYPES, PNAMES, IERR) Argument List Descriptions for TKPROP Variable I/O † Type Dimension BLKID I CHARACTER*(*) — Block ID ICOL I INTEGER — Column number NPROP I INTEGER — Number of properties ITYPES O INTEGER NPROP Property type (1=Non-component-dependent, 2=Component-dependent) PNAMES O CHARACTER*12 NPROP Property name. See Appendix B for a description. IERR O INTEGER Error flag (0=No error) — Description † I = Input to subroutine, O = Output from subroutine 3 Block Result Subroutines 51 Non-Component-Dependent Column Profiles Call subroutine TKPRO1 to retrieve the profile for a non-componentdependent property. This includes hydraulic properties. TKPRO1 returns a single units type and label for the entire profile. Calling Sequence for TKPRO1 CALL TKPRO1 (BLKID, PNAME, ICOL, NSTAGE, RVALS, TYPE, LABEL, IERR) Argument List Descriptions for TKPRO1 Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID PNAME I CHARACTER*12 — Property name returned by TKPROP ICOL I INTEGER — Column number NSTAGE I INTEGER — Number of stages RVALS O REAL*8 NSTAGE Property values TYPE O CHARACTER*12 — Units type LABEL O CHARACTER*16 — Units label IERR O INTEGER — Error flag (0=No error) † I = Input to subroutine, O = Output from subroutine Component-Dependent Column Profiles Call subroutine TKPRO2 to retrieve the profile for a component-dependent property. The results are in the RVALS array, which returns NCP * NSTAGE results. Treat RVALS as a one-dimensional array. All property results for a stage are stored consecutively. TKPRO2 returns a single units type and label for the entire profile. Calling Sequence for TKPRO2 CALL TKPRO2 (BLKID, PNAME, ICOL, NCP, COMPID, NSTAGE, RVALS, TYPE, LABEL, IERR) Argument List Descriptions for TKPRO2 52 Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID PNAME I CHARACTER*12 — Property name returned by TKPROP ICOL I INTEGER — Column number NCP I INTEGER — Number of components present COMPID O CHARACTER*8 NCP Component IDs NSTAGE I INTEGER — Number of stages 3 Block Result Subroutines Variable I/O † Type Dimension Description RVALS O REAL*8 NCP* NSTAGE Property values TYPE O CHARACTER*12 — Units types LABEL O CHARACTER*16 — Units labels IERR O INTEGER Error flag (0=No error) — † I = Input to subroutine, O = Output from subroutine RadFrac Thermosiphon Reboiler Results A RadFrac unit may optionally have a thermosiphon reboiler. You can retrieve this data using two steps: 1 Call TKTRNR to determine the numbers of results and components. 2 Call TKTRRS to retrieve the property names, results, and list of components. Number of Components Call subroutine TKTRNR to determine the number of components present, the number of component-dependent properties with results, and the number of properties with results that are non-component-dependent. If the unit does not have a thermosiphon reboiler, NRES, NCPROP, and NCP are all returned as 0. Calling Sequence for TKTRNR CALL TKTRNR (BLKID, NRES, NCPROP, NCP) Argument List Descriptions for TKTRNR Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID NRES O INTEGER — Number of non-componentdependent results NCPROP O INTEGER — Number of component-dependent properties NCP O INTEGER — Number of components present in reboiler † I = Input to subroutine, O = Output from subroutine Reboiler Results Call subroutine TKTRRS to retrieve the property names and values for the thermosiphon reboiler. Two sets of property names and values are returned: one for the component-dependent results and one for the non-componentdependent results. Note that the component-dependent data is returned in a single array, with all the results for a single property returned in consecutive elements of the CRVALS array. 3 Block Result Subroutines 53 Calling Sequence for TKTRRS CALL TKTRRS (BLKID, NRES, NCPROP, NCP, PNAME, RVALS, TYPES, LABELS, CPNAME, COMPID, CRVALS, IERR) Argument List for Subroutine TKTRRS Variable I/O † Type Dimension BLKID I CHARACTER*(*) — Block ID NRES I INTEGER — Number of non-componentdependent results NCPROP I INTEGER — Number of component-dependent results NCP I INTEGER — Number of components present in reboiler PNAMES O CHARACTER*12 NRES Property names for noncomponent-dependent results. See Appendix B for a description. RVALS O REAL*8 Results for non-componentdependent properties TYPES O CHARACTER*12 NRES Results types for non-componentdependent properties LABELS O CHARACTER*16 NRES Results labels for non-componentdependent properties CPNAME O CHARACTER*12 NCPROP Property names for componentdependent results COMPID O CHARACTER*8 NCP CRVALS O REAL*8 NCP* NCPROP Results for component-dependent properties IERR O INTEGER — NRES Description Component names Error flag (0=No error) † I = Input to subroutine, O = Output from subroutine Interconnecting Stream and Pumparound Results The MultiFrac and RateFrac models may contain interconnecting streams. The RadFrac model may contain pumparounds. You can retrieve the data for these streams and pumparounds using these two steps: 1 Call TKNICS to determine the number of interconnecting streams or pumparounds in the model. 2 Call TKICST to retrieve the results for all the interconnecting streams or pumparounds in a model. Number of Interconnecting Streams and Pumparounds Call subroutine TKNICS to determine the number of interconnecting streams present in a MultiFrac or RateFrac model. Also call TKNICS to determine the number of pumparounds in a RadFrac model. The value of NICST is returned 54 3 Block Result Subroutines as 0 if the model does not have any interconnecting streams or pumparounds. Calling Sequence for TKNICS CALL TKNICS (BLKID, NICST) Argument List Descriptions for TKNICS Variable I/O † Type Dimension BLKID I CHARACTER*(*) — Block ID NICST O INTEGER Number of interconnecting streams or pumparounds — Description † I = Input to subroutine, O = Output from subroutine Retrieving Results for Interconnecting Streams and Pumparounds Call subroutine TKICST to retrieve the results for MultiFrac or RateFrac interconnecting streams. Also call TKICST to retrieve the results for RadFrac pumparounds. The routine returns arrays containing the results for all the interconnecting streams or pumparounds in a model. Source and destination data are not returned for the RateFrac model, and zeros are returned for these properties. The mass and volume flows are also unavailable for the RateFrac model, and values of RMISS are returned for these properties. Calling Sequence for TKICST CALL TKICST (BLKID, NICST, ISCOL, ISSTG, IDCOL, IDSTG, TEMP, PRES, DUTY, VFRAC, FMOLE, FMASS, FVOL, IERR) Argument List Descriptions for TKICST Variable I/O † Type BLKID I CHARACTER*(*) — Block ID NICST I INTEGER — Number of interconnecting streams or pumparounds ISCOL O INTEGER NICST Source Column ISSTG O INTEGER NICST Source Stage IDCOL O INTEGER NICST Destination Column IDSTG O INTEGER NICST Destination Stage TEMP O REAL*8 NICST Temperature PRES O REAL*8 NICST Pressure DUTY O REAL*8 NICST Duty VFRAC O REAL*8 NICST Vapor Fraction FMOLE O REAL*8 NICST Mole Flow FMASS O REAL*8 NICST Mass Flow FVOL O REAL*8 NICST Standard liquid volume flow 3 Block Result Subroutines Dimension Description 55 Variable I/O † Type Dimension Description IERR O — Error flag (0=No error) INTEGER † I = Input to subroutine, O = Output from subroutine Additional Data for PetroFrac Models The PetroFrac model has a number of additional routines that retrieve the results for the pumparounds, furnace, and connectivity of the model. The PetroFrac model consists of a main column and a number of strippers. 1 Call subroutine TKNPET to determine the dimensions of the additional data. 2 Call subroutine TKPTRS to retrieve additional data for each column. 3 Call TKPTAD to list additional property profiles. 4 Call TKPTPR to retrieve the values of the additional property profiles. 5 Call subroutine TKPTFR to retrieve the PetroFrac furnace data. 6 Call subroutine TKFRCM to retrieve the values for component-dependent properties in the furnace. 7 Call subroutine TKPTPP to retrieve pumparound results for the PetroFrac columns. 8 Call subroutine TKPTCN to retrieve connectivity data for the strippers. Dimensions of Additional Data Call subroutine TKNPET for each column number in the PetroFrac model to determine the sizes of the additional data. If a type of data is not present for the column number, the size is returned as 0. The main column always returns 0 for NSTRCN and NCNRES. The strippers always return 0 for NPUMP, NPRRES, NFRCON, NFRRES, NFPROP, and NFCOMP. 56 3 Block Result Subroutines Calling Sequence for TKNPET CALL TKNPET (BLKID, ICOL, NMOLE, NMASS, NSVOL, NRES, NPUMP, NPRRES, NFRCON, NFRRES, NFPROP, NFCOMP, NSTRCN, NCNRES) Argument List Descriptions for TKNPET Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID ICOL I INTEGER — Column number NMOLE O INTEGER — Number of molar profile results NMASS O INTEGER — Number of mass profile results NSVOL O INTEGER — Number of standard liquid volume profile results NRES O INTEGER — Number of scalar column results NPUMP O INTEGER — Number of pumparounds NPRRES O INTEGER — Number of pumparound results NFRCON O INTEGER — Number of furnace streams NFRRES O INTEGER — Number of furnace results NFPROP O INTEGER — Number of furnace component properties NFCOMP O INTEGER — Number of furnace components NSTRCN O INTEGER — Number of connectivity streams NCNRES O INTEGER — Number of connectivity results † I = Input to subroutine, O = Output from subroutine Additional Scalar Results Data TKBRES (see Standard Scalar Block Results, this chapter) returns the convergence data for PetroFrac column numbers. Call subroutine TKPTRS to retrieve the additional scalar results data for each PetroFrac column number. Calling Sequence for TKPTRS CALL TKPTRS (BLKID, ICOL, NRES, NAME, PNAMES, RVALS, TYPES, LABELS, IERR) Argument List Descriptions for TKPTRS Variable I/O † Type BLKID I CHARACTER*(*) — Block ID ICOL I INTEGER — Column number NRES I INTEGER — Number of column results NAME O CHARACTER*8 — Side stripper name PNAMES O CHARACTER*12 NRES 3 Block Result Subroutines Dimension Description Property name. See Appendix B for a description. 57 Variable I/O † Type Dimension Description RVALS O REAL*8 NRES Results TYPES O CHARACTER*12 NRES Units type LABELS O CHARACTER*16 NRES Units label IERR O INTEGER Error flag (0=No error) — † I = Input to subroutine, O = Output from subroutine Additional PetroFrac Profile Properties Call TKPTAD to list the additional profile properties available for each column number. None of these properties is component-dependent (see Column Profile Properties, this chapter). There are three sets of additional properties for PetroFrac. These consist of similar properties. But the results are returned on either a molar, mass, or standard liquid volume basis, depending on the value you give for BASIS. The number of properties differs slightly for each BASIS, so ensure that NPROF is set to the correct value returned from TKNPET. The value of NPROF is NMOLE for MOLE BASIS, NMASS for MASS, and NSVOL for SVOL. Calling Sequence for TKPTAD CALL TKPTAD (BLKID, ICOL, NPROF, BASIS, PNAMES, IERR) Argument List Descriptions for TKPTAD Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID ICOL I INTEGER — Column number NPROF I INTEGER — Number of profile properties. (Use the value NMOLE, NMASS, or SVOL from TKNPET.) BASIS I CHARACTER*4 — Basis for profile (MOLE, MASS, or SVOL) PNAMES O CHARACTER*12 NPROF Property name. See Appendix B for a description. IERR O INTEGER Error flag (0=No error) — † I = Input to subroutine, O = Output from subroutine Additional Property Profiles Call TKPTPR to retrieve profiles for the PetroFrac additional properties. Calling Sequence for TKPTPR CALL TKPTPR 58 (BLKID, PNAME, ICOL, NSTAGE, BASIS, RVALS, TYPE, LABEL, IERR) 3 Block Result Subroutines Argument List Descriptions for TKPTPR Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID PNAME I CHARACTER*12 — Profile property name from TKPTAD ICOL I INTEGER — Column number NSTAGE I INTEGER — Number of stages BASIS I CHARACTER*4 — Basis for profile (MOLE, MASS, or SVOL) RVALS O REAL*8 NSTAGE Real values TYPE O CHARACTER*12 — Units type LABEL O CHARACTER*16 — Units label IERR O INTEGER Error flag (0=No error) — † I = Input to subroutine, O = Output from subroutine Furnace Data for PETROFRAC Call subroutine TKPTFR to retrieve the furnace data for PetroFrac. Data is returned for each connection between the furnace and a PetroFrac column. Supply the connection number in the ICON parameter. The connections are numbered sequentially, starting at 1. The total number of connections is given by the NFRCON parameter returned in TKNPET. Calling Sequence for TKPTFR CALL TKPTFR (BLKID, ICON, NFRRES, PNAMES, ITYPES, IVALS, CVALS, RVALS, TYPES, LABELS, IERR) Argument List Descriptions for TKPTFR Variable I/O † Type Dimension BLKID I CHARACTER*(*) — Block ID ICON I INTEGER — Connection number NFRRES I INTEGER — Number of properties PNAMES O CHARACTER*12 NFRRES Property name. See Appendix B for a description. ITYPES O INTEGER NFRRES Result type (1=Integer, 2=Real, 3=Character) IVALS O INTEGER NFRRES Integer values CVALS O CHARACTER*12 NFFRES RVALS O REAL*8 TYPES O CHARACTER*12 NFRRES Units type LABELS O CHARACTER*16 NFRRES Units label IERR O INTEGER Error flag (0=No error) NFRRES — Description Character values Real values † I = Input to subroutine, O = Output from subroutine 3 Block Result Subroutines 59 Component-Dependent Properties for the PetroFrac Furnace Call subroutine TKFRCM to retrieve the values for component-dependent properties in the PetroFrac furnace. The property names and the results are returned. The real values are returned. All the data for a property are arranged sequentially in the array, followed by all the data for the second property, and so on. Since all the properties are dimensionless, TYPES and LABELS return blank strings. Calling Sequence for TKFRCM CALL TKFRCM (BLKID, NFPROP, NFCOMP, PNAMES, COMPID, RVALS, TYPES, LABELS, IERR) Argument List Descriptions for TKFRCM Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID NFPROP I INTEGER — Number of properties NFCOMP I INTEGER — Number of components PNAMES O CHARACTER*12 NFPROP COMPID O CHARACTER*8 NFCOMP RVALS O REAL*8 NFCOMP* NFPROPReal values TYPES O CHARACTER*12 NFPROP Units type LABELS O CHARACTER*16 NFPROP Units label IERR O INTEGER Error flag (0=No error) Property name. See Appendix B for a description. Component names — † I = Input to subroutine, O = Output from subroutine Pumparound Results for PetroFrac Columns Call subroutine TKPTPP to retrieve pumparound results for the PetroFrac columns. Supply the pumparound number in the IPUMP parameter. The pumparounds are numbered sequentially, starting at 1. The total number of pumparounds is given by the NPUMP parameter returned in TKNPET. Calling Sequence for TKPTPP CALL TKPTPP (BLKID, IPUMP, NPRRES, PNAMES, ITYPES, IVALS, RVALS, TYPES, LABELS, IERR) Argument List Descriptions for TKPTPP 60 Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID IPUMP I INTEGER — Pumparound number NPRRES I INTEGER — Number of properties 3 Block Result Subroutines Variable I/O † Type PNAMES O CHARACTER*12 NPRRES Property name. See Appendix B for a description. ITYPES O INTEGER NPRRES Result type (1=Integer, 2=Real) IVALS O INTEGER NPRRES Integer values RVALS O REAL*8 NPPRES Real values TYPES O CHARACTER*12 NPRRES Units type LABELS O CHARACTER*16 NPRRES Units label IERR O INTEGER Error flag (0=No error) † I = Input to subroutine, Dimension — Description O = Output from subroutine Connectivity Data for PetroFrac Strippers Call subroutine TKPTCN to retrieve connectivity data for the PetroFrac strippers. Specify the column number of the stripper in ICOL and the connection number in ICON. The connections are numbered sequentially, starting at 1. The total number of connections for each stripper is given by the NSTRCN parameter in TKNPET. Calling Sequence for TKPTCN CALL TKPTCN (BLKID, ICOL, ICON, NCNRES, PNAMES, ITYPES, IVALS, CVALS, RVALS, TYPES, LABELS, IERR) Argument List Descriptions for TKPTCN Variable I/O † Type Dimension BLKID I CHARACTER*(*) — Block ID ICOL I INTEGER — Column number ICON I INTEGER — Connection number NCNRES I INTEGER — Number of properties PNAMES O CHARACTER*12 NCNRES Property name. See Appendix B for a description. ITYPES O INTEGER NCNRES Result type (1=Integer, 2=Real) IVALS O INTEGER NCNRES Integer values CVALS O CHARACTER*12 NCNRES Character values RVALS O REAL*8 Real values TYPES O CHARACTER*12 NCNRES Units type LABELS O CHARACTER*16 NCNRES Units label IERR O INTEGER Error flag (0=No error) NCNRES — Description † I = Input to subroutine, O = Output from subroutine 3 Block Result Subroutines 61 Additional Data for RateFrac Models The RateFrac model has additional routines to retrieve further scalar block results, the component split fractions in the outlet streams, and the number of liquid phases in each segment of the column. You can retrieve the additional scalar results data, using a two-step process: 1 Call subroutine TKRTNR to determine the dimensions of the additional scalar results data. 2 Call subroutine TKRTRS to retrieve the additional scalar results for each column. You can retrieve the split fractions of each component in the outlet streams, using a two-step process: 1 Call subroutine TKRTSP to determine the dimensions of the split fractions. 2 Call subroutine TKRTSP to retreive the split fraction results. Call subroutine TKRTNL to determine the number of liquid phases in each segment of a column. Dimensions of Additional Scalar Data Call subroutine TKRTNR for each column number in the RateFrac model, to determine the sizes for the additional data. NRES is returned as zero if the model has no additional scalar results. Calling Sequence for TKRTNR CALL TKRTNR (BLKID, ICOL, NRES) Argument List Descriptions for TKRTNR Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID ICOL I INTEGER — Column number NRES O INTEGER — Number of scalar results † I = Input to subroutine, O = Output from subroutine Additional Scalar Results Data TKBRES (see Standard Scalar Block Results, this chapter) returns the convergence data for the RateFrac column. Call subroutine TKRTRS to retrieve the additional scalar data for each RateFrac column. Calling Sequence for TKRTRS CALL TKRTRS 62 (BLKID, ICOL, NRES, PNAMES, RVALS, TYPES, LABELS, IERR) 3 Block Result Subroutines Argument List Descriptions for TKRTRS Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID ICOL I INTEGER — Column number NRES O INTEGER — Number of scalar results PNAMES O CHARACTER*12 — RVALS O REAL*8 TYPES O CHARACTER*12 NRES Unit types LABELS O CHARACTER*16 NRES Unit labels IERR O INTEGER Error flag (0=No error) NRES — Property names. See Appendix B for a description. Real values † I = Input to subroutine, O = Output from subroutine Dimensions of Component Split Fractions Call subroutine TKRTSP to determine the dimensions of the component split fraction results. Calling Sequence for TKRTSP CALL TKRTSP (BLKID, NCP, NSTREAM) Argument List Descriptions for TKRTSP Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID NCP O INTEGER — Number of components in outlet streams NSTREAM O INTEGER — Number of outlet streams † I = Input to subroutine, O = Output from subroutine Component Split Fractions Call subroutine TKRTSR to retrieve the component split fractions in the RateFrac outlet streams. The results are ordered in the SFRACS array so that all the fractions for a component are returned consecutively. Calling Sequence for TKRTSR CALL TKRTSR 3 Block Result Subroutines (BLKID, NCP, NSTREAM, COMPID, STRMID, SFRACS, IERR) 63 Argument List Descriptions for TKRTSR Variable I/O † Type Dimension Description BLKID I CHARACTER*(* — ) Block ID NCP I INTEGER — Number of components in outlet streams NSTREAM I INTEGER — Number of outlet streams COMPID O CHARACTER*8 NCP Component IDs STRMID O CHARACTER*8 NSTREAM Outlet Stream IDs SFRACS O REAL*8 NSTREAM* NCPComponent Split Fractions IERR O INTEGER — Error flag (0=No error) † I = Input to subroutine, O = Output from subroutine Number of Liquid Phases Call subroutine TKRTNL to get the number of liquid phases in each segment of the specified column. Calling Sequence for TKRTNL CALL TKRTNL (BLKID, ICOL, NSTAGE, NLIQ, IERR) Argument List Descriptions for TKRTNL Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID ICOL I INTEGER — Column number NSTAGE I INTEGER — Number of sections (Use NSTAGE from TKPROF) NLIQ I INTEGER NSTAGE Number of liquid phases IERR O INTEGER — Error flag (0=No error) † I = Input to subroutine, O = Output from subroutine Tray Reports Tray report results are calculated when the Tray-Report option is chosen for a rigorous distillation model. The user defines the properties calculated and the stages for which they are calculated. Tray Report Dimensions Call subroutine TKTREP to determine the dimensions of the tray report for a block. TKTREP returns the number of stages for which properties are calculated, and the number of properties in the tray report. 64 3 Block Result Subroutines Calling Sequence for TKTREP CALL TKTREP (BLKID, ICOL, NSTAGE, NPROP) Argument List Descriptions for TKTREP Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID ICOL I INTEGER — Column number NSTAGE O INTEGER — Number of stage values NPROP O INTEGER — Total number of properties † I = Input to subroutine, O = Output from subroutine Sequential Tray Report Properties Call subroutine TKNTPR to retrieve the next property from a tray report. Use the property sequence number INUM to specify the property. TKNTPR returns the list of stage numbers, the property value, the property set qualifiers, and the units type and label. Calling Sequence for TKNTPR CALL TKNTPR (BLKID, ICOL, INUM, NSTAGE, ISTAGE, PNAME, SUBSID, PHASE, COMPID, WETDRY, BASIS, RVALS, TYPE, LABEL, IERR) Argument List Descriptions for TKNTPR Variable I/O † Type Dimension BLKID I CHARACTER*(*) — Block ID ICOL I INTEGER — Column number INUM I INTEGER — Property sequence number NSTAGE I INTEGER — Number of stage values ISTAGE O INTEGER NSTAGE List of stage numbers PNAME O CHARACTER*12 — SUBSID O CHARACTER*8 — Substream ID PHASE O CHARACTER*8 — Phase COMPID O CHARACTER*8 — Component ID WETDRY O CHARACTER*4 — Wet/dry basis (WET or DRY) †† BASIS O CHARACTER*4 — Units basis (MOLE, MASS, or FLOW) RVALS O REAL*8 NSTAGE Property values TYPE O CHARACTER*12 — Units type LABEL O CHARACTER*16 — Units label IERR O INTEGER Error flag (0=No error) — Description Property name. See Appendix B for a description. † I = Input to subroutine, O = Output from subroutine †† Can be left unspecified. 3 Block Result Subroutines 65 Specific Tray Report Properties Call subroutine TKTPRP to retrieve a specific property from the tray report for a block. The property is identified by specifying the property set qualifiers (PNAME, SUBSID, PHASE, COMPID, WETDRY, BASIS). Before calling TKTPRP, make sure that all the qualifiers are either set to the desired values or unset. TKTPRP returns the list of stage numbers, the property values, and the units type and label. Calling Sequence for TKTPRP CALL TKTPRP (BLKID, ICOL, NSTAGE, ISTAGE, PNAME, SUBSID, PHASE, COMPID, WETDRY, BASIS, RVALS, TYPE, LABEL, IERR) Argument List Descriptions for TKTPRP Variable I/O † Type Dimension BLKID I CHARACTER*(*) — Block ID ICOL I INTEGER — Column number NSTAGE I INTEGER — Number of stage values ISTAGE O INTEGER NSTAGE List of stage numbers PNAME I CHARACTER*12 — SUBSID I CHARACTER*8 — Substream ID PHASE I CHARACTER*8 — Phase COMPID I CHARACTER*8 — Component ID WETDRY I CHARACTER*4 — Wet/dry basis (WET or DRY)†† BASIS I CHARACTER*4 — Units basis (MOLE, MASS, or FLOW) RVALS O REAL*8 NSTAGE Property values TYPE O CHARACTER*12 — Units type LABEL O CHARACTER*16 — Units label IERR O INTEGER Error flag (0=No error) — Description Property name. See Appendix B for a list of valid property names. † I = Input to subroutine, O = Output from subroutine †† Can be left unspecified. Tray/Packing Sizing and Rating You can retrieve column tray/packing sizing and rating data for the rigorous distillation models RadFrac, MultiFrac, and PetroFrac. You can retrieve the results using a seven-step process: 66 1 Call subroutine TKNCOL to determine the number of columns where appropriate. 2 Call subroutine TKNSEC to determine the number of sections in the column. 3 Call subroutine TKLSEC to list the column section types and their numbers. 3 Block Result Subroutines 4 Call subroutine TKSSEC to determine the dimensions of a section. 5 Call subroutine TKSCRS to retrieve the scalar results for the column section. 6 Call subroutine TKPSEC to obtain a list of the properties in a section profile. 7 Call subroutine TKSCPR to retrieve the profile data for a named property in a section. Several subroutines below have a TYPE or TYPES argument for section types. The possible values are: TYPE value Type of column section TRAY-SIZE Tray sizing TRAY-RATE Tray rating PACK-SIZE Packed sizing PACK-RATE Packed rating Number of Columns If you want to retrieve MultiFrac or PetroFrac data, call TKNCOL. (See Column Results, this chapter.) Omit this step if you want to retrieve RadFrac data. Number of Column Sections Call subroutine TKNSEC to determine the number of Tray/Packing Sizing and Rating calculation sections in the column. Calling Sequence for TKNSEC CALL TKNSEC (BLKID, ICOL, NSECT, IERR) Argument List Descriptions for TKNSEC Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID ICOL I INTEGER — Column number (MultiFrac and PetroFrac) NSECT O INTEGER — Number of sections IERR O INTEGER — Error flag (0=No error) † I = Input to subroutine, O = Output from subroutine Column Section Types and Numbers Call subroutine TKLSEC to list the section types and numbers used to identify individual sections. Calling Sequence for TKLSEC CALL TKLSEC 3 Block Result Subroutines (BLKID, ICOL, NSECT, TYPES, NUMBRS, IERR) 67 Argument List Descriptions for TKLSEC Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID ICOL I INTEGER — Column number. (MultiFrac and PetroFrac) NSECT I INTEGER — Number of sections TYPES O CHARACTER*12 NSECT Types of column sections (see above) NUMBRS O INTEGER NSECT Section numbers IERR O INTEGER — Error flag (0=No error) † I = Input to subroutine, O = Output from subroutine Size of a Column Section Call subroutine TKSSEC to determine the dimensions of a section. TKSSEC returns the number of: Stages in a section. Scalar properties. Profile properties. Profile properties have a value for each stage in a section. Scalar properties have a single value for a section as a whole. Calling Sequence for TKSSEC CALL TKSSEC (BLKID, ICOL, TYPE, NUMBER, NSTAGE, NPROF, NSCAL, IERR) Argument List Descriptions for TKSSEC Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID ICOL I INTEGER — Column number (MultiFrac and PetroFrac) TYPE I CHARACTER*12 — Section type (see above) NUMBER I INTEGER — Section number NSTAGE O INTEGER — Number of stages in the section NPROF O INTEGER — Number of profile properties NSCAL O INTEGER — Number of scalar properties IERR O INTEGER — Error flag (0=No error) † I = Input to subroutine, O = Output from subroutine 68 3 Block Result Subroutines Scalar Results for a Column Section Call subroutine TKSCRS to retrieve the section results for the scalar properties. Calling Sequence for TKSCRS CALL TKSCRS (BLKID, ICOL, TYPE, NUMBER, NSCAL, PNAMES, ITYPES, IVALS, CVALS, RVALS, UTYPES, LABELS, IERR) Argument List Descriptions for TKSCRS Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID ICOL I INTEGER — Column number (MultiFrac and PetroFrac) TYPE I CHARACTER*12 — Section type (see above) NUMBER I INTEGER — Section number NSCAL I INTEGER — Number of scalar properties PNAMES O CHARACTER*12 NSCAL Property name. See Appendix B for a description. ITYPES O INTEGER NSCAL Result types (1=Integer value 2=Real*8 value 3=Character*12 value)†† IVALS O INTEGER NSCAL Integer result CVALS O CHARACTER*12 NSCAL Character result RVALS O REAL*8 NSCAL Real result UTYPES O CHARACTER*12 NSCAL Units types LABELS O CHARACTER*16 NSCAL Units labels IERR O INTEGER — Error flag (0=No error) † I = Input to subroutine, O = Output from subroutine †† For each result, the value in ITYPE specifies which array contains the result (IVALS, CVALS, or RVALS). For example, if ITYPE(4) is 2, then IVALS(4) is 0, CVALS(4) is blank and RVALS(4) contains the result. Column Section Profile Properties Call routine TKPSEC to retrieve the list of properties for a specified section profile. TKPSEC returns an array of property names. When you specify a tray rating section type, TKPSEC also returns an array indicating if the property belongs to panel A, B, C, or D. Calling Sequence for TKPSEC CALL TKPSEC 3 Block Result Subroutines (BLKID, ICOL, TYPE, NUMBER, NPROF, PNAMES, PANELS, IERR) 69 Argument List Descriptions for TKPSEC Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID ICOL I INTEGER — Column number (MultiFrac and PetroFrac) TYPE I CHARACTER*12 — Section type (see above) NUMBER I INTEGER — Section number NPROF I INTEGER — Number of profile properties PNAMES O CHARACTER*12 NPROF PANELS O CHARACTER*1 NPROF Panel identifier (A, B, C, D) (TRAY-RATE only) IERR O INTEGER — Error flag (0=No error) Property name. See Appendix B for a description. † I = Input to subroutine, O = Output from subroutine Column Section Profiles Call subroutine TKSCPR to retrieve the section profile data for the named property. If the section type is TRAY-RATE, you must specify the panel. Calling Sequence for TKSCPR CALL TKSCPR (BLKID, ICOL, TYPE, NUMBER, NSTAGE, ISTAGE, PNAME, PANEL, RVALS, UTYPE, LABEL, IERR) Argument List Descriptions for TKSCPR Variable I/O † Type Dimension BLKID I CHARACTER*(*) — Block ID ICOL I INTEGER — Column number (MultiFrac and PetroFrac) TYPE I CHARACTER*12 — Section type (see above) NUMBER I INTEGER — Section number NSTAGE I INTEGER — Number of stages in section ISTAGE O INTEGER NSTAGE List of stage numbers PNAME I CHARACTER*12 — PANEL I CHARACTER*1 — Panel identifier (A, B, C, D) (TRAY-RATE only) RVALS O REAL*8 NSTAGE Property values UTYPE O CHARACTER*12 — Units type LABEL O CHARACTER*16 — Units label IERR O INTEGER Error flag (0=No error) — Description Property name from TKPSEC † I = Input to subroutine, O = Output from subroutine 70 3 Block Result Subroutines Reactor Results You can retrieve reactor profile results from the summary file for the reactor models RPlug and RBatch. You can also retrieve the vent accumulator and vent profile results for the RBatch model. (See RBatch Vent Accumulator Results, and RBatch Vent Profile Results, this chapter.) You can retrieve reaction data for the RStoic, REquil and RGibbs models. (See Reaction Data, this chapter.) Retrieving reactor profile results is a four-step process: 1 Call subroutine TKRSUB to determine the number of substreams. 2 Call subroutine TKRPRF to determine the dimensions of the profile. 3 Call subroutine TKRPRP to list the properties. 4 Retrieve the property values. Call subroutine TKRPR1 for non-componentdependent properties. Call subroutine TKRPR2 for component-dependent properties. Call subroutines TKRNAC, TKRNCA, TKRSCA, and TKRCAT to retrieve the property values for the component attributes of a solid substream. Call subroutines TKRNFS and TKRFSP to retrieve the property values for the continuous feed stream to the RBatch block. Number of Reactor Substreams Call subroutine TKRSUB to determine the number of substreams in a block modeled using the rigorous reactor models RBatch and RPlug. All other models return a value of 0. Calling Sequence for TKRSUB CALL TKRSUB (BLKID, NSUB) Argument List Descriptions for TKRSUB Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID NSUB O INTEGER — Number of substreams † I = Input to subroutine, O = Output from subroutine Reactor Profile Dimensions Call subroutine TKRPRF to determine the sizes of the reactor profile arrays for the specified substream. TKRPRF returns the: Substream ID for the requested substream. Number of output points. Number of components present. Number of properties. Calling Sequence for TKRPRF CALL TKRPRF 3 Block Result Subroutines (BLKID, ISUB, SUBSID, NPOINT, NCP, NPROP) 71 Argument List Descriptions for TKRPRF Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID ISUB I INTEGER — Substream number SUBSID O CHARACTER*8 — Substream ID NPOINT O INTEGER — Number of output points NCP O INTEGER — Number of components present NPROP O INTEGER — Number of properties † I = Input to subroutine, O = Output from subroutine Reactor Profile Properties Call subroutine TKRPRP to list the reactor profile properties for a specified substream. TKRPRP returns an array of property names. TKRPRP also returns the array ITYPES, which indicates whether the property is componentdependent, not component-dependent, a component attribute, or a continuous feed stream property. Calling Sequence for TKRPRP CALL TKRPRP (BLKID, SUBSID, NPROP, ITYPES, PNAMES, IERR) Argument List Descriptions for TKRPRP Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — SUBSID I CHARACTER*8 — Substream ID NPROP I INTEGER — Number of properties ITYPES O INTEGER NPROP Property type: 1=Non-component-dependent 2=Component-dependent 3=Component attributes 4=Continuous feed stream property PNAMES O CHARACTER*12 NPROP Property name. See Appendix B for a description. IERR O INTEGER Error flag (0=No error) — Block ID † I = Input to subroutine, O = Output from subroutine Non-Component-Dependent Reactor Profiles Call subroutine TKRPR1 to retrieve reactor profiles for non-componentdependent properties. 72 3 Block Result Subroutines Calling Sequence for TKRPR1 CALL TKRPR1 (BLKID, PNAME, SUBSID, NPOINT, RVALS, TYPE, LABEL, IERR) Argument List Descriptions for TKRPR1 Variable I/O † Type Dimension BLKID I CHARACTER*(*) — Block ID PNAME I CHARACTER*12 — Property name from TKRPRP SUBSID I CHARACTER*8 — Substream ID NPOINT I INTEGER — Number of output points RVALS O REAL*8 NPOINT Property values TYPE O CHARACTER*12 — Units type LABEL O CHARACTER*16 — Units label IERR O INTEGER Error flag (0=No error) — Description † I = Input to subroutine, O = Output from subroutine Component-Dependent Reactor Profiles Call subroutine TKRPR2 to retrieve reactor profiles for component-dependent properties. The results are returned in the RVALS array, with all the component data for a point stored consecutively. Calling Sequence for TKRPR2 CALL TKRPR2 (BLKID, PNAME, SUBSID, NCP, COMPID, NPOINT, RVALS, TYPE, LABEL, IERR) Argument List Descriptions for TKRPR2 Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID PNAME I CHARACTER*12 — Property name from TKRPRP SUBSID I CHARACTER*8 — Substream ID NCP I INTEGER — Number of components present COMPID O CHARACTER*8 NCP Component IDs NPOINT I INTEGER — Number of output points RVALS O REAL*8 NCP* NPOINT Property values TYPE O CHARACTER*12 — Units type LABEL O CHARACTER*16 — Units label IERR O INTEGER — Error flag (0=No error) † I = Input to subroutine, O = Output from subroutine 3 Block Result Subroutines 73 Number of Components with Component Attribute Results Call subroutine TKRNAC to retrieve the number of components that are reported for the component attribute property. Calling Sequence for TKRNAC CALL TKRNAC (BLKID, SUBSID, NCP) Argument List Descriptions for TKRNAC Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID SUBSID I CHARACTER*8 — Substream ID NCP O INTEGER — Number of components † I = Input to subroutine, O = Output from subroutine Number of Attributes for a Component Call subroutine TKRNCA to determine the number of attributes a property has for a specified component. The component is specified by supplying the sequence number of the component (for example, 1 for the first component). The corresponding component ID is returned. Calling Sequence for TKRNCA CALL TKRNCA (BLKID, SUBSID, ICP, COMPID, NATT) Argument List Descriptions for TKRNCA Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — SUBSID I CHARACTER*8 — Substream ID ICP I INTEGER — Component sequence number COMPID O CHARACTER*8 — Component ID NATT O INTEGER — Number of attributes Block ID † I = Input to subroutine, O = Output from subroutine Details of a Component Attribute Call subroutine TKRSCA to retrieve the number of elements the component attribute has. The component attribute is specified by supplying the sequence number of the component attribute (for example, 1 for the first attribute). The corresponding component attribute ID is returned. Calling Sequence for TKRSCA CALL TKRSCA 74 (BLKID, SUBSID, COMPID, IDSEQ, IDATT, NELEM) 3 Block Result Subroutines Argument List Descriptions For TKRSCA Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID SUBSID I CHARACTER*8 — Substream ID COMPID I CHARACTER*8 — Component ID IDSEQ I INTEGER — Sequence number of attribute IDATT O CHARACTER*8 — Attribute ID NELEM O INTEGER — Number of elements † I = Input to subroutine, O = Output from subroutine Component Attribute Results Call subroutine TKRCAT to retrieve the results for all the elements of a specified component attribute. (The results are returned in the RVALS array with all the data for a point stored consecutively.) The names of the elements are also returned. Calling Sequence for TKRCAT CALL TKRCAT (BLKID, SUBSID, COMPID, IDATT, NELEM, NPOINT, ELEMID, RVALS, IERR) Argument List Descriptions For TKRCAT Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID SUBSID I CHARACTER*8 — Substream ID COMPID I CHARACTER*8 — Component ID IDATT I CHARACTER*8 — Attribute ID NELEM I INTEGER — Number of elements NPOINT I INTEGER — Number of points ELEMID O CHARACTER*8 NELEM Element names RVALS O REAL*8 NELEM* POINT Property values IERR O INTEGER — Error flag (0=No error) † I = Input to subroutine, O = Output from subroutine Number of Continuous Feed Streams Call subroutine TKRNFS to determine the number of continuous feed streams to an RBatch block. This number is used for the continuous feed stream properties. Calling Sequence for TKRNFS CALL TKRNFS 3 Block Result Subroutines (BLKID, SUBSID, NFS) 75 Argument List Descriptions For TKRNFS Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID SUBSID I CHARACTER*8 — Substream ID NFS O INTEGER — Number of continuous feed streams † I = Input to subroutine, O = Output from subroutine Continuous Feed Stream Results Call subroutine TKRFSP to retrieve the results for a continuous feed stream to an RBatch block. The continuous feed stream number is specified (for example, 1 for the first stream). The name of this stream and the property results are returned. Calling Sequence for TKRFSP CALL TKRSFP (BLKID, SUBSID, IFEED, IDFEED, PNAME, NPOINT, RVALS, TYPE, LABEL, IERR) Argument List Descriptions For TKRFSP Variable I/O † Type Dimension BLKID I CHARACTER*(*) — SUBSID I CHARACTER*8 — Substream ID IFEED I INTEGER — Feed stream number IDFEED O CHARACTER*8 — Continuous feed stream ID PNAME I CHARACTER*12 — Property name from TKRPRP NPOINT I INTEGER — Number of points RVALS O REAL*8 NPOINT Property values TYPE O CHARACTER*12 — Units type LABEL O CHARACTER*16 — Units label IERR O INTEGER Error flag (0=No error) — Description Block ID † I = Input to subroutine, O = Output from subroutine RBATCH Vent Accumulator Results Retrieving the vent accumulator profiles for the RBatch model requires three additional steps: 76 1 Call subroutine TKVAPF to determine the dimensions of the profile. 2 Call subroutine TKVAPR to list the properties. 3 Call subroutine TKVAR1 to retrieve the property values for noncomponent-dependent properties, or subroutine TKVAR2 to retrieve the property values for component-dependent properties. 3 Block Result Subroutines Vent Accumulator Profile Dimensions Call subroutine TKVAPF to determine the sizes of profile arrays for the vent accumulator. TKVAPF returns the number of: Output points. Components present. Properties. Calling Sequence for TKVAPF CALL TKVAPF (BLKID, NPOINT, NCP, NPROP) Argument List Descriptions for TKVAPF Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID NPOINT O INTEGER — Number of output points NCP O INTEGER — Number of components present NPROP O INTEGER — Number of properties † I = Input to subroutine, O = Output from subroutine Vent Accumulator Profile Properties Call subroutine TKVAPR to list the RBatch vent accumulator profile properties. TKVAPR returns an array of property names, and an array indicating whether or not the property is component-dependent. Calling Sequence for TKVAPR CALL TKVAPR (BLKID, NPROP, ITYPES, PNAMES, IERR) Argument List Descriptions for TKVAPR Variable I/O † Type Dimension BLKID I CHARACTER*(*) — Block ID NPROP I INTEGER — Number of properties ITYPES O INTEGER NPROP Property type: 1=Non-component-dependent 2=Component-dependent PNAMES O CHARACTER*12 NPROP Property name. See Appendix B for a description. IERR O INTEGER Error flag (0=No error) — Description † I = Input to subroutine, O = Output from subroutine 3 Block Result Subroutines 77 Non-Component-Dependent Vent Accumulator Profiles Call subroutine TKVAR1 to retrieve RBatch vent accumulator profiles for noncomponent-dependent properties. Calling Sequence for TKVAR1 CALL TKVAR1 (BLKID, PNAME, NPOINT, RVALS, TYPE, LABEL, IERR) Argument List Descriptions for TKVAR1 Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID PNAME I CHARACTER*12 — Property name from TKVAPR NPOINT I INTEGER — Number of output points RVALS O REAL*8 NPOINT Property values TYPE O CHARACTER*12 — Units type LABEL O CHARACTER*16 — Units label IERR O INTEGER — Error flag (0=No error) † I = Input to subroutine, O = Output from subroutine Component-Dependent Vent Accumulator Profiles Call subroutine TKVAR2 to retrieve RBatch vent accumulator profiles for component-dependent properties. Calling Sequence for TKVAR2 CALL TKVAR2 (BLKID, PNAME, NCP, COMPID, NPOINT, RVALS, TYPE, LABEL, IERR) Argument List Descriptions for TKVAR2 Variable I/O † Type Dimension BLKID I CHARACTER*(*) — Block ID PNAME I CHARACTER*12 — Property name from TKVAPR NCP I INTEGER — Number of components present COMPID O CHARACTER*8 NCP Component IDs NPOINT I INTEGER — Number of output points RVALS O REAL*8 NCP* NPOINT Property values TYPE O CHARACTER*12 — Units type LABEL O CHARACTER*16 — Units label IERR O INTEGER Error flag (0=No error) — Description † I = Input to subroutine, O = Output from subroutine 78 3 Block Result Subroutines RBatch Vent Profile Results Retrieving the vent profiles for the RBatch model requires three steps: 1 Call subroutine TKVTPF to determine the dimensions of the profile. 2 Call subroutine TKVTPR to list the properties. 3 Call subroutine TKVTR1 to retrieve the property values for noncomponent-dependent properties, or subroutine TKVTR2 to retrieve the property values for component-dependent properties. Vent Profile Dimensions Call subroutine TKVTPF to determine the sizes of the profile arrays for the vent. TKVTPF returns the number of: Output points. Components present. Properties. Calling Sequence for TKVTPF CALL TKVTPF (BLKID, NPOINT, NCP, NPROP) Argument List Descriptions for TKVTPF Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID NPOINT O INTEGER — Number of output points NCP O INTEGER — Number of components present NPROP O INTEGER — Number of properties † I = Input to subroutine, O = Output from subroutine Vent Profile Properties Call subroutine TKVTPR to list the RBatch vent profile properties. TKVTPR returns an array of property names, and an array indicating whether or not the property is component-dependent. Calling Sequence for TKVTPR CALL TKVTPR (BLKID, NPROP, ITYPES, PNAMES, IERR) Argument List Descriptions for TKVTPR Variable I/O † Type BLKID I CHARACTER*(*) — Block ID NPROP I INTEGER — Number of properties ITYPES O INTEGER NPROP Property type (1=Non-component-dependent, 2=Component-dependent) 3 Block Result Subroutines Dimension Description 79 Variable I/O † Type Dimension Description PNAMES O CHARACTER*12 NPROP Property name. See Appendix B for a description. IERR O INTEGER Error flag (0=No error) — † I = Input to subroutine, O = Output from subroutine Non-Component-Dependent Vent Profiles Call subroutine TKVTR1 to retrieve RBatch vent profiles for non-componentdependent properties. Calling Sequence for TKVTR1 CALL TKVTR1 (BLKID, PNAME, NPOINT, RVALS, TYPE, LABEL, IERR) Argument List Descriptions for TKVTR1 Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID PNAME I CHARACTER*12 — Property name from TKVTPR NPOINT I INTEGER — Number of output points RVALS O REAL*8 NPOINT Property values TYPE O CHARACTER*12 — Units type LABEL O CHARACTER*16 — Units label IERR O INTEGER — Error flag (0=No error) † I = Input to subroutine, O = Output from subroutine Component-Dependent Vent Profiles Call subroutine TKVTR2 to retrieve RBatch vent profiles for componentdependent properties. Calling Sequence for TKVTR2 CALL TKVTR2 (BLKID, PNAME, NCP, COMPID, NPOINT, RVALS, TYPE, LABEL, IERR) Argument List Descriptions for TKVTR2 80 Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID PNAME I CHARACTER*12 — Property name from TKVTPR NCP I INTEGER — Number of components present COMPID O CHARACTER*8 NCP Component Ids NPOINT I INTEGER — Number of output points RVALS O REAL*8 NCP* NPOINT Property values TYPE O CHARACTER*12 — Units type 3 Block Result Subroutines Variable I/O † Type Dimension LABEL O CHARACTER*16 — Units label IERR O INTEGER Error flag (0=No error) — Description † I = Input to subroutine, O = Output from subroutine Reaction Data You can retrieve the reaction equilibrium constants for each reaction in the REquil and RGibbs models. For the RStoic model you can retrieve the reaction extent and the heat of reaction for each reaction. You can also retrieve the component selectivity for RStoic. You can retrieve reaction data using a threestep process: 1 Call subroutine TKRRPF to determine the number of reactions. 2 Call subroutine TKRRPR to retrieve the equilibrium constants or reaction data. 3 Call subroutine TKRRHR to retrieve the heat of reaction data for RStoic. Use these additional two steps to retrieve the component selectivity results: 4 Call subroutine TKRRNS to determine the number of selectivity results. 5 Call subroutine TKRRSL to retrieve the component selectivity results. Number of Reactions Call subroutine TKRRPF to determine the number of reactions in the REquil, RGibbs, and RStoic models. Calling Sequence for TKRRPF CALL TKRRPF (BLKID, NREAC) Argument List Descriptions for TKRRPF Variable I/O Type Dimension Description BLKID I CHARACTER*(*) — Block ID NREAC O INTEGER — Number of reactions † † I = Input to subroutine, O = Output from subroutine Reaction Results Call subroutine TKRRPR to retrieve the reaction results. TKRRPR returns a single property, equilibrium constant for REquil and RGibbs models, and reaction extent for RStoic models. Specify NPROP as 1. Calling Sequence for TKRRPR CALL TKRRPR 3 Block Result Subroutines (BLKID, NPROP, NREAC, PNAMES, RVALS, TYPES, LABELS, IERR) 81 Argument List Descriptions for TKRRPR Variable I/O Type Dimension Description BLKID I CHARACTER*(*) — Block ID NPROP I INTEGER — Use NPROP = 1 Number of properties NREAC I INTEGER — Number of reactions PNAMES O CHARACTER*12 NPROP Property name. See Appendix B for a description. RVALS O REAL*8 NPROP* NREAC Real results TYPES O CHARACTER*12 NPROP Units type LABELS O CHARACTER*16 NPROP Units label IERR O INTEGER — Error flag (0=No error) † † I = Input to subroutine, O = Output from subroutine Heats of Reaction Call subroutine TKRRHR to retrieve the heats of reaction results for RStoic models. The heat of reaction and the ID of the reference component in the reaction are returned for each reaction. Calling Sequence for TKRRHR CALL TKRRHR (BLKID, NREAC, COMPID, RVALS, TYPE, LABEL, IERR) Argument List Descriptions for TKRRHR Variable I/O Type Dimension Description BLKID I CHARACTER*(*) — Block ID NREAC I INTEGER — Number of reactions COMPID O CHARACTER*12 NREAC Reference component ID RVALS O REAL*8 NREAC Real results TYPE O CHARACTER*12 — Units type LABEL O CHARACTER*16 — Units label IERR O INTEGER — Error flag (0=No error) † † I = Input to subroutine, O = Output from subroutine Number of Selectivity Results Call subroutine TKRRNS to determine the number of component selectivity specifications given for the RStoic model. Calling Sequence for TKRRNS CALL TKRRNS 82 (BLKID, NSEL) 3 Block Result Subroutines Argument List Descriptions for TKRRNS Variable I/O Type BLKID I CHARACTER*(*) — Block ID NSEL O INTEGER Number of selectivity specifications † Dimension — Description † I = Input to subroutine, O = Output from subroutine Reactor Component Selectivity Results Call subroutine TKRRSL to retrieve the results of each component selectivity specification. The reference/reactant component and product component, together with their substreams, are returned with the result for each selectivity specification. Calling Sequence for TKRRSL CALL TKRRSL (BLKID, NSEL, PCOMPS, PSUBS, RCOMPS, RSUBS, RVALS, IERR) Argument List Descriptions for TKRRSL Variable I/O BLKID I CHARACTER*(*) — Block ID NSEL I INTEGER — Number of selectivity specifications PCOMPS O CHARACTER*8 NSEL Product component PSUBS O CHARACTER*8 NSEL Product component substream RCOMPS O CHARACTER*8 NSEL Reference component (reactant) RSUBS O CHARACTER*8 NSEL Reference component substream RVALS O REAL*8 NSEL Component selectivity IERR O INTEGER — Error flag (0=No error) † Type Dimension Description † I = Input to subroutine, O = Output from subroutine 3 Block Result Subroutines 83 Reactor Property Reports Reactor report results are calculated in Aspen Plus when the PROP-REPORT option is used with the RPlug or RBatch models. The RBatch model allows you to choose the property report for the reactor, accumulator, or vent. You can retrieve each type of reactor property report using a three-step process: 1 Call TKLRRP to determine the number and types of reports available for the reactor. 2 Call TKSRRP to determine the size of a reactor report. 3 Call TKNRRP to retrieve the next property set property calculated for a reactor property report, or call TKRRRP to retrieve a specific property. The possible types of reports are: Type of report For PROP-REACTOR RBatch Reactor PROP-ACCUM RBatch Vent accumulator PROP-VENT RBatch Vent PROP-REPORT RPlug Reactor Number of Reports for a Reactor Block Call subroutine TKLRRP to determine the number and types of report available for the reactor. Calling Sequence for TKLRRP CALL TKLRRP (BLKID, NRPRT, TYPES, IERR) Argument List Descriptions for TKLRRP Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID NRPRT O INTEGER Number of reactor property reports TYPES O CHARACTER*12 3 Types of property reports (see above) IERR O INTEGER Error flag (0=No error) — — † I = Input to subroutine, O = Output from subroutine Size of a Reactor Property Report Call subroutine TKSRRP to determine the size of the reactor property report. TKSRRP returns the number of points in the report and the number of property sets calculated. 84 3 Block Result Subroutines Calling Sequence for TKSRRP CALL TKSRRP (BLKID, TYPE, NPOINT, NPROP, IERR) Argument List Descriptions for TKSRRP Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID TYPE I CHARACTER*12 — Type of property report (see above) NPOINT O INTEGER — Number of points NPROP O INTEGER — Number of properties IERR O INTEGER — Error flag (0=No error) † I = Input to subroutine, O = Output from subroutine Sequential Reactor Report Properties Call subroutine TKNRRP to retrieve the next property set calculated for a reactor property report. Use the property sequence number to identify the property. TKNRRP returns the property set qualifiers, the property values, and the units type and label. Calling Sequence for TKNRRP CALL TKNRRP (BLKID, TYPE, NPOINT, IPROP, PNAME, SUBSID, PHASE, COMPID, WETDRY, BASIS, RVALS, UTYPE, LABEL, IERR) Argument List Descriptions for TKNRRP Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID TYPE I CHARACTER*12 — Type of property report (see above) NPOINT I INTEGER — Number of points IPROP I INTEGER — Property sequence number PNAME O CHARACTER*12 — Property name. See Appendix B for a description. SUBSID O CHARACTER*8 — Substream ID PHASE O CHARACTER*8 — Phase COMPID O CHARACTER*8 — Component ID WETDRY O CHARACTER*4 — Wet/dry basis †† BASIS O CHARACTER*4 — Units basis (MOLE, MASS, or FLOW) RVALS O REAL*8 NPOINT Property values UTYPE O CHARACTER*12 — Units type LABEL O CHARACTER*16 — Units label IERR O INTEGER — Error flag (0=No error) † I = Input to subroutine, O = Output from subroutine †† Can be left unspecified 3 Block Result Subroutines 85 Specific Reactor Report Properties Call subroutine TKRRRP to retrieve a specific property from a reactor property report. The property is identified by specifying the property set qualifiers (PNAME, SUBSID, PHASE, COMPID, WETDRY, BASIS). TKRRRP returns the property values, the units type, and the units label. Calling Sequence for TKRRRP CALL TKRRRP (BLKID, TYPE, NPOINT, PNAME, SUBSID, PHASE, COMPID, WETDRY, BASIS, RVALS, UTYPE, LABEL, IERR) Argument List Descriptions for TKRRRP Variable I/O † Type Dimension BLKID I CHARACTER*(*) — Block ID TYPE I CHARACTER*12 — Type of property report (see above) NPOINT I INTEGER Number of points PNAME I CHARACTER*12 — SUBSID I CHARACTER*8 — Substream ID PHASE I CHARACTER*8 — Phase COMPID I CHARACTER*8 — Component ID WETDRY I CHARACTER*4 — Wet/dry basis (WET or DRY)†† BASIS I CHARACTER*4 — Units basis RVALS O REAL*8 NPOINT Property values UTYPE O CHARACTER*12 — Units type LABEL O CHARACTER*16 — Units label IERR O INTEGER Error flag (0=No error) — — Description Property name. See Appendix B for a list of valid property names. † I = Input to subroutine, O = Output from subroutine †† Can be left unspecified. Pipeline Results You can retrieve all the pipeline model results with the toolkit. Retrieve block results using the standard block result routine TKBRES. Retrieve other results using the routines described in this section. Retrieving all the additional pipeline results is a ten-step process: 86 1 Call subroutine TKPLSZ to retrieve the dimensions of the pipeline results. 2 Call subroutine TKPLIO to retrieve the inlet and outlet conditions. 3 Call subroutine TKPLCP to retrieve the inlet and outlet property names for components in a pipeline. 4 Call subroutine TKPLCO to retrieve the inlet and outlet conditions for components in a pipeline. 3 Block Result Subroutines 5 Call subroutine TKPLSP to retrieve the segment data property names. 6 Call subroutine TKPLSG to retrieve the segment data. 7 Call subroutine TKPLNP to retrieve the node property names. 8 Call subroutine TKPLND to retrieve the node results. 9 Call subroutine TKPLPP to retrieve the pipeline profile property names. 10 Call subroutine TKPLPR to retrieve the pipeline profile data. Pipeline Results Dimensions Call subroutine TKPLSZ to retrieve the dimensions of the pipeline results. TKPLSZ returns the number of each type of pipeline results. Calling Sequence for TKPLSZ CALL TKPLSZ (BLKID, NIORES, NCC, NCCPRP, NSEG, NSGPRP, NNODE, NNDPRP, NPOINT, NPROF, IERR) Argument List Descriptions for TKPLSZ Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID NIORES O INTEGER — Number of inlet/outlet condition results NCC O INTEGER — Number of components present NCCPRP O INTEGER — Number of component properties NSEG O INTEGER — Number of pipeline segments NSGPRP O INTEGER — Number of segment properties NNODE O INTEGER — Number of pipeline nodes NNDPRP O INTEGER — Number of node properties NPOINT O INTEGER — Number of pipeline profile points NPROF O INTEGER — Number of profile properties IERR O INTEGER — Error flag (0=No error) † I = Input to subroutine, O = Output from subroutine Non-Component-Dependent Pipeline Inlet and Outlet Conditions Call subroutine TKPLIO to retrieve the results for the inlet and outlet conditions of a pipeline. The inlet and outlet results share the same property name, units type and label. The type of the result is indicated in the ITYPES array. 3 Block Result Subroutines 87 Calling Sequence for TKPLIO CALL TKPLIO (BLKID, NIORES, PNAMES, ITYPES, CVALSI, CVALSO, RVALSI, RVALSO, TYPES, LABELS, IERR) Argument List Descriptions for TKPLIO Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID NIORES I INTEGER Number of results PNAMES O CHARACTER*12 NIORES Property name. See Appendix B for a description. ITYPES O INTEGER Data type of results (2=Real, 3=Character) CVALSI O CHARACTER*12 NIORES Inlet character results CVALSO O CHARACTER*12 NIORES Outlet character results RVALSI O REAL*8 NIORES Inlet real results RVALSO O REAL*8 NIORES Outlet real results TYPES O CHARACTER*12 NIORES Units types LABELS O CHARACTER*16 NIORES Units labels IERR O INTEGER Error flag (0=No error) — NIORES — † I = Input to subroutine, O = Output from subroutine Component-Dependent Pipeline Inlet and Outlet Property Names Call subroutine TKPLCP to retrieve the names of the component-dependent properties of the pipeline. Calling Sequence for TKPLCP CALL TKPLCP (BLKID, NCCPRP, PNAMES, IERR) Argument List Descriptions for TKPLCP Variable I/O † Type Dimension BLKID I CHARACTER*(*) — Block ID NCCPRP I INTEGER Number of component properties PNAMES O CHARACTER*12 NCCPRP Property name. See Appendix B for a description. IERR O INTEGER Error flag (0=No error) — — Description † I = Input to subroutine, O = Output from subroutine 88 3 Block Result Subroutines Component-Dependent Pipeline Inlet and Outlet Conditions Call subroutine TKPLCO to retrieve the results for a specified componentdependent property in the pipeline. The inlet and outlet results share the same property name, units type and label. Calling Sequence for TKPLCO CALL TKPLCO (BLKID, NCC, PNAME, RVALSI, RVALSO, TYPE, LABEL, IERR) Argument List Descriptions for TKPLCO Variable I/O † Type Dimension BLKID I CHARACTER*(* — ) Block ID NCC I INTEGER Number of components PNAME I CHARACTER*12 — RVALSI O REAL*8 NCC Inlet results RVALSO O REAL*8 NCC Outlet results TYPE O INTEGER*12 — Units type LABEL O CHARACTER*16 — Units label IERR O INTEGER Error flag (0=No error) — Description Property name from TKPLCP — † I = Input to subroutine, O = Output from subroutine Segment Data Property Names Call TKPLSP to retrieve a list of the names of the properties reported for pipeline segments. Calling Sequence for TKPLSP CALL TKPLSP (BLKID, NSGPRP, PNAMES, IERR) Argument List Descriptions for TKPLSP Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID NSGPRP I INTEGER — Number of segments PNAMES O CHARACTER*12 NSGPRP Property name. See Appendix B for a description. IERR O INTEGER — Error flag (0=No error) † I = Input to subroutine, O = Output from subroutine 3 Block Result Subroutines 89 Pipeline Segment Data Call subroutine TKPLSG to retrieve segment data for the specified property name. The result will be either a character or a real value, indicated by the value of ITYPE. Calling Sequence for TKPLSG CALL TKPLSG (BLKID, NSEG, PNAME, ITYPE, RVALS, CVALS, TYPE, LABEL, IERR) Argument List Descriptions for TKPLSG Variable I/O † Type Dimension BLKID I CHARACTER*(*) — Block ID NSEG I INTEGER Number of pipeline segments PNAME I CHARACTER*12 — Property name from TKPLSP ITYPE O INTEGER — Data type of results (2=Real, 3=Character) †† RVALS O REAL*8 NSEG Real results CVALS O CHARACTER*12 NSEG Character results TYPE O CHARACTER*12 — Units type LABEL O CHARACTER*16 — Units label IERR O INTEGER Error flag (0=No error) — — Description † I = Input to subroutine, O = Output from subroutine †† For each result, the value in ITYPE specifies which array contains the result (CVALS or RVALS). For example, if ITYPE(4) is 2, then CVALS(4) is blank and RVALS(4) contains the result. Pipeline Node Property Names Call TKPLNP to retrieve a list of the reported property names for a pipeline node. Calling Sequence for TKPLNP CALL TKPLNP (BLKID, NNDPRP, PNAMES, IERR) Argument List Descriptions for TKPLNP Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID NNDPRP I INTEGER Number of node properties PNAMES O CHARACTER*12 NNDPRP Property name. See Appendix B for a description. IERR O INTEGER Error flag (0=No error) — — † I = Input to subroutine, O = Output from subroutine 90 3 Block Result Subroutines Pipeline Node Results Call subroutine TKPLND to retrieve the node results for the specific property. The type of result is indicated by ITYPE. Calling Sequence for TKPLND CALL TKPLND (BLKID, NNODE, PNAME, ITYPE, RVALS, CVALS, TYPE, LABEL, IERR) Argument List Descriptions for TKPLND Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID NNODE I INTEGER — Number of nodes PNAME I CHARACTER*12 — Property name from TKPLNP ITYPE O INTEGER — Data type of results (2=Real, 3=Character) †† RVALS O REAL*8 NNODE Segment results CVALS O CHARACTER*12 NNODE Character segment results TYPE O CHARACTER*12 — Units type LABEL O CHARACTER*16 — Units label IERR O INTEGER — Error flag (0=No error) † I = Input to subroutine, O = Output from subroutine †† For each result, the value in ITYPE specifies which array contains the result (CVALS or RVALS). For example, if ITYPE(4) is 2, then CVALS(4) is blank and RVALS(4) contains the result. Pipeline Profile Property Names Call subroutine TKPLPP to retrieve the names of the properties in the pipeline fluid profile. Since not all pipelines have this profile, make sure that NPROF is greater than zero before calling this routine. TKPLPP will return an error in IERR if NPROF is zero. Calling Sequence for TKPLPP CALL TKPLPP (BLKID, NPROF, PNAMES, IERR) Argument List Descriptions for TKPLPP Variable I/O † Type Dimension BLKID I CHARACTER*(*) — Block ID NPROF I INTEGER Number of profile properties PNAMES O CHARACTER*12 NPROF Property name. See Appendix B for a description. IERR O INTEGER Error flag (0=No error) — — Description † I = Input to subroutine, O = Output from subroutine 3 Block Result Subroutines 91 Pipeline Profile Results Call subroutine TKPLPR to retrieve the pipeline profile results for the named property. Since not all pipelines have this profile, make sure that NPOINT is greater than zero before calling this routine. TKPLPR will return an error in IERR if NPOINT is zero. Calling Sequence for TKPLPR CALL TKPLPR (BLKID, NPOINT, PNAME, RVALS, TYPE, LABEL, IERR) Argument List Descriptions for TKPLPR Variable I/O † Type Dimension BLKID I CHARACTER*(*) — Block ID NPOINT I INTEGER Number of profile points PNAME I CHARACTER*12 — Property name from TKPLPP RVALS O REAL*8 Profile results TYPE O CHARACTER*12 — Units type LABEL O CHARACTER*16 — Units label IERR O INTEGER Error flag (0=No error) — NPOINT — Description † I = Input to subroutine, O = Output from subroutine Pipe Results You can retrieve all the results for the single-segment pipeline model Pipe, using the standard block results routines TKNRES and TKBRES. Retrieve other results using the routines described in this section. You can retrieve Pipe results using a six-step process: 92 1 Call subroutine TKPISP to retrieve the dimensions of the standard profiles. 2 Call subroutine TKPINP to retrieve the names of the standard profile properties. 3 Call subroutine TKPIPR to retrieve results for standard profile properties. 4 Call subroutine TKPLSZ to retrieve the number of fluid properties. For a description of TKPLSZ, see Pipeline Results Dimensions, this chapter. 5 Call subroutine TKPLPP to retrieve the names of the fluid properties. For a description of TKPLPP, see Pipeline Profile Property Names, this chapter. 6 Call subroutine TKPLPR to retrieve the fluid properties results. For a description of TKPLPR, see Pipeline Profile Results, this chapter. 3 Block Result Subroutines Pipe Standard Profile Dimensions Call subroutine TKPISP to retrieve the dimensions of the standard Pipe profiles results. NPOINT returns zero if there are no profile results for this block. TKPISP returns the number of: Profile points. Profile properties. Calling Sequence for TKPISP CALL TKPISP (BLKID, NPOINT, NPROP) Argument List Descriptions for TKPISP Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID NPOINT O INTEGER — Number of profile points NPROP O INTEGER — Number of profile properties † I = Input to subroutine, O = Output from subroutine Pipe Standard Profile Property Names Call subroutine TKPINP to retrieve the names of the properties in the standard Pipe profiles results. Calling Sequence for TKPINP CALL TKPINP (BLKID, NPROP, PNAMES, IERR) Argument List Descriptions for TKPINP Variable I/O † Type Dimension BLKID I CHARACTER*(*) — Block ID NPROP I INTEGER Number of profile properties PNAMES O CHARACTER*12 NPROP Property name. See Appendix B for a description. IERR O INTEGER Error flag (0=No error) — — Description † I = Input to subroutine, O = Output from subroutine Pipe Standard Profile Properties Call subroutine TKPIPR to retrieve the results for the specific property in the standard Pipe profiles results. Calling Sequence for TKPIPR CALL TKPIPR 3 Block Result Subroutines (BLKID, NPOINT, PNAME, RVALS, TYPE, LABEL, IERR) 93 Argument List Descriptions for TKPIPR Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID NPOINT I INTEGER — Number of profile points PNAME I CHARACTER*12 — Property name from TKPINP RVALS O REAL*8 NPOINT Real results TYPE O CHARACTER*12 — Units type LABEL O CHARACTER*16 — Units label IERR O INTEGER — Error flag (0=No error) † I = Input to subroutine, O = Output from subroutine Pipe Property Reports The Pipe model allows you to get a profile report for the properties in a named property set. You can retrieve these results using a two-step process: 1 Call TKSPIR to determine the size of the property set profile. 2 Call TKNPIP to retrieve the next property set property calculated in the profile report. Call TKRPIP to retrieve a specified property. Size of a Pipe Property Report Call subroutine TKSPIR to determine the size of the property set report. The number of points in the report and the number of properties are returned. Calling Sequence for TKSPIR CALL TKSPIR (BLKID, NPOINT, NPROP) Argument List Descriptions for TKSPIR Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID NPOINT O INTEGER — Number of profile points NPROP O INTEGER — Number of profile properties † I = Input to subroutine, O = Output from subroutine Sequential Pipe Report Properties Call subroutine TKNPIP to retrieve the next property calculated for a pipe property report. Use the property sequence number to identify the property. TKNPIP returns the: 94 Property qualifiers. Property values. Units type. Units label. 3 Block Result Subroutines Calling Sequence for TKNPIP CALL TKNPIP (BLKID, NPOINT, IPROP, PNAME, SUBSID, PHASE, COMPID, WETDRY, BASIS, RVALS, TYPE, LABEL, IERR) Argument List Descriptions for TKNPIP Variable I/O † Type Dimension BLKID I CHARACTER*(*) — Block ID NPOINT I INTEGER — Number of profile points IPROP I INTEGER — Property sequence number PNAME O CHARACTER*12 — Property name. See Appendix B for a description. SUBSID O CHARACTER*8 — Substream ID PHASE O CHARACTER*8 — Phase COMPID O CHARACTER*8 — Component ID WETDRY O CHARACTER*4 — Wet/dry basis (WET or DRY) BASIS O CHARACTER*4 — Unit basis (MOLE, MASS, or FLOW) RVALS O REAL*8 NPOINT Property values TYPE O CHARACTER*12 — Units type LABEL O CHARACTER*16 — Units label IERR O INTEGER Error flag (0=No error) — Description † I = Input to subroutine, O = Output from subroutine Specific Pipe Report Properties Call subroutine TKRPIP to retrieve a specific property from a pipe property report. The property is identified by specifying the property set qualifiers (PNAME, SUBSID, PHASE, COMPID, WETDRY, BASIS). TKRPIP returns the property values, and the units type and label. Calling Sequence for TKRPIP Call TKRPIP (BLKID, NPOINT, PNAME, SUBSID, PHASE, COMPID, WETDRY, BASIS, RVALS, TYPE, LABEL, IERR) Argument List Descriptions for TKRPIP Variable I/O † Type BLKID Dimension Description I CHARACTER*(*) — Block ID NPOINT I INTEGER Number of profile points PNAME I CHARACTER*12 — SUBSID I CHARACTER*8 — Substream ID PHASE I CHARACTER*8 — Phase COMPID I CHARACTER*8 — Component ID WETDRY I CHARACTER*4 — Wet/dry basis (WET or DRY) 3 Block Result Subroutines — Property name. See Appendix B for a list of valid property names. 95 Variable I/O † Type Dimension Description BASIS I CHARACTER*4 — Unit basis (MOLE, MASS, or FLOW) RVALS O REAL*8 NPOINT Property values TYPE O CHARACTER*12 — Units type LABEL O CHARACTER*16 — Units label IERR O INTEGER Error flag (0=No error) — † I = Input to subroutine, O = Output from subroutine Block VLE Results Call subroutine TKVLE to retrieve vapor-liquid (or vapor-liquid-liquid) equilibrium results for a block. These results are available for the following Aspen Plus models: Heater, Flash2, Flash3, RStoic, and RYield. Calling Sequence for TKVLE CALL TKVLE (BLKID, NPH, NCP, COMPID, F, X, Y, RK, X2, RK2) Argument List Descriptions for TKVLE Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID NPH O INTEGER — Number of phases (2=VLE, 3=VLLE) NCP O INTEGER — Number of components present COMPID O CHARACTER*8 NCP Component IDs F O REAL*8 NCP Feed mole fractions X O REAL*8 NCP Liquid mole fractions (for VLE) or Liquid1 mole fractions (for VLLE) Y O REAL*8 NCP Vapor mole fractions RK O REAL*8 NCP Vapor-Liquid K-value (for VLE) or Vapor-Liquid1 K-value (for VLLE) X2 O REAL*8 NCP Liquid2 mole fractions RK2 O REAL*8 NCP Vapor-Liquid2 K-value † I = Input to subroutine, O = Output from subroutine Heating/Cooling Curves Aspen Plus can calculate heating/cooling curves for unit operation models Heater, Flash2, Flash3, HeatX, MHeatX, MCompR, RadFrac, MultiFrac, RateFrac, and PetroFrac. A unit operation block can have any number of heating/cooling curves. Many unit operation models allow for multiple types of heating/cooling curves.You can retrieve heating/cooling curve results using a five-step process: 96 3 Block Result Subroutines 1 Call TKNHCR to determine the number of heating/cooling curves for a block. 2 Call TKLHCR to list the heating/cooling curve types and numbers. 3 Call TKSHCR to determine the size of a heating/cooling curve. 4 Call TKHCUR to retrieve the standard results (temperature, pressure, vapor fraction, and duty) for a heating/cooling curve. 5 Retrieve the property set results by calling either TKNHCP for sequential heating/cooling curve properties or TKHCPR for specific heating/cooling curve properties. The routines listed above replace the routines TKNHCV, TKLHCV, TKSHCV, TKHCRV, TKNHPR, and TKHPRP. These routines will continue to be supported and updated but cannot be used to access PetroFrac heating/cooling curves. PetroFrac models have strippers and pumparounds that may have heating/cooling curves. The heating/cooling curve for a particular stripper or pumparound has both a block ID and a second ID for the main column/pumparound/stripper. The heating/cooling curve routines have an argument for this second ID called ID2. This argument is ignored for other models. You can determine the interconnecting stream ID for MultiFrac heating/cooling curves by calling TKHCID. Number of Heating/Cooling Curves for a Block Call subroutine TKNHCR to determine the number of heating/cooling curves for a unit operation block. Calling Sequence for TKNHCR CALL TKNHCR (BLKID, NCURVE) Argument List Descriptions for TKNHCR Variable I/O † Type Dimension BLKID I CHARACTER*(*) — Block ID NCURVE O INTEGER Number of heating/cooling curves — Description † I = Input to subroutine, O = Output from subroutine Heating/Cooling Curves for a Block Call subroutine TKLHCR to list the heating/cooling curves for a unit operation block. TKLHCR returns a list of heating/cooling curve types and numbers, which are used to identify individual curves. The IDs of the main column, pumparound, and strippers of the PetroFrac unit are returned in ID2. Calling Sequence for TKLHCR CALL TKLHCR 3 Block Result Subroutines (BLKID, NCURVE, ID2, TYPES, NUMBER, IERR) 97 Argument List Descriptions for TKLHCR Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID NCURVE I INTEGER — Number of heating/cooling curves ID2 O CHARACTER*8 NCURVE ID of PetroFrac main column, pumparound, or stripper TYPES O CHARACTER*16 NCURVE Type of heating/cooling curve (see below) NUMBER O INTEGER NCURVE Heating/cooling curve number of each curve IERR O INTEGER — Error flag (0=No error) † I = Input to subroutine, O = Output from subroutine TYPES value Type of Heating/Cooling Curve HCURVE Standard HOT Hot side COLD Cold side REBOILER Reboiler CONDENSER Condenser ICSTREAM Interconnecting stream heater PUMPAROUND Pumparound STRIPPERREBOILER Stripper reboiler Size of a Heating/Cooling Curve Call subroutine TKSHCR to determine the size of a heating/cooling curve. TKSHCR returns the number of points in the curve, and the number of properties calculated. Calling Sequence for TKSHCR CALL TKSHCR (BLKID, ID2, TYPE, NUMBER, NPOINT, NPROP) Argument List Descriptions for TKSHCR Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — ID2 I CHARACTER*8 — ID of PetroFrac main column, pumparound, or stripper TYPE I CHARACTER*16 — Type of heating/cooling curve NUMBER I INTEGER — Heating/cooling curve number NPOINT O INTEGER — Number of points in curve NPROP O INTEGER — Number of properties Block ID † I = Input to subroutine, O = Output from subroutine 98 3 Block Result Subroutines Standard Heating/Cooling Curve Results Call subroutine TKHCUR to retrieve the temperature, pressure, vapor fraction, heat duty, and error flag for each point along the curve. Calling Sequence for TKHCUR CALL TKHCUR (BLKID, ID2, TYPE, NUMBER, NPOINT, IERFLG, TEMP, PRES, VFRAC, DUTY, IERR) Argument List Descriptions for TKHCUR Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID ID2 I CHARACTER*8 TYPE I CHARACTER*16 — Type of heating/cooling curve NUMBER I INTEGER — Heating/cooling curve number NPOINT I INTEGER — Number of points IERFLG O INTEGER NPOINT Status flag for each point 0=OK 1=Errors in this row 2=Dew point 3=Bubble point) TEMP O REAL*8 NPOINT Temperature at each point PRES O REAL*8 NPOINT Pressure at each point VFRAC O REAL*8 NPOINT Vapor fraction at each point DUTY O REAL*8 NPOINT Duty at each point IERR O INTEGER — Error flag (0=No error) ID of PetroFrac main column, pumparound, or stripper † I = Input to subroutine, O = Output from subroutine Sequential Heating/Cooling Curve Properties Call subroutine TKNHCP to retrieve the next property set calculated for a heating/cooling curve. Use the property sequence number to identify the property. TKNHCP returns the property set qualifiers, the property values, and the units type and label. Calling Sequence for TKNHCP CALL TKNHCP 3 Block Result Subroutines (BLKID, ID2, TYPE, NUMBER, NPOINT, IPROP, PNAME, SUBSID, PHASE, COMPID, WETDRY, BASIS, RVALS, UTYPE, LABEL, IERR) 99 Argument List Descriptions for TKNHCP Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID ID2 I CHARACTER*8 TYPE I CHARACTER*16 — Type of heating/cooling curve NUMBER I INTEGER — Heating/cooling curve number NPOINT I INTEGER — Number of points in curve IPROP I INTEGER — Property sequence number PNAME O CHARACTER*12 — Property name. See Appendix B for a description. SUBSID O CHARACTER*8 — Substream ID PHASE O CHARACTER*8 — Phase COMPID O CHARACTER*8 — Component ID WETDRY O CHARACTER*4 — Wet/dry basis (WET or DRY) †† BASIS O CHARACTER*4 — Units basis (MOLE, MASS, or FLOW) RVALS O REAL*8 NPOINT Real values UTYPE O CHARACTER*12 — Units type LABEL O CHARACTER*16 — Units label IERR O INTEGER — Error flag (0=No error) ID of PetroFrac main column, pumparound, or stripper † I = Input to subroutine, O = Output from subroutine †† Can be left unspecified. Specific Heating/Cooling Curve Properties Call subroutine TKHCPR to retrieve a specific property for a heating/cooling curve. The property is identified by specifying the property set qualifiers (PNAME, SUBSID, PHASE, COMPID, WETDRY, BASIS). Before calling TKHCPR, make sure that all the qualifiers are either set to the desired value or unset. TKHCPR returns the property values, the units type, and the units label. Calling Sequence for TKHCPR CALL TKHCPR (BLKID, ID2, TYPE, NUMBER, NPOINT, PNAME, SUBSID, PHASE, COMPID, WETDRY, BASIS, RVALS, UTYPE, LABEL, IERR) Argument List Descriptions for TKHCPR 100 Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID ID2 I CHARACTER*8 ID of PetroFrac main column, pumparound, or stripper TYPE I CHARACTER*16 — Type of heating/cooling curve 3 Block Result Subroutines Variable I/O † Type Dimension Description NUMBER I INTEGER — Heating/cooling curve number NPOINT I INTEGER — Number of points in curve PNAME I CHARACTER*12 — SUBSID I CHARACTER*8 — Substream ID PHASE I CHARACTER*8 — Phase COMPID I CHARACTER*8 — Component ID WETDRY I CHARACTER*4 — Wet/dry basis (WET or DRY) †† BASIS I CHARACTER*4 — Units basis (MOLE, MASS, or FLOW) RVALS O REAL*8 NPOINT Real values UTYPE O CHARACTER*12 — Units type LABEL O CHARACTER*16 — Units label IERR O INTEGER Error flag (0=No error) — Property name. See Appendix B for a list of valid property names. † I = Input to subroutine, O = Output from subroutine †† Can be left unspecified. Interconnecting Stream IDs MultiFrac heating/cooling curves of type ICSTREAM are associated with interconnecting streams. Call subroutine TKHCID to retrieve the ID of the interconnecting streams. Calling Sequence for TKHCID CALL TKHCID (BLKID, TYPE, NUMBER, INTID, CHARID, IERR) Argument List Descriptions for TKHCID Variable I/O † Type Dimension Description BLKID I CHARACTER*(*) — Block ID TYPE I CHARACTER*16 — Type of heating/cooling curve NUMBER I INTEGER — Heating/cooling curve number INTID O INTEGER — Interconnecting stream ID for MultiFrac CHARID O CHARACTER*8 — Not currently used IERR O INTEGER — Error flag (0=No error) † I = Input to subroutine, O = Output from subroutine 3 Block Result Subroutines 101 102 3 Block Result Subroutines 4 Stream Result Subroutines This chapter describes the use of stream result retrieval subroutines in the Aspen Plus summary file toolkit. Use the subroutines described in this chapter for: Stream identification. Material stream results. Heat and work stream results. Component attribute results. Substream attribute results. Stream property set results. Stream Identification The following subroutines are used to identify streams in the summary file: TKSIDS returns a list of all the streams in the summary file. TKNSTR returns the next sequential stream. Both routines return the stream type (MATERIAL, HEAT, or WORK). Listing Stream IDs Call subroutine TKSIDS to retrieve the list of streams. Calling Sequence for TKSIDS CALL TKSIDS (NSTRM, STRMID, STRTYP, IERR) Argument List Descriptions for TKSIDS Variable I/O † Type Dimension Description NSTRM — I INTEGER Stream number STRMID O CHARACTER*(*) NSTRM Stream ID STRTYP O CHARACTER*12 NSTRM Stream type (MATERIAL, HEAT, or WORK) IERR O INTEGER Error flag (0=No error) 4 Stream Result Subroutines — 103 † I = Input to subroutine, O = Output from subroutine Determining the Next Stream Call subroutine TKNSTR to get the next stream in a sequence. The stream is identified by the sequence number. TKNSTR also returns the stream type. To find the stream ID of the first stream, set ISTRM to 1. To find the name of the second stream, set ISTRM to 2. Calling Sequence for TKNSTR CALL TKNSTR (ISTRM, STRMID, STRTYP, IERR) Argument List Descriptions for TKNSTR Variable I/O † Type Dimension Description ISTRM I INTEGER — Stream number STRMID O CHARACTER*(*) — Stream ID STRTYP O CHARACTER*12 — Stream type (MATERIAL, HEAT, or WORK) IERR O INTEGER Error flag (0=No error) — † I = Input to subroutine, O = Output from subroutine Material Stream Results TKSINF returns the source and destination blocks, along with the dimensions of the data for material streams. TKSSID returns the list of substream IDs for a stream. TKSTRM retrieves the results for material streams. Retrieving Basic Stream Information Call subroutine TKSINF to retrieve basic stream information. TKSINF returns the source and destination blocks of the stream. In addition, TKSINF returns the number of substreams and the dimensions of the results for material streams. Calling Sequence for TKSINF CALL TKSINF (STRMID, SOURCE, DEST, NSUBS, LEN, IERR) Argument List Descriptions for TKSINF 104 Variable I/O † Type Dimension Description STRMID I CHARACTER*(*) — Stream ID SOURCE O CHARACTER*(*) — Source block ID DEST O CHARACTER*(*) — Destination block ID NSUBS O INTEGER — Number of substreams LEN O INTEGER — Number of stream results 4 Stream Result Subroutines Variable I/O † Type Dimension Description IERR O INTEGER — Error flag (0=No error) † I = Input to subroutine, O = Output from subroutine Listing Substream IDs Call subroutine TKSSID to list the substreams for a stream. Calling Sequence for TKSSID CALL TKSSID (STRMID, NSUB, SUBSID) Argument List Descriptions for TKSSID Variable I/O † Type Dimension Description STRMID I CHARACTER*(*) — Stream ID NSUB I INTEGER — Number of substreams SUBSID O CHARACTER*8 NSUB Substream IDs † I = Input to subroutine, O = Output from subroutine Retrieving Stream Results Call subroutine TKSTRM to retrieve the results for a material stream. The property is identified by its qualifiers. Typical qualifiers are property name, substream, component ID, and units basis. Calling Sequence for TKSTRM CALL TKSTRM (STRMID, LEN, QUALS, RVALS, TYPES, LABELS, IERR ) Argument List Descriptions for TKSTRM Variable I/O † Type Dimension STRMID I CHARACTER*(*) — Stream ID LEN I INTEGER Number of stream results QUALS O CHARACTER*16 4*LEN RVALS O REAL*8 TYPES O CHARACTER*12 LEN Units type LABELS O CHARACTER*16 LEN Units label IERR O INTEGER Error flag (0=No error) — LEN — Description Qualifiers for results. For each value they are: Property name. See Appendix B for a description. Substream ID Component ID Units basis Real results † I = Input to subroutine, O = Output from subroutine 4 Stream Result Subroutines 105 Retrieving a Single Stream Property Call subroutine TKSVAL to retrieve a single material stream property. RVALS is an array which should be dimensioned to 1 if an overall stream property is requested, or to NCOMP if a component property from Table B.4 is requested. Calling Sequence for TKSVAL CALL TKSVAL (STRMID, SUBSID, PNAME, BASIS, RVALS, TYPE, LABEL, IERR) Argument List Descriptions for TKSVAL Variable I/O † Type Dimension STRMID I CHARACTER*(*) — SUBSID I CHARACTER*8 PNAME I CHARACTER*12 — BASIS I CHARACTER*4 — RVALS O REAL*8 1 or NCOMP Real results (Use NCOMP if value is for a component property.) TYPE O CHARACTER*12 — Units type LABEL O CHARACTER*16 — Units label IERR O INTEGER Error flag (0=No error) — — Description Stream ID Substream ID Property name. See Appendix B for a list of valid property names. Units basis (MOLE, MASS, or FLOW) † I = Input to subroutine, O = Output from subroutine Heat and Work Stream Results Call subroutine TKSTRA to retrieve the result value from a heat or a work stream. Heat streams return an enthalpy flow. Work streams return a power. Calling Sequence for TKSTRA CALL TKSTRA 106 (STRMID, STRTYP, VALUE, LABEL) 4 Stream Result Subroutines Argument List Descriptions for TKSTRA Variable I/O † Type Dimension Description STRMID I CHARACTER*(*)— Stream ID STRTYP I CHARACTER*4 — Stream type (HEAT or WORK) VALUE O REAL*8 LABEL O CHARACTER*16 — — Result value Units labels (type is ENTHALPY-FLOW for heat streams, POWER for work streams) † I = Input to subroutine, O = Output from subroutine Component Attribute Results You can retrieve component attribute results for a substream using a fourstep process: 1 Call TKSNAC to determine the number of components with attributes in the substream. 2 Call TKSNCA to determine the number of attributes for a component in a substream. 3 Call TKSSCA to determine the size of a component attribute. 4 Call TKSCAT to retrieve the component attribute values. Determining the Number of Components with Attributes Call subroutine TKSNAC to retrieve the number of components with attributes in a specified substream. Calling Sequence for TKSNAC CALL TKSNAC (STRMID, SUBSID, NAC) Argument List Descriptions for TKSNAC Variable I/O † Type Dimension Description STRMID I CHARACTER*(*) — Stream ID SUBSID I CHARACTER*8 — Substream ID NAC O INTEGER — Number of components with attributes † I = Input to subroutine, O = Output from subroutine 4 Stream Result Subroutines 107 Determining Number of Attributes for a Component Call subroutine TKSNCA to determine the number of attributes for a component. Specify the component number; TKSNCA returns the component ID and the number of attributes. Calling Sequence for TKSNCA CALL TKSNCA (STRMID, SUBSID, ICOMP, COMPID, NATT) Argument List Descriptions for TKSNCA Variable I/O † Type Dimension Description STRMID I CHARACTER*(*) — Stream ID SUBSID I CHARACTER*8 — Substream ID ICOMP I INTEGER — Component sequence number COMPID O CHARACTER*8 — Component ID NATT O INTEGER — Number of attributes † I = Input to subroutine, O = Output from subroutine Determining Component Attribute Size Call subroutine TKSSCA to determine the size of a component attribute. Specify the attribute sequence number. TKSSCA returns the attribute name and the number of elements. Calling Sequence for TKSSCA CALL TKSSCA (STRMID, SUBSID, COMPID, IATT, IDATT, NELEM) Argument List Descriptions for TKSSCA Variable I/O † Type Dimension Description STRMID I CHARACTER*(*) — Stream ID SUBSID I CHARACTER*8 — Substream ID COMPID I CHARACTER*8 — Component ID IATT I INTEGER — Attribute sequence number IDATT O CHARACTER*8 — Attribute name NELEM O INTEGER — Number of elements † I = Input to subroutine, O = Output from subroutine 108 4 Stream Result Subroutines Retrieving Component Attribute Values Call subroutine TKSCAT to retrieve the array of component attribute values and the name of each attribute element. Calling Sequence for TKSCAT CALL TKSCAT (STRMID, SUBSID, COMPID, IDATT, NELEM, ELEMID, VALUES, IERR) Argument List Descriptions for TKSCAT Variable I/O † Type Dimension Description STRMID I CHARACTER*(*) — Stream ID SUBSID I CHARACTER*8 — Substream ID COMPID I CHARACTER*8 — Component ID IDATT I CHARACTER*8 — Attribute name NELEM I INTEGER — Number of elements ELEMID O CHARACTER*8 NELEM Names of elements VALUES O REAL*8 NELEM Real values IERR O INTEGER — Error flag (0=No error) † I = Input to subroutine, O = Output from subroutine Substream Attribute Results You can retrieve substream attribute results for a substream using a threestep process: 1 Call TKSNSA to get the number of substream attributes in a substream. 2 Call TKSSSA to get the size of a substream attribute. 3 Call TKSSAT to retrieve the substream attribute results. Determining the Number of Substream Attributes Call subroutine TKSNSA to determine the number of attributes in a substream. Calling Sequence for TKSNSA CALL TKSNSA 4 Stream Result Subroutines (STRMID, SUBSID, NSATT) 109 Argument List Descriptions for TKSNSA Variable I/O † Type Dimension Description STRMID I CHARACTER*(*) — Stream ID SUBSID I CHARACTER*8 — Substream ID NSATT O INTEGER — Number of substream attributes † I = Input to subroutine, O = Output from subroutine Determining Substream Attribute Size Call subroutine TKSSSA to determine the size of a substream attribute. Specify the attribute sequence number; TKSSSA returns the number of elements and the attribute ID. Calling Sequence for TKSSSA CALL TKSSSA (STRMID, SUBSID, ISATT, SATID, NELEM) Argument List Descriptions for TKSSSA Variable I/O † Type Dimension Description STRMID I CHARACTER*(*) — Stream ID SUBSID I CHARACTER*8 — Substream ID ISATT I INTEGER — Attribute sequence number SATID O CHARACTER*8 — Attribute ID NELEM O INTEGER — Number of elements † I = Input to subroutine, O = Output from subroutine Retrieving Substream Attribute Values Call subroutine TKSSAT to retrieve results for substream attributes. Calling Sequence for TKSSAT CALL TKSSAT (STRMID, SUBSID, SATID, NELEM, VALUES, IERR) Argument List Descriptions for TKSSAT Variable I/O † Type Dimension Description STRMID I CHARACTER*(*) — SUBSID I CHARACTER*8 — Substream ID SATID I CHARACTER*8 — Attribute ID NELEM I INTEGER — Number of elements VALUES O REAL*8 NELEM Real values IERR O INTEGER — Error flag (0=No error) Stream ID † I = Input to subroutine, O = Output from subroutine 110 4 Stream Result Subroutines Stream Property Set Results You can retrieve results for additional property sets specified in the standard stream report using a two-step process: 1 Call subroutine TKNSPR to get the number of properties. 2 Call TKSPRP to retrieve the property values. Determining Dimensions of Stream Property Values Call subroutine TKNSPR to determine the number of property set results for a stream. Calling Sequence for TKNSPR CALL TKNSPR (STRMID, NVAL, IERR) Argument List Descriptions for TKNSPR Variable I/O † Type Dimension Description STRMID I CHARACTER*(*) — Stream ID NVAL O INTEGER Number of values — † I = Input to subroutine, O = Output from subroutine Retrieving Stream Property Results Call subroutine TKSPRP to retrieve the property values for a stream. TKSPRP returns the property qualifiers to identify each property value. Calling Sequence for TKSPRP CALL TKSPRP (STRMID, NVAL, PNAME, SUBSID, PHASE, COMPID, WETDRY, BASIS, RVALS, TYPES, LABELS, IERR) Argument List Descriptions for TKSPRP Variable I/O † Type Dimension Description STRMID I CHARACTER*(*) — Stream ID NVAL I INTEGER Number of values PNAME O CHARACTER*12 NVAL SUBSID O CHARACTER*8 NVAL Substream ID PHASE O CHARACTER*8 NVAL Phase COMPID O CHARACTER*8 NVAL Component ID WETDRY O CHARACTER*4 NVAL Wet/dry basis (WET or DRY) †† BASIS O CHARACTER*4 NVAL Units basis (MOLE, MASS, or FLOW) RVALS O REAL*8 NVAL Real results 4 Stream Result Subroutines — Property name. See Appendix B for a description. 111 Variable I/O † Type Dimension Description TYPES O CHARACTER*12 NVAL Units types LABELS O CHARACTER*16 NVAL Units labels IERR O INTEGER Error flag (0=No error) — † I = Input to subroutine, O = Output from subroutine †† Can be left unspecified. 112 4 Stream Result Subroutines 5 Physical Property Table Results Subroutines You can retrieve all property table results using a standard set of subroutines. There is a separate set of subroutines for retrieving pressure-temperature envelope results. This chapter describes: Property table identification. Property and flashcurve table results. Pressure-temperature envelope results. 5 Physical Property Table Results Subroutines 113 Property Table Identification Call subroutine TKNPPT to get the next property table in sequence from the summary file. Calling Sequence for TKNPPT CALL TKNPPT (ITABLE, TABID, TYPE, IERR) Argument List Descriptions for TKNPPT Variable I/O † Type Dimension Description ITABLE I INTEGER — TABID O CHARACTER*(*) — TYPE O CHARACTER*12 — Property table type (PROPS, FLASHCURVE, or PTENVELOPE) IERR O INTEGER — Error flag (0=No error) Property table sequence number Property table ID † I = Input to subroutine, O = Output from subroutine Property and Flashcurve Table Results You can retrieve property and flashcurve table results by calling either of the following two subroutines: TKNPPR to retrieve the next sequential property. TKPPRP to retrieve a specific property. When you use either of these subroutines, you must call subroutine TKSPPT to determine the dimensions of the property table. Determining Property Table Dimensions Call subroutine TKSPPT to determine the dimensions of a property table. TKSPPT returns the number of points and the number of properties. Calling Sequence for TKSPPT CALL TKSPPT (TABID, NPOINT, NPROP, IERR) Argument List Descriptions for TKSPPT Variable I/O † Type 114 Dimension Description TABID I CHARACTER*(*) — Property table ID NPOINT O INTEGER — Number of points NPROP O INTEGER — Number of properties IERR O INTEGER — Error flag (0=No error) 5 Physical Property Table Results Subroutines † I = Input to subroutine, O = Output from subroutine Retrieving Sequential Properties in a Table Call subroutine TKNPPR to retrieve the next property in sequence from the property table. Identify the property using the property sequence number. TKNPPR returns the stream property qualifiers. Calling Sequence for TKNPPR CALL TKNPPR (TABID, NPOINT, IPROP, PNAME, SUBSID, PHASE, COMPID, WETDRY, BASIS, RVALS, TYPE, LABEL, IERR) Argument List Descriptions for TKNPPR Variable I/O † Type Dimension Description TABID I CHARACTER*(*) — Property table ID NPOINT I INTEGER — Number of points IPROP I INTEGER — Property number PNAME O CHARACTER*12 — Property name. See Appendix B for a description. SUBSID O CHARACTER*8 — Substream ID PHASE O CHARACTER*8 — Phase COMPID O CHARACTER*8 — Component ID WETDRY O CHARACTER*4 — Wet/dry basis (WET or DRY) †† BASIS O CHARACTER*4 — Units basis (MOLE, MASS, or FLOW) RVALS O REAL*8 NPOINT Real values TYPE O CHARACTER*12 — Units type LABEL O CHARACTER*16 — Units label IERR O INTEGER — Error flag (0=No error) † I = Input to subroutine, O = Output from subroutine †† Can be left unspecified. Retrieving Specific Properties from a Table Call subroutine TKPPRP to retrieve a specific property from the property table. Specify the property by listing its qualifiers. Calling Sequence for TKPPRP CALL TKPPRP (TABID, NPOINT, PNAME, SUBSID, PHASE, COMPID, WETDRY, BASIS, RVALS, TYPE, LABEL, IERR) Argument List Descriptions for TKPPRP Variable I/O † Type Dimension Description TABID I CHARACTER*(*) — Property table ID NPOINT I INTEGER Number of points 5 Physical Property Table Results Subroutines — 115 PNAME I CHARACTER*12 — Property name. See Appendix B for a list of valid property names. SUBSID I CHARACTER*8 — Substream ID PHASE I CHARACTER*8 — Phase COMPID I CHARACTER*8 — Component ID WETDRY I CHARACTER*4 — Wet/dry basis (WET or DRY) †† BASIS I CHARACTER*4 — Units basis (MOLE, MASS, or FLOW) RVALS O REAL*8 NPOINT Real values TYPE O CHARACTER*12 — Units type LABEL O CHARACTER*16 — Units label IERR O INTEGER Error flag (0=No error) — † I = Input to subroutine, O = Output from subroutine †† Can be left unspecified. Pressure-Temperature Envelope Results You can retrieve pressure-temperature envelope results using a four-step process: 1 Call TKNENV to determine the number of envelopes and properties in a property table. 2 Call TKSENV to determine the size of each branch of an envelope. 3 Call TKPTEV to retrieve the temperature and pressure along each branch of an envelope. 4 Retrieve the property set for each branch of an envelope. You can retrieve each property sequentially using TKNPEV, or retrieve a specific property using TKPPEV. Determining Dimensions for Properties in the Envelope Call subroutine TKNENV to determine the number of envelopes and the number of properties. Calling Sequence for TKNENV CALL TKNENV (TABID, NENVL, NPROP, IERR) Argument List Descriptions for TKNENV Variable I/O † Type 116 Dimension Description TABID I CHARACTER*(*) — Property table ID NENVL O INTEGER — Number of envelopes NPROP O INTEGER — Number of properties 5 Physical Property Table Results Subroutines IERR O INTEGER — Error flag (0=No error) † I = Input to subroutine, O = Output from subroutine Determining Envelope Dimensions Call subroutine TKSENV to determine the dimensions of an envelope. TKSENV returns the number of points for each branch of the envelope. For an envelope at a vapor fraction of .5, zero is returned as the dimension of the complementary branch. Calling Sequence for TKSENV CALL TKSENV (TABID, IENVL, NP1, NP2) Argument List Descriptions for TKSENV Variable I/O † Type Dimension Description TABID I CHARACTER*(*) — Property table ID IENVL I INTEGER — Envelope number NP1 O INTEGER — Number of points in the first branch NP2 O INTEGER — Number of points in the complementary branch † I = Input to subroutine, O = Output from subroutine Retrieving Temperature and Pressure for Envelope Branch Call subroutine TKPTEV to retrieve the temperature and pressure for each branch along an envelope. TKPTEV also returns the vapor fraction values for each branch. Calling Sequence for TKPTEV CALL TKPTEV (TABID, IENVL, NP1, NP2, VFRAC1, VFRAC2, TEMP1, PRES1, TEMP2, PRES2) Argument List Descriptions for TKPTEV Variable I/O † Type Dimension Description TABID I CHARACTER*(*) — Property table ID IENVL I INTEGER — Envelope number NP1 I INTEGER — Number of points in the first branch NP2 I INTEGER — Number of points in the complementary branch VFRAC1 O REAL*8 — Vapor fraction for the first branch VFRAC2 O REAL*8 — Vapor fraction for the complementary branch TEMP1 O REAL*8 NP1 Temperature values for the first branch PRES1 O REAL*8 NP1 Pressure values for the first branch 5 Physical Property Table Results Subroutines 117 Variable I/O † Type Dimension Description TEMP2 O REAL*8 NP2 Temperature values for the complementary branch PRES2 O REAL*8 NP2 Pressure values for the complementary branch † I = Input to subroutine, O = Output from subroutine Retrieving Sequential Envelope Properties Call subroutine TKNPEV to retrieve the next sequential property for an envelope. TKNPEV returns the property values for both branches of the envelope and the vapor fraction values. Calling Sequence for TKNPEV CALL TKNPEV (TABID, IENVL, IPROP, NP1, NP2, VFRAC1, VFRAC2, PNAME, SUBSID, PHASE, COMPID, WETDRY, BASIS, VALS1, VALS2, TYPE, LABEL) Argument List Descriptions for TKNPEV Variable I/O † Type Dimension Description TABID I CHARACTER*(*) — Table ID IENVL I INTEGER — Envelope number IPROP I INTEGER — Property sequence number NP1 I INTEGER — Number of points along the first branch NP2 I INTEGER — Number of points along the complementary branch VFRAC1 O REAL*8 — Vapor fraction for the first branch VFRAC2 O REAL*8 — Vapor fraction for the complementary branch PNAME O CHARACTER*12 — Property name. See Appendix B for a description. SUBSID O CHARACTER*8 — Substream ID PHASE O CHARACTER*8 — Phase COMPID O CHARACTER*8 — Component ID WETDRY O CHARACTER*4 — Wet/dry basis (WET or DRY) †† BASIS O CHARACTER*4 — Units basis (MOLE, MASS, or FLOW) VALS1 O REAL*8 NP1 Property values for the first branch VALS2 O REAL*8 NP2 Property values for the complementary branch TYPE O CHARACTER*12 — Units type LABEL O CHARACTER*16 — Units label † I = Input to subroutine, O = Output from subroutine †† Can be left unspecified. 118 5 Physical Property Table Results Subroutines Retrieving Specific Envelope Properties Call subroutine TKPPEV to retrieve a specific property set from a pressuretemperature envelope. Calling Sequence for TKPPEV CALL TKPPEV (TABID, IENVL, NP1, NP2, PNAME, SUBSID, PHASE, COMPID, WETDRY, BASIS, VFRAC1, VFRAC2, VALS1, VALS2, TYPE, LABEL) Argument List Descriptions for TKPPEV Variable I/O † Type Dimension Description TABID I CHARACTER*(*) — Table ID IENVL I INTEGER — Envelope number NP1 I INTEGER — Number of points along the first branch NP2 I INTEGER — Number of points along the complementary branch PNAME I CHARACTER*12 — SUBSID I CHARACTER*8 — Substream ID PHASE I CHARACTER*8 — Phase COMPID I CHARACTER*8 — Component ID WETDRY I CHARACTER*4 — Wet/dry basis (WET or DRY)†† BASIS I CHARACTER*4 — Units basis (MOLE, MASS, or FLOW) VFRAC1 O REAL*8 — Vapor fraction of the first branch VFRAC2 O REAL*8 — Vapor fraction of the complementary branch VALS1 O REAL*8 NP1 Property values for the first branch VALS2 O REAL*8 NP2 Property values for the complementary branch TYPE O CHARACTER*12 — Units type LABEL O CHARACTER*16 — Units label Property name. See Appendix B for a list of valid property names. † I = Input to subroutine, O = Output from subroutine †† Can be left unspecified. 5 Physical Property Table Results Subroutines 119 120 5 Physical Property Table Results Subroutines 6 Costing Results Subroutines This chapter describes the use of costing equipment item retrieval subroutines in the summary file toolkit. Use the subroutines described in this chapter for retrieving this information about equipment items: Identification. Costing and sizing results. 6 Costing Results Subroutines 121 Equipment Item Identification The subroutines used to identify costing equipment items in the summary file are: Subroutine Returns TKNEQ Number of equipment items in the summary file TKEIDS List of equipment items in the summary file TKNEQP Equipment item IDs sequentially Determining Number of Equipment Items Call TKNEQ to determine the number of equipment items in the summary file. Calling Sequence for TKNEQ CALL TKNEQ (NEQUIP) Argument List Descriptions for TKNEQ Variable I/O † Type NEQUIP INTEGER — O Dimension Description Number of equipment items † I = Input to subroutine, O = Output from subroutine Listing Equipment Items Call subroutine TKEIDS to get the list of equipment items and types. Calling Sequence for TKEIDS CALL TKEIDS (NEQUIP, EQPID, EQPTYP, IERR) Argument List Descriptions for TKEIDS Variable I/O † Type Dimension Description NEQUIP I INTEGER — Number of equipment items EQPID O CHARACTER*8 NEQUIP Equipment item ID EQPTYP O CHARACTER*12 NEQUIP Equipment type IERR O INTEGER Error flag (0=No error) — † I = Input to subroutine, O = Output from subroutine Determining Next Equipment Item Call subroutine TKNEQP to find the name of the next equipment item. To find the ID of the first equipment item, set IEQUIP to 1. To find the name of the second item, set IEQUIP to 2, and so on. 122 6 Costing Results Subroutines Calling Sequence for TKNEQP CALL TKNEQP (IEQUIP, EQPID, EQPTYP, IERR) Argument List Descriptions for TKNEQP Variable I/O † Type Dimension Description IEQUIP I INTEGER — Equipment item number EQPID O CHARACTER*8 — Equipment item ID EQPTYP O CHARACTER*12 — Equipment type IERR O INTEGER Error flag (0=No error) — † I = Input to subroutine, O = Output from subroutine Equipment Item Results The following subroutines are used to return results for equipment items in the summary file: Subroutine Returns TKEQCR Costing results for an equipment item TKNEQS Number of sizing results for an equipment item TKEQSR Sizing results for an equipment item Retrieving Equipment Item Costing Results Call subroutine TKEQCR to retrieve the calculated number of equipment items, the carbon steel cost, and the purchased cost. Calling Sequence for TKEQCR CALL TKEQCR (EQPID, EQPTYP, NCALC, CSCOST, PCOST, IERR) Argument List Descriptions for TKEQCR Variable I/O † Type Dimension Description EQPID I CHARACTER*8 — Equipment Item ID NCALC O INTEGER — Calculated number of equipment items CSCOST O REAL*8 — Carbon steel cost PCOST O REAL*8 — Purchased cost IERR O INTEGER — Error flag (0=No error) † I = Input to subroutine, O = Output from subroutine Determining Equipment Item Sizing Results Call subroutine TKNEQS to determine the number of equipment item sizing results. 6 Costing Results Subroutines 123 Calling Sequence for TKNEQS CALL TKNEQS (EQPID, NVAL, IERR) Argument List Descriptions for TKNEQS Variable I/O † Type Dimension Description EQPID I CHARACTER*8 — Equipment Item ID NVAL O INTEGER — Number of results IERR O INTEGER — Error flag (0=No error) † I = Input to subroutine, O = Output from subroutine Retrieving Equipment Item Sizing Results Call subroutine TKEQSR to retrieve the equipment item sizing results. Calling Sequence for TKEQSR CALL TKEQSR (EQPID, NVAL, PNAMES, ITYPES, IVALS, CVALS, RVALS, UTYPES, LABELS, IERR) Argument List Descriptions for TKEQSR Variable I/O † Type Dimension Description EQPID I CHARACTER*8 — Equipment item ID NVAL I INTEGER — Number of results PNAMES O CHARACTER*12 NVAL Property names. See Appendix B for a description. ITYPES O INTEGER NVAL Result type (1 = Integer value, 2 = Real*8 value, 3 = Character value)†† IVALS O INTEGER NVAL Integer result CVALS O CHARACTER*12 NVAL Character result RVALS O REAL*8 NVAL Real result UTYPES O CHARACTER*12 NVAL Units type LABELS O CHARACTER*16 NVAL Units label IERR O INTEGER — Error flag (0=No error) † I = Input to subroutine, O = Output from subroutine †† For each result, the value in ITYPE specifies which array contains the result (IVALS, CVALS, or RVALS). For example, if ITYPE(4) is 2, then IVALS(4) is 0, CVALS(4) is blank and RVALS(4) contains the result. 124 6 Costing Results Subroutines 7 Pressure Relief Subroutines This chapter describes the use of pressure relief retrieval subroutines in the summary file toolkit. Use the subroutines described in this chapter for: Pressure relief model identification. Dynamic and steady-state results. Scalar results. Profile results. Vessel results. Vent results. Accumulator results. 7 Pressure Relief Subroutines 125 Pressure Relief Block Identification The following subroutines are used to identify the pressure relief blocks in the summary file: TKNPRS returns the number of pressure relief blocks in the summary file. TKPIDS returns a list of pressure relief IDs in the summary file. TKNXPR retrieves the pressure relief IDs sequentially. There is no additional type information, unlike the corresponding block routines. Determining the Number of Pressure Relief Blocks Call subroutine TKNPRS to determine the number of pressure relief blocks in the summary file. Calling Sequence for TKNPRS CALL TKNPRS (NPR) Argument List Descriptions for TKNPRS Variable I/O † Type NPR O Dimension Description INTEGER— Number of pressure relief blocks † I = Input to subroutine, O = Output from subroutine Listing Pressure Relief Blocks Call subroutine TKPIDS to get a list of pressure relief blocks. Calling Sequence for TKPIDS CALL TKPIDS (NPR, PRID, IERR) Argument List Descriptions for TKPIDS Variable I/O † Type Dimension Description NPR I INTEGER — PRID O CHARACTER*(*) NPR Pressure relief IDs IERR O INTEGER Error flag (0=No error) — Number of pressure relief blocks † I = Input to subroutine, O = Output from subroutine 126 7 Pressure Relief Subroutines Determining the Next Pressure Relief Block Call subroutine TKNXPR to find the ID of the next pressure relief block in sequence. To find the first ID, set IPR to 1. To find the ID of the second, set IPR to 2. Calling Sequence for TKNXPR CALL TKNXPR (IPR, PRID, IERR) Argument List Descriptions for TKNXPR Variable I/O † Type Dimension Description IPR I INTEGER — PRID O CHARACTER*(*) — Pressure relief ID IERR O INTEGER Error flag (0=No error) — Sequence number of pressure relief blocks † I = Input to subroutine, O = Output from subroutine Pressure Relief Results You can retrieve scalar and profile results from the summary file for the pressure relief blocks. Results are either steady state or dynamic. You can also retrieve the vent accumulator and vent profile results for the dynamic case. Retrieving pressure relief results is a five-step process: 1 Call subroutine TKPSUB to determine the number of substreams. 2 Call subroutine TKPSRF to determine the dimensions of the scalar results and profiles. 3 Call TKPSSR to retrieve the dynamic scalar results; call subroutine TKPSSS to retrieve steady-state results. 4 Call subroutine TKPSRP to list the dynamic properties; call subroutine TKPSSP to list the steady-state properties. 5 For dynamic results, call subroutine TKPSR1 to retrieve the noncomponent-dependent profile properties; call subroutine TKPSR2 to retrieve the component-dependent profile properties. – Or – For steady-state results, call subroutine TKPSS1 to retrieve the property values. Retrieving the vent accumulator profiles for the dynamic results requires three additional steps: 6 Call subroutine TKPVPF to determine the dimensions of the profile. 7 Call subroutine TKPVRP to list the properties. 7 Pressure Relief Subroutines 127 8 Call subroutine TKPVR1 to retrieve the property values for positiondependent properties. Or call subroutine TKPVR2 to retrieve the property values for component-dependent properties. Retrieving the vent profiles for the dynamic results requires another three steps: 9 Call subroutine TKPAPF to determine the dimensions of the profile. 10 Call subroutine TKPAPR to list the properties. 11 Call subroutine TKPAR1 to retrieve the property values for noncomponent-dependent properties. Or call subroutine TKPAR2 to retrieve the property values for component-dependent properties. Determining the Number of Substreams Call subroutine TKPSUB to determine the number of substreams for which the pressure relief block has results. If the results for the pressure relief model are at steady-state there are no substream dependent results and a value of one is returned. Calling Sequence for TKPSUB CALL TKPSUB (PRID, NSUB) Argument List Descriptions for TKPSUB Variable I/O † Type Dimension Description PRID I CHARACTER*(*) — Block ID NSUB O INTEGER Number of substreams — † I = Input to subroutine, O = Output from subroutine Determining Dimensions of Pressure Relief Arrays Call subroutine TKPSRF to determine the sizes for the pressure relief arrays. TKPSRF returns: Number of scalar results. Number of profile points. Number of components present. Number of profile properties. Substream ID for the requested substream. Whether the results are steady state or dynamic. Calling Sequence for TKPSRF CALL TKPSRF (PRID, ISUB, SUBSID, ISTATE, NSCAL, NPOINT, NCP, NPROP) Argument List Descriptions for TKPSRF Variable I/O † Type 128 Dimension Description 7 Pressure Relief Subroutines PRID I CHARACTER*(*) — Block ID ISUB I INTEGER — Substream number SUBSID O CHARACTER*8 — Substream ID ISTATE O INTEGER — Results (1=Steady state, 2=Dynamic) NSCAL O INTEGER — Number of scalar results NPOINT O INTEGER — Number of output points NCP O INTEGER — Number of components present NPROP O INTEGER — Number of properties † I = Input to subroutine, O = Output from subroutine, Listing Profile Properties Call subroutine TKPSRP to list the dynamic profile properties for a specified substream. TKPSRP returns an array of property names, and an array indicating whether the property is component-dependent. Call subroutine TKPSSP to list the steady-state profile properties. TKPSSP returns an array of property names, and the names of the pressure relief positions for each profile point. Calling Sequence for TKPSRP CALL TKPSRP (PRID, SUBSID, NPROP, ITYPES, PNAMES, IERR) Argument List Descriptions for TKPSRP Variable I/O † Type Dimension Description PRID I CHARACTER*(*) — SUBSID I CHARACTER*8 — Substream ID NPROP I INTEGER — Number of properties ITYPES O INTEGER NPROP Property type (1=Not component-dependent 2=Component-dependent) PNAMES O CHARACTER*12 NPROP Property names. See Appendix B for a description. IERR O INTEGER Error flag (0=No error) — Block ID † I = Input to subroutine, O = Output from subroutine Calling Sequence for TKPSSP CALL TKPSSP 7 Pressure Relief Subroutines (PRID, NPROP, NPOINT, PNAMES, POSIDS, IERR) 129 Argument List Descriptions for TKPSSP Variable I/O † Type Dimension Description PRID I CHARACTER*(*) — Block ID NPROP I INTEGER — Number of properties NPOINT I INTEGER — Number of profile points PNAMES O CHARACTER*12 NPROP Property names. See Appendix B for a description. POSIDS O CHARACTER*32 NPOINT Position names IERR O INTEGER Error flag (0=No error) — † I = Input to subroutine, O = Output from subroutine Retrieving Dynamic Scalar Results Call subroutine TKPSSR to retrieve the scalar dynamic results for pressure relief blocks. Calling Sequence for TKPSSR CALL TKPSSR (PRID, NSCAL, PNAMES, ITYPES, IVALS, CVALS, DVALS, RVALS, TYPES, LABELS, IERR) Argument List Descriptions for TKPSSR Variable I/O † Type Dimension Description PRID I CHARACTER*(*) — Block ID NSCAL I INTEGER — Number of scalar results PNAMES O CHARACTER*12 NSCAL Property name. See Appendix B for a description. ITYPES O INTEGER NSCAL Data type of result (1=Integer 2=Real 3=Character 4=Description) IVALS O INTEGER NSCAL Integer property values CVALS O CHARACTER*12 NSCAL Character property values DVALS O CHARACTER*32 NSCAL Descriptive property values RVALS O REAL*8 NSCAL Real property values TYPES O CHARACTER*12 NSCAL Units type LABELS O CHARACTER*16 NSCAL Units label IERR O INTEGER — Error flag (0=No error) † I = Input to subroutine, O = Output from subroutine 130 7 Pressure Relief Subroutines Retrieving Steady-State Scalar Results Call subroutine TKPSSS to retrieve steady-state scalar results. Calling Sequence for TKPSSS CALL TKPSSS (PRID, NSCAL, PNAMES, ITYPES, NPOINT, IVALS, CVALS, DVALS, RVALS, TYPES, LABELS, IERR) Argument List Descriptions for TKPSSS Variable I/O † Type DimensionDescription PRID I CHARACTER*(*) — Block ID NSCAL I INTEGER — Number of scalar results PNAMES O CHARACTER*12 NSCAL Property name. See Appendix B for a description. ITYPES O INTEGER NSCAL Data type of result (1=Integer 2=Real 3=Character 4=Description) IVALS O INTEGER NSCAL Integer property values CVALS O CHARACTER*8 NSCAL Character property values DVALS O CHARACTER*32 NSCAL Descriptive property values RVALS O REAL*8 NSCAL Real property values TYPES O CHARACTER*12 NSCAL Units type LABELS O CHARACTER*16 NSCAL Units label IERR O INTEGER — Error flag (0=No error) † I = Input to subroutine, O = Output from subroutine Retrieving Non-Component-Dependent Dynamic Profiles Call subroutine TKPSR1 to retrieve profiles for non-component-dependent properties. The results are independent of the substream. Calling Sequence for TKPSR1 CALL TKPSR1 7 Pressure Relief Subroutines (PRID, PNAME, NPOINT, ITYPES, CVALS, RVALS, TYPE, LABEL, IERR) 131 Argument List Descriptions for TKPSR1 Variable I/O † Type Dimension Description PRID I CHARACTER*(*) — Block ID PNAME I CHARACTER*12 — Property name. See Appendix B for a list of valid property names. NPOINT I INTEGER — Number of output points ITYPES O INTEGER — Data type of results (2=Real 3=Character) CVALS O CHARACTER*8 NPOINT Character property values RVALS O REAL*8 NPOINT Property values TYPE O CHARACTER*12 — Units type LABEL O CHARACTER*16 — Units label IERR O INTEGER — Error flag (0=No error) † I = Input to subroutine, O = Output from subroutine Retrieving Dynamic Component-Dependent Profiles Call subroutine TKPSR2 to retrieve profiles for component-dependent properties. Calling Sequence for TKPSR2 CALL TKPSR2 (PRID, PNAME, SUBSID, NCP, COMPID, NPOINT, RVALS, TYPE, LABEL, IERR) Argument List Descriptions for TKPSR2 Variable I/O † Type Dimension Description PRID I CHARACTER*(*) — Block ID PNAME I CHARACTER*12 — Property name. See Appendix B for a list of valid property names. SUBSID I CHARACTER*8 — Substream ID NCP I INTEGER — Number of components present COMPID O CHARACTER*8 NCP Component IDs NPOINT I INTEGER — Number of output points RVALS O REAL*8 NCP* NPOINT Property values TYPE O CHARACTER*12 — Units type LABEL O CHARACTER*16 — Units label IERR O INTEGER — Error flag (0=No error) † I = Input to subroutine, O = Output from subroutine 132 7 Pressure Relief Subroutines Retrieving Steady-State Profiles Call subroutine TKPSS1 to retrieve profiles for the steady-state results. Calling Sequence for TKPSS1 CALL TKPSS1 (PRID, PNAME, NPOINT, RVALS, TYPE, LABEL, IERR) Argument List Descriptions for TKPSS1 Variable I/O † Type Dimension Description PRID I CHARACTER*(*) — Block ID PNAME I CHARACTER*12 — Property name. See Appendix B for a list of valid property names. NPOINT I INTEGER — Number of output points RVALS O REAL*8 NPOINT Property values TYPE O CHARACTER*12 — Units type LABEL O CHARACTER*16 — Units label IERR O INTEGER — Error flag (0=No error) † I = Input to subroutine, O = Output from subroutine Determining Vent Accumulator Profile Dimensions Call subroutine TKPAPF to determine the sizes of profile arrays for the vent accumulator. TKPAPF returns the number of: Output points. Components present. Properties. Calling Sequence for TKPAPF CALL TKPAPF (PRID, NPOINT, NCP, NPROP) Argument List Descriptions for TKPAPF Variable I/O † Type Dimension Description PRID I CHARACTER*(*) — Block ID NPOINT O INTEGER — Number of output points NCP O INTEGER — Number of components present NPROP O INTEGER — Number of properties † I = Input to subroutine, O = Output from subroutine 7 Pressure Relief Subroutines 133 Listing Vent Accumulator Profile Properties Call subroutine TKPAPR to list the vent accumulator profile properties. TKPAPR returns an array of property names, and an array indicating whether the property is component-dependent. Calling Sequence for TKPAPR CALL TKPAPR (PRID, NPROP, ITYPES, PNAMES, IERR) Argument List Descriptions for TKPAPR Variable I/O † Type Dimension PRID I CHARACTER*(*) — Block ID NPROP I INTEGER — Number of properties ITYPES O INTEGER NPROP Property type (1=Non-component-dependent 2=Component-dependent) PNAMES O CHARACTER*12 NPROP Property names. See Appendix B for a description. IERR O INTEGER Error flag (0=No error) — Description † I = Input to subroutine, O = Output from subroutine Retrieving Non-Component-Dependent Vent Accumulator Profiles Call subroutine TKPAR1 to retrieve vent accumulator profiles for noncomponent-dependent properties. The corresponding times for each profile point are retrieved using the property name TIME. Calling Sequence for TKPAR1 CALL TKPAR1 (PRID, PNAME, NPOINT, RVALS, TYPE, LABEL, IERR) Argument List Descriptions for TKPAR1 Variable I/O † Type Dimension Description PRID I CHARACTER*(*) — Block ID PNAME I CHARACTER*12 — Property name. See Appendix B for a list of valid property names. NPOINT I INTEGER — Number of output points RVALS O REAL*8 NPOINT Property values TYPE O CHARACTER*12 — Units type LABEL O CHARACTER*16 — Units label IERR O INTEGER — Error flag (0=No error) † I = Input to subroutine, O = Output from subroutine 134 7 Pressure Relief Subroutines Retrieving Component-Dependent Vent Accumulator Profiles Call subroutine TKPAR2 to retrieve vent accumulator profiles for componentdependent properties. The corresponding times for each profile point are retrieved using the property name TIME in TKPAR1. Calling Sequence for TKPAR2 CALL TKPAR2 (PRID, PNAME, NCP, COMPID, NPOINT, RVALS, TYPE, LABEL, IERR) Argument List Descriptions for TKPAR2 Variable I/O † Type Dimension Description PRID I CHARACTER*(*) — Block ID PNAME I CHARACTER*12 — Property name. See Appendix B for a list of valid property names. NCP I INTEGER — Number of components present COMPID O CHARACTER*8 NCP Component IDs NPOINT I INTEGER — Number of output points RVALS O REAL*8 NCP* NPOINT Property values TYPE O CHARACTER*12 — Units type LABEL O CHARACTER*16 — Units label IERR O INTEGER — Error flag (0=No error) † I = Input to subroutine, O = Output from subroutine Determining Pressure Relief Vent Profile Dimensions Call subroutine TKPVPF to determine the sizes of the profile arrays for the vent. TKPVPF returns the number of: Output points. Components present. Positions. Calling Sequence for TKPVPF CALL TKPVPF (PRID, NPOINT, NCP, NPROP, NPOS) Argument List Descriptions for TKPVPF Variable I/O † Type Dimension Description PRID I CHARACTER*(*) — Block ID NPOINT O INTEGER — Number of output points NCP O INTEGER — Number of components 7 Pressure Relief Subroutines 135 Variable I/O † Type Dimension Description present NPROP O INTEGER — Number of properties NPOS O INTEGER — Number of positions † I = Input to subroutine, O = Output from subroutine Listing Vent Profile Properties Call subroutine TKPVRP to list the vent profile properties. TKPVRP returns an array of property names, the corresponding times for each profile point, and an array indicating whether the property is position-dependent or componentdependent. Calling Sequence for TKPVRP CALL TKPVRP (PRID, NPROP, ITYPES, PNAMES, TIMES, TYPE, LABEL, IERR) Argument List Descriptions for TKPVRP Variable I/O † Type Dimension Description PRID I CHARACTER*(*) — Block ID NPROP I INTEGER — Number of properties NPOINT I INTEGER — Number of points ITYPES O INTEGER NPROP Property type (1=Position-dependent 2= Component-dependent) PNAMES O CHARACTER*12 NPROP Property names. See Appendix B for a description. TIMES O REAL*8 NPOINT Time intervals TYPE O CHARACTER*12 — Time type LABEL O CHARACTER*16 — Time label IERR O INTEGER — Error flag (0=No error) † I = Input to subroutine, O = Output from subroutine Retrieving Position-Dependent Vent Profiles Call subroutine TKPVR1 to retrieve vent profiles for properties at the listed positions. The times for each profile point are retrieved in TKPVRP. Calling Sequence for TKPVR1 CALL TKPVR1 136 (PRID, PNAME, NPOINT, RVALS, TYPE, LABEL, IERR) 7 Pressure Relief Subroutines Argument List Descriptions for TKPVR1 Variable I/O † Type Dimension Description PRID I CHARACTER*(*) — Block ID PNAME I CHARACTER*12 — Property name. See Appendix B for a list of valid property names. NPOS I INTEGER — Number of positions POSIDS O CHARACTER*16 NPOS Names of positions NPOINT I INTEGER — Number of output points RVALS O REAL*8 NPOS* NPOINT Property values TYPE O CHARACTER*12 — Units type LABEL O CHARACTER*16 — Units label IERR O INTEGER — Error flag (0=No error) † I = Input to subroutine, O = Output from subroutine Retrieving Component-Dependent Vent Profiles Call subroutine TKPVR2 to retrieve vent profiles for component-dependent properties. The times for each profile point are retrieved in TKPVRP. Calling Sequence for TKPVR2 CALL TKPVR2 (PRID, PNAME, NCP, COMPID, NPOINT, RVALS, TYPE, LABEL, IERR) Argument List Descriptions for TKPVR2 Variable I/O † Type Dimension Description PRID I CHARACTER*(*) — Block ID PNAME I CHARACTER*12 — Property name. See Appendix B for a list of valid property names. NCP I INTEGER — Number of components present COMPID O CHARACTER*8 NCP Component Ids NPOINT I INTEGER — Number of output points RVALS O REAL*8 NCP* NPOINT Property values TYPE O CHARACTER*12 — Units type LABEL O CHARACTER*16 — Units label IERR O INTEGER — Error flag (0=No error) † I = Input to subroutine, O = Output from subroutine 7 Pressure Relief Subroutines 137 138 7 Pressure Relief Subroutines 8 Examples This chapter presents a series of examples to illustrate the development and use of an application program using the Summary File Toolkit: Example Title 1 Stream Heat and Material Balance Table Generation 2 Interactive Heating/Cooling Curve Table Generation 3 Column Profile Results Written to Plot File 4 Distillation Column Diagram Generation The Fortran source code for these examples is in the Engine\user directory of the Aspen Plus installation. They are named sftex#.f where # is the number of the example.A summary file (sftex.sum) and the input file used to generate it (sft.inp) are also in the same directory. Example 1: Stream Heat and Material Balance Table Generation This example retrieves stream results from the summary file. Both standard stream results and property set results are retrieved. The results are written to a file in table format. Declaring Variables and Dimensioning The toolkit routines used in this program require a variety of character variables and arrays. Space is needed to store results retrieved from the toolkit routines. This program assumes only 5 streams per printed page of the table, 1000 properties at most for each stream, and a maximum of 100 components. C C Variable declarations; reals are double precision. C IMPLICIT REAL*8 (A-H, O-Z) CHARACTER*80 SUMFIL, RCPROP, RCUNIT, ASPDIR CHARACTER UNISET*4, VERSN*20, RUNID*8, DATE*80, INFILE*80, 8 Examples 139 + + + + C C C C C ID*8, TYPE*12, IDS*8, QUALS*16, TYPES*12, LABELS*16,OLDNAM*16, PLUS*16, EXCL*16, PNAMES*12, SSID*8,COMPID*8, PHASE*8, WETDRY*4, BASIS*4, OLDPHS*8, KFF*1,OLDLAB*16, SOURCE*8, DEST*8 Dimension arrays for the toolkit routines. Arrays are dimensioned for 5 streams, 1000 properties, and 100 components. + + DIMENSION QUALS(4,1000), TYPES(1000), LABELS(1000), PNAMES(1000), SSID(1000), COMPID(1000), PHASE(1000), WETDRY(1000), BASIS(1000) DIMENSION SVALS(1000, 5), IDS(5) DIMENSION XMW(100) Initializing the Toolkit The executable section of the application program begins by initializing the summary file toolkit. The steps are: 1 Get the name of the Aspen Plus Simulation Engine directory by prompting the user. 2 Get the name of the summary file by prompting the user. 3 Call TKINIT to perform the initialization. C C C C C C C C C Begin executable code. Get file names for the toolkit. Get rcpropnu.dat and rcunits.dat by prompting the user for the name of the directory where the Aspen Plus Simulation Engine is installed. + 50 55 C C C C C C C C WRITE(6, *) ' Enter the Aspen Plus Simulation Engine' // 'directory name: ' READ(5, FMT='(A)') ASPDIR DO 50 LEN = 80, 1, -1 IF (ASPDIR(LEN:LEN) .NE. ' ') GO TO 55 CONTINUE CONTINUE RCPROP = ASPDIR(1:LEN) // '\toolkit\rcpropnu.dat' RCUNIT = ASPDIR(1:LEN) // '\toolkit\rcunits.dat' Prompt the user for the name of the summary file: WRITE(6, *) ' Enter the summary file name: ' READ(5, FMT='(A)') SUMFIL -------------------------------------------------------Open the summary file and call TKINIT to initialize the toolkit. If there is an error, end execution. OPEN(UNIT=2, FILE=SUMFIL, STATUS='UNKNOWN') CALL TKINIT(UNISET, 1, 2, 3, RCPROP, 4, RCUNIT, RMISS,IERR) IF (IERR .NE. 0) GO TO 9999 140 8 Examples Finding Number of Streams To find the streams, TKINFO is called to determine the number of simulation objects in the summary file. The variable NSTRM is the total number of streams. C Get the number of streams by calling TKINFO. C CALL TKINFO(VERSN, RUNID, DATE, INFILE, ISTAT, IWORK, + NBLK, NSTRM, NTABLE, NSENS ) Finding Component Molecular Weight For component-dependent properties, the molecular weight is written for each component in the table. Molecular weight is retrieved by calling TKCOMP to determine the number of conventional components, and TKCPRP to retrieve the property values. C Get the number of components and molecular weight values. C CALL TKCOMP(NCC, NNCC) PNAMES(1) = 'MW' CALL TKCPRP(PNAMES, NCC, XMW, LABELS) Retrieving Stream Properties For each material stream, both standard and property set results are retrieved. TKSINF determines the dimensions of the standard results, and TKSTRM retrieves them. For property set results, TKNSPR determines the number of results, and TKSPRP retrieves them. C Call TKSINF and TKSTRM to retrieve the basic stream results. C CALL TKSINF(ID, SOURCE, DEST, NSUBS, LEN, IERR) CALL TKSTRM(ID, LEN, QUALS, SVALS(1, NPPG), TYPES, + LABELS, IERR) C C If an error occurred retrieving the results, skip this C stream. C IF (IERR .NE. 0) THEN WRITE(6, *) ' ERROR ON STREAM ',ID NPPG = NPPG - 1 GO TO 1000 ENDIF C C Call TKNSPR and TKSPRP to retrieve the property sets. C Check for an error, and skip this stream if one occurs. C CALL TKNSPR(ID, NPROP, IERR) IF (IERR .NE. 0) THEN WRITE(6, *) ' ERROR ON STREAM ',ID NPPG = NPPG - 1 GO TO 1000 ENDIF LL = LEN + 1 CALL TKSPRP(ID, NPROP, PNAMES, SSID, PHASE, COMPID, 8 Examples 141 + + WETDRY, BASIS, SVALS(LL, NPPG), TYPES(LL), LABELS(LL), IERR) Writing Stream Table Every five streams, or when the last stream is processed, the table is written to the file hmbtable.out. The standard results are written first; the molecular weight associated with each component is written with the first componentdependent property. The property sets follow the standard results. An example of one page of output is shown in Figure 8.1. C If this is the 5th stream, or the last stream, write the C table for the set of streams. C IF (NPPG .NE. 5 .AND. I .NE. NSTRM) GO TO 1000 WRITE(7, 30) KFF WRITE(7, 31) (PLUS,II=1,NPPG), EXCL WRITE(7, 10) (IDS(II),II=1,NPPG) WRITE(7, 31) (PLUS,II=1,NPPG), EXCL OLDNAM = ' ' ICOMP = 1 C C Loop through the basic stream properties. Check to see C if each is component-dependent. C DO 500 J = 1, LEN C C For non-component-dependent properties, write the name, C the unit label, and the values. C IF (QUALS(3,J) .EQ. ' ') THEN WRITE(7, 20) QUALS(1,J), LABELS(J), + (SVALS(J,JJ),JJ=1,NPPG) WRITE(7, 31) (PLUS,II=1,NPPG), EXCL OLDNAM = QUALS(1,J) ELSE C C For component-dependent properties, write the name if C the previous name is different. C IF (QUALS(1,J) .NE. OLDNAM) + WRITE(7, 21) QUALS(1,J),LABELS(J), + (EXCL,II=1,NPPG),EXCL OLDNAM = QUALS(1,J) IF (ICOMP .GT. NCC) THEN C C Write the molecular weight with the component name C if this is the first component-dependent property. C WRITE(7, 22) QUALS(3,J), (SVALS(J,JJ),JJ=1,NPPG) ELSE WRITE(7, 23) QUALS(3,J), XMW(ICOMP), + (SVALS(J,JJ),JJ=1,NPPG) ENDIF IEND = MOD(ICOMP, NCC) 142 8 Examples IF (IEND .EQ. 0) WRITE(7, 31) (PLUS,II=1,NPPG), EXCL ICOMP = ICOMP + 1 ENDIF CONTINUE 500 C C C C C Loop through the PROP-SET properties. The properties are sorted by phase. If the current phase is different from the previous phase, then print a new phase header. C OLDNAM = ' ' OLDPHS = ' ' OLDLAB = ' ' IFIRST = 1 DO 600 J = 1, NPROP L = J + LEN IF (PHASE(J) .NE. OLDPHS) THEN First item is already preceded by a line IF (IFIRST .EQ. 0) THEN WRITE(7, 31) (PLUS,II=1,NPPG), EXCL ELSE IFIRST = 0 ENDIF WRITE(7, 40) PHASE(J), (EXCL,II=1,NPPG), EXCL ENDIF C C C Check for a component qualifier on the property. + C C C C For component-dependent properties, write the name for the set of components only once. + 600 C IF (COMPID(J) .EQ. ' ') THEN WRITE(7, 31) (PLUS,II=1,NPPG), EXCL WRITE(7, 20) PNAMES(J), LABELS(L), (SVALS(L,JJ),JJ=1,NPPG) OLDNAM = PNAMES(J) OLDLAB = LABELS (L) ELSE IF (PNAMES(J).NE.OLDNAM .OR. LABELS(L).NE.OLDLAB) THEN WRITE(7, 31) (PLUS,II=1,NPPG), EXCL WRITE(7, 21) PNAMES(J),LABELS(L), (EXCL,II=1,NPPG),EXCL ENDIF OLDNAM = PNAMES(J) OLDLAB = LABELS(L) WRITE(7, 22) COMPID(J), (SVALS(L,JJ),JJ=1,NPPG) ENDIF OLDPHS = PHASE(J) CONTINUE Underline the final item WRITE(7,31) (PLUS, II=1, NPG), EXCL Figure 8.1 – Stream Table Results Excerpt VAP 8 Examples LIQ H2RCY CHRCY PRODUCT 143 MOLEFLOW KMOL/HR H2 (MW = 2.02) 13.663 0.25941 12.570 0.77824E-01 0.38241E-11 N2 (MW = 28.01) 6.7132 0.23753 6.1762 0.71260E-01 0.14270E-10 C1 (MW = 16.04) 17.519 2.0170 16.118 0.60509 BZ (MW = 78.11) 0.11318E-02 0.89643E-01 0.10412E-02 0.26893E-01 0.62739E-01 CH (MW = 84.16) 0.78883 64.619 0.72573 19.386 45.229 MOLEFLMX KMOL/HR 38.686 67.222 35.591 20.167 45.291 MASSFLMX KG/HR 563.14 5485.0 518.09 1645.5 3811.4 VLSTDMX L/MIN 805.90 131.48 741.43 39.445 123.98 TEMP K 322.04 322.04 322.04 322.04 474.15 PRES ATM 21.094 21.094 21.094 21.094 13.609 VFRAC 1.0000 0.00000E+00 1.0000 LFRAC 0.00000E+00 1.0000 SFRAC 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00 0.13065E-07 0.00000E+00 0.00000E+00 0.00000E+00 1.0000 1.0000 HMX CAL/MOL -8542.1 -35492. -8542.1 -35492. -29055. HMX CAL/GM -586.81 -434.98 -586.81 -434.98 -345.26 HMX CAL/SEC -91794. -0.66274E+06 -84450. -0.19882E+06 -0.36554E+06 SMX CAL/MOL-K -14.579 -138.84 -14.579 -138.84 -125.29 SMX CAL/GM-K -1.0016 -1.7016 -1.0016 -1.7016 -1.4888 RHOMX MOL/CC 0.80005E-03 0.85210E-02 0.80005E-03 0.85210E-02 0.60884E-02 RHOMX GM/CC 0.11646E-01 0.69527 0.11646E-01 0.69527 0.51236 14.557 14.557 84.154 MWMX 81.595 81.595 ** VAPOR PHASE ** DMX H2 0.35103E-01 0.10000E+36 0.35103E-01 0.10000E+36 0.10000E+36 N2 0.16453E-01 0.10000E+36 0.16453E-01 0.10000E+36 0.10000E+36 C1 0.19524E-01 0.10000E+36 0.19524E-01 0.10000E+36 0.10000E+36 BZ 0.69972E-02 0.10000E+36 0.69972E-02 0.10000E+36 0.10000E+36 CH 0.67625E-01 0.10000E+36 0.67625E-01 0.10000E+36 0.10000E+36 MUMX 0.13021E-01 0.10000E+36 0.13021E-01 0.10000E+36 0.10000E+36 ** LIQUID PHASE ** DMX SQCM/SEC H2 0.10000E+36 0.11111E-03 0.10000E+36 0.11111E-03 0.41453E-03 N2 0.10000E+36 0.99235E-04 0.10000E+36 0.99235E-04 0.36919E-03 C1 0.10000E+36 0.91460E-04 0.10000E+36 0.91460E-04 0.35104E-03 BZ 0.10000E+36 0.54343E-04 0.10000E+36 0.54343E-04 0.20117E-03 CH 0.10000E+36 0.20065E-03 0.10000E+36 0.20065E-03 0.14933E-03 MUMX 144 CP 0.10000E+36 0.25699 0.10000E+36 0.25699 0.10380 8 Examples Example 2: Interactive Heating/Cooling Curve Table Generation This example retrieves heating/cooling curve results from unit operation blocks. The summary file is queried for a list of blocks containing curve results. This example uses a toolkit utility routine TKUPPR, that takes a character string as an argument and uppercases it. A sample of the program dialog is shown in Figure 8.2. A sample of the output is shown in Figure 8.3. Declaring Variables Declarations and dimensions are similar to those in Example 1. But in this example, the paths for the properties and units files are coded into the program. C C Data statements C DATA UNISET / 'ENG' / DATA PLUS / '-----------------+' / DATA EXCL / '-----------------!'/ DATA RMISS / 1.0D35 / DATA RCPROP / 'C:\Aspen Plus\Engine\Toolkit\RCPROPNU.DAT' / DATA RCUNIT / 'C:\Aspen Plus\Engine\Toolkit\RCUNITS.DAT' / Initializing the Toolkit The user is prompted for the name of the summary file. The summary file must be opened before TKINIT is called. C C Prompt the user for the name of the summary file. C WRITE(6, *) ' Enter the summary file name: ' READ(5, FMT='(A)') SUMFIL C C Open the summary file and call TKINIT to initialize C the toolkit. If there is an error, end execution. C OPEN(UNIT=2, FILE=SUMFIL, STATUS='UNKNOWN') CALL TKINIT(UNISET, 1, 2, 3, RCPROP, 4, RCUNIT, RMISS,IERR) IF (IERR .NE. 0) GO TO 9999 Finding Number of Blocks The number of blocks is determined by calling TKINFO. C Get the number of blocks by calling TKINFO. CALL TKINFO(VERSN, RUNID, DATE, INFILE, ISTAT, IWORK, + NBLK, NSTRM, NTABLE, NSENS ) 8 Examples 145 Finding Blocks with Heating/Cooling Curves One method of listing the blocks is to loop through them by calling TKNBLK. This allows a check of each block for the existence of heating/cooling curves. C C Prompt the user to have Hcurves checked for the block. C To check for Hcurves, loop through all the blocks by C calling TKNHCV. C If the block has an Hcurve, load its ID and model type C into the ID arrays. C 100 CONTINUE NITEM = 0 NSET = 0 DO 200 I = 1, NBLK I1 = NITEM + 1 CALL TKNBLK(I, ID8(I1), ID12(I1), IERR) IF (IERR .NE. 0) GO TO 200 CALL TKNHCV(ID8(I1), NCURVE) IF (NCURVE .EQ. 0) GO TO 200 NITEM = NITEM + 1 C C If there are more than 100 blocks with Hcurves, C the work area will be filled. Write the first 100 blocks C to the list. C IF (NITEM .LT. 100 .OR. I .EQ. NBLK) GO TO 200 IF (NSET .EQ. 0) THEN WRITE(6, *) + ' The following blocks contain Hcurve results:' WRITE(6, *) ' Block ID Model' WRITE(6, *) ' =======================' ENDIF DO 190 J = 1, NITEM WRITE(6, FMT='(1X,A8,2X,A12)') ID8(J), ID12(J) 190 CONTINUE IF (I .NE. NBLK) NSET = 1 NITEM = 0 200 CONTINUE C C If there are any unwritten entries in the list, write C the list of blocks with Hcurves. C IF (NITEM .NE. 0) THEN IF (NSET .EQ. 0) THEN WRITE(6, *) + ' The following blocks contain Hcurve results:' WRITE(6, *) ' Block ID Model' WRITE(6, *) ' =======================' ENDIF DO 210 J = 1, NITEM WRITE(6, FMT='(1X,A8,2X,A12)') ID8(J), ID12(J) 210 CONTINUE ENDIF 146 8 Examples Prompting for Block Name When the blocks with heating/cooling curves are listed, prompt the user for the block IDs. Since all IDs in the summary file are in uppercase, userspecified IDs must be converted to uppercase. TKNHCV is called for each ID, to check whether or not a valid ID has been entered. C Prompt the user for the block to be checked; C remember to convert the block ID to uppercase. C WRITE(6, *) ' ' WRITE(6, *) ' Please select a block from the list:' READ(5, FMT='(A)') ID C Uppercase the response using a toolkit utility routine CALL TKUPPR (ID) CALL TKNHCV(ID, NCURVE) IF (NCURVE .LE. 0) THEN WRITE(6, *) ' ',ID,' is not a valid block ID.' WRITE(6, *) ' Please select again.' GO TO 100 ENDIF Finding Heating/Cooling Curves for Selected Block Once a valid block ID is given, the heating/cooling curves in the block are listed by calling TKLHCV. The routine CHKREP checks that an integer is specified for the heating/cooling curve ID. C For a valid block with Hcurve data, print a list of C the Hcurves for the block. C 240 CONTINUE WRITE(6, *) ' ',ID,' contains the following Hcurves:' WRITE(6, *) ' ID Type Hcurve No.' WRITE(6, *) ' =======================' CALL TKLHCV(ID, NCURVE, ID16, INTS, IERR) DO 250 I = 1, NCURVE WRITE(6, FMT='(1X,I2,2X,A16,1X,I4)') I, ID16(I), INTS(I) 250 CONTINUE WRITE(6, *) + ' Please select an Hcurve by specifying its ID:' READ(5, '(A4)') REPLY CALL CHKREP (REPLY, II, ISTAT) IF ( ISTAT .EQ. 1 ) THEN WRITE(6, *)'"',REPLY, + '" is not an integer. Please select again:' GO TO 240 ENDIF IF (II .LE. 0 .OR. II .GT. NCURVE) THEN WRITE(6, *) '"',II, + '" is not a valid ID. Please select again:' GO TO 240 ENDIF 8 Examples 147 Finding Dimensions of Heating/Cooling Curve TKSHCV checks the dimensions of the data for the curve that is selected. If the dimensions are larger than the arrays are dimensioned, an exit with an error may occur. C C For a specific Hcurve, get its size, and C print the standard properties. C IHCNO = INTS(II) CALL TKSHCV(ID, ID16(II), IHCNO, NPOINT, NPROP) C C The TVAL array is dimensioned for 100 points and 100 C properties. C That means only 99 stream properties can be stored. If C there are more than 99, or more than 100 points, print C error. C IF (NPROP .GT. 99 .OR. NPOINT .GT. 100) THEN WRITE(6, *) ' *** Error - This Hcurve is too large ***' GO TO 700 ENDIF Retrieving Standard Heating/Cooling Curve Results This program allows the user to choose one of the standard results (temperature, pressure, heat duty, or vapor fraction) as the independent variable in the table. The table of these standard results is written, so the user can choose one of them. TKHCRV is called to retrieve the standard results. C C Call TKHCRV to get the standard properties. C CALL TKHCRV(ID, ID16(II), IHCNO, NPOINT, INTS, TVAL(1,1), + TVAL(1,2), TVAL(1,3), TVAL(1,4), IERR) C C Get unit label information for standard properties. C TYPES(1) = 'TEMPERATURE' TYPES(2) = 'PRESSURE' TYPES(3) = 'ENTHALPY-FLOW' CALL TKLABL(3, TYPES, LABELS) LABELS(4) = LABELS(3) LABELS(3) = ' ' C C Write the table of standard results, so that the user C can select an independent variable. C WRITE(6, 31) (PLUS,JJ=1,3),EXCL WRITE(6, 10) (PROPS(JJ),JJ=1,4) 148 8 Examples 500 WRITE(6, 10) (LABELS(JJ),JJ=1,4) WRITE(6, 31) (PLUS,JJ=1,3),EXCL DO 500 I = 1, NPOINT WRITE(6, 20) (TVAL(I,JJ),JJ=1,4) CONTINUE WRITE(6, 31) (PLUS,JJ=1,3),EXCL Retrieving Property Sets The user is prompted for the property sets to be included in the table. TKNHPR is called to retrieve the name of the properties with their qualifiers, and to retrieve the values. C C Loop through the property sets to create a list of C properties for the user to choose from. Store the C properties in the TVAL array. C WRITE(6, *) ' Select properties from the following list:' WRITE(6, *) ' ID Property Phase Component' WRITE(6, *) ' ===============================' DO 600 I = 1, NPROP CALL TKNHPR(ID, ID16(II), IHCNO, NPOINT, I, + PNAMES(I+1), SSID, PHASE(I+1), COMPID(I+1), + WETDRY, BASIS, TVAL(1,I+1), TYPES(I+1), + LABELS(I+1), IERR) WRITE(6, 11) I, PNAMES(I+1), PHASE(I+1), COMPID(I+1) 600 CONTINUE NCOL = 2 605 CONTINUE WRITE(6, *) ' Please enter the ID number of the property:' READ(5, '(A4)') REPLY CALL CHKREP (REPLY, JCOL, ISTAT) IF ( ISTAT .EQ. 1 ) THEN WRITE(6, *)'"',REPLY, + '" is not an integer. Please select again:' GO TO 605 ENDIF IF (JCOL .LT. 1 .OR. JCOL .GT. NPROP) THEN WRITE(6, *) ' "',JCOL,'" is not a valid ID' GO TO 605 ENDIF ICOL(NCOL) = JCOL + 1 WRITE(6, *) ' Do you want another property (Y/N)?' INFILE = ' ' READ(5, FMT='(A)') INFILE C Uppercase the response using a toolkit utility routine CALL TKUPPR(INFILE) After the user has chosen the properties to be tabulated, they are written to the file hcurve.out. Figure 8.2 Example 2 Program Dialog Enter the summary filename: MANU.SUM The following blocks contain Hcurve results: 8 Examples 149 Block ID Model FEED-MIX HEATER HP-SEP FLASH2 Please select a block from the list: FEED-MIX FEED-MIX contains the following Hcurves: ID Type Hcurve No. 1 HCURVE 1 2 HCURVE 2 Select an Hcurve by specifying its ID. TEMPERATURE (F) PRESSURE (PSI) VAPOR FRACTION DUTY (BTU/HR) 103.76 330.00 0.73446 0.00000E+00 156.99 330.00 0.75237 0.52969E+06 198.86 330.00 0.78232 0.10594E+07 231.90 330.00 0.82372 0.15891E+07 258.28 330.00 0.87527 0.21188E+07 279.65 330.00 0.93567 0.26485E+07 296.36 330.00 1.0000 0.31507E+07 300.00 330.00 1.0000 0.31782E+07 Specify the independent variable – either TEMP, PRES, VFRAC, or DUTY. TEMP Select properties from the following list: ID Property Phase 1 KMX VAPOR 2 KMX LIQUID 3 MUMX VAPOR 4 MUMX LIQUID Component Enter the ID number of the property. 1 Do you want another property (Y/N)? Y Enter the ID number of the property. 3 Do you want another property (Y/N)? N Do you want to generate another table (Y/N)? N 150 8 Examples Figure 8.3 Sample Output File hcurve.out 8 Examples Temperature (F) KMX Vapor (BTU-FT/HR-SQFT-R) MUMX Vapor (CP) 103.76 0.72312E-01 0.10226E-01 156.99 0.71705E-01 0.11065E-01 198.86 0.67680E-01 0.11734E-01 231.28 0.62145E-01 0.12190E-01 258.28 0.56470E-01 0.12467E-01 279.65 0.51312E-01 0.12626E-01 296.36 0.47088E-01 0.12712E-01 300.00 0.47323E-01 0.12763E-01 151 Example 3: Column Profile Results Written to Plot File This example demonstrates retrieving column profile results and writing the results to a plot file. The program prompts the user for the property to be retrieved, along with labels for the axes. Opening Files and Initializing Toolkit The first step is to identify the file names. The properties and units files are in the TOOLKIT subdirectory of the Aspen Plus supplemental directory on Windows systems. The environment variable ASPTOP points to this top level directory. The environment variable XSUM is used in this example to pass the name of the summary file into the program. Both environment variables are decoded using the subroutine GETENV. The following example uses subroutine TKOPEN to open the summary file. You must use TKOPEN if the summary file toolkit DLL is called. The plot file is not written by the summary file toolkit DLL, and therefore does not use TKOPEN. USE IFPORT C Open the plot file as HYDRAUL.PLF. C OPEN(UNIT=7,FILE='HYDRAUL.PLF', STATUS='UNKNOWN') C C Set file names and unit set. C CALL GETENV('ASPTOP',ASPTOP) DO 55 I = 255, 1, -1 IF (ASPTOP(I:I) .NE. ' ') THEN ILEN = I GO TO 56 ENDIF 55 CONTINUE 56 CONTINUE RCPROP = ASPTOP(1:ILEN) // '\TOOLKIT\RCPROPNU.DAT' RCUNIT = ASPTOP(1:ILEN) // '\TOOLKIT\RCUNITS.DAT' UNISET = 'ENG' C C Read the summary file name from the environment variable C XSUM. C CALL GETENV ('XSUM', SUMFIL) C Open the summary file with TKOPEN. ACCESS = 'SEQUENTIAL' FORM = 'FORMATTED' MODE = 'READ' STATUS = 'OLD' CALL TKOPEN(1, SUMFIL, ACCESS, FORM, 80, STATUS, MODE,IERR) C C Call TKINI2 to initialize the toolkit. 152 8 Examples C XMISS = 1D35 CALL TKINI2(UNISET,2,1,3,RCPROP,4,RCUNIT,XMISS,IERR, 6) Finding List of Blocks One option for listing the blocks is calling TKBIDS to return the list of block IDs and block types. The block types array can be checked for the correct type before prompting the user for the block ID. C Call TKINFO to get the number of blocks, and TKBIDS to C get the list. Allow the user to choose from RADFRAC C blocks. C CALL TKINFO(VERSN , RUNID , DATE , INFILE, ISTAT , IWORK , + NBLK , NSTRM , NTABLE, NSENS ) CALL TKBIDS(NBLK, BLKID, BLKTYP, IERR) 100 CONTINUE WRITE(6, *) 'Select a block from the following list:' WRITE(6, *) '---------------------------------------' DO 110 I = 1, NBLK IF (BLKTYP(I) .NE. 'RADFRAC') GO TO 110 WRITE(6, *) BLKID(I) 110 CONTINUE Finding List of Properties This program allows the user to choose from the available properties for those to plot. TKPROF determines the dimensions of the data, including the number of properties. TKPROP lists the properties and identifies them as componentor non-component-dependent. C C Call TKPROF and TKPROP to get a list of properties. C CALL TKPROF(ID,ICOL,NSTAGE,NCP,NPROP) CALL TKPROP(ID,ICOL,NPROP,ITYPES,PNAMES,IERR) C C Prompt the user for the desired property to plot. C 120 CONTINUE WRITE(6,*) 'Choose from the following properties:' WRITE(6,*) '-------------------------------------' WRITE(6,*) ' ' ITER = ((NPROP-1/5)) DO 130 I = 0,ITER WRITE(6,*) (PNAMES(5*I+J),J=1,5) 130 CONTINUE WRITE(6,*) ' ' WRITE(6,*) 'ENTER THE ABBREVIATED NAME OF THE PROPERTY' READ(5,10) PNAME C Uppercase the response using a toolkit utility routine CALL TKUPPR (PNAME) INDEX = 0 DO 150 I = 1,NPROP IF (PNAMES(I) .EQ. PNAME) THEN INDEX=I 8 Examples 153 GO TO 151 ENDIF 150 CONTINUE IF (INDEX .EQ. 0) THEN WRITE (6,*) + 'PROPERTY NAME NOT FOUND. PLEASE ENTER AGAIN.' WRITE (6,*) GO TO 120 ENDIF 151 CONTINUE Retrieving Selected Property Profile Once the property has been selected, the data must be retrieved. The value of ITYPES for the property determines whether TKPRO1 is called for noncomponent- dependent properties, or TKPRO2 for component-dependent properties. C C Call either TKPRO1 or TKPRO2 to retrieve the results. C IF (ITYPES(INDEX) .EQ. 1) THEN CALL TKPRO1(ID,PNAME,ICOL,NSTAGE,RVALS,TYPE + ,LABEL,IERR) C ELSE CALL TKPRO2(ID,PNAME,ICOL,NCP,COMPID,NSTAGE,RVALS, + TYPE,LABEL,IERR) C ENDIF After the values are retrieved, they can be written to the plot file. A sample plot file is shown in Figure 8.5. Closing the Application The following two steps should be used when using the DLL version of the summary file toolkit: 1 Call TKCLOS to close the files opened by the summary file toolkit. 2 Call TKCLFL to close the summary file. Because the plot file was not opened with TKOPEN, close it with the Fortran CLOSE statement directly: C Shut down the toolkit. CALL TKCLOS (1, 2, 3, 4) C Close summary file. CALL TKCLFL (2, IERR) C Close the plot file CLOSE (7) C STOP END 154 8 Examples Figure 8.4 Example 3 Program Dialog Select a block from the following list: COLUMN Please select a block from the list: COLUMN Choose from the following properties: B_TEMP B_PRES DUTY LIQ_FLOW VAP_FLOW FEED_LFLOW FEED_VFLOW FEED_FLOW PROD_LFLOW PROD_VFLOW LIQ_ENTH VAP_ENTH HYD_LMF HYD_VMF HYD_LVF HYD_VVF HYD_RHOL HYD_RHOV HYD_MUL HYD_MUV HYD_STEN HYD_PARM HYD_QR HYD_MWL HYD_MWV HYD_FMIDX HYD_FFR X Y B_K Enter the name of the property HYD-RHOL Enter the title LIQUID DENSITY VS STAGE Enter the label for x-axis STAGE Enter the label for y-axis LIQUID DENSITY Enter the first legend: DENSITY Do you want to choose another property (Y/N) N Figure 8.5 Sample Plot File ///// ///// ///// BLOCK: COLUMN SENTENCE:PLOT NDEP NPTS LTITLE LHLABEL LVLABEL 1 15 12 10 10 LIQUID DENSITY VS STAGE STAGE LIQUID DENSITY DENSITY 1 2 3 4 5 6 7 8 9 10 8 Examples LEG1 10 LEG2 0 LEG3 0 LEG4 0 LEG5 0 45.872 36.130 34.708 34.474 34.434 34.427 34.425 34.007 32.150 32.000 155 11 12 13 14 15 31.987 31.986 31.986 31.986 31.986 Example 4: Distillation Column Diagram Generation This example uses the summary file toolkit to retrieve basic information about a distillation model. The information retrieved includes feed and product flows, reflux and boilup ratios, condenser and reboiler duties, and stage information. These results are used to create an annotated diagram of the column. Initializing the Toolkit The first step is getting the file names for toolkit initialization. In this example, the paths to the properties and units files are fixed. The summary file name is read from the file toolkit.dat. C C Get filenames for the toolkit - rcpropnu.dat and C rcunits.dat C RCPROP = 'C:\Aspen Plus\Engine\Toolkit\RCPROPNU.DAT' RCUNIT = 'C:\Aspen Plus\Engine\Toolkit\RCUNITS.DAT' C C Open the summary file and call TKINIT to initialize C the toolkit. If there is an error, end execution. C OPEN(UNIT=2, FILE='TOOLKIT.DAT',STATUS='UNKNOWN') READ(2,FMT='(A)') SUMFIL CLOSE(2) OPEN(UNIT=2, FILE=SUMFIL, STATUS='OLD') UNISET = 'ENG' CALL TKINIT(UNISET, 1, 2, 3, RCPROP, 4, RCUNIT, RMISS,IERR) IF (IERR .NE. 0) GO TO 9999 Retrieving Basic Block Results After the user has selected a block, the basic results must be retrieved. This is a two-step process: 1 Call TKNRES to determine the dimensions of the data. 2 Call TKBRES to retrieve the results. Four results are selected from the list of values returned by TKBRES: Q1, QN, RR, and BU_RATIO. C C Get the basic scalar results for the column, to provide C values for Q1, QN, RR, and BR. C 156 8 Examples 140 C C C CONTINUE CALL TKNRES(ID, NRES, NQUAL, IERR) IF (NRES .EQ. 0 .OR. IERR .NE. 0) THEN WRITE(6, *) ' *** Error occurred in block' GO TO 9999 ENDIF IF (NQUAL .EQ. 0) NQUAL = 1 CALL TKBRES(ID, NRES, NQUAL, PNAMES, QUALS, ITYPES, INTS, + CW8, TVALS, TYPES, LABELS) Search the results array for the values wanted. 150 DO 150 I = 1, NRES IF (PNAMES(I) .EQ. 'RR') I1=I IF (PNAMES(I) .EQ. 'BU_RATIO') I2=I IF (PNAMES(I) .EQ. 'COND_DUTY') I3=I IF (PNAMES(I) .EQ. 'REB_DUTY') I4=I IF (PNAMES(I) .EQ. 'TOP_LFLOW') I5=I IF (PNAMES(I) .EQ. 'BOT_LFLOW') I6=I CONTINUE RR = TVALS(I1,1) BR = TVALS(I2,1) Q1 = TVALS(I3,1) QN = TVALS(I4,1) TVFLOW = TVALS(I5,1) BLFLOW = TVALS(I6,1) Retrieving Inlet and Outlet Stream Flows To find the inlet and outlet stream flows, profile results are retrieved for the feed and product properties. TKPROF finds the dimensions of the data, and TKPROP lists the properties. TKPRO1 is called to retrieve the values. C C Call TKPROF to get the dimensions, and TKPRO1 to C get the values. C CALL TKPROF(ID, 1, NSTAGE, NCP, NPROP) CALL TKPROP(ID,1,NPROP,ITYPES,PNAMES,IERR) PNAME = 'PROD_VFLOW' CALL TKPRO1(ID, PNAME, 1, NSTAGE, RVALS, TYPES, + LABELS, IERR) PNAME='PROD_LFLOW' CALL TKPRO1(ID,PNAME,1,NSTAGE,RLALS,TYPES,LABELS,IERR) II = 0 DO 133 I = 1,NSTAGE IF (RVALS(I) .NE. 0.0) THEN II = II + 1 ISP(II) = I ENDIF IF (RLALS(I) .NE. 0.0) THEN II = II + 1 ISP(II) = I ENDIF 133 CONTINUE PNAMES(1) = 'FEED_LFLOW' CALL TKPRO1(ID, PNAMES, 1, NSTAGE, TVALS(1,6), TYPES, 8 Examples 157 + LABELS, IERR) PNAMES(1) = 'FEED_VFLOW' CALL TKPRO1(ID, PNAMES, 1, NSTAGE, TVALS(1,7), TYPES, + LABELS, IERR) Finding Inlet and Outlet Stream IDs The connectivity routines are called to list the inlet and outlet streams. TKSTRM is called for each stream to determine the flow rate. The flow rate is matched against the feed or product flow to determine the stage for each stream. The feed stream check follows: C C Call the connectivity routines. C CALL TKCNTN(ID, NIN, NOUT, IERR) CALL TKCNCT(ID, NIN, NOUT, BLKIN, TYPIN, BLKOUT, TYPOUT, + IERR) C C Feed and products are matched with stage numbers, C by matching flowrates with the streams. C C Loop through the inlet streams and get the moleflows. C DO 200 I = 1, NIN INTS(I) = 0 IF (TYPIN(I) .NE. 'MATERIAL') GO TO 200 CALL TKSINF(BLKIN(I), SOURCE, DEST, NSUBS, LEN, IERR) CALL TKSTRM(BLKIN(I), LEN, QUALS, TVALS(1,8), TYPES, + LABELS, IERR) DO 160 J = 1, LEN IJ = 4*J – 3 IF (QUALS(IJ) .EQ. 'MOLEFLMX') THEN FLOW = TVALS(J,8) FX = TVALS(J,8) L5 = LABELS(J) ENDIF 160 CONTINUE DO 170 J = 1, NSTAGE IF (J .EQ. 1) TFLOW = TVALS(J,6) IF (J .GT. 1) TFLOW = TVALS(J,6) + TVALS(J-1,7) FDIFF = DABS(TFLOW - FLOW) / FLOW IF (FDIFF .GT. 1D-5) GO TO 170 INTS(I) = J NPOS = J 170 CONTINUE 200 CONTINUE With the values retrieved, and the stages matched to the feeds and products, the diagram can be written. Sample output is shown in Figure 8.5. Figure 8.6 Sample Column Diagram +-------+ ! ! +-----------+ ! ! +---+---+ 158 COND-DUTY= -112659.17200 BTU/HR 8 Examples +----+----+ ! ! -------+ T-PROD= 3.89 LBMOL/HR !------- ! ! -------! !------- ! BOILUP RATIO= 1.55 ! -------! REFLUX RATIO= 1.20 !------- ! ! -------! ->+------- ! FEED = 103.74 LBMOL/HR ! -------! !------- ! ! -------! !------- ! !------- +<-----+ +----+----+ ! REB-DUTY= 1415130.30000 BTU/HR ! +---+----+ +-------+ +-------- B-PROD= 99.85 LBMOL/HR ! ! +--------+ 8 Examples 159 160 8 Examples 9 XML Summary File The XML Summary File can be saved by selecting File | Export, and in the Save as type box, selecting XML Results File (*.xml). This file is an XML file that can be edited with standard XML tools and viewed with the ability to open and close individual sections in Internet Explorer. The XML Summary File begins with a top-level <Plant> tag. Within this tag are a number of tags for blocks, streams, convergence blocks, flowsheeting operations, run status, etc. Each of these tags has a dictionary attribute which refers to an XML schema file delivered with Aspen Plus in the Aspen Plus <version>\Engine\Dat or APrSystem <version>\Engine\Dat folder. In the XML file, the variables $ASPTOP and $APRSYS are used to refer to the Aspen Plus <version>\Engine and APrSystem <version>\Engine folders, respectively. Each of these tags also has a name, which is the actual name of the block, stream, etc. wherever such a name is available. There are a number of status variables with numerical values that appear in the Run-status sections. The most important of these are explained here. UOSSTAT2 UOSSTAT2 provides the status message that appears on the Run-Status | Summary sheet. It has the following possible values: Value Message 2 Simulation was completed normally 3 Simulation was not completed normally, use status button for details 4 Data regression was completed normally 5 Data regression was completed with errors, use status button for details 6 Assay data analysis was completed normally 7 Assay data analysis was completed with errors, use status button for details 8 Calculations were completed normally 9 Calculations were completed with errors, use status button for details 10 Calculations were completed with warnings, use status button for details TOTSTAT TOTSTAT describes the most severe status of all errors / warnings. 9 XML Summary File 161 Value Most Severe Status 0 No error/warning 1 Error 2 Warning ITSTAT ITSTAT gives the input translation status. Value Meaning 0 No problems 4 Warnings UOSSTAT, CVSTAT, SENSSTAT, CSSTAT, SSTAT, FORSTAT These status variables contain the same information available in ISTATF on page 22. 162 9 XML Summary File A Units A complete, up-to-date list of all units is contained in the file units.lis in the toolkit source directory. See Chapter 1 for the directory name on all operating systems. You can also find them and explanations of some of the symbols in Chapter 3 of the Aspen Plus Input Language Guide. A Units 163 164 A Units B Property Names This chapter lists the property names that are returned in the PNAME or QUALS arguments of the toolkit routines. It also lists the property names that you can specify where PNAME and QUALS are input arguments. B Property Names 165 Table B.1 - Standard Property Names 166 Property Name Description ABVSRG Percentage above surge for a compressor ACT_AREA Active area/panel for trays ACT_DPINLET Actual pressure drop reached in inlet pipe ACT_DPTAIL Actual pressure drop reached in tail pipe ACT_REFLUX Actual reflux ratio ACT_STAGES Actual number of stages ALLW_DPINLET Maximum pressure drop allowed in inlet pipe ALLW_DPTAIL Maximum pressure drop allowed in tail pipe ALLW_PRES Maximum pressure allowed in vessel ALLW_TEMP Maximum temperature allowed in vessel ANGLE Angle of pipe segment AREA_CALC Calculated area AREA_RATIO Ratio of outside finned area to inside tube area AVGDP_HT Average pressure drop/height BACKUP_LOC Downcomer location (side/center) BAFFLE_CUT Baffle cut as a fraction of shell diameter BAFFLE_TYPE Baffle type (segmental or rod) BAL_ENTH_GEN Overall reaction generated enthalpy BAL_ENTH_OUT Overall outlet enthalpy rate BAL_MASG_FLW Conventional components generated mass flow BAL_MASG_TFL Overall reaction generated mass flow BAL_MASI_TFL Overall inlet mass flow rate BAL_MASO_FLW Conventional components outlet mass flow BAL_MASO_TFL Overall outlet mass flow rate BAL_MASR_TFL Rel. difference of overall inlet and outlet mass flow BAL_MOLG_TFL Overall reaction generated molar flow BAL_MOLG_FLW Conventional components generated mole flow BAL_MOLI_TFL Overall inlet molar flow rate BAL_MOLO_FLW Conventional components outlet mole flow BAL_MOLO_TFL Overall outlet molar flow rate BAL_MOLR_TFL Rel. difference of overall inlet and outlet molar flow BAL_NNCI_FLW Non-conventional components inlet mass flow BAL_NNCO_FLW Non-conventional components outlet mass flow BAL_NNCG_FLW Non-conventional components generated mass flow BAL_NNCR_FLW Non-conventional components relative mass balance BELSWL Percentage below stonewall for a compressor BOTTHICK Bottom shell thickness B Property Names Property Name Description BOTTOM_TEMP Bottoms temperature BOT_L1FLOW Bottom stage liquid1 flow BOT_L2FLOW Bottom stage liquid2 flow BOT_LFLOW Bottom stage liquid flow BOT_VFLOW Bottom stage vapor flow BR Boilup ratio BRAKE_POWER Brake power BU_RATIO Boilup ratio BWG Birmingham wire gauge for the tubes BYPASS Bypass fraction B_K Block vapor-liquid K-value B_MASSFLOW Mass flow B_MASSFRAC Mass fraction B_MOLEFLOW Mole flow B_MOLEFRAC Mole fraction B_PRES Block pressure B_TEMP Block temperature B_VFRAC Block vapor fraction CALC Variable calculated value CAPAC_FAC Capacity factor CAV_INDX Valve cavitation index CEFF Calculated efficiency CHOK_STAT Valve choked flow status CHOKE_POUT Valve outlet pressure for choked flow CODE_COMPLY Code compliance COLDIN Cold side inlet stream ID COLDINP Cold side inlet pressure COLDINT Cold side inlet temperature COLDINVF Cold side inlet vapor fraction COLDOUT Cold side outlet stream ID COLD_FRAC Cold side vapor fraction COLD_KODE Cold side flash calculation code COLD_LRATIO Cold side liquid1/total liquid ratio COLD_PRES Cold side pressure COLD_TEMP Cold side temperature COMP-ATTR Component attribute value COMP-STAGES Compressor stage COMPFRAC Component fraction COMPRESS Compressibility COMPTYPE Compressor type COND_DUTY Condenser duty COND_Q_NSC Condenser duty without subcooling COND_RES_TIM Residence time of condensed phases (RCSTR) B Property Names 167 168 Property Name Description COND_VOL Volume occupied by the condensed phases (RCSTR) COOL-PRES Coolant pressure COOL-TEMP Coolant temperature COOLANT_TEMP Coolant temperature COR_PDRP_FAC Pressure drop ratio factor with pipe fittings COR_PREC_FAC Pressure recovery factor with pipe fittings COSTID Unit label for user2 sizing result CPCV_FAC Ratio of specific heats factor CRIT_PRS_FAC Liquid critical pressure ratio factor CSCOST Carbon steel cost for the equipment CSD-PHASE Conventional solid destination phase CUM_DPACC Cumulative accelerational pressure drop CUM_DPELEV Cumulative elevational pressure drop CUM_DPFRIC Cumulative frictional pressure drop CUM_DPTOTL Cumulative total pressure drop CYCLE_TIME Cycle time C_LIQ_FLOW Component liquid mole flow in stream C_VAP_FLOW Component vapor mole flow in stream DCAREA Downcomer area/column area ratio DCBACKUP Downcomer backup DCBSPACE Backing/tray spacing DCRATIO Velocity/design velocity ratio DCVELOC Downcomer velocity DELT Temperature change DENSITY Liquid density DEVICE_TYPE Safety relief device type DIAM Diameter DIAM50 50% diameter size DIAM-RATIO Diameter ratio DIAM_CYL Cylinder diameter DIAM_OUT Diameter of outlet DIAM_SOL Solid diameter DIS Displacement DISTIL_TEMP Distillate temperature DIST_VS_FEED Distillate-to-feed ratio DPACC Accelerational pressure drop for the segment DPELEV Elevational pressure drop for the segment DPFRIC Frictional pressure drop for the segment DPTOTL Total pressure drop for the segment DP-COL Column pressure drop DP-COND Condenser pressure drop DP-STAGE Pressure drop per stage DP_SECTION Section pressure drop B Property Names Property Name Description DUTY Calculated duty EFF Efficiency EFF_POLY Polytropic efficiency EFF_ISEN Isentropic efficiency EFFICIENCY Fin efficiency ELEC_POWER Electrical power ENTH_BAL Enthalpy balance difference ENTH_CYCLE Enthalpy per cycle ENTH_TIME Enthalpy flow during operation EPC Polytropic or isentropic efficiency EQUIV-LEN Pipe equivalent length ERO_VEL Erosion velocity at the node ERR Error ERR_TOL Error/tolerance EV Volumetric efficiency EXHTS Extra height of the vessel EXP_FAC Expansion factor EXTENT Reaction extent F Feed mole fraction FACTOR Geometric or packing factor FEED-QUALITY Feed quality FEED_FLOW Feed flow FEED_LFLOW Liquid feed flow FEED_LOCATN Feed stage location FEED_TRAY_T Feed tray temperature FEED_VFLOW Vapor feed flow FHEIGHT Fin height FILT_DIAM Filter diameter FILT_RESIST Filter resistance FINDEX Fractionation index FIN_PRES Final pressure FIN_TEMP Final temperature FIRE-FACTOR Credit factor calculated for the Fire scenario FLOOD Percentage flooding FLOOD_FAC Flooding factor FLOOD_PANEL Panel indicating the flooding regime FLOW_COEF Valve flow coefficient FLOW-COF Compressor flow coefficient FLOWP Flow parameter FLUID_POWER Fluid power FTHICKNESS Fin thickness FWDECANT Free-water decant rate FWREFLUX Free-water reflux ratio B Property Names 169 170 Property Name Description GAS-VEL Vapor superficial velocity at the node GAS_FLOW Gas flow rate HCRATIO Heat capacity ratio HEAD Head HEAD-COF Compressor head coefficient HEAT_FLUX Heat flux HEAT_RATE Total heat transfer rate HEAT_REAC Heat of reaction HEIGHT Height HETP Stage height equivalent of a theoretical plate HOLDUP Total liquid holdup HOTIN Hot side inlet stream ID HOTINP Hot side inlet pressure HOTINT Hot side inlet temperature HOTINVF Hot side inlet vapor fraction HOTOUT Hot side outlet stream ID HOT_KODE Hot side flash calculation code HOT_LRATIO Hot side liquid1/total liquid ratio HOT_PRES Hot side pressure HOT_TEMP Hot side temperature HOT_VFRAC Hot side vapor fraction HTLOSS Heat loss HT_FROM_TOP Height from top of section HX_AREAC Calculated (required) area HX_AREAP Actual (physical) area HX_DELT Delta-T between hot and cold streams HX_DTLM Log-mean temperature difference HX_DUTY Calculated heat duty HX_FMTD Log-mean temperature difference correction factor HX_NTUC Number of transfer units HX_OVERD Percent over design HX_PTNO Point number within a zone HX_SBDP Shell stream baffled flow area pressure drop HX_SFLM Shellside film coefficient HX_SMCR Shell stream crossflow Reynolds number HX_SMCV Shell stream crossflow velocity HX_SMWR Shell stream window Reynolds number HX_SMWV Shell stream window velocity HX_SNDP Shell stream nozzle pressure drop HX_SPR Shell stream Prandtl number HX_STDP Shell stream total pressure drop HX_STMP Shell stream temperature HX_TBDP Tube stream tube pressure drop B Property Names Property Name Description HX_TFLM Tubeside film coefficient HX_TMR Tube stream Reynolds number HX_TMV Tube stream velocity HX_TNDP Tube stream nozzle pressure drop HX_TPR Tube stream Prandtl number HX_TTDP Tube stream total pressure drop HX_TTMP Tube stream temperature HX_UAVC Average heat transfer coefficient for clean service HX_UAVD Average heat transfer coefficient for dirty service HX_WTMP Wall temperature HX_XIC Thermal effectiveness HX_ZNNO Exchanger zone number HYD_FFR Reduced F factor HYD_FMIDX Marangoni foaming index HYD_LMF Hydraulic liquid mass flow HYD_LVF Hydraulic liquid volume flow HYD_MUL Hydraulic liquid viscosity HYD_MUV Hydraulic vapor viscosity HYD_MWV Vapor molecular weight HYD_PARM Hydraulic flow parameter HYD_QR Hydraulic reduced vapor throughput HYD_RHOL Hydraulic liquid density HYD_RHOV Hydraulic vapor density HYD_STEN Hydraulic surface tension HYD_VMF Hydraulic vapor mass flow HYD_VVF Hydraulic vapor volume flow H_GAS Vapor phase enthalpy H_LIQ Liquid phase enthalpy H_MIX Mixture enthalpy IN-MACH Compressor inlet Mach number IND_POWER Indicated horsepower INIT_PRES Initial pressure in vessel INIT_TEMP Initial temperature in vessel INLET_D80 Inlet 80% diameter size INSIDE_DIAM Tube inside diameter IN_BFL_SP Inlet baffle spacing for segmental baffles IN_EROVEL Erosional velocity at inlet IN_LVFRAC Liquid volume fraction at inlet IN_NODE Inlet node name IN_PRES Inlet pressure IN_REGIME Flow regime at inlet IN_REYNO Reynolds Number at inlet IN_TEMP Inlet temperature B Property Names 171 172 Property Name Description IN_VELOC Velocity at inlet IN_VF Inlet vapor fraction IN_VVFRAC Vapor volume fraction at inlet INT_TEMP Interface temperature INT_X Interface liquid mole fractions INT_Y Interface vapor mole fractions ITYPE Type of pump K Equilibrium constant K1 Vapor-liquid1 K-value K2 Vapor-liquid2 K-value KLL Liquid1-liquid2 K-value KODE Flash calculation code L1_ENTH Liquid1 enthalpy L1_FLOW Liquid1 flow L1_MW Liquid1 molecular weight L2_ENTH Liquid2 enthalpy L2_FLOW Liquid2 flow L2_MW Liquid2 molecular weight LENGTH Length LEN_CONE Cone length LEN_CYL Length of cylinder LEN_OUT Length of outlet LEN_VORTEX Length of vortex LIQ_ENTH Liquid enthalpy LIQ_FLOW Liquid flow LIQ_FRAC Liquid volume fraction at the node LIQ_MF_TOT Sum of liquid mole fractions in stream LIQ_RATIO Liquid1/total liquid ratio LIQ_VEL Liquid superficial velocity at the node LIQ_VOL Volume occupied by liquid phase (RCSTR) LIQ1_VOL Volume occupied by liquid1 phase (RCSTR) L_CONDUC Liquid conduction transfer rate LL_RATIO Liquid/liquid ratio LMTD Log-mean temperature difference MASSFLWS Solid mass flow rate MASSFRC_CAKE Mass fraction of cake MASS-B Bottoms mass flow rate MASS-BFR Bottoms to feed mass ratio MASS-BR Boilup mass ratio MASS-D Distillate mass flow rate MASS-DFR Distillate to feed mass ratio MASS-DW Free water draw mass flow rate MASS-L1 Reflux mass flow rate B Property Names Property Name Description MASS-RR Reflux mass ratio MASS-VN Boilup mass flow rate MASS_ABS Absolute mass balance MASS_CYCLE Mass per cycle MASS_RATE Mass transfer rate MASS_REL Relative mass balance MASS_TIME Mass flow during operation MATERIAL Tube material of construction MATFAC Material of construction factor for equipment MATFAC1 Material of construction factor for the trays MAXBACKUP Stage with maximum downcomer backup MAXFLOOD Stage with maximum flooding MAXSTAGE Stage with maximum diameter MAXVELOC Stage with max velocity MAX_MASSFLOW Maximum mass-based vent flow rate reached MAX_MOLEFLOW Maximum mole-based vent flow rate reached MAX_PRES Maximum pressure reached in vessel MAX_TEMP Maximum temperature reached in vessel MAX_VENTFLOW Maximum mass-based vent flow rate reached MAX_VOLFLOW Maximum volume-based vent flow rate reached MF_LIQ Component liquid mole fraction in stream MF_VAP Component vapor mole fraction in stream MID_BFL_SP Center baffle spacing for segmental baffles MIN_REFLUX Minimum reflux ratio MIN_STAGES Minimum number of equilibrium stages MODE Filter mode MOISTURE Moisture content MOLE-B Bottoms molar flow rate MOLE-BFR Bottoms to feed mole ratio MOLE-BR Boilup molar ratio MOLE-D Distillate molar flow rate MOLE-DFR Distillate to feed mole ratio MOLE-DW Free water draw molar flow rate MOLE-L1 Reflux molar flow rate MOLE-RR Reflux molar ratio MOLE-VN Boilup molar flow rate MOLE_ABS Absolute mole balance MOLE_CYCLE Moles per cycle MOLE_REL Relative mole balance MOLE_TIME Moleflow during operation MW Molecular weight MW_LIQ Liquid phase molecular weight NBAGS Number of bags B Property Names 173 174 Property Name Description NCELLS Number of cells NCLEAN Number of cells being cleaned NODENAME Node name NOMINAL-SIZE Standard tube outside diameter NPER_LENGTH Number of fins per unit length NPHASE Number of phases NPSH-AVAIL Net positive suction head available NSBAFFLE Number of baffles in the shell NSEAL_STRIP Number of sealing strip pairs NTRAIN Number of trains NTURNS Number of turns NUMBER Number of cyclones OIL_FLOW Oil flow rate OIL_VISC Oil viscosity OPER_TIME Operating time ORIENTATION Exchanger physical orientation OUTLET_D80 Outlet 80% diameter size OUTSIDE_DIAM Tube outside diameter OUTSTREAM Outlet stream ID OUT_BFL_SP Outlet baffle spacing for segmental baffles OUT_EROVEL Erosional velocity at outlet OUT_LVFRAC Liquid volume fraction at outlet OUT_NODE Outlet node name OUT_PRES Outlet pressure OUT_REGIME Flow regime at outlet OUT_REYNO Reynolds Number at outlet OUT_TEMP Outlet temperature OUT_VELOC Velocity at outlet OUT_VVFRAC Vapor volume fraction at outlet PART_DIAM Particle diameter PATTERN Tube bank layout pattern PCOST Purchase cost for the equipment PDROP Stage pressure drop PDROP_FAC Pressure drop ratio factor PDRP Pressure drop PHASE Phase PHASE-FRAC Phase fraction PIPE_FIT_FAC Pipe fittings geometry factor PITCH Center to center distance between adjacent tubes PLACED-STRM Stream for phase placement POC Outlet pressure POROSITY Porosity POS Isentropic outlet pressure B Property Names Property Name Description POWER Calculated power PPOINT Pinch point PPSTAT Property table status PRES-RATIO Pressure ratio PRES1 Stage 1/condenser pressure PRES2 Stage 2 pressure PROD_L1FLOW Liquid1 product flow PROD_L2FLOW Liquid2 product flow PROD_LFLOW Product flow PROD_VFLOW Vapor product flow PRREC_FAC Pressure recovery factor PVOLS Volume per tank PWGHT Weight of each section of the Tray-Tower P_OUT Valve outlet pressure QCALC Calculated duty QNET Calculated net heat duty QZONE Duty for zone Q-FIRE Heat input calculated for the Fire scenario RADIUS Radius REAC_LRATE Rates of generation in liquid phase REAC_VRATE Rates of generation in vapor phase REB_DUTY Reboiler duty RECT_STAGES Number of rectification stages REGIME Flow regime at the node REL_VOL Relative volatility RES_TIME Residence time REYNO Reynolds Number RHOS Solid density RHO_GAS Vapor phase density RHO_LIQ Liquid phase density RING_INDIAM Baffle ring inside diameter RING_OUTDIAM Baffle ring outside diameter ROD_BFL_SP Baffle spacing for rod baffles ROD_DIAM Support rod diameter ROD_LENGTH Total length of support rods per rod baffle ROOT_DIAM Root mean diameter of finned tube RR Reflux ratio RUN_TYPE Run type RW Free water reflux ratio RXN_GEN Reaction generation S-SONICV Suction sonic velocity of a compressor SADD Stream added to outlet SALT_VOL Volume occupied by the salts (RCSTR) B Property Names 175 176 Property Name Description SAUTER_DIAM Sauter diameter SCDUTY Subcooled duty SCENARIO Scenario SCTEMP Subcooled temperature SECTION Section ID SELECT Selectivity SETPOINT Set point SH-SPEED Compressor shaft speed SHELL_BFL_SP Clearance between the shell and the baffles SHELL_BND_SP Clearance between shell and tube bundle SHELL_DIAM Shell inside diameter SHELL_MIXED Is the shell stream unmixed/mixed? SIDE Heat exchanger side SIDE_AREA Side downcomer area/panel SIDE_DRAW Side draw flow rate SNOZ_INDIAM Shell inlet nozzle diameter SNOZ_OUTDIAM Shell outlet nozzle diameter SOL_FLOW Solid flow SONVEL Sonic velocity SP-DIAM Specific diameter of a compressor wheel SP-SPEED Specific shaft speed of a compressor SPACE Floor space required SPAREA Packing surface area SPCHNG Phase change SPC_MASSFLOW Specified mass-based vent flow rate SPC_MOLEFLOW Specified mole-based vent flow rate SPC_VOLFLOW Specified volume-based vent flow rate SPEC Variable specified value SPEED Speed STAGE_NO Stage number START_STG Number of first stage in section STATUS Choke status of pressure relief system STDVFLOW Standard volume flow STDVFRAC Standard volume fraction STDVOL-B Bottoms volumetric flow rate STDVOL-BFR Bottoms to feed volumetric ratio STDVOL-BR Boilup volumetric ratio STDVOL-D Distillate volumetric flow rate STDVOL-DFR Distillate to feed volumetric ratio STDVOL-DW Free water volumetric mass flow rate STDVOL-L1 Reflux volumetric flow rate STDVOL-RR Reflux volumetric ratio STDVOL-VN Boilup volumetric flow rate B Property Names Property Name Description STDVOL_CYCLE Standard volume per cycle STDVOL_TIME Standard volume flow during operation STEAM-FLOW Steam flow rate STEN Surface tension STICH1 1st Stichlmair constant STICH2 2nd Stichlmair constant STICH3 3rd Stichlmair constant STOP-CRIT Stop criterion STOP-TIME Stop time STOP_STG Number of last stage in section STREAMFRAC Stream fraction STRENGTH Strength SUBS-ATTR Substream attribute value SURFTEN Surface tension S_LINEAR Linear s-plot value S_LOG Logarithmic s-plot value TAMBIENT Ambient temperature at the node TB Boiling point temperature TEMA_TYPE Standard TEMA shell type THGHT Total height of the equipment THICKNESS Thickness TH_BETA Thermosiphon liquid1/total liquid ratio TH_DUTY Thermosiphon duty TH_MOLEFLOW Thermosiphon mole fraction TH_PRES Thermosiphon pressure TH_TEMP Thermosiphon temperature TH_VFRAC Thermosiphon vapor faction TH_X Thermosiphon liquid mole fraction TH_X1 Thermosiphon liquid1 mole fraction TH_X2 Thermosiphon liquid2 mole fraction TH_Y Thermosiphon vapor mole fraction TIME Time TIP-MACH Rotor tip Mach number for a compressor wheel TMAX Maximum temperature TMIN Minimum temperature TNOZ_INDIAM Tube inlet nozzle diameter TNOZ_OUTDIAM Tube outlet nozzle diameter TOC Outlet temperature TOLERANCE Tolerance TOPTHICK Top shell thickness TOP_L1FLOW Top stage liquid1 flow TOP_L2FLOW Top stage liquid2 flow TOP_LFLOW Top stage liquid flow B Property Names 177 178 Property Name Description TOP_TEMP Top stage temperature TOP_VFLOW Top stage vapor flow TOS Isentropic outlet temperature TOTAL-MASS Total mass TOTAL_NUMBER Total number of tubes TOT_AREA Total tray area TOT_ENTH_ABS Absolute total enthalpy balance TOT_ENTH_REL Relative total enthalpy balance TOT_MASS_ABS Absolute total mass balance TOT_MASS_REL Relative total mass balance TOT_MOLE_ABS Absolute total mole balance TOT_MOLE_REL Relative total mole balance TRAY_NUMBER Actual number of trays TRYSPS Tray spacing in the tray-tower TTLEN Tangent to tangent length of the vessel TUBES_IN_WIN Are there tubes in the baffle windows? TUBE_BFL_SP Clearance between the tubes and the baffles TUBE_FLOW Direction of tubeside flow for vertical exchangers TUBE_LENGTH Effective tube length TUBE_MIXED Is the tube stream unmixed/mixed? TUBE_NPASS Number of tube passes TUBE_TYPE Bare or finned tubes? TWGHT Total weight of the equipment TYPE Type of cyclone UA Area time heat transfer coefficient UAZONE Area time heat transfer coefficient for zone VALVE_DP Delta-P across valve VALVE_POSN Operating valve position (as percentage of max opening) VAP_ENTH Vapor enthalpy VAP_FLOW Vapor flow VAP_MF_TOT Sum of vapor mole fractions in stream VAP_RES_TIM Residence time of vapor phase (RCSTR) VAP_VOL Volume occupied by vapor phase (RCSTR) VELOCITY Velocity VELOC_LOC Stage with maximum downcomer velocity VENT_FLOW Mass-based vent flow VFLOW Volume flow VL_RATIO Vapor/liquid ratio VMIX Mixture velocity at the node VOIDFR Packing void fraction VOLFLOW Volumetric flow VOLTAGE Voltage VSTD Standard liquid volume B Property Names Property Name Description V_CONDUC Vapor conduction transfer rate V_CONVEC Vapor convection transfer rate WALL-THICK Tube wall thickness WATER-FRAC Water volume fraction in stream WATER_FLOW Water flow rate WEIRLEN Side weir length WETTED_AREA Wetted vessel area WIDTH Width WNET Calculated net work X Liquid mole fraction X1 Liquid1 mole fraction X2 Liquid2 mole fraction Y Vapor mole fraction Table B.2 - Mixture Thermodynamic Properties Volume Property Name Description RHOLSTD Standard liquid density RHOMX Density VLSTDMX Standard liquid volume VMX Volume VVSTDMX Standard vapor volume Flow Rates, Fractions Property Name Description BETA Molar fraction of liquid that is L1 LFRAC Liquid fraction MASSFLMX Mass flow rate MASSVFRAC Mass vapor fraction MASSSFRAC Mass solid fraction MOLEFLMX Mole flow rate SFRAC Solid fraction VFRAC Mole vapor fraction VOLFLMX Volume flow rate B Property Names 179 Enthalpy, Entropy, Gibbs Energy, Heat Capacity Property Name Description AVAILMX Availability, H-ToS To=298.15 K CPCVMX Heat capacity ratio (CPMX/CVMX) CPIGMX Ideal gas heat capacity CPMX Constant pressure heat capacity CSATMX Specific heat at saturation CVMX Constant volume heat capacity DGMIX Gibbs free energy of mixing DGMX Free energy departure DHMX Enthalpy departure DSMX Entropy departure GIGMX Ideal gas free energy GMX Free energy GXS Excess free energy HIGMX Ideal gas enthalpy HMX Enthalpy HXS Excess enthalpy SIGMX Ideal gas entropy SMX Entropy Other properties 180 Property Name Description ABSHUMID Absolute humidity COMB-02 Amount of oxygen need to combust a mixture MWMX Molecular weight PBUB Bubble point pressure PCMX Critical pressure PDEW Dew point pressure PRES Pressure PRMX Reduced pressure RELHUMID Percentage relative humidity SONVELMX Sonic velocity TBUB Bubble point temperature TCMX Critical temperature TDEW Dew point temperature TEMP Temperature TRMX Reduced temperature VCMX Critical volume ZCMX Critical compressibility factor ZMX Compressibility factor B Property Names Table B.3 - Thermodynamic Properties of Components in Mixtures Property Name Description GAMMA Activity coefficient GAMPC Activity coefficient pressure correction GAMUS Unsymmetrically normalized activity coefficient KLL2 Liquid-liquid K-value KVL Vapor-liquid K-value KVL2 Vapor-liquid2 K-value MASSCONC Mass concentration MASSFLOW Mass flow rate MASSFRAC Mass fraction MOLECONC Molar concentration MOLEFLOW Mole flow rate MOLEFRAC Mole fraction PHIMX Fugacity coefficient PPMX Partial pressure SSOLFACT Solubility safety factor SSOLUB Equilibrium solubility of a freeze-out component TFREEZ Freeze-out temperature of a component TFRZMARG Temperature safety margin VLSTD Standard liquid volume VLSTDFR Standard liquid volume fraction VVSTD Standard vapor volume VVSTDFR Standard vapor volume fraction B Property Names 181 Table B.4 - Pure Component Thermodynamic Property Sets 182 Property Name Description AVAIL Availability, H-ToS To=298.15 K CP Constant pressure heat capacity CPCV Heat capacity ratio (CP/CV) CPIG Ideal gas heat capacity CV Constant volume heat capacity DG Free energy departure DGPC Free energy departure pressure correction DH Enthalpy departure DHVL Enthalpy of vaporization DHPC Enthalpy departure pressure correction DS Entropy departure G Free energy GIG Ideal gas free energy H Enthalpy HIG Ideal gas enthalpy PHI Fugacity coefficient PHIPC Fugacity coefficient pressure correction PL Vapor pressure RHO Density S Entropy SIG Ideal gas entropy SONVEL Sonic velocity V Volume B Property Names Table B.5 - Electrolyte Property Sets Property Name Description FAPP Apparent component molar flow rate FTRUE True species molar flow rates GXTRUE Activity coefficient of a true species (mole fraction scale) GMTRUE Activity coefficient of a true species (molality scale) IONSM Ionic strength (molality scale) IONSX Ionic strength (mole fraction scale) MAPP Apparent component molality MTRUE True species molality OSMOT Osmotic coefficient PH25 pH at 25C PH pH POH25 pOH at 25C POH pOH SOLINDEX Solubility index (ratio of activity in mixture to activity at saturation) WAPP Apparent component mass flow rate WTRUE True species mass flow rate WXAPP Apparent component mass fraction WXTRUE True species mass fraction XAPP Apparent component mole fraction XTRUE True species mole fraction B Property Names 183 Table B.6 - Transport Properties Mixture Property Name Description KINVISC Kinematic viscosity KMX Thermal conductivity MUMX Viscosity PR Prandtl Number SIGMAMX Surface tension THRMDIFF Thermal diffusivity Component in a Mixture Property Name Description DMX Diffusion coefficient Pure Components Property Name Description K Thermal conductivity MU Viscosity SIGMA Surface tension Table B.7 - Petroleum-Related Properties for Mixtures 184 Property Name Description ANILPT Aniline point API API gravity CETANENO Cetane number CHRATIO Carbon to hydrogen ratio FLPT-API Flash point (API method) MABP Mean average boiling point PHYDRATE Hydrate formation pressure PRPT-API Pour point (API method) QVALGRS Gross heating value QVALNET Net heating value B Property Names Property Name Description REFINDEX Refractive index RVP-ASTM Reid vapor pressure (ASTM method) RVP-API Reid vapor pressure (API method) SG Specific gravity SGAIR Specific gravity (ref.AIR at 60F) THYDRATE Hydrate formation temperature VABP Volume average boiling point VISINDEX Liquid viscosity index WAT Watson UOP K-factor Distillation Curves Property Name Description APICRV API gravity curve (liquid volume basis) APICRVWT API gravity curve (weight basis) D86CRK ASTM D86 distillation curve with cracking correction (liquid volume basis) D86CRV ASTM D86 curve (liquid volume basis) D86CRVWT ASTM D86 curve (weight basis) D86WTCRK ASTM D86 distillation curve with cracking correction (weight basis) D1160CRV ASTM D1160 curve (liquid volume basis) D1160CVW ASTM D1160 curve (weight basis) D2887CRV ASTM D2887 distillation curve (weight basis) GRVCRV Gravity curve (liquid volume basis) GRVCRVWT Gravity curve (weight basis) MWCRV Molecular weight curve (liquid volume basis) MWCRVWT Molecular weight curve (weight basis) TBPCRV True boiling point curve (liquid volume basis) TBPCRVWT True boiling point curve (weight basis) VACCRV Vacuum curve (liquid volume basis) VACCRVWT Vacuum curve (weight basis) Distillation Temperature Property Name Description D2887T ASTM D2887 temperature, at a given liquid volume percent D86TCK ASTM D86 temperature with cracking correction, at a given liquid volume percent D86TWTCK ASTM D86 temperature with cracking correction, at a given weight percent D86T ASTM D86 temperature, at a given liquid volume percent D86TWT ASTM D86 temperature, at a given weight percent B Property Names 185 Property Name Description D1160T ASTM D1160 temperature, at a given liquid volume percent D1160TWT ASTM D1160 temperature, at a given weight percent TBPT True boiling point temperature, at a given liquid volume percent TBPTWT True boiling point temperature, at a given weight percent VACT Vacuum temperature, at a given liquid volume percent VACTWT Vacuum temperature, at a given weight percent Distillation Volume and Weight Percent Property Name Description D2887WT ASTM D2887 weight percent D86LVCK ASTM D86 liquid volume percent with cracking correction D86WTCK ASTM D86 weight percent with cracking correction D86LV ASTM D86 liquid volume percent D86WT ASTM D86 weight percent D1160LV ASTM D1160 liquid volume percent D1160WT ASTM D1160 weight percent TBPLV True boiling point liquid volume percent TBPWT True boiling point weight percent VACLV Vacuum liquid volume percent VACWT Vacuum weight percent Bulk Petroleum Property Values from Assay Curves 186 Property Name Description ANILPT Aniline point AROMATIC Aromatic content BASIC-N2 Basic nitrogen content CARBON Carbon content FLASHPT Flash point FREEZEPT Freeze point HYDROGEN Hydrogen content IRON Iron content KNOCKIDX Anti knock index KVISC Kinematic viscosity LUMI-NO Luminometer number MERCAPTAN Mercaptan content METAL Metal content MOC-NO Motor octane number NAPHTHENE Naphthene content NICKEL Nickel content B Property Names Property Name Description OLEFIN Olefin content OXYGEN Oxygen content PARAFFIN Paraffin content POURPT Pour point REFINDEX Refractive index ROC-NO Research octane number RVP Reid vapor pressure SMOKEPT Smoke point SULFUR Sulfur content TOTAL-N2 Total nitrogen content VANADIUM Vanadium VISC Viscosity VLOCKIDX Vapor lock index WARMIDX Warm-up index Petroleum Cuts Property Name Description <100F Flow rates for petroleum cuts boiling below 100F 100-200F Flow rates for petroleum cuts boiling between 100 and 200F 200-300F Flow rates for petroleum cuts boiling between 200 and 300F 300-400F Flow rates for petroleum cuts boiling between 300 and 400F 400-500F Flow rates for petroleum cuts boiling between 400 and 500F 500-600F Flow rates for petroleum cuts boiling between 500 and 600F 600-700F Flow rates for petroleum cuts boiling between 600 and 700F 700-800F Flow rates for petroleum cuts boiling between 700 and 800F 800-900F Flow rates for petroleum cuts boiling between 800 and 900F 900-999F Flow rates for petroleum cuts boiling between 900 and 1000F >1000F Flow rates for petroleum cuts boiling above 1000F 50-100C Flow rates for petroleum cuts boiling between 50 and 100C 100-150C Flow rates for petroleum cuts boiling between 100 and 150C 150-200C Flow rates for petroleum cuts boiling between 150 and 200C 200-250C Flow rates for petroleum cuts boiling between 200 and 250C 250-300C Flow rates for petroleum cuts boiling between 250 and 300C 300-350C Flow rates for petroleum cuts boiling between 300 and 350C 350-400C Flow rates for petroleum cuts boiling between 350 and 400C 400-450C Flow rates for petroleum cuts boiling between 400 and 450C 450-500C Flow rates for petroleum cuts boiling between 450 and 500C B Property Names 187 Property Name Description 500-550C Flow rates for petroleum cuts boiling between 500 and 550C >550C Flow rates for petroleum cuts boiling above 550C CUTS-E Flow rates for petroleum cuts in 100F increments CUTS-M Flow rates for petroleum cuts in 50C increments LT-ENDS Flow rates for light ends Petroleum Property Curves 188 Property Name Description ANILCRV Aniline point curve AROMCRV Aromatic content curve BAS-NCRV Basic Nitrogen content curve CARBCRV Carbon content curve FLASHCRV Flash point curve FREEZECRV Freeze point curve HYDROCRV Hydrogen content curve IRONCRV Iron content curve KNOCKCRV Antiknock index curve KVISCCRV Kinematic viscosity curve LUM-NCRV Luminometer number curve MERCCRV Mercaptan content curve METALCRV Metal content curve MOCNCRV Motor octane number curve NAPHCRV Naphthene content curve NICKCRV Nickel content curve OLEFCRV Olefin content curve OXYGCRV Oxygen content curve PARACRV Paraffin content curve POURCRV Pour point curve REFICRV Refractive index curve ROCNCRV Research octane number curve RVPCRV Reid vapor pressure curve SMOKCRV Smoke point curve SULFCRV Sulfur content curve TOT-NCRV Total nitrogen content curve UOPKCRV Watson UOP K curve VANACRV Vanadium content curve VISCCRV Viscosity curve VLOCKCRV Vapor knock index curve WARMICRV Warm-up index curve B Property Names Table B.8 - Elemental Analysis of Mixtures Property Name Description MOLEFLC Mole flow of carbon atom MOLEFLH Mole flow of hydrogen atoms MOLEFLN Mole flow of nitrogen atoms MOLEFLS Mole flow of sulfur atoms MOLEFLF Mole flow of fluorine atoms MOLEFLCL Mole flow of chlorine atoms MOLEFLBR Mole flow of bromine atoms MOLEFLI Mole flow of iodine atoms MOLEFLAR Mole flow of argon atoms MOLEFLHE Mole flow of helium atoms MASSFLC Mass flow of carbon atoms MASSFLH Mass flow of hydrogen atoms MASSFLO Mass flow of oxygen atoms MASSFLN Mass flow of nitrogen atoms MASSFLS Mass flow of sulfur atoms MASSFLF Mass flow of fluorine atoms MASSFLCL Mass flow of chlorine atoms MASSFLBR Mass flow of bromine atoms MASSFLI Mass flow of iodine atoms MASSFLHE Mass flow of helium atoms MOLEFRC Mole fraction of carbon atoms MOLEFRH Mole fraction of hydrogen atoms MOLEFRO Mole fraction of oxygen atoms MOLEFRN Mole fraction of nitrogen atoms MOLEFRS Mole fraction of sulfur atoms MOLEFRF Mole fraction of fluorine atoms MOLEFRCL Mole fraction of chlorine atoms MOLEFRBR Mole fraction of bromine atoms MOLEFRI Mole fraction of iodine atoms MOLEFRAR Mole fraction of argon atoms MOLEFRHE Mole fraction of helium atoms MASSFRC Mass fraction of carbon atoms MASSFRH Mass fraction of hydrogen atoms MASSFRO Mass fraction of oxygen atoms MASSFRN Mass fraction of nitrogen atoms MASSFRS Mass fraction of sulfur atoms MASSFRF Mass fraction of fluorine atoms B Property Names 189 Property Name Description MASSFRCL Mass fraction of chlorine atoms MASSFRBR Mass fraction of bromine atoms MASSFRI Mass fraction of iodine atoms MASSFRAR Mass fraction of argon atoms MASSFRHE Mass fraction of helium atoms Table B.9 - Nonconventional Component Properties Property Name Description DENSITY Density ENTHALPY Enthalpy HEAT-CAPACITY Heat capacity Table B.10 - Property Names for Costing Results Equipment Type: HEATX Property Name Description NUMBER Total number of heat exchangers CSCOST Carbon steel cost per exchanger PCOST Purchased cost per exchanger VARID Material of construction BBCOST Total carbon steel cost TCOST Total purchased cost MATFAC Material of construction factor PAREAS Heat transfer area per unit AREA_CALC Total heat transfer area SCDUTY Total scaled heat duty LMTD Log mean temperature difference FACTOR Exchanger geometry correction factor Equipment Type: AIRCOOL 190 Property Name Description NUMBER Total number of air coolers CSCOST Carbon steel cost per cooler B Property Names Property Name Description PCOST Purchased cost per cooler VARID Material of construction BBCOST Total carbon steel cost TCOST Total purchased cost MATFAC Material of construction factor PAREAS Bare tube area per cooler AREA_CALC Total bare tube area SCDUTY Total scaled heat duty LMTD Log mean temperature difference Equipment Type: FIRED-HEATER Property Name Description NUMBER Total number of fired-heaters CSCOST Carbon steel cost per heater PCOST Purchased cost per heater VARID Material of construction BBCOST Total carbon steel cost TCOST Total purchased cost MATFAC Material of construction factor SCDUTY Scaled duty per fired-heater DUTY Scaled total heat duty QCALC Energy required per fired-heater B_PRES Defaulted pressure Equipment Type: PUMP Property Name Description NUMBER Total number of pumps ITYPE Pump type CSCOST Carbon steel cost per pump PCOST Purchased cost per pump VARID Material of construction BBCOST Total carbon steel cost TCOST Total purchased cost MATFAC Material of construction factor PROD_VFLOW Total scaled volumetric flow L1_FLOW Volumetric flow per pump B_PRES Pressure rise HEAD Pump head DENSITY Liquid density EFF Pump efficiency CEFF Motor efficiency B Property Names 191 Property Name Description ELEC_POWER Power required per pump Equipment Type: COMPR Property Name Description NUMBER Total number of compressors ITYPE Compressor type CSCOST Carbon steel cost per compressor PCOST Purchased cost per compressor VARID Material of construction BBCOST Total carbon steel cost TCOST Total purchased cost POWER Indicated horsepower MATFAC Material of construction factor LIQ_FLOW Volumetric flow per compressor VAP_FLOW Total scaled volumetric flow B_PRES Pressure rise HCRATIO Heat capacity ratio EFF Compressor efficiency ELEC_POWER Power required per compressor Equipment Type: BLOWER Property Name Description 192 NUMBER Total number of blowers TYPE Blower class SPEED Motor speed CSCOST Carbon steel cost per blower PCOST Purchased cost per blower VARID Material of construction BBCOST Total carbon steel cost TCOST Total purchased cost MATFAC Material of construction factor PAREAS Outlet area per blower AREA_CALC Total outlet area LIQ_FLOW Scaled total volumetric flow VAP_FLOW Scaled flow per blower VELOCITY Outlet gas velocity B_PRES Corrected static pressure EFF Motor efficiency CEFF Blower efficiency ELEC_POWER Power required per blower B Property Names Equipment Type: TRAY-TOWER Property Name Description NUMBER Total Number of Tray-Towers CSCOST Carbon steel cost per tower PCOST Purchased cost per tower VARID Material of construction BBCOST Total carbon steel cost TCOST Total purchased cost MATFAC Tower material factor MATFAC1 Tray material factor TWGHT Total shell weight THGHT Tower tangent-to-tangent length THICKNESS Average shell thickness Equipment Type: TRAY-TOWER Section Results Property Name Description PWGHT Weight LIQ_FLOW Liquid flow VAP_FLOW Vapor flow FLOWP Flow parameter DIAM Diameter TRYSPS Tray spacing EFF Tray efficiency TRAY_NUMBER Number of trays EXHTS Extra height TTLEN Tangent-to-tangent length Equipment Type: USER Property Name Description NUMBER Total number of equipment CSCOST Carbon steel cost per piece PCOST Purchased cost per piece VARID Material of construction BBCOST Total carbon steel cost TCOST Total purchased cost VAR_VAL Scaled capacity B Property Names 193 Equipment Type: V-VESSEL Property Name Description NUMBER Total number of v-vessels CSCOST Carbon steel cost per v-vessel PCOST Purchased cost per v-vessel VARID Material of construction BBCOST Total carbon steel cost TCOST Total purchased cost MATFAC Material of construction factor VAP_FLOW Scaled vapor flow LIQ_FLOW Scaled liquid flow VOLUME Volume per vessel DIAMETER Diameter TTLEN Tangent-to-tangent length TOPTHICK Top shell thickness BOTTHICK Bottom shell thickness TWGHT Total shell weight Equipment Type: H-VESSEL 194 Property Name Description NUMBER Total number of h-vessels CSCOST Carbon steel cost per h-vessel PCOST Purchased cost per h-vessel VARID Material of construction BBCOST Total carbon steel cost TCOST Total purchased cost MATFAC Material of construction factor VAP_FLOW Scaled vapor flow LIQ_FLOW Scaled liquid flow VOLUME Volume per vessel DIAMETER Diameter TTLEN Tangent-to-tangent length TOPTHICK Top shell thickness BOTTHICK Bottom shell thickness TWGHT Total shell weight B Property Names Equipment Type: TANK Property Name Description NUMBER Total number of tanks TYPE Tank type CSCOST Carbon steel cost per tank PCOST Purchased cost per tank VARID Material of construction BBCOST Total carbon steel cost TCOST Total purchased cost MATFAC Material of construction factor LIQ_FLOW Scaled liquid flow VOLUME Total volume required PVOLS Volume per tank B Property Names 195 196 B Property Names Index AspenTech support, 4 AspenTech Support Center, 4 customer support, 4 e-bulletins, 4 help desk, 4 support, technical, 4 technical support, 4 TKACCT, 23 TKALIS, 27 TKBIDS, 32 TKBRES, 14, 37 TKCASN, 28 TKCIDS, 27 TKCLFL, 20 TKCLOS, 19 TKCNCT, 33 TKCNTN, 33 TKCNVT, 25 TKCOMP, 26 TKCPRP, 28 TKEIDS, 122 TKEQCR, 123 TKEQSR, 124 TKFLWB, 23 TKFRCM, 60 TKHCID, 101 TKHCPR, 100 TKHCUR, 99 TKHXBA, 47 TKHXD1, 43 TKHXD2, 44 TKHXNO, 47 TKHXPF, 48 TKHXPP, 49 TKHXPR, 49 TKHXSH, 45 TKHXTU, 46 TKHXZO, 45 TKICST, 55 Index TKINFO, 21 TKINI2, 19 TKINIT, 18 TKLABL, 26 TKLHCR, 97 TKLRRP, 84 TKLSEC, 67 TKMCCP, 42 TKMCPR, 41 TKNBLK, 32 TKNCOL, 50 TKNENV, 116 TKNEQ, 122 TKNEQP, 123 TKNEQS, 124 TKNEXT, 29 TKNHCP, 99 TKNHCR, 97 TKNHXD, 43 TKNHXT, 44 TKNICS, 55 TKNMCP, 41 TKNPER, 39 TKNPET, 57 TKNPEV, 118 TKNPIP, 95 TKNPPR, 115 TKNPPT, 114 TKNPRS, 126 TKNRES, 36 TKNRRP, 85 TKNSEC, 67 TKNSEN, 29 TKNSPR, 111 TKNSTR, 104 TKNTPR, 65 TKNWHL, 40 TKNXPR, 127 TKOPEN, 20 197 TKPAPF, 133 TKPAPR, 134 TKPAR1, 134 TKPAR2, 135 TKPERF, 39 TKPIDS, 126 TKPINP, 93 TKPIPR, 93 TKPISP, 93 TKPLCO, 89 TKPLCP, 88 TKPLIO, 88 TKPLND, 91 TKPLNP, 90 TKPLPP, 91 TKPLPR, 92 TKPLSG, 90 TKPLSP, 89 TKPLSZ, 87 TKPORT, 34 TKPPEV, 119 TKPPRP, 115 TKPRO1, 52 TKPRO2, 52 TKPROF, 51 TKPROP, 51 TKPSEC, 69 TKPSR1, 131 TKPSR2, 132 TKPSRF, 128 TKPSRP, 129 TKPSS1, 133 TKPSSP, 129 TKPSSR, 130 TKPSSS, 131 TKPSUB, 128 TKPTAD, 58 TKPTCN, 61 TKPTEV, 117 TKPTFR, 59 TKPTPP, 60 TKPTPR, 58 TKPTRS, 57 TKPVPF, 135 TKPVR1, 136 TKPVR2, 137 TKPVRP, 136 TKRCAT, 75 TKRFSP, 76 TKRNAC, 74 TKRNCA, 74 TKRNFS, 75 TKRPIP, 95 198 TKRPR1, 73 TKRPR2, 73 TKRPRF, 71 TKRPRP, 72 TKRRHR, 82 TKRRNS, 82 TKRRPF, 81 TKRRPR, 81 TKRRRP, 86 TKRRSL, 83 TKRSCA, 74 TKRSUB, 71 TKRTNL, 64 TKRTNR, 62 TKRTRS, 62 TKRTSP, 63 TKRTSR, 63 TKSCAT, 109 TKSCPR, 70 TKSCRS, 69 TKSENS, 30 TKSENV, 117 TKSHCR, 98 TKSIDS, 103 TKSINF, 104 TKSNAC, 107 TKSNCA, 108 TKSNSA, 109 TKSPIR, 94 TKSPPT, 114 TKSPRP, 111 TKSRRP, 85 TKSSAT, 110 TKSSCA, 108 TKSSEC, 68 TKSSID, 105 TKSSSA, 110 TKSTRA, 106 TKSTRM, 105 TKSVAL, 106 TKTITL, 22 TKTPRP, 66 TKTREP, 65 TKTRNR, 53 TKTRRS, 54 TKUNIT, 25 TKVAPF, 77 TKVAPR, 77 TKVAR1, 78 TKVAR2, 78 TKVLE, 96 TKVTPF, 79 TKVTPR, 79 Index TKVTR1, 80 TKVTR2, 80 TKWHLR, 40 web site, technical support, 4 Index 199