Aspen Plus Guide
Aspen Plus Guide
You can use Fortran in Aspen Plus to perform any task that can be
written as valid Fortran expressions.
You can input Fortran expressions in a number of ways in Aspen Plus:
To ensure that you enter accurate variable names, click the right
mouse button. In the popup menu, click Variable List. The Defined
Variable List window appears. You can drag and drop the variables
from the Defined Variable List to the Fortran sheet.
To review rules and restrictions for in line Fortran, see Rules for
In-Line Fortran Statements.
The Defined Variable List window appears. You can drag and drop the
variables from the Defined Variable List to the Calculate sheet.
To ensure that you enter accurate variable names, click the right
mouse button. In the popup menu, click Variable List. The Defined
Variable List window appears. You can drag and drop the variables
from the Defined Variable List to the Fortran sheet.
To do this Use
Indicate comments Column one for C and leave column two blank
Enter statement labels Only columns three, four, and five
Begin executable Column seven or beyond
statements
You can call your own subroutines or functions. You can use
labeled or blank (unlabeled) COMMON blocks.
Fortran variables you define on the Specification sheet cannot
be placed in a COMMON.
Do not use IMPLICIT, SUBROUTINE, ENTRY, RETURN, END statements,
nor arithmetic statement functions.
READ and WRITE statements to numbered file units (as in WRITE
(NTERM,*)) only work if the same compiler was used to compile
the code containing these statements and the code which opened
the files. Aspen Plus now uses the Intel Fortran compiler to
open its built-in units for the report file, history file, and
control panel. See Chapter 1 of Aspen Plus User Models for more
information.
About the Interpreter
You can use the equivalent single precision or generic function names
in your Fortran statements. However, Aspen Plus always performs
double precision calculations, and using the other names will require
compilation.
If you use the following statements, you must enter them on the
Declaration sheet:
To do this Use
Indicate comments Column one for C and leave column two blank
Enter statement labels Only columns three, four, and five
Begin executable Column seven or beyond
statements
You can call your own subroutines or functions. You can use
labeled or blank (unlabeled) COMMON blocks.
Fortran variables you define on the Specification sheet cannot
be placed in a COMMON.
Do not use IMPLICIT, SUBROUTINE, ENTRY, RETURN, END statements,
nor arithmetic statement functions.
READ and WRITE statements to numbered file units (as in WRITE
(NTERM,*)) only work if the same compiler was used to compile
the code containing these statements and the code which opened
the files. Aspen Plus now uses the Intel Fortran compiler to
open its built-in units for the report file, history file, and
control panel. See Chapter 1 of Aspen Plus User Models for more
information.
Include statements
COMMON definitions
DIMENSION definitions
Include statements
COMMON definitions
DIMENSION definitions
Fortran variables that you defined on the Define sheet should not be
declared in the Declarations dialog box.
Fortran Declarations
COMMON definitions
DIMENSION definitions
Fortran variables that you defined on the Define sheet should not be
declared on the Declarations sheet.
Templates that include the argument list and other useful code for
starting a user model are provided in the Templates directories where
Aspen Plus is installed. For more information on how to write a user
model, see Aspen Plus User Models.
You can use Fortran in Aspen Plus to perform any task that can be
written as valid Fortran expressions.
You can input Fortran expressions in a number of ways in Aspen Plus:
Unit Destination
NTERM Control Panel (if running from the user
interface)
Terminal (if running interactively
outside of the user interface), or
Log file (if running batch)
NRPT Aspen Plus report
NHSTRY Simulation history
Examples:
For writing to the Control Panel, enter:
WRITE(NTERM, *) A, B, C, X
For writing to the report file, enter:
WRITE(NRPT, *) A, B, C, X
If writing to the Aspen Plus report from a Fortran Calculator block,
select Report in the Execute field on the Sequence Sheet. Output
written to the report file will appear in the Flowsheet section of
the Calculator block report.
When writing to a user-defined file, use a Fortran unit number
between 50 and 100.
Writing to the predefined Aspen Plus units will only work in compiled
Fortran if the Fortran is compiled with the Intel compiler. Writing
to user-defined files will only work if the code that opened the file
and the code with the write statement were compiled with the same
compiler. See Chapter 1 in Aspen Plus User Models for more
information.
Excel Calculator blocks do not have the ability to write to the
Control Panel or Aspen Plus report or history files, but you may use
VBA macros to display information in dialog boxes.
To ensure that you enter accurate variable names, click the right
mouse button. In the popup menu, click Variable List. The Defined
Variable List window appears. You can drag and drop the variables
from the Defined Variable List to the Fortran sheet.
To ensure that you enter accurate variable names, click the right
mouse button. In the popup menu, click Variable List. The Defined
Variable List window appears. You can drag and drop the variables
from the Defined Variable List to the Fortran sheet.
To ensure that you enter accurate variable names, click the right
mouse button. In the popup menu, click Variable List. The Defined
Variable List window appears. You can drag and drop the variables
from the Defined Variable List to the Fortran sheet.
Level Description
0..4 No messages
5 Defined-variable values before block
execution are listed
6..8 Level 5 and defined-variable values after
block execution are listed
Flowsheet Connectivity for User
Material Streams
Heat Streams
Work Streams
Specifying User
You must specify the name of the subroutine model on the Input
Specifications sheet. You have the option of specifying:
Values of the integer and real arrays passed to the user model
subroutine
User Reference
User can model any unit operation model. You must write a Fortran
subroutine to calculate the values of the outlet streams based on the
inlet streams and parameters you specify.
User and User2 differ only in the number of inlet and outlet streams
allowed and the argument lists to the model subroutine. User is
limited to a maximum of four material and one heat or work inlet
stream and a maximum of four material and one heat or work outlet
stream. User2 has no limits on the number of inlet and outlet
streams.
User and User2 differ only in the number of inlet and outlet streams
allowed and the argument lists to the model subroutine. User is
limited to a maximum of four material and one heat or work inlet
stream and a maximum of four material and one heat or work outlet
stream. User2 has no limits on the number of inlet and outlet
streams.
Use the following forms to enter specifications and view results for
User:
Specifying User
You must specify the name of the subroutine model on the Input
Specifications sheet. You have the option of specifying:
Values of the integer and real arrays passed to the user model
subroutine
Templates that include the argument list and other useful code for
starting a user model are provided in the Templates directories where
Aspen Plus is installed. For more information on how to write a user
model, see Aspen Plus User Models.
User Models
Aspen Plus provides several methods for you to create your own unit
operation models:
Fortran
Excel