0% found this document useful (0 votes)
20 views16 pages

Capitulo 5 Aspen Plus

The document discusses the sensitivity study and design specification tools in Aspen Plus. It uses an example of a mixer block with three input streams to demonstrate how to use these tools to specify an output variable. The sensitivity study allows plotting different trial values of an input variable, like the flow rate of stream 2, against the output to find an approximate solution. The design specification then solves precisely for the input value that satisfies the specified output. It provides details on using Fortran code in blocks to define variables and expressions needed to set up and run the sensitivity study and design specification.

Uploaded by

Cami Tamayo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views16 pages

Capitulo 5 Aspen Plus

The document discusses the sensitivity study and design specification tools in Aspen Plus. It uses an example of a mixer block with three input streams to demonstrate how to use these tools to specify an output variable. The sensitivity study allows plotting different trial values of an input variable, like the flow rate of stream 2, against the output to find an approximate solution. The design specification then solves precisely for the input value that satisfies the specified output. It provides details on using Fortran code in blocks to define variables and expressions needed to set up and run the sensitivity study and design specification.

Uploaded by

Cami Tamayo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Chapter Five

Flowsheeting and Model Analysis Tools


5.1 Introduction
Two of the most useful tools in Aspen Plus are the Design specification and
the Sensitivity study located on the Navigation Pane, at Flowsheeting
Options/Design Specs, and at Model Analysis Tools/Sensitivity. These tools
work hand-in-hand and are used when it is desired to specify the value of a
block or stream output variable, or a block parameter. For example, the file
Chapter Five Examples/mixer5.bkp presents a mixer block with three feeds.
When all input streams are properly specified, the block will calculate the
composition and state of the output stream. Figures 5.1 and 5.2 show the
graphic setup and the solution. Note that the product, stream 4, is a straight
forward summation of all of the feeds on a componential basis, excluding
energy balance. Suppose, in the example, however, one requires that the
composition of a specific component, say ethanol, is to be 0.5 mole fraction. It
will be necessary to increase the flow of stream 2. This is easy to do with a
hand calculation but if this block were in the middle of a process flow diagram
it may not be a trivial task. The Sensitivity study permits the specification of a
trial range of flow rates for stream 2, which may be plotted against the
resulting ethanol composition. Once an approximate solution is obtained, by
plotting the results and checking the location of the target composition, the
Design specification can be employed to provide a means for Aspen Plus to
solve for the exact value of the flow rate of stream 2, which satisfies the
desired specification. In setting up both the Sensitivity study and the Design
specification, it may be necessary to employ the Fortran language capability
imbedded in several blocks and available on a stand-alone basis in the
Calculator block.

Figure 5.1 Mixer5 example.


Figure 5.2 Mixer5 solution.

5.2 Introduction to Fortran in Aspen Plus


Fortran (Formula Translation) is a very old but rich language that has
traditionally been used for scientific applications. Details of the language are
very complex and can be found in many books. Aspen Plus employs both
interpreted (line-by-line execution) for the blocks in this chapter and
compiled (dynamic link library creation) Fortran for creation of user models.
An overview of the language criteria can be found in Aspen Plus Help and
searching for About the Interpreter. Aspen Plus supports many Fortran
compilers. Details can be found in the Aspen Plus knowledge base.

5.3 Basic Interpreted Fortran Capabilities


For the purposes of this chapter's functions, what follows is the primary
functionality that is available when using interpreted Fortran. There is no
intent here to present a thorough documentation of the Fortran programming
language, just merely what is sufficient to be able to work with the subject
matter of this chapter and some material in later chapters.

5.3.1 Primary Fortran Operators


The primary Fortran operators are given in Table 5.1. Prior to execution of
any statement, all variables appearing on the right-hand side of an equal sign
must be defined, that is, contain either a numeric value or contain a value
calculated with previous legal statements.
Table 5.1 Fortran Operators
Operator Definition Example Result
= Replacement A=B B
+ Addition A=A+A 2A
− Subtraction A=A−A 0
/ Division A = A/A 1
* Multiplication A = A*A A2
** Exponentiation A = A**B AB
.LT. Logical less than
.GT. Logical greater than
.EQ. Logical equal
.AND. Logical and
Function call A = D log(B) ln (B)
Subroutine call CALL XYZ XYZ executes

A listing of all the functions available is given in Aspen Plus documentation on


the ribbon at Get Started/What's New and search for “Fortran.”

5.3.2 Precedence of Calculations


The following rules apply when a Fortran statement is evaluated:
Fortran statements may be organized in groups of operations within
parenthesis.
The contents of each group are evaluated prior to evaluation of the
complete statement.
Function calls precede group evaluation.
Exponentiation precedes group evaluation.
Divisors if part of a group must be evaluated prior to numerators.
For example, the precedence of calculations for the Fortran statement given
by Equation 5.1 is as follows:

5.1

1. e**f
2. d*e**f
3. (c − d*e**f)
4. (a + b)
5. (a + b) + (c − d*e**f)
6. d log (b)
7. f*d log (b)
8. (f*d log (b) + c)
9. (f*d log (b) + c)/(a + b) + (c − d*e**f)

5.3.3 Statement Format


Fortran, as implemented in Aspen Plus's interpreter, is not quite standard
Fortran (there are differences of opinion as to what is standard Fortran). The
main formatting rules, taken from Aspen Plus's documentation, are given
below.
Column 1 can contain a C. All other entries on the same line are
comments.
Column 2 is left blank.
Columns 3–5 are reserved for statement labels. Under certain logical
conditions, program execution can be transferred to a labeled statement.
Executable statements begin at column 7 and beyond.
No variables may begin with the characters IZ or ZZ.
Integer variables begin with letters I through N.
Real variables begin with letters A through H or O through Z.
Variables names are limited in length to seven characters.
Lowercase characters are permitted.

5.3.4 Program Logic Control


Logical statements may take a variety of forms. An example of one of the IF
variations, the most common, is as follows:
IF ((expression a) .EQ. (expression b) (expression c)
expression d

Expression c will execute if the logical grouping is true, otherwise expression


d executes. In all statements of this type, the number of left parentheses must
equal the number of right parentheses. The logical operators are all
interchangeable and can be nested within each expression to meet program
requirements.
Another common logic control statement is the direct Go To:
Go To statement label

All statements following the Go To are skipped until the labeled statement is
found, then execution proceeds normally.

5.4 The Sensitivity Function


The features of the sensitivity function will be displayed by the continuation of
example mixer5.bkp through the example mixer5s.bkp. The sensitivity
function is located under the setup menu Model Analysis Tools/Sensitivity
and when selected initiates the Sensitivity data browser. When New is
selected, a sensitivity ID, such as, S-1, is assigned. This initiates a display that
facilitates the association of a Fortran accessible variable with a variable
within the process. It is imperative that this process be started by selecting the
New button, which generates the Displays shown in Figure 5.3. The variable
XETOH, which is user created, using the Define tab, represents the mole
fraction of ethanol in the output stream 4 of the example. Figure 5.4 shows
the assignment of the process variable to the Fortran variable. For this
example, a Fortran expression will be created to calculate the fraction of
alcohols in stream 4. For this purpose it will be necessary to create three
additional Fortran accessible variables, fmoh, fetoh, and f4, which are
respectively, the flow rates of methanol and ethanol in stream 4, and the total
flow of stream 4.

Figure 5.3 Creation of a Fortran accessible variable.


Figure 5.4 Association of flowsheet variable with a Fortran variable.
The selection of the tab Vary, produces Figure 5.5 in which the range of trial
values i.e. the independent variable, are assigned to stream 2 to seek a value
that would produce an approximate solution to the desired target i.e. ethanol
mole fraction of 0.5 in stream 4.
Figure 5.5 Defining the range of a trial variable.
The selection of the tab Tabulate permits the assignment of any defined
Fortran variables or legitimate Fortran expression to the column of a table on
which the results of Sensitivity study will be presented. Note that column 3, in
the example, contains an expression for the calculation of the fraction of
alcohols leaving the mixer. Tabular and plotted results are displayed in Figure
5.6. One can see that the flow rate required to produce a 0.5 mole fraction of
ethanol is bracketed between a stream 2 flow of 100 and 300 mol/h, and from
the plot the solution is approximately 225 mol/h. The results of this example
can be found by executing Examples/mixer5s.
Figure 5.6 Results of sensitivity study Mixer5s.

5.5 The Design Specification


The features of the design function will be displayed by the modification of the
example mixer5s.bkp and is given in mixer5d.bkp. The Design Spec is located
under the setup menu Flowsheeting Options/Design Specs and when selected
initiates the Design Specs Input forms. The selection of the New button
assigns an identifier to a design spec such as DS-1. The key to implementing
the design specification, in this example, is to manipulate the feed, stream 2,
so that it can take on the required flow rate to achieve the required stream 4
specification. One possibility is shown in Figure 5.7. Here, the inclusion of
stream 5, which has a larger flow than what is required to meet the stream 4
specification, is fed to a multiply block in which the flow rate is determined
from the design specification. The design spec function will manipulate the
multiplier value, which will act upon the multiplier and place appropriate
value into stream 2 to satisfy the design specification. The implementation
requires the definition of a Fortran variable, in this case, XETOH, just like the
setup in the Sensitivity study, which is shown in Figure 5.8. Additionally,
there are two other tabs in the Design Spec setup, the target value and an
acceptable tolerance, which are shown in Figure 5.9. These define the function
to be solved given in Equation 5.2

5.2
where f is a function of “factor,” the multiplying factor applied to the block
M1. The function is solved by Aspen Plus's built-in secant method equation
solver, within a user-specified tolerance, in this case 0.001. Figure 5.10 gives
the limits applied to the variable “FACTOR,” which in this example is the
multiplier of the block M1. Results are shown in Figure 5.11.
Figure 5.7 Flowsheet for Mixer5c.

Figure 5.8 Defining a Fortran variable.

Figure 5.9 Mixer5d design specification.


Figure 5.10 Limits of varied parameter.

Figure 5.11 Mixer5d design specification satisfied.

5.6 The Calculator Function


The calculator can be found under the Navigation Pane, Flowsheeting
Options/Calculator. Like the design and sensitivity functions, the user
associates flowsheet variables with user-defined Fortran variables. After the
New button is clicked, an id box is displayed followed by the basic Calculator
display, and when the Define tab is selected, the association of Fortran
variables with simulation variables is enabled. Clicking the New button
initiates the details of the association of variables. As an example, the entries
for the creation of the variable FLO4EN are shown in Figure 5.12. Two very
important selections on the display are import, which copies current values of
variables from the flowsheet into the Fortran variables, and export, which
copies values of the Fortran variables into current variables of the flowsheet.
An example of Fortran coding that accomplishes the same result as in the
example Mix5d.bkp is given in Figure 5.13, which uses the definitions in
Figure 5.12. Figure 5.14 illustrates the placement of Fortran or excel
calculations, virtually anywhere in the sequence of flowsheet calculations.
Figure 5.12 Basic calculator display with Fortran variables defined.

Figure 5.13 Fortran coding for Mixer5c equivalent to Mixerd5d.


Figure 5.14 Sequence control of Fortran code.
The results of the calculations are shown in Figure 5.15. The first Fortran
statement is a material balance that calculates the amount of ethanol that
needs to be added to stream 4 to make the 0.5 mole fraction specification. The
second statement exports the sum of the original value of ethanol in stream 4
and the results of the first statement. When these operations are completed,
Aspen Plus issues a series of errors and warnings that are documented in the
Control Panel as shown in Figure 5.16. This example can be found in
Examples/mixer5c. Attention should be paid to the information in the control
panel because it will caution the user to any irregularity. As an example, note
the warning that the mixer block is not in material balance. This occurred
because the mixer was executed prior to the calculation function.
Figure 5.15 Results of Mixer5c.
Figure 5.16 Warnings and errors in Mixer5c results.

5.7 The Transfer Function


The error “Block mix1 is not in material balance” in Examples/mixer5c.bkp
occurs because stream 2 has not been updated with the contents of stream 4
as shown in Figure 5.15. Aspen Plus provides the Transfer function, which
enables the copying of data from stream to stream. Details are in
Examples/mixer5t. When the Transfer function is invoked and the New
button selected, an ID is assigned and, after the From tab is selected, the
display shown in Figure 5.17 appears. Selection of the tab To shows Figure
5.18. Entering the appropriate information on the forms enables the selection
of streams to copy from and to as well as which elements of those streams to
employ. Selection of the tab Sequence displays Figure 5.19, which enables the
user to choose the timing within the flowsheet calculations for executing the
transfer. Figure 5.20 shows the results.
Figure 5.17 Transfer Function display “From.”

Figure 5.18 Transfer Function display “To.”

Figure 5.19 Transfer Function sequence.


Figure 5.20 Mixer5t Transfer Function results.

5.8 Workshops
Workshop
5.1 Copy the file four3n.bkp, which will be the basis for using Aspen Plus's
Sensitivity Studies' capability to determine the effect of the decanter's
performance with regard to the fraction of cyclohexane leaving the
decanter in its aqueous product, stream C. For the base case, this
specification is 0.02. The sensitivity studies should vary this value between
0.01 and 0.10 in increments of 0.01. Select as tear streams C and F. Make a
reasonable estimate of the componential flows and solve the flowsheet
using the Newton convergence option. This becomes the base case
solution. This file is to be modified using the sensitivity function. Select
the following as the dependent variables:
1. The total flow of stream G, the cyclohexane-rich distillate recycled to
the decanter. Call it FLOWG.
2. The flow of cyclohexane in stream G. Call it FLOWGC.
Plot the results. If the pipe line in which G is to flow is limited to 300 lb/h,
what is the fraction of the cyclohexane entering the decanter that leaves in
stream C?
Workshop

You might also like