181
Aspen Custom Modeler 2004.1 Library Reference Guide

ACM Library Reference Guide

Embed Size (px)

Citation preview

Page 1: ACM Library Reference Guide

Aspen Custom

Modeler 2004.1

Library Reference Guide

Page 2: ACM Library Reference Guide

Who Should Read this Guide 2

Who Should Read this Guide

This guide contains reference information on control models, property procedure types, utility routines, port types, and variable types.

Page 3: ACM Library Reference Guide

Contents 3

Contents

INTRODUCING ASPEN CUSTOM MODELER..................................................... 10

1 CONTROL MODELS..................................................................................... 11 Time Units in Control Models ................................................................................... 11 Comparator........................................................................................................... 12

Comparator Equation......................................................................................... 12 Configuring Comparator ..................................................................................... 12

Dead_time ............................................................................................................ 12 Dead_time Equation .......................................................................................... 12 Configuring Dead_time ...................................................................................... 13

Discretize.............................................................................................................. 13 Discretize Equations .......................................................................................... 13 Configuring Discretize ........................................................................................ 13

FeedForward ......................................................................................................... 14 FeedForward Equations ...................................................................................... 14 Configuring FeedForward.................................................................................... 15

HiLoSelect............................................................................................................. 15 HiLoSelect Equations ......................................................................................... 15 Configuring HiLoSelect ....................................................................................... 16

IAE ...................................................................................................................... 16 IAE Equation .................................................................................................... 16 Configuring IAE................................................................................................. 17

ISE ...................................................................................................................... 17 ISE Equation .................................................................................................... 17 Configuring ISE................................................................................................. 18

Lag_1................................................................................................................... 18 Lag_1 Equations ............................................................................................... 18 Configuring Lag_1 ............................................................................................. 19

Lead_lag............................................................................................................... 19 Lead_lag Equations ........................................................................................... 19 Configuring Lead_lag ......................................................................................... 20

Multiply ................................................................................................................ 21 Multiply Equations ............................................................................................. 21 Configuring Multiply........................................................................................... 21

Page 4: ACM Library Reference Guide

Contents 4

Noise ................................................................................................................... 21 Noise Equations ................................................................................................ 22 Configuring Noise.............................................................................................. 22

PID ...................................................................................................................... 23 PID Algorithms ................................................................................................. 31 PID Controller Faceplates ................................................................................... 32 Closed-Loop Controller Tuning using the Ziegler-Nichols Technique .......................... 32 Using the ISE and IAE Models with a PID Controller ............................................... 33

PIDIncr................................................................................................................. 34 PID Algorithms ................................................................................................. 41 Anti Reset Windup............................................................................................. 42 PIDIncr Controller Faceplates.............................................................................. 43 Automatic Controller Tuning Context.................................................................... 44 Using Automatic Controller Tuning....................................................................... 44 Using the ISE and IAE Models with the PIDIncr Controller ....................................... 47

PRBS.................................................................................................................... 47 PRBS Equations ................................................................................................ 48 Configuring PRBS .............................................................................................. 49

Ratio .................................................................................................................... 50 Ratio Equations................................................................................................. 50 Configuring Ratio .............................................................................................. 50

Scale.................................................................................................................... 50 Scale Equations ................................................................................................ 51 Configuring Scale .............................................................................................. 51

SplitRange ............................................................................................................ 52 SplitRange Equations......................................................................................... 52 Configuring SplitRange....................................................................................... 52

SteamPtoT ............................................................................................................ 54 Sum..................................................................................................................... 54

Sum Equations ................................................................................................. 54 Configuring Sum ............................................................................................... 54

Transform............................................................................................................. 55 Transform Equations.......................................................................................... 55 Configuring Transform ....................................................................................... 55

Valve_dyn............................................................................................................. 56 Valve_dyn Equations ......................................................................................... 56 Configuring Valve_dyn ....................................................................................... 57

2 ASPEN REACTIONS TOOLKIT..................................................................... 59 ART Reaction Model Component Overview ................................................................. 59

Page 5: ACM Library Reference Guide

Contents 5

Design of ART Reaction Model Component ................................................................. 60 Using ART Reaction Model Component in Reactor Model............................................... 62

Interface to Reaction Global Structures ................................................................ 62 Interface to Non-Distributed Portion of a Reaction Model......................................... 63 Interface to Distributed portion of a Reaction Model ............................................... 63 Use Multiple Sets of Reaction Models in a Reactor Model ......................................... 64 Examples......................................................................................................... 65

Configuration of ART Reaction Model Component ........................................................ 68 Adding ART Configure Form to Reaction Global Structure ........................................ 68 ART Configure Form .......................................................................................... 70

Built-in Reaction Classes ......................................................................................... 78 Power Law ....................................................................................................... 78 LHHW.............................................................................................................. 80 GLHHW............................................................................................................ 82 Equilibrium....................................................................................................... 82 Custom Reaction Model...................................................................................... 83

Building Custom Reaction Model Component .............................................................. 83 Custom Reaction Model Wizard ........................................................................... 83 Writing a Custom Reaction Model ........................................................................ 84 Compiling a Custom Reaction Model..................................................................... 86 Removing a Custom Reactions Model ................................................................... 87

Exporting a Custom Reaction Model .......................................................................... 87 Appendix .............................................................................................................. 88

Example of Assigning Variables and Equations to Hierarchy Levels ........................... 88 Defining Stoichiometry for a Reaction................................................................... 89 Calculation of Concentration Exponents for Reverse Rate ........................................ 90

3 PROPERTY PROCEDURES........................................................................... 96 Property Procedures with Analytic Derivatives ............................................................ 96

Procedure pCond_Liq......................................................................................... 96 Procedure pCond_Vap........................................................................................ 97 Procedure pCp_Mol_Liq...................................................................................... 97 Procedure pCp_Mol_Vap..................................................................................... 98 Procedure pCv_Mol_Liq ...................................................................................... 98 Procedure pCv_Mol_Vap..................................................................................... 99 Procedure pDens_Mass_Liq ................................................................................ 99 Procedure pDens_Mass_Vap ..............................................................................100 Procedure pDens_Mol_Liq..................................................................................100 Procedure pDens_Mol_Vap ................................................................................101 Procedure pDiffus_Liq .......................................................................................102 Procedure pDiffus_Vap......................................................................................102

Page 6: ACM Library Reference Guide

Contents 6

Procedure pEnth_Mol_Liq ..................................................................................103 Procedure pEnth_Mol_Vap .................................................................................103 Procedure pEntr_Mol_Liq...................................................................................104 Procedure pEntr_Mol_Vap .................................................................................104 Procedure pFuga_Liq ........................................................................................105 Procedure pFuga_Vap .......................................................................................105 Procedure pGibbs_Mol_Liq.................................................................................106 Procedure pGibbs_Mol_Vap ...............................................................................106 Procedure pKllValues ........................................................................................107 Procedure pKValues..........................................................................................108 Procedure pSurf_Tens.......................................................................................108 Procedure pVisc_Liq .........................................................................................109 Procedure pVisc_Vap ........................................................................................109

Property Procedures without Analytic Derivatives.......................................................110 Procedure pAct_Coeff_Liq..................................................................................110 Procedure pBubt ..............................................................................................110 Procedure pDens_Mass_Sol ...............................................................................111 Procedure pDens_Mol_Sol .................................................................................111 Procedure pDewt..............................................................................................112 Procedure pEnth_Mol ........................................................................................113 Procedure pEnth_Mol_Sol ..................................................................................113 Procedure pEntr_Mol ........................................................................................114 Procedure pEntr_Mol_Sol ..................................................................................114 Procedure pFlash .............................................................................................115 Procedure pFlash3............................................................................................115 Procedure pFlash3PH ........................................................................................116 Procedure pFlash3PV ........................................................................................117 Procedure pFlash3TH ........................................................................................118 Procedure pFlash3TV ........................................................................................119 Procedure pFlashPH..........................................................................................119 Procedure pFlashPV ..........................................................................................120 Procedure pFlashTH..........................................................................................121 Procedure pFlashTV..........................................................................................121 Procedure pFuga_Sol ........................................................................................122 Procedure pGibbs_Mol_IDLGAS ..........................................................................123 Procedure pGibbs_Mol_Sol ................................................................................123 Procedure pMolWeight ......................................................................................124 Procedure pMolWeights .....................................................................................124 Procedure ppH.................................................................................................125 Procedure pPropZ.............................................................................................125 Procedure pPropZPct ........................................................................................126 Procedure pPropZPPct.......................................................................................126

Page 7: ACM Library Reference Guide

Contents 7

Procedure pSurf_Tensy .....................................................................................127 Procedure pTrueCmp2 ......................................................................................128 Procedure pTrueCmpVLS...................................................................................129 Procedure pTrueComp ......................................................................................129 Procedure pTrueCmp2 ......................................................................................131 Procedure pVap_Pressures ................................................................................132 Procedure pVap_Pressure..................................................................................132

4 PHYSICAL PROPERTIES SUBMODELS .......................................................134 Key Features ........................................................................................................134

Properties Calculated ........................................................................................134 Local Properties ...............................................................................................135 Flash Methods .................................................................................................136 Flash Efficiencies..............................................................................................137 Polymers Support.............................................................................................138 Units of Measurement.......................................................................................138 Summary of Features ......................................................................................138

Using Submodels within your Models .......................................................................139 Instancing a Submodel .....................................................................................139 Conditional Instancing ......................................................................................139 Changing Options.............................................................................................140 Bubble Point and Dew Point Calculations..............................................................140

Running Simulations that use the Submodels ............................................................140 Physical Property Submodel Details .........................................................................141

Props_liquid ....................................................................................................141 Props_liq_entr .................................................................................................142 Props_vapor ....................................................................................................142 Props_vap_entr ...............................................................................................143 Props_flash2 ...................................................................................................143 Props_flash2_entr ............................................................................................145 Props_flash3 ...................................................................................................146 Props_flash3_entr ............................................................................................147 Props_flash2w .................................................................................................149 Props_lle.........................................................................................................150 Props_lwe .......................................................................................................151

5 UTILITY ROUTINES ..................................................................................153 ACM_Print Routine ................................................................................................153

Calling Routine ACM_PRINT from Fortran.............................................................153 Calling Routine ACM_Print from C.......................................................................155

ACM_Rqst Routine.................................................................................................157

Page 8: ACM Library Reference Guide

Contents 8

Calling Routine ACM_RQST from Fortran..............................................................157 ACM_GetComponents Routine.................................................................................161

Calling Routine ACM_GETCOMPONENTS from Fortran ............................................161 Calling Routine ACM_GetComponents from C/C++................................................162

Routines Provided for Compatibility with SPEEDUP 5.5................................................163 Procedure pSpRMod .........................................................................................163 Procedure pLMTD .............................................................................................164 Procedure pLimit ..............................................................................................164

6 PORT TYPES .............................................................................................166 MainPort Port Type................................................................................................166

7 VARIABLE TYPES......................................................................................167 A Variable Types ..............................................................................................167 C Variable Types ..............................................................................................167 D Variable Types..............................................................................................168 E Variable Types ..............................................................................................168 F Variable Types ..............................................................................................169 G Variable Types..............................................................................................170 H Variable Types..............................................................................................170 K Variable Types ..............................................................................................171 L Variable Types ..............................................................................................171 M Variable Types..............................................................................................171 N Variable Types..............................................................................................171 P Variable Types ..............................................................................................172 R Variable Types ..............................................................................................172 S Variable Types ..............................................................................................172 T Variable Types ..............................................................................................173 V Variable Types ..............................................................................................173

GENERAL INFORMATION..............................................................................174 Copyright.............................................................................................................174 Related Documentation..........................................................................................176

TECHNICAL SUPPORT...................................................................................177 Online Technical Support Center .............................................................................177 Phone and E-mail..................................................................................................178

INDEX ..........................................................................................................179

Page 9: ACM Library Reference Guide

Contents 9

Page 10: ACM Library Reference Guide

Introducing Aspen Custom Modeler 10

Introducing Aspen Custom Modeler

Aspen Custom Modeler 2004.1 (ACM) is an easy-to-use tool for creating, editing and re-using models of process units. You build simulation applications by combining these models on a graphical flowsheet. Models can use inheritance and hierarchy and can be re-used directly or built into libraries for distribution and use. Dynamic, steady-state, parameter estimation and optimization simulations are solved in an equation-based manner which provides flexibility and power.

ACM uses an object-oriented modeling language, editors for icons and tasks, and Microsoft Visual Basic for scripts. ACM is customizable and has extensive automation features, making it simple to combine with other products such as Microsoft Excel and Visual Basic. This allows you to build complete applications for non-experts to use.

Page 11: ACM Library Reference Guide

1 Control Models 11

1 Control Models

This chapter describes the control models:

Model Name Description

Comparator Calculates the difference between two input signals

Dead_time Delays a signal by a specified time

Discretize Discretizes a signal, for example, for use in simulating an online analyzer

FeedForward Feed forward controller using both lead-lag and dead time

HiLoSelect Selects the higher or lower of two input signals

IAE Calculates the integral of the absolute value of the error between a process variable and its desired value

ISE Calculates the integral of the squared error between a process variable and its desired value

Lag_1 Models a first order lag between the input and output

Lead_lag Models a lead-lag element

Multiply Calculates the product of two input signals

Noise Generates a Gaussian noise signal

PID A three mode proportional integral derivative controller using a traditional positional algorithm

PIDIncr A three mode proportional integral derivative controller using an incremental control algorithm

PRBS Generates a pseudo-random binary signal

Ratio Calculates the ratio of two input signals

Scale Scales an input signal

SplitRange Models a split range controller

SteamPtoT Calculates steam temperature given its vapor pressure

Sum Calculates the sum of two input signals

Transform Performs a loge, square, square root or power transform

Valve_dyn Models the dynamics of a valve actuator

Time Units in Control Models By default, the control models use time units of hours. This means they are compatible with process models that are written to use time units of hours, such as those in Aspen Dynamics.

You can also use the control models in a flowsheet that uses your own models which work in different time units. To do this:

Page 12: ACM Library Reference Guide

1 Control Models 12

1 After instancing one or more control models, in Explorer go to Simulation and open the Globals table.

2 Change the value of GlabalTimeScalar to the number of seconds per time unit used in your models. The default value of 3600 is for models written in hours. If your models are written in minutes, change the value to 60, and if they are written in seconds, change the value to 1

Note: All process models in a flowsheet must be written to work in a single, consistent time unit. Where possible, we recommend that you use hours for consistency with AspenTech models, such as those in Aspen Dynamics.

Comparator Input1

Output_Input2

Comparator calculates its output as the difference of the two input signals.

Comparator Equation The equation used in the Comparator model is:

Output_ = Input1 � Input2

Configuring Comparator Comparator has no configuration parameters.

Dead_time

Input_ Output_

Dead_time represents a pure dead time. The output of Dead_time element is equal to the input delayed by the time delay.

Dead_time Equation The equation used in the dead-time model is:

Output_ = Delay Input_ by DeadTime

Page 13: ACM Library Reference Guide

1 Control Models 13

Configuring Dead_time Dead_time has the following configuration parameter:

Parameter Description Units Valid

Values Default Value

DeadTime Dead time min 0 -> 1E6 0.0

If your process models are written to work in time units other than hours, you will need to change the control model time units. See Time Units in Control Models, earlier in this chapter.

DeadTime for Dead_time

DeadTime specifies the delay between the input and output of Dead_time. It has units of minutes.

Discretize Input_ Output_

Discretize discretizes a continuous control signal. It can be used to model the behavior of an online composition analyzer, which updates its output at intervals.

Discretize Equations The following illustration shows the relationship between the input and output signals:

Configuring Discretize Discretize has the following configuration parameter:

Page 14: ACM Library Reference Guide

1 Control Models 14

Parameter Description Units Valid

Values Default Value

Interval Sample interval

min 0 -> 1E6 0

If your process models are written to work in time units other than hours, you will need to change the control model time units. See Time Units in Control Models, earlier in this chapter.

Interval for Discretize

Interval specifies the time between successive updates to the output value.

FeedForward

FeedForward is a generalized feed-forward controller, which uses a combination of a lead-lag and a dead time to model the process dynamics. It includes the following features:

• Clipping and scaling of the process value and output.

• Forward and reverse action.

You can supply the bias by an external connection so that combined feed-forward/feedback control can be implemented.

FeedForward Block Diagram

FeedForward Equations The main equations for the FeedForward controller are:

For Lead-Lag:

Alpha*$aux = Gain*(PVs - SPs) - aux

Output_LL = Beta*$aux + aux

For Dead Time:

Output_DT = Delay Output_LL by DeadTime

Where:

Page 15: ACM Library Reference Guide

1 Control Models 15

Alpha = Lag time constant.

Beta = Lead time constant.

Gain = Process gain.

PVs = Scaled process variable.

SPs = Scaled setpoint.

aux = Auxiliary variable connecting the lead and the lag.

Output_LL = Output of the lead-lag.

DeadTime = Dead time.

Output_DT = Output of the dead-time.

Configuring FeedForward The FeedForward Configure form has the following parameters:

Parameter Description Units Valid Values Default

Value

Action Controller action - Direct/Reverse Direct

SP Operator set point - -1E9 -> 1E9 0

Bias Bias - -1E9 -> 1E9 0

Gain Gain - -1E9 -> 1E9 1

Alpha Lag time constant min 0.0 ->1E6 1

Beta Lead time constant min 0.0 ->1E6 1

DeadTime Dead time min 0.0 ->1E6 0

PVClipping Clip PV - Yes/No Yes

OPClipping Clip OP - Yes/No Yes

PVMin Minimum value of PV - -1E9 -> 1E9 0

PVMax Maximum value of PV - -1E9 -> 1E9 100

OPMin Minimum value of OP - -1E9 -> 1E9 0

OPMax Maximum value of OP - -1E9 -> 1E9 100

HiLoSelect Input1

Output_Input2

HiLoSelect models a high or low selector. The output is either the larger or smaller of the two inputs, depending on the select option you specify.

HiLoSelect Equations When configured as a high selector:

Page 16: ACM Library Reference Guide

1 Control Models 16

If Input1>Input2 then

Output_ = Input1

Else

Output_ = Input2

Endif

When configured as a low selector:

If Input1<Input2 then

Output_ = Input1

Else

Output_ = Input2

Endif

Configuring HiLoSelect HiLoSelect has the following configuration parameter:

Parameter Description Units Valid

Values Default Value

Select Select high or low input � High

Low

High

Select for HiLoSelect

Select specifies whether the block is to act as a high selector or a low selector.

IAE Input IAESP

IAE calculates the integral of the absolute value of the error between its input and a set point value.

The model provides a time-integral performance criterion. You can use IAE to measure how successful a control system has been in keeping a process variable at its set point (SP) over the entire dynamic response of a controlled process. SP can be specified within the block or be an input from another block.

IAE Equation The equation used in the model is the standard integral of the absolute value of the error form:

Page 17: ACM Library Reference Guide

1 Control Models 17

IAE e t dtT

= ∫0| ( )|.

Where:

e = Deviation of the variable from the desired set point.

t = Time.

IAE = Integral absolute error value.

T = Current time.

Configuring IAE IAE has the following configuration parameter:

Parameter Description Units Valid Values Default

Value

SP Set point � -1E9 -> 1E9 0.0

SP for IAE

SP specifies the required value of the input variable. The IAE element calculates its performance criterion as the integral of the absolute difference between this required value and the input value. SP may be specified within the IAE block, or supplied through an input signal to the block. If SP is supplied through an input signal, make sure you change its Spec from Fixed to Free on the block Configure table.

ISE Input_ ISESP

ISE calculates the integral of the squared error between its input and a set point value.

The model provides a time-integral performance criterion. You can use ISE to measure how successful a control system has been in keeping a process variable at its set point (SP) over the entire dynamic response of a controlled process. SP can be specified within the block or be an input from another block.

ISE Equation The equation used in the model is the standard integral of the absolute value of the error form:

ISE e t dtT

= ∫0

2( ) .

Page 18: ACM Library Reference Guide

1 Control Models 18

Where:

e = Deviation of the variable from the desired set point.

t = Time.

ISE = Integral absolute error value.

T = Current time.

Configuring ISE ISE has the following configuration parameter:

Parameter Description Unit Valid

Values Default Value

SP Set point � -1E9 -> 1E9 0.0

SP for ISE

SP specifies the required value of the input variable. The ISE element calculates its performance criterion as the integral of the squared difference between this required value and the input value. SP may be specified within the ISE block, or supplied through an input signal to the block. If SP is supplied through an input signal, make sure you change its Spec from Fixed to Free on the block Configure table.

Lag_1 Input_ Output_

Lag_1 models a first order lag between the input and output signals.

Lag_1 Equations The Laplace domain transfer function for the first order lag is:

1.)(

+=

sTauGainsg

Where:

Gain = Steady-state gain (ultimate change in output divided by change in input).

Tau = Time constant in minutes.

The model uses the following equation to implement this in the time domain:

Page 19: ACM Library Reference Guide

1 Control Models 19

__)(._. Outputdt

OutputdTauInputGain +=

Configuring Lag_1 Lag_1 has the following configuration parameters:

Parameter Description Units Valid Values Default

Value

Gain Steady-state gain

� -1E9 -> 1E9 1.0

Tau Time constant min 0 -> 1E6 0.0

If your process models are written to work in time units other than hours, you will need to change the control model time units. See Time Units in Control Models, earlier in this chapter.

Gain for Lag_1

Gain specifies the steady-state gain of the first order lag. The steady-state gain is equal to the ultimate change in the output, divided by the change in the input.

Tau for Lag_1

Tau specifies the amount of the first order lag that is imposed upon the input variable. Tau is equal to the time at which the output has reached 63.2% of its final value following a step change in the input.

The units of Tau are minutes.

Lead_lag Input_ Output_

Lead_lag models a lead-lag element. The output is the input signal passed through a lead-lag function.

A lead-lag consists of a first-order lead of unit gain and a first-order lag of unit gain in series. The numerator component introduces phase lead and the denominator component introduces phase lag. The response of the output can span from approximate first-order lag behavior to approximate first-order lead behavior.

Lead_lag Equations The Laplace domain transfer function for the lead-lag element is:

Page 20: ACM Library Reference Guide

1 Control Models 20

1.1..)(

++

=sAlpha

sBetaGainsg

Where:

Beta = Lead time constant in minutes

Alpha = Lag time constant in minutes

Gain = Steady state gain

The model uses the following equations to implement this in the time domain:

_.)( InputGainauxdtauxdAlpha =+ (lag component)

auxdtauxdBetaOutput +=

)(_ (lead component)

Where:

aux = Signal after the lag but before the lead.

Configuring Lead_lag Lead_lag has the following configuration parameters:

Property Description Units Valid

Values Default Value

Gain Steady-state gain

� -1E9 -> 1E9 1.0

Beta Lead time constant

min 0 -> 1E6 1.0

Alpha Lag time constant

min 0.01 -> 1E6 1.0

If your process models are written to work in time units other than hours, you will need to change the control model time units. See Time Units in Control Models, earlier in this chapter.

Gain for Lead_lag

Gain specifies the steady-state gain between the input and output.

Beta for Lead_lag

Beta specifies the amount of lead imposed upon the input variable. The units of Beta are minutes.

Page 21: ACM Library Reference Guide

1 Control Models 21

Alpha for Lead_lag

Alpha specifies the amount of lag that is imposed upon the input variable. A pure lead with no lag is physically impractical, and may cause problems when solving the simulation. Therefore Alpha has a lower limit of 0.01.

The units of Alpha are minutes.

Multiply Input1

Output_Input2

Multiply evaluates its output as the product of the two input signals.

Multiply Equations The equation used in the Multiply model is:

2.1_ InputInput = Output

Configuring Multiply Multiply has no configuration parameters.

Noise

Input_ Output_

Noise generates a Gaussian noise signal. You can use the Noise model in two ways:

• To add noise to the input signal.

• To generate a noisy signal.

Noise can be used for testing how well your control system rejects noise.

Page 22: ACM Library Reference Guide

1 Control Models 22

Noise Equations The Noise model generates a random value with amplitude which follows a Gaussian probability distribution. The mean of the noise is zero, and the magnitude of the noise is determined by the specified standard deviation. The output of this model is the sum of the input to the model plus the noise.

The model approximates Gaussian white noise, which is often a good representation of noise found in process measurement and control systems.

The following graph shows the shape of the Gaussian distribution.

−σ 0 σ 2σ 3σ−3σ −2σ

Probability

= Standard deviationσ

Amplitude

Configuring Noise To add noise to an input signal, connect to both the Input_ and Output_ connections. To generate a noisy signal, connect Output_ only, and Fix Input_ to the required mean value of the noisy signal.

Noise has the following configuration parameters:

Property Description Units Valid

values Default Value

StdDev Standard deviation � -1E9->1E9 0.0

StdDev for Noise

StdDev specifies the standard deviation for the Gaussian distribution of the amplitude of the noise.

Page 23: ACM Library Reference Guide

1 Control Models 23

PID

SPRemote

OPPV

PID models a proportional integral derivative controller using a traditional positional algorithm. Key features of PID include:

• Ideal, series, and parallel algorithms.

• Auto, manual, and cascade operation.

• Optional bumpless transfer between auto and manual modes.

• Optional anti-reset windup.

• Various input filtering options.

• Dead banding.

You can control which of the three controller modes (Proportional, Integral and Differential) by using appropriate values of the tuning constants, for example:

To simulate this controller type

Use this value for the tuning constant

Proportional (P) Gain > 0.0, Integral time > 0.0, Derivative time = 0.0

Proportional Integral (PI) Integral time - as required Derivative time = 0.0

Proportional Integral Derivative (PID)

Integral time � as required Derivative time � as required

PIDIncr and PID

PIDIncr and PID are both models of PID controllers. They have similar features but are implemented differently. PID uses a positional algorithm to calculate the controller output from the current error and accumulated integral error. PIDIncr uses an incremental algorithm which calculates the change in the output as a function of the error.

The implementation of PIDIncr is closer to that of real industrial controllers, and it models their detailed behavior more closely. In particular there is no bump in the output when you change the tuning parameters during a dynamic simulation, whereas PID may give a bump in the output. This make PIDIncr better for tuning controllers as a simulation runs.

We recommend the use of PIDIncr for most simulations. PID is retained for backwards compatibility of existing simulations. If you wish to use PIDIncr in simulations which previously used PID, you can drag and drop PIDIncr from Simulation Explorer on to an existing controller and select yes to use PIDIncr in place of PID. The controller settings will be automatically mapped across.

Page 24: ACM Library Reference Guide

1 Control Models 24

Configuring PID

Use the Configure form to enter parameters for PID.

The form is divided into four tabs for configuring different aspects of the controller. Each of these is explained below. You will need to change values on the Tuning and Ranges tab, but the default values on the Filtering and Other tab are suitable for most applications.

To help you configure the controller, ensure that you have connected the Process Variable (PV) and output (OP) connections, and then use the Initialize Values button on the Configure form.

When you click the button, the current values of the measured variable and manipulated variable are used to initialize controller parameters as follows:

Name Initialized to

Operator set point Measured Variable

Bias Manipulated Variable

PV range minimum If Measured Variable > 0 0 If Measured Variable < 0 2 x Measured Variable

PV range maximum If Measured Variable > 0 2 x Measured variable If Measured Variable < 0 0

Output range maximum

If Manipulated Variable > 0 0 If Manipulated Variable < 0 2 x Manipulated Variable

Output range minimum

If Manipulated Variable > 0 2 x Manipulated Variable If Manipulated Variable < 0 0

If your process models are written to work in time units other than hours, you will need to change the control model time units. See Time Units in Control Models, earlier in this chapter.

Page 25: ACM Library Reference Guide

1 Control Models 25

PID Tuning Tab

The PID tuning tab has these configuration parameters:

Description Name Units Valid

values Default Value

Operator set point SPo � -1E9 -> 1E9 50

Bias Bias � -1E9 -> 1E9 0

Gain Gain � -1E9 -> 1E9 1

Integral time IntegralTime min 1E-3 -> 1E12

20

Derivative time DerivTime min 0 -> 1E6 0

Controller action Action � Direct Reverse

Direct

Operator Set Point

Operator set point (SPo) is used when the controller is in auto mode. When the controller is in Cascade mode, the remote set point is used instead.

Bias for PID

The bias is a constant term added to the controller output. Bias is typically set to the value of the manipulated variable when the process is at steady state.Gain for PID

Gain is the proportional gain of the controller. Gain is dimensionless. Gain is related to the proportional band for the controller as follows:

Gain = 100% / Proportional band

Integral Time for PID

The Integral Time of the controller is also known as reset time. It has units of time/repeat.

Derivative Time for PID

The controller's derivative time is also known as rate time. It has units of time.

Action for PID

Controller action determines whether the controller is direct or reverse acting. The following table shows the effects of direct or reverse action:

When the action is

And the measured variable

Then the manipulated variable is

Direct Increases Increased

Direct Decreases Decreased

Reverse Increases Decreased

Reverse Decreases Increased

Page 26: ACM Library Reference Guide

1 Control Models 26

PID Ranges Tab

The PID Ranges tab has these configuration parameters:

Description Name Units Valid values Default

Value

Process Variable Range minimum

PVmin � -1E9 -> 1E9 0

Process Variable Range maximum

PVmax � -1E9 -> 1E9 100

Process Variable Clip to Range

PVClipping � Yes No

Yes

Output Range minimum

OPmin � -1E9 -> 1E9 0

Output Range maximum

OPmax � -1E9 -> 1E9 100

Output Clip to Range

OPClipping � Yes No

Yes

PVmin, PVmax, and PVClipping for PID

Process Variable Range minimum (Pvmin) and Process Variable Range maximum (Pvmax) represent the range over which the process variable (PV) can vary, and may correspond to the range of the instrument used to measure the PV.

PVmin and PVmax are used to determine the scaled process variable (PVs) as follows:

minmaxmin.100

PVPVPVPVPVs−

−=

PVs has units of %. It is clipped between 0 and 100%.

PVs is used in the controller equations.

If Process Variable Clip to Range is selected, PV is clipped between PVmin and PVmax.

OPmin, OPmax, and OPClipping for PID

Output Range minimum (Opmin) and Output Range maximum (Opmax) represent the range over which the output (OP) can vary, and usually correspond to the range of the final control element to which the controller output is connected. If the final control element is a valve, OPmin and OPmax are usually 0 and 100 respectively.

OPmin and OPmax are used to determine the actual controller output (OP) for the scaled controller output (OPs) as follows:

min100

min)max.( OPOPOPOPsOP +−

=

OPs has units of %. OPs is used in the controller equations.

If Output Clip to Range is selected, then OP is clipped between OPmin and OPmax.

Page 27: ACM Library Reference Guide

1 Control Models 27

PID Filtering Tab

The PID Filtering tab has these configuration parameters:

Description Name Units Valid

values Default Value

Enable filtering PVFiltering � Yes No

No

Filter time constant

PVFilter min 1E-3 -> 1E6 1

Proportional term SP change filter

Beta � 0 -> 1 1.0

Derivative term filter constant

Alpha � 0.03 -> 1 0.1

Derivative term SP change filter

Gamma � 0 -> 1 1

Enable Filtering and Filter time constant for PID

If Enable filtering (PVFiltering) is selected, the process variable value (PV) will be passed through a first order filter before being used in the controller equations. This feature is used in real controllers to help smooth a noisy measurement.

Filter time constant (PVFilter) has units of time.

In the Laplace domain the filter equation is:

1.1)(

+=

sPVFiltersg

Derivative term filter constant for PID

This is the derivative term filter constant (Alpha). To avoid excessive response to rapid changes in error, the error term is passed through a first-order filter before it is used to calculate the derivative term. The time constant for this filter is the product of Alpha and the derivative time.

In the Laplace domain the filter equation is:

( ) 1..1)(

+=

sDerivTimeAlphasg

Alpha can be set to any value between 0.03 and 1.0. Normal settings are between 0.1 to 0.125. Increasing Alpha reduces the effect of the derivative term.

Proportional Term SP Change filter for PID

The proportional term SP change filter constant (Beta) determines how the proportional action of the controller is affected by set point changes:

If Beta is The result is

1.0 The proportional action of the controller is the standard error signal (default).

< 1.0 The amount of controller output from the controller for set

Page 28: ACM Library Reference Guide

1 Control Models 28

point changes is limited.

0 The proportional action acts only on process variable movement. This enables smooth integrated response to set point changes and fast response to disturbances.

The error used in calculating the proportional term is related to Beta as follows:

Ep = Beta.SP - PV

Where:

Ep = Proportional error

SP = Set point

PV = Process variable

Derivative term SP Change Filter

The derivative term SP change filter (Gamma) determines how the derivative action of the controller is affected by set point changes:

If Gamma is

The result is

1.0 The derivative action works in the same way on both set point and disturbance changes (default)

< 1.0 The derivative action from the controller for set point changes is limited

0 The derivative action works only on the process variable signal. Derivative action that works on the set point is usually not a problem except in cascade loops or other cases in which the set point is manipulated. Derivative action may become excessive due to abrupt changes in the set point.

The error used in calculating the derivative term is related to Gamma as follows:

Ed = Gamma.SP - PV

Where:

Ed = Derivative error

SP = Set point

PV = Process variable

PID Other Tab

The PID Other tab has these configuration parameters:

Description Name Units Valid

values Default Value

Controller algorithm

Algorithm � Ideal Parallel Series

Ideal

Bumpless auto/manual transfer

Bumpless � Yes No

Yes

Page 29: ACM Library Reference Guide

1 Control Models 29

Anti-reset windup ARWindup � Yes No

Yes

Range below set point

DBlo % 0 -> 100 0

Range above set point

DBhi % 0 -> 100 0

Algorithm for PID

Commercial PID controllers typically use one of three alternative algorithms. These algorithms are:

• Ideal: This is the classical form normally found in text books.

• Series: This is also known as the interacting or analog algorithm.

• Parallel: This is also known as the ideal parallel or non-interacting algorithm.

Anti Reset Windup for PID

Anti reset windup determines whether the controller anti-reset windup algorithm is active.

What is Reset Windup?

The integral term of a proportional integral derivative controller causes its output to continue changing as long as there is a non-zero error. If the error cannot be eliminated quickly, then eventually the integral term saturates the control action (the valve is completely open or shut). Then, even if the error returns to zero, the control action may remain saturated. This phenomenon is called reset windup or integral windup.

The integral mode of the controller does not reverse the direction of the controller output until the measurement crosses the set point.

Proportional action, on the other hand, reverses the direction of the controller output when the controller input reverses:

Proportional error = SP PV−

Integral error = ( )SP PV dT−∫ .

Where:

SP = Set point

PV = The measured process variable

Reset Windup Example

The following graph shows what happens to the proportional and integral error term of a controller with and without anti-reset windup.

Page 30: ACM Library Reference Guide

1 Control Models 30

Manipulated variable

Integral error with anti-reset windup

Integral error withoutanti-reset windup

Proportional error

For a controller with anti-reset windup, when the manipulated variable is at its minimum value of 10, the anti-reset windup mechanism prevents the integral error from increasing further.

For a controller without anti-reset windup, the integral error term continues to increase. When the manipulated variable comes off the minimum at time=15, the proportional error term decreases, while the integral term continues to increase. The controller has to pull back the extra amount that the integral term has wound up while the manipulated variable has saturated at its minimum.

Bumpless for PID

Bumpless determines whether the bumpless transfer option is active. If bumpless transfer is active, the controller avoids a bump in its output when you switch between auto and manual modes.

This is achieved as follows:

When switching from

The effect is

Auto to manual The output is frozen at the value it was when the controller was switched to manual mode. The output will change only when you enter a new value for the controller output.

Manual to auto mode

The set point is set to the value of the measured variable when the controller was switched to auto mode. The set point will change only when you supply a new value.

DBlo and DBhi for PID

Sometimes you may wish to specify a dead band either side of the controller set point. If the process variable is within this dead band, the controller output is not changed. Specify the lower (Dblo) and upper (Dbhi) limits to

Page 31: ACM Library Reference Guide

1 Control Models 31

specify the lower and upper limits of this dead band as a percentage of the process variable range (PVmax�PVmin).

If DBlo and DBhi are

The result is

0.0 No dead band is active (default)

>0.0 Dead band is active within the ranges specified

PID Algorithms The equations used in the PID model to describe controller output depend on the algorithm you choose:

• Ideal algorithm

• Series algorithm

• Parallel algorithm

Ideal Algorithm

The equation used to determine the controller output (OP) is:

++∗+= ∫ dtEd

DerivTimedtEmeIntegralTi

EGainBiasOP DIP

)(.1

Where:

EP = Proportional mode error

IE = Integral mode error

DE = Derivative mode error

All of these errors are derived from the standard error (E), which is defined as:

E = set point � process variable

Series Algorithm

The equation used to determine the controller output (OP) is:

+

++= ∫ dtEd

DerivTimedtEmeIntegralTi

EGainBiasOP DIP

)(1..1.

Parallel Algorithm

The equation used to determine the controller output (OP) is:

∫ +++=dtEdDerivTimedtE

meIntegralTiEGainBiasOP D

IP)(.1.

Note: All values of the variables used in these equations are the scaled values based on the process variable range minimum and

Page 32: ACM Library Reference Guide

1 Control Models 32

maximum or the output range minimum and maximum.

PID Controller Faceplates The PID model includes two controller faceplates that you can use to interact with the controller during a running simulation:

• Full faceplate

• Compact faceplate

The full faceplate is similar to that found on real PID controllers. It includes three horizontal bars which show the set point (SP), process variable (PV), and output (OP) as a percentage of range. To the right are the actual numerical values of SP, PV, and OP in process units.

The first three buttons at the top level enable you to switch between auto, manual, and cascade modes respectively. When you are in auto mode (as in the example), the value for SP has a white background, which means you can type a new value. When you are in manual mode, the value for OP has a white background, which means you can change the value.

Pressing the fourth button from the left opens the Configure table so that you can easily change configuration parameters.

The fifth button opens the plot for the controller which shows values of SP, PV and OP either in process units, or as a percentage of the range versus time. The sixth button plots the same variables but shows them as percentages of range, instead of in process units.

The compact faceplate shows a subset of the information found on the full faceplate.

Closed-Loop Controller Tuning using the Ziegler-Nichols Technique The Ziegler-Nichols closed-loop technique is one of the most popular methods for tuning controllers. This technique gives approximate values of the controller's gain, integral time, and derivative time required to obtain a one quarter amplitude response.

Page 33: ACM Library Reference Guide

1 Control Models 33

The Ziegler-Nichols closed-loop method is suitable for many single-loop controllers. For processes that contain interacting loops, open-loop tuning methods are preferred. For more information on open-loop tuning, please consult a text book on controller tuning.

Using the Ziegler-Nichols Technique 1 To use the Ziegler-Nichols technique:

2 With the controller in automatic, remove all the reset and derivative action. To do this, set:

− Integral time to 1.0E6 − Derivative time to 0.0

3 Make a small set point or load change and observe the response.

4 If the response is not continuously oscillatory, increase the controller's gain and repeat step 2.

5 Repeat step 3 until you obtain a continuous oscillatory response.

The gain that gives these continuous oscillations is called the ultimate gain, KU . The period of the oscillations is called the ultimate period, TU .

Obtaining the Approximate Decay Ratio Settings

Use the following expressions to calculate the controller settings from the ultimate gain KU . and the ultimate period TU .

Controller Type Gain Integral

Time Derivative Time

P uK5.0 6le 0

PI uK45.0 2.1/uT 0

PID uK6.0 2/uT 8/uT

Using the ISE and IAE Models with a PID Controller The ISE model and IAE model can be used to give a measure of how successful a control system is at keeping a process variable (PV) at its set point (SP). When used with a PID controller, it is convenient to link the input of the ISE and IAE models directly to the setpoint and process variable of the controller. For this reason, the PID setpoint (SP) and process variable (PV) are defined as output control connections, and you can use control streams to connect the PID controller and ISE or IAE block, as in the following table: Connect this PID controller: To this connection of

the ISE or IAE block:

SP SP

PV Input_

Page 34: ACM Library Reference Guide

1 Control Models 34

PIDIncr

SPRemote

OPPV

PIDIncr models a proportional integral derivative controller using an incremental control algorithm, as used in most modern electronic controllers. Key features of PIDIncr include:

• Ideal, series, and parallel algorithms.

• Auto, manual, and cascade operation.

• Optional tracking of the process variable by the set point when in manual mode.

• Anti-reset windup.

• Various input filtering options.

• Dead banding.

• Auto-tuning capability.

You can control which of the three controller modes (Proportional, Integral and Differential) by using appropriate values of the tuning constants, for example:

To simulate this controller type

Use this value for the tuning constant

Proportional (P) Integral time � very large e.g. 1e6 Derivative time = 0.0

Proportional Integral (PI) Integral time - as required Derivative time = 0.0

Proportional Integral Derivative (PID) Integral time � as required Derivative time � as required

PIDIncr and PID

PIDIncr and PID are both models of PID controllers. They have similar features but are implemented differently. PID uses a positional algorithm to calculate the controller output from the current error and accumulated integral error. PIDIncr uses an incremental algorithm which calculates the change in the output as a function of the error.

The implementation of PIDIncr is closer to that of real industrial controllers, and it models their detailed behavior more closely. In particular there is no bump in the output when you change the tuning parameters during a dynamic simulation, whereas PID may give a bump in the output. This make PIDIncr better for tuning controllers as a simulation runs.

We recommend the use of PIDIncr for most simulations. PID is retained for backwards compatibility of existing simulations. If you wish to use PIDIncr in

Page 35: ACM Library Reference Guide

1 Control Models 35

simulations which previously used PID, you can drag and drop PIDIncr from Simulation Explorer on to an existing controller and select yes to use PIDIncr in place of PID. The controller settings will be automatically mapped across.

Configuring PIDIncr

Use the Configure form to enter parameters for PID.

The form is divided into four tabs for configuring different aspects of the controller. Each of these is explained below. You will need to change values on the Tuning and Ranges tab, but the default values on the Filtering and Other tab are suitable for most applications.

To help you configure the controller, ensure that you have connected the process variable (PV) and output (OP) connections, and then use the Initialize Values button on the Configure form.

When you click the button, the current values of the measured variable and manipulated variable are used to initialize controller parameters as follows:

Parameter Initialized to

Set point Measured Variable

Initial Output Manipulated Variable

PV range minimum If Measured Variable > 0 0 If Measured Variable < 0 2 x Measured Variable

PV range maximum If Measured Variable > 0 2 x Measured variable If Measured Variable < 0 0

Output range maximum

If Manipulated Variable > 0 0 If Manipulated Variable < 0 2 x Manipulated Variable

Output range minimum

If Manipulated Variable > 0 2 x Manipulated Variable If Manipulated Variable < 0 0

Page 36: ACM Library Reference Guide

1 Control Models 36

If your process models are written to work in time units other than hours, you will need to change the control model time units. See Time Units in Control Models, earlier in this chapter.

PIDIncr Tuning Tab

The PID tuning tab has these configuration parameters:

Description Name Units Valid

Values Default Value

Set point SP � -1E9 -> 1E9 50

Initial output OPMan -- -1E9 -> 1E9 50

Gain Gain � -1E9 -> 1E9 1

Integral time IntegralTime min 1E-3 -> 1E12

20

Derivative time DerivTime min 0 -> 1E6 0

Controller action Action � Direct Reverse

Direct

Set Point for PIDIncr

The set point is used when the controller is in auto mode. When the controller is in Cascade mode, the remote set point is used instead. Use this to change the set point before a simulation, or when a dynamic simulation is paused. If you wish to change the value while a dynamic simulation is running you should change the value from the controller faceplate.

Initial Output for PIDIncr

Because PIDIncr uses an incremental algorithm the value of the output at the start of a dynamic simulation must be defined. If you have previously performed a steady state simulation this will already be at the steady state value and you will probably want to leave it unchanged. If you have not performed a steady state run you should normally specify the initial value.

Gain for PIDIncr

Gain is the proportional gain of the controller. Gain is dimensionless. Some people use the term Proportional Band, and this is related to gain by the equation:

Gain = 100% / Proportional Band

Integral Time for PIDIncr

The Integral Time of the controller is also known as reset time. It has units of time/repeat.

Derivative Time for PIDIncr

The controller's derivative time is also known as rate time. It has units of time.

Page 37: ACM Library Reference Guide

1 Control Models 37

Action for PIDIncr

Controller action determines whether the controller is direct or reverse acting. The following table shows the effects of direct or reverse action:

When the action is

And the measured variable

Then the manipulated variable is

Direct Increases Increased

Direct Decreases Decreased

Reverse Increases Decreased

Reverse Decreases Increased

PIDIncr Ranges Tab

The PID Ranges tab has these configuration parameters:

Description Parameter Units Valid values Default

Value

Process variable and set point, Range minimum

PVmin � -1E9 -> 1E9 0

Process variable and set point, Range maximum

PVmax � -1E9 -> 1E9 100

Process variable and set point, Clip PV to Range

PVClipping � Yes No

Yes

Process variable and set point, Clip SP to Range

SPClipping � Yes No

Yes

Output, Range minimum

OPmin � -1E9 -> 1E9 0

Output, Range maximum

OPmax � -1E9 -> 1E9 100

Output, Clip to Range

OPClipping � Yes No

Yes

PVmin, PVmax, PVClipping and SPClipping for PIDIncr

Process Variable Range minimum (PVmin) and Process Variable Range maximum (PVmax) represent the range over which the process variable (PV) can vary, and may correspond to the range of the instrument used to measure the PV.

PVmin and PVmax are used to determine the scaled process variable (PVs) as follows:

minmaxmin.100

PVPVPVPVPVs−

−=

PVs has units of %.

PVs is used in the controller equations.

Page 38: ACM Library Reference Guide

1 Control Models 38

If Clip PV to Range is selected, the value of PV used in the controller equations is clipped between PVmin and PVmax, which means PVs is always between 0 and 100%.

If Clip SP to range is selected, the value of SP used in the controller equations is clipped between PVmin and PVmax.

OPmin, OPmax, and OPClipping for PIDIncr

Output Range minimum (OPmin) and Output Range maximum (OPmax) represent the range over which the output (OP) can vary, and usually correspond to the range of the final control element to which the controller output is connected. If the final control element is a valve, OPmin and OPmax are usually 0 and 100 respectively.

OPmin and OPmax are used to determine the actual controller output (OP) for the scaled controller output (OPs) as follows:

min100

min)max.( OPOPOPOPsOP +−

=

OPs has units of %. OPs is used in the controller equations.

If Output Clip to range is selected, then OP is clipped between OPmin and OPmax.

PIDIncr Filtering Tab

The PID Filtering tab has these configuration parameters:

Description Parameter Units Valid

Values Default Value

Filter time constant

PVFilter min 1E-3 -> 1E6 0.0333

Proportional term SP change filter

Beta � 0 -> 1 1.0

Derivative term filter constant

Alpha � 0.03 -> 1 0.1

Derivative term SP change filter

Gamma � 0 -> 1 1

Filter time constant for PIDIncr

The process variable value (PV) is passed through a first order filter before being used in the controller equations. This feature is used in real controllers to help smooth a noisy measurement.

Filter time constant (PVFilter) has units of time. The default value is 0.0333 minutes, which is 2 seconds.

In the Laplace domain the filter equation is:

1.1)(

+=

sPVFiltersg

Page 39: ACM Library Reference Guide

1 Control Models 39

Derivative term filter constant for PIDIncr

This is the derivative term filter constant (Alpha). To avoid excessive response to rapid changes in error, the error term is passed through a first-order filter before it is used to calculate the derivative term. The time constant for this filter is the product of Alpha and the derivative time.

In the Laplace domain the filter equation is:

( ) 1..1)(

+=

sDerivTimeAlphasg

Alpha can be set to any value between 0.03 and 1.0. Normal settings are between 0.1 to 0.125. Increasing Alpha reduces the effect of the derivative term.

Proportional Term SP Change filter for PIDIncr

The proportional term SP change filter constant (Beta) determines how the proportional action of the controller is affected by set point changes:

If Beta is The result is

1.0 The proportional action of the controller is the standard error signal (default)

< 1.0 The amount of controller output from the controller for set point changes is limited

0 The proportional action acts only on process variable movement. This enables smooth integrated response to set point changes and fast response to disturbances.

The error used in calculating the proportional term is related to Beta as follows:

dEp = Beta.dSP - dPV

Where:

dEp = Rate of change of proportional error

dSP = Rate of change of set point

dPV = Rate of change of process variable

Derivative term SP Change Filter

The derivative term SP change filter (Gamma) determines how the derivative action of the controller is affected by set point changes:

If Gamma is

The result is

1.0 The derivative action works in the same way on both set point and disturbance changes (default)

< 1.0 The derivative action from the controller for set point changes is limited

0 The derivative action works only on the process variable signal. Derivative action that works on the set point is usually not a problem except in cascade loops or other cases in which the set point is manipulated. Derivative action may become

Page 40: ACM Library Reference Guide

1 Control Models 40

excessive due to abrupt changes in the set point.

The error used in calculating the derivative term is related to Gamma as follows:

dEd = Gamma,dSP - dPV

Where:

dEd = Rate of change of derivative error

dSP = Rate of change of set point

dPV = Rate of change of process variable

PIDIncr Other Tab

The PIDIncr Other tab has these configuration parameters:

Description Parameter Uni

ts Valid values

Default Value

Controller algorithm

Algorithm � Ideal Parallel Series

Ideal

SP tracks PV when in manual

PVTrack � Yes No

Yes

Range above set point

DBhi % 0 -> 100 0

Range below set point

DBlo % 0 -> 100 0

Algorithm for PIDIncr

Commercial PID controllers typically use one of three alternative algorithms. These algorithms are:

• Ideal: This is the classical form normally found in text books.

• Series: This is also known as the interacting or analog algorithm.

• Parallel: This is also known as the ideal parallel or non-interacting algorithm.

PVTrack for PIDIncr

PVTrack determines whether the set point tracks (in other words follows) the process variable when the controller is in manual. This is a common feature of industrial controllers. It means that when you switch back from manual to auto, the controller will attempt to keep the process variable at the value it had when the switch was made.

If PVTrack is set to no the set point remains constant when in manual mode.

DBlo and DBhi for PIDIncr

Sometimes you may wish to specify a dead band either side of the controller set point. If the process variable is within this dead band, the controller output is not changed. Specify the lower (DBlow) and upper (DBhi) limits to specify the lower and upper limits of this dead band as a percentage of the process variable range (PVmax�PVmin).

Page 41: ACM Library Reference Guide

1 Control Models 41

If DBlow and DBhi are

The result is

0.0 No dead band is active (default)

>0.0 Dead band is active within the ranges specified

PID Algorithms The equations used in the PIDIncr model to describe controller output depend on the algorithm you choose:

• Ideal algorithm

• Series algorithm

• Parallel algorithm

Ideal Algorithm

The equation used to determine the controller output (OP) is:

++∗+= ∫ dtEd

DerivTimedtEmeIntegralTi

EGainBiasOP DIP

)(.1

Where:

EP = Proportional mode error

IE = Integral mode error

DE = Derivative mode error

All of these errors are derived from the standard error (E), which is defined as:

E = set point � process variable

Series Algorithm

The equation used to determine the controller output (OP) is:

+

++= ∫ dtEd

DerivTimedtEmeIntegralTi

EGainBiasOP DIP

)(1..1.

Parallel Algorithm

The equation used to determine the controller output (OP) is:

∫ +++=dtEdDerivTimedtE

meIntegralTiEGainBiasOP D

IP)(.1.

Note: All values of the variables used in these equations are the scaled values based on the process variable range minimum and maximum or the output range minimum and maximum.

Page 42: ACM Library Reference Guide

1 Control Models 42

Anti Reset Windup In common with modern industrial controllers, PIDIncr implements anti reset windup. This section explains what anti reset windup is.

The integral term of a controller causes its output to continue changing as long as there is a non-zero error. If the error cannot be eliminated quickly, then eventually the integral term saturates the control action (the valve is completely open or shut). Then, even if the error returns to zero, the control action may remain saturated. This phenomenon is called reset windup or integral windup.

The integral mode of the controller does not reverse the direction of the controller output until the measurement crosses the set point.

Proportional action, on the other hand, reverses the direction of the controller output when the controller input reverses:

Proportional error = SP PV−

Integral error = ( )SP PV dT−∫ .

Where:

SP = Set point

PV = The measured process variable

Reset Windup Example

The following graph shows what happens to the proportional and integral error term of a controller with and without anti-reset windup.

Manipulated variable

Integral error with anti-reset windup

Integral error withoutanti-reset windup

Proportional error

For a controller with anti-reset windup, when the manipulated variable is at its minimum value of 10, the anti-reset windup mechanism prevents the integral error from increasing further.

For a controller without anti-reset windup, the integral error term continues to increase. When the manipulated variable comes off the minimum at time=15,

Page 43: ACM Library Reference Guide

1 Control Models 43

the proportional error term decreases, while the integral term continues to increase. The controller has to pull back the extra amount that the integral term has wound up while the manipulated variable has saturated at its minimum.

PIDIncr Controller Faceplates The PID model includes two controller faceplates that you can use to interact with the controller during a running simulation:

• Full faceplate

• Compact faceplate

The full faceplate is similar to that found on real PID controllers. It includes three horizontal bars which show the set point (SP), process variable (PV), and output (OP) as a percentage of range. To the right are the actual numerical values of SP, PV, and OP in process units.

The first three buttons at the top level enable you to switch between auto, manual, and cascade modes respectively. When you are in auto mode (as in the example), the value for SP has a white background, which means you can type a new value. When you are in manual mode, the value for OP has a white background, which means you can change the value.

The fourth button enables you to switch between viewing values in process units or percentages of range. To see the process units you can hold the mouse pointer over the label SP, PV or OP.

To individually switch viewing of SP, PV or OP between percentage and process units right mouse click on the label and select as required.

Page 44: ACM Library Reference Guide

1 Control Models 44

Pressing the fifth button opens the Configure form so that you can easily change configuration parameters.

The sixth button opens the plot for the controller which shows values of SP, PV and OP either in process units, or as a percentage of the range, versus time.

The seventh button opens the Tune form which you can use to automatically determine tuning parameters for the controller.

To save space the compact faceplate only includes the three buttons required to change controller mode, and does not include bars to represent values. Otherwise the behavior is the same as for the main faceplate.

Automatic Controller Tuning Context The PIDIncr Tune form provides access to automatic tuning capabilities which you can use to determine suitable values for the controller tuning parameters. This technique is useful when designing control systems for new processes or improving those for existing processes.

Note: To obtain good results that can be transferred to a real control system it is important that you accurately model the loop dynamics. This means modeling the sensor and actuator dynamics if they have a significant effect on the overall loop dynamics. It is particularly important to model and dead times in the control loop.

Using Automatic Controller Tuning Before using automatic tuning ensure that the controller Process Variable and Output connections are in place. Also ensure that you have entered the controller input and output ranges and the Set Point. If you use the Closed Loop ATV test method you must also have entered the correct controller action.

Next choose your required test method and test settings.

Start a dynamic simulation and open the controller faceplate. Wait until the controller PV and OP are stable. This is easiest to see if you plot the values using the plot button. Then press the Start test button to start the test.

When the test has run press the Finish Test button. For an Open loop test this is when the PV has stopped changing significantly. For a closed loop ATV test this is when each cycle looks the same as the previous one.

The test results will then be calculated and displayed automatically.

Page 45: ACM Library Reference Guide

1 Control Models 45

For step tests, in some cases the automatic tuner may find it difficult to estimate the Time constant and Dead time from the test results. This can be true if you are using the Discretize model to simulate the effect of an analyzer in the control loop. For this reason we recommend you visually check that the values shown look reasonable. The diagram below shows how the values can be determined from the step response curve.

Time Hours

Set P

oint

Con

trolle

r Out

put

Proc

ess

Varia

ble

0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 5.5 6 6.5 7

50

52.5

55

57.5

60

62.5

65

45

46

47

48

49

50

51

52

53

54

55

Time constantDead time

If you would like to change the values used for the calculation of the tuning parameters type in the values you want to use in place of those determined by the automatic tuner.

If for any reason you wish to stop a test without calculating the results press the Cancel test button to abort the test.

To calculate tuning parameters select the Tuning parameters tab. Select the tuning parameter options and press the Calculate button to calculate the results. If you wish to update the controller with the calculated values click the Update controller button.

Tips:

• If your control loop has very fast dynamics, or if you are using Closed Loop ATV testing on a loop with a very small dead time, you may need to reduce the Simulation Communication Interval to ensure that the fast changes in the PV are adequately captured. You can do this on the Run Options dialog in the section Time control. You may also need to reduce the integrator minimum step size. Do this on the Integrator tab of the Solver Options dialog.

• If you rewind or restart your simulation after clicking the Update controller button the controller parameters are reset

Page 46: ACM Library Reference Guide

1 Control Models 46

to their previous values. To prevent this click the Update controller button after you have rewound or restarted the simulation.

Test Method and Test Settings for PIDIncr You can perform either an open loop test or a closed loop ATV test.

For an open loop test the controller is set to manual and the output is stepped. You can specify whether the step is up or down, and the size of the step as a percentage of output range. This approach assumes that the process can be approximated by a first order lag plus deadtime. The response of the PV is used to estimate an open loop gain, time constant and dead time for the process.

Tip: You can try different steps directions and sizes to see how these affect the results. The more non-linear the process the greater the differences will be.

For a closed loop ATV test the control operates as a relay controller to create a limit cycle in the PV. For a Direct acting controller, when the PV is greater than the set point, the controller moves the output to the initial output plus the relay amplitude that you specify. When the PV is less than the set point the controller moves the output to the initial value less the amplitude. If the controller action is reverse this works the other way round. It is important that you select the correct controller action before running this test.

The size and period of the limit cycle in the PV is used to determine the ultimate gain and ultimate period of the process.

Tip: The Closed Loop ATV test method is only effective if you have some dead time in the control loop. If you have not modeled loop dead time you should use the Open Loop test method.

Tuning Parameter Options for PIDIncr First specify the controller type that you wish to calculate parameters for. This can be P, PI or PID. Then select the tuning rule to be used. Many methods have been proposed for determining controller tuning parameters. We have provided some of the most commonly used methods. The methods available differ depending upon whether you performed an open loop or closed loop test. Some methods are not available for all controller types.

Open Loop Methods

Ziegler-Nichols � Aims to provide a quarter amplitude decay ratio, in other words for each oscillation to be one quarter the amplitude of the previous one

Cohen-Coon � Also aims to provide a quarter amplitude decay ratio. Seeks to improve on Ziegler-Nichols when the dead time is large compared to the time constant

Page 47: ACM Library Reference Guide

1 Control Models 47

IMC � Uses tuning rules developed by Rivera and Morari. Aims to provide robust control with no oscillation or overshoot. Provides a more damped response than Ziegler-Nichols and Cohen-Coon

If you select the IMC tuning rule you must enter a value for lambda. This is a filter parameter. It must be greater than 0.2 times the calculated process time constant. For a PI controller is must be greater than 1.7 times the dead time, and for a PID controller it must be greater than 0.25 times the dead time. A smaller value gives a faster response.

IAE � Aims to minimize the integrated absolute error in the response to a disturbance

ISE � Aims to minimize the integrated squared error in the response to a disturbance

ITAE � Aims to minimize the integrated time waited absolute error in the response to a disturbance

Closed Loop Methods:

Ziegler-Nichols - Aims to provide a quarter amplitude decay ratio, in other words for each oscillation to be one quarter the amplitude of the previous one

Tyreus-Luyben � Less aggressive than Ziegler-Nichols with lower gain and larger integral times. Minimizes overshoot. Developed specifically for process applications.

Using the ISE and IAE Models with the PIDIncr Controller The ISE model and IAE model can be used to give a measure of how successful a control system is at keeping a process variable at its set point. When used with a PIDIncr controller, it is convenient to link the input of the ISE and IAE models directly to the set point and process variable of the controller. For this reason, the set point (SP) and process variable (PV) are defined as output control connections, and you can use control streams to connect the PIDIncr controller and ISE or IAE block, as in the following table: Connect this PIDIncr controller connection:

To this connection of the ISE or IAE block:

SP SP

PV Input_

PRBS Output_

PRBS generates a pseudo-random binary signal. You can use the output from the model in two ways:

Page 48: ACM Library Reference Guide

1 Control Models 48

• As a noise source added to a signal using the Sum model.

• As the signal itself.

PRBS can be used for testing how well your control system rejects noise.

The output signal can have either a fixed or varying amplitude.

PRBS Equations PRBS can be used to generate a noise signal with one of the following:

• Fixed amplitude

• Variable amplitude

When fixed amplitude signal is selected, the output is always the datum plus or minus the amplitude. If a variable amplitude is selected, the output is the datum plus or minus a random value in the range (-amplitude) to (+amplitude). In both cases, the output signal is re-calculated at an interval defined by the specified period of the noise.

The following graphs show the two types of pseudo-random signals that can be generated:

Fixed Amplitude

Upperbound

Datum

Lowerbound

Time

Amplitude

Amplitude

Page 49: ACM Library Reference Guide

1 Control Models 49

Varying Amplitude

Upperbound

Datum

Lowerbound

Time

Amplitude

Amplitude

Configuring PRBS PRBS has the following configuration parameters:

Property Description Units Valid

Values Default Value

Amplitude Type

Type of amplitude variation � Fixed

Varying

Fixed

Datum Datum point for deviation � -1E9 -> 1E9

0.0

Amplitude Amplitude of deviation � 0 -> 1E9 1.0

Period Period of random change min 1E-4 -> 1E6

1.0

Seed Seed for random No. generation

� 1000 -> 1E9

12345

If your process models are written to work in time units other than hours, you will need to change the control model time units. See Time Units in Control Models, earlier in this chapter.

AmplitudeType for PRBS

AmplitudeType specifies the type of pseudo-random binary signal.

If AmplitudeType is

The result is

Fixed Deviation around Datum is fixed at -Amplitude or +Amplitude.

Variable Deviation around Datum can vary between -Amplitude and +Amplitude.

Page 50: ACM Library Reference Guide

1 Control Models 50

Datum for PRBS

Datum specifies the fixed value around which the random deviation occurs. For steady-state and other non-dynamic run modes, the output from PRBS is fixed at Datum.

Amplitude for PRBS

Amplitude specifies the size of the deviation around the Datum value.

Period for PRBS

Period specifies the period at which the random signal can change. The units of Period are minutes.

Seed for PRBS

Seed is used to initialize the random number generator used within PRBS. Make sure Seed is a large number, in the order of thousands. Using the same seed will give the same random signal for repeated runs of the simulation. To get different sequences of random numbers, change the value of seed.

Ratio Input1

Output_Input2

Ratio calculates its output as the ratio of input1 to input2.

Ratio Equations The model equation calculates the ratio of the first input signal to the second input signal:

21_

InputInputOutput =

Configuring Ratio Ratio has no configuration parameters.

Scale

Input_ Output_

Page 51: ACM Library Reference Guide

1 Control Models 51

Scale maps an input signal onto a scale, where a given minimum is 0% and a given maximum is 100%. The output signal can also be clipped to remain within the range 0 to 100%.

Scale Equations Scale uses the following scaling equation:

ScaleMinScaleMaxScaleMinInputOutput

−−

=)_.(100_

If clipping is enabled, Output_ will never be less than 0 or greater than 100, even if this equation calculates a value outside of this range.

Configuring Scale Scale has the following configuration parameters:

Property Description Units Valid Values Default

Value

Clipping Output clipping � Yes

No

No

ScaleMin Scale minimum � -1E9 -> 1E9 0.0

ScaleMax Scale maximum � -1E9 -> 1E9 100.0

Clipping for Scale

Output clipping determines whether or not the output of the scaler is clipped between the values of ScaleMin and ScaleMax.

If output clipping is

The result is

No No clipping (default)

Yes Output is clipped between ScaleMin and ScaleMax

ScaleMin for Scale

ScaleMin specifies the lower limit to which the input of the scaler is clipped if clipping is active.

ScaleMax for Scale

ScaleMax specifies the upper limit to which the input of the scaler is clipped if clipping is active.

Page 52: ACM Library Reference Guide

1 Control Models 52

SplitRange Input_

Output1

Output2

SplitRange Equations The following illustration shows the relationship between the input and output signals:

In this example, the outputs have the following actions:

Output Action Meaning

1 Direct Increases as the input increases

2 Reverse Decreases as the input increases

The plot shows that Output 1 increases from Output1Min to Output1Max as the input increases from Output1InMin to Output1InMax.

Output 2 decreases from Output2Max to Output2Min as the input increases from Output2InMin to Output2InMax.

Configuring SplitRange SplitRange has the following configuration parameter:

Parameter Description Unit

s Valid Values

Default Value

Output1Action Action for Output 1 � Direct

Reverse

Direct

Output1Min Minimum value of Output 1 � -1E9 -> 1E9 0

Output1Max Maximum value of Output 1 � -1E9 -> 1E9 100

Page 53: ACM Library Reference Guide

1 Control Models 53

Output1InMin Value of input above which Output 1 starts to change

� -1E9 -> 1E9 0

Output1InMax Value of input above which Output 1 stops changing

� -1E9 -> 1E9 50

Output2Action Action for Output 2 � Direct Reverse

Direct

Output2Min Minimum value of Output 2 � -1E9 -> 1E9 0

Output2Max Maximum value of Output 2 � -1E9 -> 1E9 100

Output2InMin Value of input above which Output 2 starts to change

� -1E9 -> 1E9 50

Output2InMax Value of input above which Output 2 stops changing

� -1E9 -> 1E9 100

Output1Action for SplitRange

Output1Action specifies whether output 1 increases or decreases as the input increases:

If Output1Action is

The result is

Direct Output 1 increases as Input increases

Reverse Output 1 decreases as Input increases

Output1Min for SplitRange

Output1Min specifies the minimum value of output 1.

Output1Max for SplitRange

Output1Max specifies the maximum value of output 1.

Output1InMin for SplitRange

Output1InMin specifies the value of the input above which Output 1 starts to change.

Output1InMax for SplitRange

Output1InMax specifies the value of the input above which Output 1 no longer changes.

Output2Action for SplitRange

Output2Action specifies whether output 2 increases or decreases as the input increases.

If Output2Action is

The result is

Direct Output 2 increases as Input increases

Reverse Output 2 decreases as Input increases

Output2Min for SplitRange

Output2Min specifies the minimum value of output 2.

Page 54: ACM Library Reference Guide

1 Control Models 54

Output2Max for SplitRange

Output2Max specifies the maximum value of output 2.

Output2InMin for SplitRange

Output2InMin specifies the value of the input above which Output 2 starts to change.

Output2InMax for SplitRange

Output2InMax specifies the value of the input above which Output 2 no longer changes.

SteamPtoT

PTP T

SteamPtoT uses the extended Antoine parameters for water (PLXANT) to calculate steam temperature from steam pressure.

Use SteamPtoT as part of a control scheme for a block where:

• Constant Temperature is the heat transfer option.

• Steam pressure is the manipulated variable (rather than steam temperature).

Sum Input1

Output_Input2

Sum evaluates its output as the sum of the two input signals.

Sum Equations The equation used in the Sum model is:

21_ InputInput = Output +

Configuring Sum Sum has no configuration parameters.

Page 55: ACM Library Reference Guide

1 Control Models 55

Transform

Input_ Output_

Transform can be used to apply one of the following transform operations to a signal:

• Loge (natural logarithm)

• Square

• Square root

• Power

Transform Equations The equation used depends on the transform operation selected as follows:

Transform Equation

Loge _)_ Inputln( = Output

None __ Input = Output

Power PowerInput = Output __

Square 2__ Input = Output

Square root __ Input= Output

Configuring Transform Transform has the following configuration parameters:

Parameter Description Units Valid

Values Default Value

Transform Transform type � Loge None Power Square Square root

None

Power Exponent for Power transform

� -500 - > 500 1

Transform for Transform

Transform specifies the type of transform to be applied.

Power for Transform

Power specifies the exponent to be used if the Power transform is selected.

Page 56: ACM Library Reference Guide

1 Control Models 56

PowerInput = Output __

Valve_dyn

Output_

Input_

Valve_dyn models the dynamics of a valve actuator. It relates the input signal to a control valve to the valve stem position. It includes the following options:

• Direct or reverse action.

• First-order, second-order, or negligible dynamic effects.

• Velocity limiting (when using first- or second-order dynamics).

• Modeling of hysteresis effects caused by valve dead band.

Connect Valve_dyn between a controller output signal and the input signal to a Valve block. Make sure the input signal is in the range 0 to 100%. The output signal represents the valve percentage open.

Valve_dyn Equations When the first-order dynamics option is used, the valve stem response is modeled using the following first-order differential equation:

( )Input Output Taud Output

dt= + 1.

Where:

Tau1 = First-order time constant

For second-order dynamics, the following second-order differential equation is used:

( ) ( )Input Taud Output

dtGamma Tau

d Outputdt

Output= + +22

2 2. . . .

Tau StemMassHookes

=

Where:

Gamma = Damping coefficient

Tau = Natural period

StemMass

= Moving mass of valve stem

Hookes = Hooke�s law constant for spring

Page 57: ACM Library Reference Guide

1 Control Models 57

When velocity limiting is used, the rate of change of stem position is clipped so that it does not exceed the maximum velocity defined by the stroke time.

Configuring Valve_dyn The properties for Valve_dyn are:

Property Description Units Valid

Values Default Value

ValveAction Valve action � Direct

Reverse

Direct

Dynamics Actuator dynamics � 1st order

2nd order

None

1st order

Tau1 First-order time constant

s 0 -> 1E4 1E-3

StemMass Stem assembly mass kg or lb 1E-3 -> 1E4 1.0

Hookes Spring Hooke�s law constant

N/m or lbf/ft 1 -> 1E10 100000

Gamma Damping factor - 1E-9 -> 1E9 1.0

StrokeTimeDo Time for full scale down stroke

s 0.01 -> 1E8 1.0

StrokeTimeUp Time for full scale up stroke

s 0.01 -> 1E8 1.0

DBand Dead band % 0 -> 100 0.0

If your process models are written to work in time units other than hours, you will need to change the control model time units. See Time Units in Control Models, earlier in this chapter.

ValveAction for Valve_dyn

ValveAction specifies whether the valve is direct- or reverse-acting:

If valve type is As the input signal increases

Direct the valve opens

Reverse the valve closes

Dynamics for Valve_dyn

Dynamics specifies the dynamic relationship between the input signal and the valve stem position:

If Dynamics is The result is

Second order The valve dynamics are represented by a second order lag between the input signal and the valve stem position.

None There are no dynamics, the full effect of a change in the input is immediately passed to the output

Page 58: ACM Library Reference Guide

1 Control Models 58

StemMass for Valve_dyn

StemMass is the mass of the stem assembly. A greater mass results in a slower response to input signal changes.

StemMass has no effect when Dynamics=None.

Hookes for Valve_dyn

Hookes is the Hooke�s law constant. This is the force exerted per unit length when the valve spring is compressed. A larger value results in a faster dynamic response to input signal changes.

Hookes has no effect when Dynamics=None.

Gamma for Valve_dyn

The damping factor Gamma determines the amount of oscillation in the dynamics response of the stem position to the valve input. The default value of damping factor is 1.0. This is typical, and will give a critically damped response. A value greater than 1 gives an overdamped response, and a value of less then 1 gives an underdamped or oscillatory response.

Gamma has no effect when Dynamics=None.

StrokeTimeDo for Valve_dyn

StrokeTimeDo is the minimum time in which the valve can move from fully open to fully closed. The maximum rate of change in the valve position, in %/s is then determined as 100/StrokeTime.

When Dynamics= 2nd order, the valve will never open or close faster than this rate.

StrokeTimeDo has no effect when Dynamics=None.

DBand for Valve_dyn

DBand is the dead band for the valve expressed as a percentage of range. When the input changes direction, it must move by an amount equal to DBand before the valve position changes. The following illustration shows the effect of dead band on the valve position as the input changes.

DBand

0 100

100

Valveposition

Inputsignal

Opening

Closing

Page 59: ACM Library Reference Guide

2 Aspen Reactions Toolkit 59

2 Aspen Reactions Toolkit

The Aspen Reactions Toolkit (ART) is a collection of built-in kinetic model libraries and utilities in Aspen Custom Modeler to allow building custom reactor models.

It includes:

• The ART Reaction Model component which is a generic framework for managing stoichiometry and kinetic models of complex reaction networks.

• A library of kinetic models which are included in the ART Reaction Model component for building custom reactor models.

• A wizard for building a custom Reaction Model component that contains custom kinetic models.

This chapter describes:

• How the ART reaction model is implemented.

• How to use the ART Reaction Model component in your reactor model.

• How to configure the ART Reaction Model component.

• How to build a custom Reaction Model component that contains custom kinetic models.

ART Reaction Model Component Overview The ART Reaction Model component is a framework specifically designed to facilitate the modeling of reaction kinetics. The component manages the stoichiometry and the kinetic model used in the reactions of a reaction system. It encapsulates all of the basic calculations within the component, while providing users with the capability to fully customize the kinetic models. It also provides a Reaction Activity utility for the simultaneous manipulation of reaction rates for selected groups of reactions. Using the ART Reaction Model component in a reactor model will dramatically reduce the effort in writing the mass balance for the model.

In general, you can think of the ART Reaction Model component as a black box which takes reaction conditions, temperature (T), pressure (P), and mole fractions ( iz ), as input, and based on reaction configuration, returns the

reaction rates and species net generation rates. You can plug in different kinetic modules, which contain collections of kinetic models, to the ART

Page 60: ACM Library Reference Guide

2 Aspen Reactions Toolkit 60

Reaction Model component, so that you can specify the kinetic model (i.e. rate expression) to be used in each reaction through the configuration.

ART Reactions

Model

T P zi

Species Reaction Rate

Configuration

Kinetic Module

Custom Module 1

Built-in Module

Custom Module 2

Design of ART Reaction Model Component In the ART reactions model component, we have segregated the �data� from the �model�, so that the �data� can be shared by many instances of a �model�. The �Data�, which include the kinetic parameters and the reaction configuration, are implemented as ACM Global Structures (Reaction Global Structure). Such an implementation is equivalent to the reaction object implementation in Aspen Plus.

To enhance the performance of a distributed (PDE) system that uses an ACM reaction model, we have further segregated the �model� into non-distributed and distributed portions. The non-distributed portion declares the variables and defines the associated equations which do not change across the integration domain, and do not need to be discretized. The distributed portion of the �model� declares the variables and defines the associated equations, which can vary along the integration domain and are discretized based on the selected discretization method.

To further optimize the flexibility and scalability of the reaction model, the reaction global structure, and the distributed and non-distributed portions of the reaction models are further segregated into three hierarchies, i.e. Module, Class, and Reaction. Variables declared in the Module level are common to all classes and reactions, and are accessible in all reaction classes and all reactions. A class is a group of reactions, which have similar kinetic behavior and therefore have the same functional form in their rate expression. Variables declared in the Class level are common to all reactions of the same class, and are accessible in all reactions within that class. However, each individual reaction within the same class can still have its own characteristics, which are captured in the Reaction level of the hierarchy. For example, Power Law and LHHW are distinct reaction classes.

Page 61: ACM Library Reference Guide

2 Aspen Reactions Toolkit 61

The following is the schematic for the design of ART reaction model:

Based on this design, each ART Reaction Model has three portions:

• Reaction Global Structures

• This portion of Reaction Model consists of a set of global structures associated with the reaction configuration in Module, Classes, and Reactions hierarchies. It encapsulates the declarations of all configuration parameters and variables (such as intrinsic pre-exponential constants and activation energies). The parameters and variables contained in this portion of the ART Reactions Model component can be shared by many instances of reactor models of different types (PFR or CSTR).

• Non-distributed portion of the Reaction Model

• This portion of the Reaction Model consists of a set of non-distributed submodels in Module, Class, and Reaction hierarchies. It encapsulates the declarations of variables and the equations which do not need to be discretized for a Distributed system. This non-distributed portion of the ART Reactions Model component is common for both the Lumped and Distributed systems, and is called the same way for both systems. The

Page 62: ACM Library Reference Guide

2 Aspen Reactions Toolkit 62

variables declared in non-distributed portion of Reaction Model are specific to each instance of reactor model. An example of a variable that can be declared as a non-distributed variable is the metal loading of a catalyst in a reactor.

• Distributed portion of the Reaction Model.

• This portion of Reaction Model consists of a set of distributed submodels in Module, Class, and Reaction hierarchies. It encapsulates the declarations of variables (such as reaction rates) and equations which need to be discretized for a Distributed system. This portion of the Reactions Model component is called differently depending on whether the model is a Lumped or a Distributed system.

Using ART Reaction Model Component in Reactor Model In general, there are three steps involved in using an ART Reaction Model component in a reactor:

• Instance an ART Reactions Model component in the model.

• Provide input (reaction conditions) to the ART Reactions Model component.

• Access output (species reaction rates) from the ART Reactions Model component.

The ART Reaction Model component is called differently depending on whether the model using the component is a Lumped system (such as CSTR) or a Distributed system (such as PFR). As discussed earlier, each ART Reaction Model is separated into three parts, one for the reaction global structures, one for the non-distributed portion of the model, and one for the distributed portion.

The top level Reaction Global Structure that a reactor model needs to reference for using the built-in ART Reaction Model component is called ARTRxnCfg. The non-distributed part of the built-in ART Reaction Model component that a reactor model needs to reference is called ARTRxnCfgModel, and the distributed part is called ARTRxnModel. In a custom ART Reactions Model component, the top level Reaction Global Structure that a reactor model needs to reference is by convention named ModuleIDRxnCfg. The non-distributed part is named ModuleIDRxnCfgModel, and the distributed part is named ModuleIDRxnModel, where ModuleID is the unique identifier of the custom Reaction Model.

Interface to Reaction Global Structures The interface to the Reaction Global Structures of an ART Reaction Model component is simply a reference to the Reaction Global Structure of the same type by declaring it as an external property,

Page 63: ACM Library Reference Guide

2 Aspen Reactions Toolkit 63

IRxnCfg as external ARTRxnCfg; // using built-in reaction model

or

IRxnCfg as external ModuleIDRxnCfg; // using custom reaction model

There are two parameters in IRxnCfg to provide the reactor model with information to check if a particular instance of the reaction configuration is compatible with the reactor configuration. They are: RxnSystem, and ActivePhase. The input to the reaction model depends on these parameters, and it�s up to the reactor model to check these parameters and provide the required input to the reaction model.

The parameter, IRxnCfg.RxnSystem, indicates if the reactions involving a solid catalyst. It has two options: �Fluid Homogeneous� and �Fluid-Solid Catalytic�. The parameter, IRxnCfg.ActivePhase, contains the set of phases in which the reactions occur

Interface to Non-Distributed Portion of a Reaction Model The reactor model that uses the ART Reaction Model component has to reference the non-distributed portion of the reaction model by:

IRxnCfgModel([1]) as ARTRxnCfgModel(IRxnCfg:IRxnCfg); // using built-in reaction model

or

IRxnCfgModel([1]) as ModuleIDRxnCfgModel(IRxnCfg:IRxnCfg); // using custom reaction model

The reactor model has to set the following variable in IRxnCfgModel(1):

Mws(componentlist) : Component molecular weight

The Mws�s are required for the calculation of concentration of various concentration basis. In addition, if the IRxnCfg.RxnSystem is �Fluid-Solid Catalytic�, the reactor model has to set the following variables in IrxnCfgModel(1):

BedVoidage : Fraction of the reactor volume NOT occupied by solid catalyst

CatDensity : Mass density of the catalyst particles

This information is required for the calculation of reaction rates which are based on catalyst weight.

Interface to Distributed portion of a Reaction Model The reactor model that uses the ART Reaction Model component has to reference the distributed portion of the reaction model by:

Page 64: ACM Library Reference Guide

2 Aspen Reactions Toolkit 64

IRxnModel as ARTRxnModel(IRxnCfg:IRxnCfg); // using built-in reaction model

or

IRxnModel as ModuleIDRxnModel(IRxnCfg:IRxnCfg); // using custom reaction model

For a distributed system, the reactor model needs to reference the distributed portion of the reaction model at all discretization nodes along the distribution:

IRxnModel ([0:X.EndNode] as ARTRxnModel(IRxnCfg:IRxnCfg);

or

IRxnModel([0:X.EndNode] as ModuleIDRxnModel(IRxnCfg:IRxnCfg);

where X is the distribution domain.

The variables that need to be passed to the reaction model are:

T: Temperature

P: Pressure

z(IRxnCfgModel.ActivePhase, componentlist): Mole fraction

Rho(IRxnCfg.ActivePhase): Molar density

Holdup(IRxnCfg.ActivePhase): Volume fraction occupied by each phase

CatEff(IRxnCfg.ActivePhase): Catalyst efficiency for each phase

CatEff is only used in a multiple-phase system when the RxnSystem is �Fluid-Solid Catalytic�. It is used to indicate the fractional coverage of the catalyst by different phases. The variables that are calculated by the reaction model and can be used in the reactor model are:

K(IRxnCfg.RxnSet): Rate constants

Rate(IRxnCfg.RxnSet): Reaction rate for each reaction per reacting phase volume

CompRate(IRxnCfg.ActivePhase,ComponentList): Component reaction rates in each phase per reactor volume

Use Multiple Sets of Reaction Models in a Reactor Model You can use more than one ART Reactions Model in a reactor model. However, you have to set the references to the Reaction Global Structure, and the pointer, iCFG, in ARTRxnModel correctly to ensure the instances of Reaction Global Structure, Non-distributed and Distributed portions of the reactions model are consistent. To use more than one ART Reactions Model, first declare the instances of ARTRxnCfg, ARTRxnCfgModel, and ARTRxnModel as arrays:

nRxnCfg as Integerparameter(0);

IRxnCfg([1:nRxnCfg]) as external ARTRxnCfg;

IRxnCfgModel([1:nRxnCfg]) as ARTRxnCfgModel;

Page 65: ACM Library Reference Guide

2 Aspen Reactions Toolkit 65

IRxnModel([1:nRxnCfg]) as ARTRxnModel;

Then set the references to the Reaction Global Structure and Reactions Model correctly:

for i in [ 1 : nRxnCfg] do

IRxnCfgModel(i).IRxnCfg : IRxnCfg(i);

IRxnModel(i).IRxnCfg : IRxnCfg(i);

IRxnModel(i).iCfg : i;

Endfor

Examples To use the built-in Reactions Model component to write a model called CSTRMassBal for the mass balance calculation of a CSTR (Lumped system):

Model CSTRMassBal

T as Temperature;

P as Pressure;

z(ComponentList) as molefraction;

Rho as dens_mol;

call (Mws) = pmolweights ();

// Reference to the Reaction Global Structure

IRxnCfg as external ARTRxnCfg;

// Reference to the non-distributed portion of reaction model

IrxnCfgModel([1]) as ARTRxnCfgModel(IRxnCfg:IRxnCfg);

// Reference to the distributed portion of reaction model

IRxnModel as ARTRxnModel(IRxnCfg:IRxnCfg);

// set input to IRxnCfgModel

IrxnCfgModel(1).Mws = Mws;

// set input to IRxnModel

IRxnModel.T = T;

Page 66: ACM Library Reference Guide

2 Aspen Reactions Toolkit 66

IRxnModel.P = P;

IRxnModel.z(�Vapor�) = z; // assume vapor phase only

IRxnModel.Rho(�Vapor�) = Rho;

IRxnModel.Holdup("Vapor") = 1.0

// use output (IRxnModel.CompRate) for mass balance

Fin*z(ComponentList) - Fout*z_OUT(ComponentList) + V*IRxnModel.CompRate(�Vapor�,ComponentList) = V*Rho*$z(ComponentList);

Fin - Fout + V* sigma(IRxnModel.CompRate("Vapor",Componentlist)) = 0;

End

To use the ART Reactions Model component in a distributed system (such as PFR), the distributed part of the component needs to be instanced for every node of the distribution. By separating the non-distributed portion of the ART Reactions Model component from the distributed portion, only the distributed portion is discretized.

For example, to use a customized Reactions Model component, called New, to write a model called PFRMassBal for the mass-balance calculation of a PFR:

Model PFRMassBal

X as LengthDomain (. . .);

T as distribution1D(XDomain is X) of temperature;

P as distribution1D(XDomain is X) of Pressure;

z(ComponentList) as distribution1D(XDomain is X) of molefraction;

Rho as distribution1D(XDomain is X) of dens_mol;

Vol as Volume;

call (Mws) = pmolweights ();.

// Reference to the Reaction Global Structure

IRxnCfg as external NewRxnCfg;

// Reference to the non-distributed portion of reaction model

IrxnCfgModel(1) as NewRxnCfgModel(IRxnCfg:IRxnCfg);

// Reference to the distributed portion of reaction model

// Note: NewRxnModel needs to be discretized NewRxnModel

Page 67: ACM Library Reference Guide

2 Aspen Reactions Toolkit 67

IRxnModel([0:x.EndNode]) as NewRxnModel(IRxnCfg:IRxnCfg);

// set input to IRxnCfgModel

IrxnCfgModel(1).Mws = Mws;

// set input to IRxnModel

IRxnModel([0:X.EndNode]).T = T([0:X.EndNode]);

IRxnModel([0:X.EndNode]).P = P([0:X.EndNode]);

IRxnModel([0:X.EndNode]).Rho(�Vapor�) = Rho([0:X.EndNode]);

For node in ([0:X.EndNode]) do

IRxnModel(node).Holdup("Vapor") = 1.0;

IRxnModel(node).z(�Vapor�, ComponentList)= z(ComponentList)(node);

Endfor

// use output (IRxnModel(node).CompRate) for mass balance

For node in ([X.Interior+X.EndNode]) do

// species mass balance for each node

for comp in componentlist do

- F(node)*z(comp)(node).ddx

- F(node).ddx*z(comp)(node)

+ Vol*IRxnModel(node).CompRate("Vapor",comp)

= Vol*Rho(node)*$z(comp)(node)

+ Vol*$Rho(node)*z(comp)(node);

endfor

// total mass balance for each node

F(node).ddx - Vol*sigma(IRxnModel(node).CompRate("Vapor",componentlist))+ Vol*$Rho(Node)= 0;

Endfor

End

Page 68: ACM Library Reference Guide

2 Aspen Reactions Toolkit 68

Configuration of ART Reaction Model Component In the ART built-in Reaction Model component, a form called Configure, is attached to each instance of the top-level Reaction Global Structure, ARTRxnCfg

For a custom Reaction Model component, the form has to be manually added to the top-level custom Reaction Global Structure. By convention, this is usually called ModuleIDRxnCfg when it is generated using the custom Reaction Model wizard, where ModuleID is the ID of the custom Reaction Model component.

Adding ART Configure Form to Reaction Global Structure To add the form to the custom Reaction Global Structure:

1 In the Simulation Explorer, click the top-level Reaction Global Structure you want to add the form to. Then in the Contents pane below, double-click Add Form.

Page 69: ACM Library Reference Guide

2 Aspen Reactions Toolkit 69

2 In the Add Form Instance dialog box, enter a name for the form.

3 Select Custom OCX from the Available Form Definitions list, and click

OK.

Page 70: ACM Library Reference Guide

2 Aspen Reactions Toolkit 70

4 Select AspenReaction.ReactionsCfg in the Select Control dialog box, and

click Select.

ART Configure Form ART configuration form allows you to configure instances of Reaction Global Structure. This form contains four sheets, Configure, Kinetic, Activity, GLHHW Ads.orption and Equilibrium. For custom Reaction Model, there is an additional sheet for additional user variables.

Page 71: ACM Library Reference Guide

2 Aspen Reactions Toolkit 71

This form contains the following sheets: Use this sheet To specify

Configuration Reactions, reaction classes, reactants, products, status, and stoichiometry.

Kinetic Kinetic data and solids options for rate-controlled reactions, including driving force data for LHHW and GLHHW reactions and adsorption parameters for LHHW reactions.

Activity Reaction activity classes.

GLHHW Ads.orption Shared adsorption parameters for GLHHW reactions.

Equilibrium Data required for the calculation of the equilibrium constant

Configuration sheet Use this sheet to add, edit, and delete reactions from a reaction set. You can specify a Name for each reaction; names must be unique and a maximum of 8 characters long). You can switch to a different Reaction Class. You can also set the Status of each reaction to on or off. Set a reaction's status to off to set its rate to be zero without deleting the reaction from the sheet.

In the Edit Stoichiometry dialog box, you can change the reaction class of a reaction, specify if the reaction is reversible and specify reactants and products, and their stoichiometric coefficients.

Page 72: ACM Library Reference Guide

2 Aspen Reactions Toolkit 72

You can edit the stoichiometry through a free-format text by clicking on the Stoichiometry field. The syntax is discussed in detail in the appendix section, Defining Stoichiometry for a Reaction.

Note: Press the F2 key in the Stoichiometry field to display a list of component IDs of available species.

Page 73: ACM Library Reference Guide

2 Aspen Reactions Toolkit 73

Click Apply to have the new configuration take effect.

Kinetic sheet Use this sheet to specify the reacting phase, concentration basis, rate basis, and kinetic parameters for rate-controlled reactions of the power-law, LHHW, GLHHW classes. For GLHHW reactions, you also need to specify the shared adsorption parameters on the GLHHW Ads. sheet.

Click the Driving Force button to bring up the Driving Force dialog box to enter parameters for the driving force expression for the selected reaction.

Page 74: ACM Library Reference Guide

2 Aspen Reactions Toolkit 74

The Adsorption button is active only when the reaction class is LHHW. Click the Adsorption button to enter adsorption parameters for the adsorption expression.

Page 75: ACM Library Reference Guide

2 Aspen Reactions Toolkit 75

Click the Summary button to see a summary of the kinetic parameters in a grid format. Click Specifications to enter parameters for individual reactions, including the driving force, and adsorption parameters.

Important Note: You must click Apply for the changes to take effect.

Activity sheet Use this sheet to define reaction activity classes and associate them with reactions. Reaction activity classes are scalar multipliers to the reaction rate. The net reaction rate for a reaction is calculated as the product of the reaction's intrinsic rate and all reaction activities associated with the reaction. The relationship between the intrinsic rate, intrinsicir , , and net reaction rate,

netir , , is:

intrinsicij

jneti rar ,, )(∏=

where the ja are all the reaction activities associated with the reaction i.

The activity classes defined here create activity variables in a reactor block that uses the Reaction Model component. The activity values entered here are only the default values to initialize the activity variables in the block., Individual reactor blocks that uses the Reaction Model component can override them.

Page 76: ACM Library Reference Guide

2 Aspen Reactions Toolkit 76

Important Note: You must click Apply for the changes to take effect.

GLHHW Ads. sheet Use this sheet to enter shared adsorption parameters for GLHHW reactions. In the current release, only one set of GLHHW parameters is supported.

Page 77: ACM Library Reference Guide

2 Aspen Reactions Toolkit 77

Equilibrium sheet Use this sheet to enter data required for the calculation of the equilibrium constant. The equilibrium constant is computed for reversible kinetic and equilibrium reactions and can be computed from rigorous thermodynamics or using an empirical correlation of the form:

TDTCTBAKeq ×+×++= )ln(

Where:

eqK = Equilibrium constant

T =Temperature in Kelvin

and

A, B, C, D are user-specified constants

Page 78: ACM Library Reference Guide

2 Aspen Reactions Toolkit 78

Important Note: You must click Apply for the changes to take effect.

Built-in Reaction Classes There are four reaction classeskinetic in the ART built-in Reaction Model component. They are:

• Power Law

• Langmuir-Hinshelwood-Hougen-Watson (LHHW)

• General Langmuir-Hinshelwood-Hougen-Watson (GLHHW)

• Equilibrium

Power Law The general rate expression for a reaction can be written as reverseforward γγγ −=

Where:

forwardγ = Rate of forward reaction

reverseγ = Rate of reverse reaction

For Power Law reactions:

Page 79: ACM Library Reference Guide

2 Aspen Reactions Toolkit 79

forwardγ = ( )ifvif CK ∏

where:

C = Component concentration

υf = Concentration exponent for forward reaction

i = Component index

Kf = Forward kinetic factor

= ( )[ ]ToTREn

o

aeTTk /1/1/ −−

if To is specified

= RTEn aekT /− if To is not specified

and

k = Pre-exponential factor

T = Temperature in Kelvin

oT = Reference temperature in Kelvin

n = Temperature exponent

aE = Activation energy

R = Universal gas law constant

For a non-reversible reaction:

0=reverseγ

For a reversible reaction:

( )irvirreverse CK ∏=γ

Where:

Kr = Reverse kinetic factor

= f

eq

KK

and

υr = Concentration exponent for the reverse reaction

The concentration exponents for the reverse rate (υr ) can be computed from the stoichiometry and the concentration exponents for the forward rate(υf). Details can be found in the appendix section Calculation of concentration exponents for the reverse rate.

The concentration terms Ci depend on the concentration basis you select:

[Ci] basis Concentration term C

Page 80: ACM Library Reference Guide

2 Aspen Reactions Toolkit 80

Molarity Component molar concentration (kgmole/m3)

Molality Component molality (gmole/kg H2O)

Mole fraction Component mole fraction

Mass fraction Component mass fraction

Partial pressure Component partial pressure (N/m2)

Mass concentration Component mass concentration (kg/m3)

Fugacity Component fugacity (N/m2)

Activity Component activity

Mole gamma Component activity coefficient

LHHW The general rate expression for a reaction can be written as:

reverseforward γγγ −=

Where:

forwardγ = Rate of forward reaction

reverseγ = Rate of reverse reaction

For LHHW reactions:

forwardγ = ( )ExpressionAdsorptionCK ifvif ∏

where:

C = Component concentration

υf = Concentration exponent for forward reaction

i = Component index

Adsorption expression= ( ){ }mvjijCK ∏Σ

Kf = Forward kinetic factor

= ( )[ ]ToTREn

o

aeTTk /1/1/ −−

if To is specified

= RTEn aekT /− if To is not specified

and

k = Pre-exponential factor

T = Temperature in Kelvin

oT = Reference temperature in Kelvin

n = Temperature exponent

aE = Activation energy

Page 81: ACM Library Reference Guide

2 Aspen Reactions Toolkit 81

R = Universal gas law constant

m = Adsorption expression exponent

iK = Adsorption equilibrium constants

For a non-reversible reaction:

0=reverseγ

For a reversible reaction:

( )ExpressionAdsorptionCK irvir

reverse∏

Where:

Kr = Reverse kinetic factor

= f

eq

KK

υr = Concentration exponent for reverse reaction

The concentration exponents for the reverse rate (υr ) can be computed from the stoichiometry and the concentration exponents for the forward rate(υf). Details can be found in the appendix section Calculation of concentration exponents for the reverse rate.

The concentration terms Ci and Cj depend on the concentration basis you select:

[Ci] basis Concentration term C

Molarity Component molar concentration (kgmole/m3)

Molality Component molality (gmole/kg H2O)

Mole fraction Component mole fraction

Mass fraction Component mass fraction

Partial pressure Component partial pressure (N/m2)

Mass concentration

Component mass concentration (kg/m3)

Fugacity Component fugacity (N/m2)

Activity Component activity

Mole gamma Component activity coefficient

The adsorption equilibrium constants, Ki, are calculated from the following correlation:

ln Ki = Ai + Bi/T + Ci * ln(T) + Di * T

Where:

T = Temperature in Kelvin

Ai, Bi, Ci, Di = User-supplied coefficients

Page 82: ACM Library Reference Guide

2 Aspen Reactions Toolkit 82

GLHHW The rate expression for GLHHW is the same as LHHW. However, the adsorption term (and therefore parameters in the adsorption term), is not associated with a particular reaction, instead, it is shared by all reactions of the same GLHHW class. Since all reactions of the same GLHHW class share the same adsorption term, they have to be in the same phase and have the same the [Ci]Basis.

Equilibrium For an equilibrium reaction, the rate expression is replaced by an equation relating the equilibrium constant to the concentrations at equilibrium:

sivieq aK ∏=

where:

Keq = Equilibrium constant

ai = Activity of component i

υsi = Stoichiometric coefficient of component i

Keq can be computed from rigorous thermodynamics or using an empirical correlation of the form:

TDTCTBAKeq ×+×++= )ln(

Where:

T = Temperature in Kelvin

and

A, B, C, D are user-specified constants

The thermodynamic activity ai is defined as:

0i

ii f

fa =

where:

fi = Fugacity of component i

fi0 = Fugacity of component i in its standard state

The standard state used depends on the species involved

For non-electrolyte systems, the standard state is assumed to be pure component ideal gas at the reference pressure (Pref=1atm). The activity is therefore given by :

ref

ii P

fa =

Page 83: ACM Library Reference Guide

2 Aspen Reactions Toolkit 83

For electrolyte systems, the standard state is assumed to be an aqueous solution at infinite dilution and the activity is therefore given by:

iii xa γ=

where:

iγ = Activity coefficient of species i

xi = Mole fraction of species I

Custom Reaction Model The rate expression for custom reaction models can be written as:

) expression force ivingfactor)(dr kinetic)(expressionCustom(=γ

Where custom expression is an expression written by user in ACM using user-defined variables. Note that the kinetic factor and driving force expression and their associated parameters are still part of the user reaction models.

Building Custom Reaction Model Component As we have discussed in an earlier section, the data and model in a Reaction Model component are segregated so that reaction configuration and parameters can be shared by many reactors. To optimize its flexibility and scalability, the Reactions Model component is structured into three hierarchy levels: Module, Class, and Reaction. To further enhance the performance when used in a distributed system (PDE), each hierarchy level in the Reaction Model component is further separated into distributed and non-distributed parts.

Due to this hierarchical nature of the Reaction Model component, it is important that Reaction Global Structures and submodels in each level are properly structured and referenced so that they can work together seamlessly among themselves and with the built-in utilities.

To facilitate the effort for building a custom Reaction Model component which contains a custom kinetic model, the CustomART Reaction Model Wizard is included in the Reactions Toolkit

Custom Reaction Model Wizard You can use the Custom Reaction Model Wizard to generate a Reaction Model component which contains templates for a reaction model that you can later customize. The wizard will guide you through steps to gather the necessary information to generate the model templates. The templates generated by the Wizard will include all the variable declarations and a dictionary for the proper referencing of the variables from other models of the Reaction Model component.

Page 84: ACM Library Reference Guide

2 Aspen Reactions Toolkit 84

The wizard will compile the templates, and all new reaction models will behave the same as the system built-in Power Law reaction model (see Writing a Custom Kinetic Model). To create a customized reaction model, you will need to add your own equations to the model and modify the rate expression using the newly declared variables. You can invoke the wizard by selecting Custom Reaction Model Wizard under the Tools menu in ACM.

The wizard consists of the following steps:

• Step 1: Introduction.

• Step 2: Specify ID.

• Step 3: Specify the number of module variables and equations.

• Step 4: Specify the number of reaction classes and their names.

• Step 5: Specify the number of class variables and equations for each class.

• Step 6: Specify the number of reaction variables and equations for each class.

• Step 7: Review the summary of the information you have entered in the wizard before the wizard generates the templates.

At each step when you specify the number of variables and equations, you will specify numbers of variables for the Reaction Global Structure, and separate numbers of variables and equations for the non-distributed and distributed parts of the model. You can also specify the names of the variables and equations, and the initial values and specifications of the variables in these steps.

When the wizard finishes generating the templates, a dialog box will display the list of templates created and compiled in ACM:

Note: You must refresh the ACM Explorer in order to see the generated templates.

Writing a Custom Reaction Model The wizard generates and compiles the model templates and builds a working custom Reactions Model component. However, all the models in this Reactions Model component are exact copies of the built-in Power Law kinetic model. To create a customized kinetic model, you will need to add your own equations to the templates and modify the rate expression (contained in the ModuleIDRxnRateModel submodel) using the newly declared Reaction Global Structure and variables.

As you do this, remember the hierarchy levels of the model. All variables in Reactions Global Structures can be referenced by all submodels in the Reaction Model component. However, non-distributed variables can be used in the definition of both non-distributed and distributed equations, but distributed variables can only be used in the definition of distributed equations. Similarly, Module variables can be used in the definition of Module, Class, and Reaction equations; Class variables can be used in the definition of Class and Reaction equations of the same class (but not in the definition of

Page 85: ACM Library Reference Guide

2 Aspen Reactions Toolkit 85

Module equations), and Reaction variables can only be used in the definition of Reaction equations of the same class.

To reference variables at other hierarchy levels (such as to reference module variables within the definition of a class equation), you must use an appropriate prefix. To make this easier, a dictionary is created in each model template. Each dictionary contains only the variables which can be referenced by the equations in that level of the model. For example, in the template for writing module non-distributed equations (in the submodel ModuleIDModNDModel), only the dictionary of module non-distributed variables will be listed; none of the Class or Reaction variables and no distributed variables will be shown.

To define your custom kinetic model, write the equations in the appropriate submodels. In the initial templates, only the names of the equations, as declared in the wizard, will appear (as comments). You must add the actual equations using ACM language. See the following sections for lists of the templates used for writing the additional equations for custom kinetics.

Module Equations For each Reaction Model component, there are two templates (submodels) for writing the module equations. They are ModuleIDModNDModel for writing the module non-distributed equations, and ModuleIDModDistModel for writing the module distributed equations, where ModuleID is the ID of the Reaction Model component.

You are not required to write any module equations. However, if you do, you may need to change the specification of the variables so that the problem remains square.

Class Equations For each reaction class that you declare in the wizard, there are two model templates (submodels) for writing the class equations. They are ClassNameClsNDModel for writing the class non-distributed equations, and ClassNameClsDistModel for writing the class distributed equations, where ClassName is the name of the reaction class.

You are not required to write any class equations. However, if you do, you may need to change the specification of the variables so that the problem remains square.

Reaction Equations For each reaction class that you declare in the wizard, there are two model templates (submodels) for writing the reaction equations. They are ClassNameRxnNDModel for writing the reaction non-distributed equations and ClassNameRxnRateModel for writing the reaction rate expression and other reaction distributed equations, where ClassName is the name of the reaction class.

It is in ClassNameRxnRateModel that the variables for rate constant (K) and reaction rate (Rate) are declared and the equations for the calculation of rate constant and rate expression are defined.

Page 86: ACM Library Reference Guide

2 Aspen Reactions Toolkit 86

These variables and equations are included in every reaction in addition to any other variables and equations you define. Initially, in a new custom model, the equations represent the Power Law model.

You can customize the rate expression by modifying the equations for calculating K and Rate, but do not delete them. To have consistent behavior with the built-in kinetic model in response to the values of reaction attributes such as Reaction Type and Status, you should follow the IF-THEN structure of the rate expression as coded in the template.

Compiling a Custom Reaction Model Due to its hierarchical nature, in order to compile a Reaction Model component, its Reaction Global Structures and submodels need to be compiled in a certain order. Assuming that New is the ID, and Cls1, Cls2, etc are reaction classes in the New, if you would like to compile the Reactions Model component manually, you need to compile the Reaction Global Structures and submodels in this order:

Reaction Global Structures NewModParam

Cls1ClsParam

Cls2ClsParam

NewClsParamUnion

Cls1RxnParam

Cls2RxnParam

NewRxnParamUnion

NewRxnCfg

Reaction Submodels NewModNDModel

NewModDistModel

Cls1ClsNDModel

Cls2ClsNDModel

NewClsNDModelUnion

Cls1ClsDistModel

Cls2ClsDistModel

NewClsDistModelUnion

Cls1RxnNDModel

Cls2RxnNDModel

NewRxnNDModelUnion

Cls1RxnRateModel

Cls2RxnRateModel

NewRxnDistModelUnion

NewRxnCfgModel

NewRxnModel

Page 87: ACM Library Reference Guide

2 Aspen Reactions Toolkit 87

Removing a Custom Reactions Model Due to its hierarchical nature, in order to remove a Reaction Model component, its Reaction Global Structures submodels need to be deleted in a certain order. Assuming that New is the ID, and Cls1, Cls2, etc are reaction classes in New, then the order for deleting a Reactions Model component New is as follows:

Submodels using the new Reactions Model component

Reaction Submodels NewRxnModel

NewRxnCfgModel

NewRxnDistModelUnion

Cls1RxnRateModel

Cls2RxnRateModel

NewRxnNDModelUnion

Cls1RxnNDModel

Cls2RxnNDModel

NewClsDistModelUnion

Cls1ClsDistModel

Cls2ClsDistModel

NewClsNDModelUnion

Cls1ClsNDModel

Cls2ClsNDModel

NewModDistModel

NewModNDModel

Reaction Global Structures NewRxnCfg

NewRxnParamUnion

Cls1RxnParam

Cls2RxnParam

NewClsParamUnion

Cls1ClsParam

Cls2ClsParam

NewModParam

Exporting a Custom Reaction Model A custom reaction model component created in Aspen Custom Modeler can be exported for use as a reaction object (type USERACM) in Aspen Plus.

Page 88: ACM Library Reference Guide

2 Aspen Reactions Toolkit 88

Assuming that New is the ID of the component, take the following steps to export the custom reaction model for use in Aspen Plus:

1 On the Explorer window, navigate to Custom Modeling/New/Models/NewRxnModel.

2 From the Right Mouse Button menu, select Export...

3 On the Export dialog, select "Model Installation package (*.msi)" and click Save.

4 Install the exported model by clicking Yes on the Install exported model dialog.

Once the installation is complete, the exported model component is ready for use inside Aspen Plus.

To use the exported Custom Reaction Model component, do the following in Aspen Plus:

1 Create a new reaction object in Aspen Plus by clicking New on the Reactions object manager.

2 Select USERACM as the type of the new reaction object.

3 On the Setup sheet of the newly created reaction object, the User model dropdown box will display a list of all installed custom reaction models. Select the appropriate model.

More details about USERACM input can be found in the Aspen Plus help.

Appendix

Example of Assigning Variables and Equations to Hierarchy Levels To demonstrate how to best structure the kinetic module in terms of module, class, and reaction hierarchies, consider the following example:

Rxn1: A → B ; 11

1,01nA

TRE

PeAr ⋅

∆−

= φ

Rxn2: A → C ; 22

2,02nA

TRE

PeAr ⋅

∆−

= φ

Rxn3: B → C ; ∑+

=⋅

∆−

iiiads

nB

TR

E

PKPeA

r,

33

3,03 1

φ

Rxn4: B → D ; ∑+

=⋅

∆−

iiiads

nB

TRE

PKPeA

r,

44

4,04 1

φ

Page 89: ACM Library Reference Guide

2 Aspen Reactions Toolkit 89

Rxn5: C → D ; 55

5,05n

CTR

E

PeAr ⋅

∆−

= φ

Where φ is a deactivation function defined as Cokee ⋅−= βαφ , α and β are constants, Coke is the level of carbonaceous deposits on the catalyst which

causes catalyst to deactivate, iadsK , is defined by TRiH

iadsiads eKK ⋅

= ,0, , and the

index i varies over the four species A, B, C, and D.

Define α, β, Coke, and φ as module variables, since they are used in all rate laws. Define α and β as module non-distributed variables because they are constant across the distributed domain. The amount of coke on the catalyst can vary within the reactor, and therefore Coke should be a module distributed variable. Since Coke is a distributed variable, φ must also be a module distributed variable. It is defined by the following equation:

Cokee ⋅−= βαφ

As this equation involves only module variables and applies to all reactions, it is a module equation. Because it depends on distributed variables, it is a distributed equation.

Reactions which follow the same functional form should belong to the same class, so we have two reaction classes, PowerLaw and LHHW. Rxn1, Rxn2, and Rxn5 belong to PowerLaw, while Rxn3 and Rxn4 belong to LHHW.

The variables such as 111,0 ,, nEA ∆ are declared in the Reaction Global

Structure at Reaction hierarchy, since they are intrinsic kinetic parameters and are unique for each reaction. Since the variables in the PowerLaw reactions are all reaction-specific (no variable is shared among reactions in the class), there are no class variables. In the LHHW reaction class, define the

iadsK ,0 and iH∆ variables as Reaction Global Structure at class hierarchy. The

iadsK , is defined as class distributed variables, since they are all shared by all

reactions in LHHW. The iadsK , are distributed variables since they depend on

temperature which can vary with reactor length.

Defining Stoichiometry for a Reaction The stoichiometry of a reaction is specified by a free-format text description similar to CHEMKIN. It consists of species symbols, stoichiometric coefficients, and delimiters: Species Symbols Reactant and product species identified by component IDs defined

in the ACM component list.

Coefficients Integer or real numbers preceding species symbols to indicate the number of moles of each species present as either reactants or products. Coefficients are always followed by the * delimiter. A coefficient of 1 can be omitted.

Currently ART does not check the atom balance. Care must be taken to ensure the reaction is balanced.

Delimiters + Separates species on either side of a reaction.

* Separates a stoichiometric coefficient from its species.

Page 90: ACM Library Reference Guide

2 Aspen Reactions Toolkit 90

=>=> Separates the last reactant and the first product in an irreversible reaction. Currently only irreversible reactions are supported.

<=> Separates the last reactant and the first product in an reversible reaction.

The syntax for the standard reaction is as follows:

nnmm PCPPCPRCRRCRRCR *...**...** 112211 ++=>+++

Where the ii CPCR , are stoichiometric coefficients (real parameters which will

not change during simulation) and the ii PR , are component IDs for the

species involved in the reaction.

Example:

C3H8 + 3* H2O => 3*CO + 7*H2

Calculation of Concentration Exponents for Reverse Rate Consider a reversible reaction:

a*A + b*B <=> c*C + d*D

Suppose νfa, νfb , νfc and νfd are the concentration exponents for the forward rate and νra, νrb , νrc and νrd are the concentration exponents for the reverse rate.

The forward rate is given by:

[ ] [ ] [ ] [ ] fDfCfBfADCBAfforward CCCCK ννννγ =

The reverse rate is given by:

[ ] [ ] [ ] [ ] rDrCrBrADCBArreverse CCCCK ννννγ =

Where:

Kf = Forward rate constant

Kr = Reverse rate constant

C = Concentration

At equilibrium:

reverseforward γγ =

i.e.

[ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] rDrCrBrAfDfCfBfADCBArDCBAf CCCCKCCCCK νννννννν =

Since by definition:

r

feq K

KK =

and

Page 91: ACM Library Reference Guide

2 Aspen Reactions Toolkit 91

[ ] [ ][ ] [ ]bB

aA

dD

cC

eq CCCC

K =

the following relation must be satisfied at equilibrium:

[ ] [ ] [ ] [ ][ ] [ ] [ ] [ ]

[ ] [ ][ ] [ ]bB

aA

dD

cC

DCBA

DCBA

CCCC

CCCCCCCC

fDfCfBfA

rDrCrBrA

=νννν

νννν

This implies that for consistency with equilibrium conditions, the concentration exponents for the forward and reverse reactions must be related as follows:

afArA =−νν

bfBrB =−νν

cfCrC =−νν

dfDrD =−νν

In other words, the concentration exponents for the reverse reaction can be computed from the concentration exponents of the forward reaction rate and the reaction stoichiometry.

Reaction Global Structures for Built-in Reaction Model The following table summarizes the reaction global structures for the built-in reaction model:

Structure types Description

ARTRxnCfg This is the topmost structure for reaction configuration of the built-in reaction model. This structure references the sub-structures that are specific to the built-in reaction model. This Structure inherits ARTRxnBaseCfg.

ARTRxnBaseCfg This structure declares parameters that are common for both built-in and custom reaction models.

RxnClsDefStruct Define parameters for reaction class attribute. This structure inherits ARTRxnAttrDef.

ARTRxnAttrDef Define parameters for reaction attributes except reaction class

ARTModParam Declare parameters shared by all classes and reactions. This is only a dummy structure, since there�s no such parameter in the built-in reaction model.

ARTClsParamUnion This structure instances the class sub-structures for all classes in the built-in reaction model. Specifically, it references GLHHWClsParam that declares adsorption parameter for GLHHW class reaction. This structure inherits RxnClsDefStruct.

ARTRxnParamUnion Declare common reaction parameters for all reactions, such as pre-exponential constant, activation constant, etc. It also instances reaction sub-structures for all classes in the built-in reaction model. Specifically, it instances LHHWRxnParam that declares adsorption parameters for LHHW class reaction. This structure inherits RxnClsDefStruct.

Page 92: ACM Library Reference Guide

2 Aspen Reactions Toolkit 92

GLHHWClsParam Declare adsorption parameters for GLHHW class. This structure inherits RxnClsDefStruct.

GLHHWRxnParam This is only a dummy structure, since there�s no additional reaction parameter for GLHHW class other than those declared in ARTRxnParam.

LHHWClsParam This is only a dummy structure, since there�s no additional class parameter for LHHW class other than those declared in ARTRxnParam. This structure inherits RxnClsDefStruct.

LHHWRxnParam Declare adsorption parameters for LHHW class.

PowerLawClsParam This is only a dummy structure, since there�s no additional class parameter for PowerLaw class other than those declared in ARTClsParam. This structure inherits RxnClsDefStruct.

PowerLawRxnParam This is only a dummy structure, since there�s no additional reaction parameter for PowerLaw class other than those declared in ARTRxnParam.

CStoichParam Declare reactions and the corresponding stoichiometric coefficients that each component participates.

AdsParam Declare components and the corresponding exponents that appear in the adsorption term.

Reaction Global Structures for Custom Reaction Model The following table summarizes the reaction global structures for the custom reaction model:

Structure types Description

ModuleIDRxnCfg This is the topmost structure for reaction configuration of a custom reaction model. This structure references the sub-structures that are specific to the custom reaction model. This Structure inherits ARTRxnBaseCfg.

ModuleIDModParam Declare parameters shared by all custom classes and reactions. This structure inherits ARTModParam.

ModuleIDClsParamUnion This structure references the class sub-structures (ClassIDClsParam) for all custom classes that are specific to the custom reaction model. This structure inherits ARTClsParamUnion.

ModuleIDRxnParamUnion This structure references the reaction sub-structures (ClassIDRxnParam) for all custom classes that are specific to the custom reaction model. This structure inherits ARTRxnParam.

ClassIDClsParam Declare class parameters that are specific to reaction class, ClassID. There can be more than one reaction classes in the custom reaction model. Each reaction class has a unique ClassID, and there will be one ClassIDClsParam sub-substructure for each class.

ClassIDRxnParam Declare reaction parameters that are specific to reaction class, ClassID. There can be more than one reaction classes in the custom reaction model. Each reaction class has a unique ClassID, and there will be one ClassIDRxnParam sub-substructure for each class.

Page 93: ACM Library Reference Guide

2 Aspen Reactions Toolkit 93

Collection of submodels for Built-in Reaction Model Component The follow table summarizes the sub-models contained in the ACM built-in Reaction Model component:

Model types Description

The following are the non-distributed portion of sub-models for the built-in reaction model: ARTRxnCfgModel This is the topmost sub-model for non-distributed portion of the built-in

reaction model.. This sub-model inherits from ARTRxnBaseCfgModel.

ARTRxnBaseCfgModel This sub-model declares variables that are common to built-in and custom reaction non-distributed sub-models

ARTModND This is the non-distributed portion of module sub-model in the built-in reaction model. This is a dummy sub-model, since there is no non-distributed module variable in the built-in reaction model.

ARTClsNDUnion This is a container for all the non-distributed portion of class sub-models in the built-in reaction model (i.e. GLHHWClsND, LHHWClsND, PowerLawClsND).

ARTRxnNDUnion This is a container for all the non-distributed portion of reaction sub-models in the built-in reaction model (i.e. GLHHWRxnND, LHHWRxnND, PowerLawRxnND).

GLHHWClsND This is the non-distributed portion of class sub-model for GLHHW. This is a dummy sub-model, since there is no non-distributed class variable for GLHHW class.

GLHHWRxnND This is the non-distributed portion of reaction sub-model for GLHHW. This is a dummy sub-model, since there is no non-distributed reaction variable for GLHHW class.

LHHWClsND This is the non-distributed portion of class sub-model for LHHW. This is a dummy sub-model, since there is no non-distributed class variable for LHHW class.

LHHWRxnND This is the non-distributed portion of reaction sub-model for LHHW. This is a dummy sub-model, since there is no non-distributed reaction variable for LHHW class.

PowerLawClsND This is the non-distributed portion of class sub-model for PowerLaw. This is a dummy sub-model, since there is no non-distributed class variable for PowerLawclass.

PowerLawRxnND This is the non-distributed portion of reaction sub-model for PowerLaw. This is a dummy sub-model, since there is no non-distributed reaction variable for PowerLawclass.

The following are the non-distributed portion of sub-models for the built-in reaction model ARTRxnModel This is the topmost sub-model for distributed portion of the built-in

reaction model. This sub-model inherits from ARTRxnBaseModel

ARTRxnBaseModel This sub-model declares variables that are common to the distributed portion of the built-in and custom reaction models.

ARTModDist This is the distributed portion of module sub-model in the built-in reaction model. This is a dummy sub-model, since there is no distributed module variable in the built-in reaction model.

ARTClsDistUnion This is a container for all the distributed portion of class sub-models in the built-in reaction model (i.e. GLHHWClsDist, LHHWClsDist, PowerLawClsDist).

ARTRxnDistUnion This is a container for all the distributed portion of reaction sub-models in the built-in reaction model (i.e. GLHHWRxnDist, LHHWRxnDist,

Page 94: ACM Library Reference Guide

2 Aspen Reactions Toolkit 94

PowerLawRxnDist).

GLHHWClsDist This is the distributed portion of class sub-model for GLHHW. This is where the adsorption terms for GLHHW class get calculated.

GLHHWRxnRate This is the distributed portion of reaction sub-model for GLHHW. This is where the rate constant and reaction rate for GLHHW class get calculated.

LHHWClsDist This is the distributed portion of class sub-model for LHHW. This is a dummy sub-model, since there is no distributed class variable for LHHW class.

LHHWRxnRate This is the distributed portion of reaction sub-model for LHHW. This is where the adsorption terms, and the rate constant and reaction rate for LHHW class get calculated

PowerLawClsDist This is the distributed portion of class sub-model for PowerLaw. This is a dummy sub-model, since there is no distributed class variable for PowerLaw class.

PowerLawRxnRate This is the distributed portion of reaction sub-model for PowerLaw. . This is where the rate constant and reaction rate for PowerLaw class get calculated.

EquilRxnRate This is the distributed portion of reaction sub-model for Equilibrium reactions . This is where the relationship between the equilibrium constant and the equilibrium concentrations is established.

Collection of Submodels for a Custom Reaction Model The follow table summarizes the sub-models contained in the ACM custom reaction model:

Model types Description

The following are the non-distributed portion of sub-models for the custom reaction model of the ID, ModuleID: ModuleIDRxnCfgModel This is the topmost sub-model for non-distributed portion of a

custom reaction model.

ModuleIDModND This is the non-distributed portion of module sub-model in a custom reaction model. This sub-model inherits ARTModND.

ModuleIDClsNDUnion This is a container for all the non-distributed portion of class sub-models in a custom reaction model. This sub-model inherits ARTClsND.

ModuleIDRxnND This is a container for all the non-distributed portion of reaction sub-models in a custom reaction. This sub-model inherits ARTRxnND.

ClassIDClsND This is the non-distributed portion of class sub-model for reaction class, ClsID.

ClassIDRxnND This is the non-distributed portion of reaction sub-model for reaction class, ClsID.

The following are the distributed portion of sub-models for the custom reaction model of the ID, ModuleID: ModuleIDRxnModel This is the topmost sub-model for distributed portion of a custom

reaction model.

ModuleIDModDist This is the distributed portion of module sub-model in a custom reaction model. This sub-model inherits ARTModDist.

ModuleIDClsDistUnion This is a container for all the distributed portion of class sub-models in a custom reaction. This sub-model inherits ARTClsDist.

ModuleIDRxnDistUnion This is a container for all the distributed portion of reaction sub-

Page 95: ACM Library Reference Guide

2 Aspen Reactions Toolkit 95

models in a custom reaction model. This sub-model inherits ARTModDist.

ClassIDClsDist This is the distributed portion of class sub-model for reaction class, ClsID.

ClassIDRxnRate This is the distributed portion of reaction sub-model for reaction class, ClsID.

Page 96: ACM Library Reference Guide

3 Property Procedures 96

3 Property Procedures

This chapter describes the physical property procedures included in the Aspen Custom Modeler library.

There are two main categories of physical property procedures. They are procedures with analytic property derivatives and procedures without analytic property derivatives.

Important Note:

For information about changing the units of measurement see About Units of Measurement in the online Help.

For information about procedures with and without analytic property derivatives, see Aspen Modeler Reference, Chapter 8.

Property Procedures with Analytic Derivatives

Procedure pCond_Liq pCond_Liq is a physical property procedure that calculates thermal conductivity of a liquid.

pCond_Liq Input Variable Types

The input variable types for pCond_Liq are:

Description Variable Type Base Units

Temperature Temperature C

Pressure Pressure bar

Composition Molefraction(*) kmol/kmol

pCond_Liq Output Variable Types

The output variable types for pCond_Liq are:

Page 97: ACM Library Reference Guide

3 Property Procedures 97

Description Variable Type Base Units

Liquid thermal conductivity

Cond_liq W/m/K

pCond_Liq Example

The following is an example of the pCond_Liq procedure:

call (T_cond) = pCond_Liq (T1, P1, x);

Procedure pCond_Vap pCond_Vap is a physical property procedure that calculates the thermal conductivity of a vapor.

pCond_Vap Input Variable Types

The input variable types for pCond_Vap are:

Description Variable Type Base Units

Temperature Temperature C

Pressure Pressure bar

Composition Molefraction(*) kmol/kmol

pCond_Vap Output Variable Types

The output variable types for pCond_Vap are:

Description Variable Type Base Units

Vapor thermal conductivity

Cond_vap W/m/K

pCond_Vap Example

The following is an example of the pCond_vap procedure:

call (T_cond) = pCond_Vap (Tv, Pv, y);

Procedure pCp_Mol_Liq pCp_Mol_Liq is a physical property procedure that calculates the molar heat capacity of a liquid at constant pressure.

pCp_Mol_Liq Input Variable Types

The input variable types for pCp_Mol_Liq are:

Description Variable Type Base Units

Temperature Temperature C

Pressure Pressure bar

Composition Molefraction(*) kmol/kmol

Page 98: ACM Library Reference Guide

3 Property Procedures 98

pCp_Mol_Liq Output Variable Types

The output variable types for pCp_Mol_Liq are:

Description Variable Type Base Units

Liquid heat capacity Cp_mol kJ/kmol/K

pCp_Mol_Liq Example

The following is an example of the pCp_Mol_Liq procedure:

call (Cpl_in) = pCp_Mol_Liq (Tin, Pin, x_in);

Procedure pCp_Mol_Vap pCp_Mol_Vap is a physical property procedure that calculates molar heat capacity of a vapor at constant pressure.

pCp_Mol_Vap Input Variable Types

The input variable types for pCp_Mol_Vap are:

Description Variable Type Base Units

Temperature Temperature C

Pressure Pressure bar

Composition Molefraction(*) kmol/kmol

pCp_Mol_Vap Output Variable Types

The output variable types for pCp_Mol_Vap are:

Description Variable Type Base Units

Vapor heat capacity Cp_mol kJ/kmol/K

pCp_Mol_Vap Example

The following is an example of the pCp_Mol_Vap procedure:

call (Cp_in) = pCp_Mol_Vap (Tin, Pin, Out_P.Z);

Procedure pCv_Mol_Liq pCv_Mol_Liq is a physical property procedure that calculates the molar heat capacity of a liquid at constant volume.

pCv_Mol_Liq Input Variable Types

The input variable types for pCv_Mol_Liq are:

Description Variable Type Base Units

Temperature Temperature C

Page 99: ACM Library Reference Guide

3 Property Procedures 99

Pressure Pressure bar

Composition Molefraction(*) kmol/kmol

pCv_Mol_Liq Output Variable Types

The output variable types for pCv_Mol_Liq are:

Description Variable Type Base Units

Liquid heat capacity Cv_mol kJ/kmol/K

pCv_Mol_Liq Example

The following is an example of the pCv_Mol_Liq procedure:

call (Cv1) = pCv_Mol_Liq (T1, P1, x);

Procedure pCv_Mol_Vap pCv_Mol_Vap is a physical property procedure that calculates the molar heat capacity of a vapor at constant volume.

pCv_Mol_Vap Input Variable Types

The input variable types for pCv_Mol_Vap are:

Description Variable Type Base Units

Temperature Temperature C

Pressure Pressure bar

Composition Molefraction(*) kmol/kmol

pCv_Mol_Vap Output Variable Types

The output variable types for pCv_Mol_Vap are:

Description Variable Type Base Units

Vapor heat capacity Cv_mol kJ/kmol/K

pCv_Mol_Vap Example

The following is an example of the pCv_Mol_Vap procedure:

call (CVv) = pCv_Mol_Vap (Tv, Pv, y);

Procedure pDens_Mass_Liq pDens_Mass_Liq is a physical property procedure that calculates the mass density of a liquid.

pDens_Mass_Liq Input Variable Types

The input variable types for pDens_Mass_Liq are:

Page 100: ACM Library Reference Guide

3 Property Procedures 100

Description Variable Type Base Units

Temperature Temperature C

Pressure Pressure bar

Composition Molefraction(*) kmol/kmol

pDens_Mass_Liq Output Variable Types

The output variable types for pDens_Mass_Liq are:

Description Variable Type Base Units

Liquid mass density Dens_mass kg/m3

pDens_Mass_Liq Example

The following is an example of the pDens_Mass_Liq procedure:

call (RHOml) = pDens_Mass_Liq (T1, P1, x);

Procedure pDens_Mass_Vap pDens_Mass_Vap is a physical property procedure that calculates the mass density of a vapor.

pDens_Mass_Vap Input Variable Types

The input variable types for pDens_Mass_Vap are:

Description Variable Type Base Units

Temperature Temperature C

Pressure Pressure bar

Composition Molefraction(*) kmol/kmol

pDens_Mass_Vap Output Variable Types

The output variable types for pDens_Mass_Vap are:

Description Variable Type Base Units

Vapor mass density Dens_mass kg/m3

pDens_Mass_Vap Example

The following is an example of the pDens_Mass_Vap procedure:

call (RHOmv) = pDens_Mass_Vap (Tv, Pv, y);

Procedure pDens_Mol_Liq pDens_Mol_Liq is a physical property procedure that calculates the molar density of a liquid.

Page 101: ACM Library Reference Guide

3 Property Procedures 101

pDens_Mol_Liq Input Variable Types

The input variable types for pDens_Mol_Liq are:

Description Variable Type Base Units

Temperature Temperature C

Pressure Pressure bar

Composition Molefraction(*) kmol/kmol

pDens_Mol_Liq Output Variable Types

The output variable types for pDens_Mol_Liq are:

Description Variable Type Base Units

Liquid molar density Dens_mol kmol/m3

pDens_Mol_Liq Example

The following is an example of the pDens_Mol_Liq procedure:

call (rho) = pDens_Mol_Liq (T, P, x);

Procedure pDens_Mol_Vap pDens_Mol_Vap is a physical property procedure that calculates the molar density of a vapor.

pDens_Mol_Vap Input Variable Types

The input variable types for pDens_Mol_Vap are:

Description Variable Type Base Units

Temperature Temperature C

Pressure Pressure bar

Composition Molefraction(*) kmol/kmol

pDens_Mol_Vap Output Variable Types

The output variable types for pDens_Mol_Vap are:

Description Variable Type Base Units

Vapor molar density Dens_mol kmol/m3

pDens_Mol_Vap Example

The following is an example of the pDens_Mol_Vap procedure:

call (Rhov) = pDens_Mol_Vap (T, P, y);

Page 102: ACM Library Reference Guide

3 Property Procedures 102

Procedure pDiffus_Liq pDiffus_Liq is a physical property procedure that calculates the liquid diffusion coefficients of components in a mixture.

pDiffus_Liq Input Variable Types

The input variable types for pDiffus_Liq are:

Description Variable Type Base Units

Temperature Temperature C

Pressure Pressure bar

Composition Molefraction(*) kmol/kmol

pDiffus_Liq Output Variable Types

The output variable types for pDiffus_Liq are:

Description Variable Type Base Units

Liquid diffusion coefficients

Diffus_liq(*) cm2/s

pDiffus_Liq Example

The following is an example of the pDiffus_Liq procedure:

call (D_liq) = pDiffus_Liq (T1, P1, X);

Procedure pDiffus_Vap pDiffus_Vap is a physical property procedure that calculates the vapor diffusion coefficients of components in a mixture.

pDiffus_Vap Input Variable Types

The input variable types for pDiffus_Vap are:

Description Variable Type Base Units

Temperature Temperature C

Pressure Pressure bar

Composition Molefraction(*) kmol/kmol

pDiffus_Vap Output Variable Types

The output variable types for pDiffus_Vap are:

Description Variable Type Base Units

Vapor diffusion coefficients

Diffus_vap(*) cm2/s

Page 103: ACM Library Reference Guide

3 Property Procedures 103

pDiffus_Vap Example

The following is an example of the pDiffus_Vap procedure:

call (D_vap) = pDiffus_Vap (T1, P1, Y);

Procedure pEnth_Mol_Liq pEnth_Mol_Liq is a physical property procedure that calculates liquid molar enthalpy.

pEnth_Mol_Liq Input Variable Types

The input variable types for pEnth_Mol_Liq are:

Description Variable Type Base Units

Temperature Temperature C

Pressure Pressure bar

Composition Molefraction(*) kmol/kmol

pEnth_Mol_Liq Output Variable Types

The output variable types for pEnth_Mol_Liq are:

Description Variable Type Base Units

Liquid molar enthalpy Enth_mol GJ/kmol

pEnth_Mol_Liq Example

The following is an example of the pEnth_Mol_Liq procedure:

Rig_enth_mol_liq: call (h) = pEnth_Mol_Liq (T, P, x);

Procedure pEnth_Mol_Vap pEnth_Mol_Vap is a physical property procedure that calculates vapor molar enthalpy.

pEnth_Mol_Vap Input Variable Types

The input variable types for pEnth_Mol_Vap are:

Description Variable Type Base Units

Temperature Temperature C

Pressure Pressure bar

Composition Molefraction(*) kmol/kmol

pEnth_Mol_Vap Output Variable Types

The output variable types for pEnth_Mol_Vap are:

Page 104: ACM Library Reference Guide

3 Property Procedures 104

Description Variable Type Base Units

Vapor molar enthalpy Enth_mol GJ/kmol

pEnth_Mol_Vap Example

The following is an example of the pEnth_Mol_Vap procedure:

call (hv) = pEnth_Mol_Vap (T, P, y);

Procedure pEntr_Mol_Liq pEntr_Mol_Liq is a physical property procedure that calculates liquid molar entropy.

pEntr_Mol_Liq Input Variable Types

The input variable types for pEntr_Mol_Liq are:

Description Variable Type Base Units

Temperature Temperature C

Pressure Pressure bar

Composition Molefraction(*) kmol/kmol

pEntr_Mol_Liq Output Variable Types

The output variable types for pEntr_Mol_Liq are:

Description Variable Type Base Units

Liquid molar entropy Entr_mol kJ/kmol/K

pEntr_Mol_Liq Example

The following is an example of the pEntr_Mol_Liq procedure:

call (s) = pEntr_Mol_Liq (T, P, x);

Procedure pEntr_Mol_Vap pEntr_Mol_Vap is a physical property procedure that calculates vapor molar entropy.

pEntr_Mol_Vap Input Variable Types

The input variable types for pEntr_Mol_Vap are:

Description Variable Type Base Units

Temperature Temperature C

Pressure Pressure bar

Composition Molefraction(*) kmol/kmol

Page 105: ACM Library Reference Guide

3 Property Procedures 105

pEntr_Mol_Vap Output Variable Types

The output variable types for pEntr_Mol_Vap are:

Description Variable Type Base Units

Vapor molar entropy

Entr_mol kJ/kmol/K

pEntr_Mol_Vap Example

The following is an example of the pEntr_Mol_Vap procedure:

call (sv) = pEntr_Mol_Vap (Tv_out, Pv_out, y_out);

Procedure pFuga_Liq pFuga_Liq is a physical property procedure that calculates component liquid fugacity coefficients.

pFuga_Liq Input Variable Types

The input variable types for pFuga_Liq are:

Description Variable Type Base Units

Temperature Temperature C

Pressure Pressure bar

Composition Molefraction(*) kmol/kmol

pFuga_Liq Output Variable Types

The output variable types for pFuga_Liq are:

Description Variable Type Base Units

Liquid fugacity coefficients

Fuga_liq �

pFuga_Liq Example

The following is an example of the pFuga_Liq procedure:

call (fuga_coeff) = pFuga_Liq (T1, P1, x);

Procedure pFuga_Vap pFuga_Vap is a physical property procedure that calculates component vapor fugacity coefficients.

pFuga_Vap Input Variable Types

The input variable types for pFuga_Vap are:

Description Variable Type Base Units

Page 106: ACM Library Reference Guide

3 Property Procedures 106

Temperature Temperature C

Pressure Pressure bar

Composition Molefraction(*) kmol/kmol

pFuga_Vap Output Variable Types

The output variable types for pFuga_Vap are:

Description Variable Type Base Units

Vapor fugacity coefficients

Fuga_Vap �

pFuga_Vap Example

The following is an example of the pFuga_Vap procedure:

call (fuga_coeff) = pFuga_Vap (Tv, Pv, Y);

Procedure pGibbs_Mol_Liq pGibbs_Mol_Liq is a physical property procedure that calculates liquid molar Gibbs Free Energy.

pGibbs_Mol_ Liq Input Variable Types

The input variable types for pGibbs_Mol_Liq are:

Description Variable Type Base Units

Temperature Temperature C

Pressure Pressure bar

Composition Molefraction(*) kmol/kmol

pGibbs_Mol_ Liq Output Variable Types

The output variable types for pGibbs_Mol_Liq are:

Description Variable Type Base Units

Solid Gibbs Free Energy

Gibbs_mol_liq kJ/kmol

pGibbs_Mol_Liq Example

The following is an example of the pGibbs_Mol_Liq procedure:

call (Gl) = pGibbs_Mol_Liq (Tx_in, Px_in, x_in);

Procedure pGibbs_Mol_Vap pGibbs_Mol_ Vap is a physical property procedure that calculates vapor molar Gibbs Free Energy.

Page 107: ACM Library Reference Guide

3 Property Procedures 107

pGibbs_Mol_ Vap Input Variable Types

The input variable types for pGibbs_Mol_Vap are:

Description Variable Type Base Units

Temperature Temperature C

Pressure Pressure bar

Composition Molefraction(*) kmol/kmol

pGibbs_Mol_ Vap Output Variable Types

The output variable types for pGib

bs_Mol_Vap are:

Description Variable Type Base Units

Solid Gibbs Free Energy

Gibbs_mol_vap kJ/kmol

pGibbs_Mol_Vap Example

The following is an example of the pGibbs_Mol_Vap procedure:

call (Gv) = pGibbs_Mol_Vap (Ty_in, Py_in, y_in);

Procedure pKllValues pKllValues is a physical property procedure that calculates component liquid-liquid equilibrium K values.

pKllValues Input Variable Types

The input variable types for pKllValues are:

Description Variable Type Base Units

Temperature Temperature C

Pressure Pressure bar

Liquid composition Molefraction(*) kmol/kmol

Vapor composition Molefraction(*) kmol/kmol

pKllValues Output Variable Types

The output variable types for pKllValues are:

Description Variable Type Base Units

Component liquid-liquid equilibrium K values

k_value(*) �

pKllValues Example

The following is an example of the pKllValues procedure:

Page 108: ACM Library Reference Guide

3 Property Procedures 108

call (K) = pKllValues (T, P, x1, x2);

Procedure pKValues pKValues is a physical property procedure that calculates component vapor-liquid equilibrium K values.

pKValues Input Variable Types

The input variable types for pKValues are:

Description Variable Type Base Units

Temperature Temperature C

Pressure Pressure bar

Liquid composition Molefraction(*) kmol/kmol

Vapor composition Molefraction(*) kmol/kmol

pKValues Output Variable Types

The output variable types for pKValues are:

Description Variable Type Base Units

Equilibrium K values k_value(*) �

pKValues Example

The following is an example of the pKValues procedure:

call (Kfc) = pKValues (T_feed, P_feed, xfc, yfc);

Procedure pSurf_Tens pSurf_Tens is a physical property procedure that calculates liquid surface tension.

pSurf_Tens Input Variable Types

The input variable types for pSurf_Tens are:

Description Variable Type Base Units

Temperature Temperature C

Pressure Pressure bar

Composition Molefraction(*) kmol/kmol

pSurf_Tens Output Variable Types

The output variable types for pSurf_Tens are:

Description Variable Type Base Units

Liquid surface tension Surf_tens N/m

Page 109: ACM Library Reference Guide

3 Property Procedures 109

pSurf_Tens Example

The following is an example of the pSurf_Tens procedure:

call (surfL) = pSurf_Tens (T, P, x);

Procedure pVisc_Liq pVisc_Liq is a physical property procedure that calculates the viscosity of a liquid.

pVisc_Liq Input Variable Types

The input variable types for pVisc_Liq are:

Description Variable Type Base Units

Temperature Temperature C

Pressure Pressure bar

Composition Molefraction(*) kmol/kmol

pVisc_Liq Output Variable Types

The output variable types for pVisc_Liq are:

Description Variable Type Base Units

Liquid viscosity Visc_liq cP

pVisc_Liq Example

The following is an example of the pVisc_Liq procedure:

call (viscL) = pVisc_Liq (T, P, x);

Procedure pVisc_Vap pVisc_Vap is a physical property procedure that calculates the viscosity of a vapor.

pVisc_Vap Input Variable Types

The input variable types for pVisc_Vap are:

Description Variable Type Base Units

Temperature Temperature C

Pressure Pressure bar

Composition Molefraction(*) kmol/kmol

pVisc_Vap Output Variable Types

The output variable types for pVisc_Vap are:

Page 110: ACM Library Reference Guide

3 Property Procedures 110

Description Variable Type Base Units

Vapor viscosity Visc_vap cP

pVisc_Vap Example

The following is an example of the pVisc_Vap procedure:

call (visg ) = pVisc_Vap (Out_P.T, Out_P.P, y_out);

Property Procedures without Analytic Derivatives

Procedure pAct_Coeff_Liq pAct_Coeff_Liq is a physical property procedure that calculates component activity coefficients of a liquid.

pAct_Coeff_Liq Input Variable Types

The input variable types for pAct_Coeff_Liq are:

Description Variable Type Base Units

Temperature Temperature C

Pressure Pressure bar

Composition Molefraction(*) kmol/kmol

pAct_Coeff_Liq Output Variable Types

The output variable types for pAct_Coeff_Liq are:

Description Variable Type Base Units

Component molar activity coefficients

Act_coeff_liq(*) �

pAct_Coeff_Liq Example

The following is an example of the pAct_Coeff_Liq procedure:

call (Activ) = pAct_Coeff_Liq (T1, P1, x);

Procedure pBubt pBubt is a physical property procedure that calculates bubble point temperature at a fixed pressure.

pBubt Input Variable Types

The input variable types for pBubt are:

Page 111: ACM Library Reference Guide

3 Property Procedures 111

Description Variable Type Base Units

Pressure Pressure bar

Composition Molefraction(*) �

pBubt Output Variable Types

The output variable types for pBubt are:

Description Variable Type Base Units

Temperature Temperature C

pBubt Example

The following is an example of the pBubt procedure:

call (T_bubble) = pBubt (P, x_out);

Procedure pDens_Mass_Sol pDens_Mass_Sol is a physical property procedure that calculates the mass density of a solid.

pDens_Mass_Sol Input Variable Types

The input variable types for pDens_Mass_Sol are:

Description Variable Type Base Units

Temperature Temperature C

Pressure Pressure bar

Composition Molefraction(*) kmol/kmol

pDens_Mass_Sol Output Variable Types

The output variable types for pDens_Mass_Sol are:

Description Variable Type Base Units

Solid mass density Dens_mass kg/m3

pDens_Mass_Sol Example

The following is an example of the pDens_Mass_Sol procedure:

call (RHOms) = pDens_Mass_Sol (Ts, Ps, s);

Procedure pDens_Mol_Sol pDens_Mol_Sol is a physical property procedure that calculates the molar density of a solid.

Page 112: ACM Library Reference Guide

3 Property Procedures 112

pDens_Mol_Sol Input Variable Types

The input variable types for pDens_Mol_Sol are:

Description Variable Type Base Units

Temperature Temperature C

Pressure Pressure bar

Composition Molefraction(*) kmol/kmol

pDens_Mol_Sol Output Variable Types

The output variable types for pDens_Mol_Sol are:

Description Variable Type Base Units

Solid molar density Dens_mol kmol/m3

pDens_Mol_Sol Example

The following is an example of the pDens_Mol_Sol procedure:

call (RHOs) = pDens_Mol_Sol (Ts_out, Ps_out, s);

Procedure pDewt pDewt is a physical property procedure that calculates the dew point temperature at fixed pressure.

pDewt Input Variable Types

The input variable types for pDewt are:

Description Variable Type Base Units

Pressure Pressure bar

Composition Molefraction(*) �

pDewt Output Variable Types

The output variable types for pDewt are:

Description Variable Type Base Units

Temperature Temperature C

pDewt Example

The following is an example of the pDewt procedure:

call (T_dew) = pDewt (P_out, x_out);

Page 113: ACM Library Reference Guide

3 Property Procedures 113

Procedure pEnth_Mol pEnth_Mol is a physical property procedure that calculates mixed phase molar enthalpy.

pEnth_Mol Input Variable Types

The input variable types for pEnth_Mol are:

Description Variable Type Base Units

Temperature Temperature C

Pressure Pressure bar

Composition Molefraction(*) kmol/kmol

pEnth_Mol Output Variable Types

The output variable types for pEnth_Mol are:

Description Variable Type Base Units

Molar enthalpy Enth_mol GJ/kmol

pEnth_Mol Example

The following is an example of the pEnth_Mol procedure:

call (hin) = pEnth_Mol (Tin, Pin, zin);

Procedure pEnth_Mol_Sol pEnth_Mol_Sol is a physical property procedure that calculates solid molar enthalpy.

pEnth_Mol_Sol Input Variable Types

The input variable types for pEnth_Mol_Sol are:

Description Variable Type Base Units

Temperature Temperature C

Pressure Pressure bar

Composition Molefraction(*) kmol/kmol

pEnth_Mol_Sol Output Variable Types

The output variable types for pEnth_Mol_Sol are:

Description Variable Type Base Units

Solid molar enthalpy Enth_mol GJ/kmol

pEnth_Mol_Sol Example

The following is an example of the pEnth_Mol_Sol procedure:

Page 114: ACM Library Reference Guide

3 Property Procedures 114

call (hs_out) = pEnth_Mol_Sol (Ts_out, Ps_out, s_out);

Procedure pEntr_Mol pEntr_Mol is a physical property procedure that calculates mixed phase molar entropy.

pEntr_Mol Input Variable Types

The input variable types for pEntr_Mol are:

Description Variable Type Base Units

Temperature Temperature C

Pressure Pressure bar

Composition Molefraction(*) kmol/kmol

pEntr_Mol Output Variable Types

The output variable types for pEntr_Mol are:

Description Variable Type Base Units

Mixed phase molar entropy Entr_mol kJ/kmol/K

pEntr_Mol Example

The following is an example of the pEntr_Mol procedure:

call (sv) = pEntr_Mol (Tv_in, Pv_in, y_in);

Procedure pEntr_Mol_Sol pEntr_Mol_Sol is a physical property procedure that calculates solid molar entropy.

pEntr_Mol_Sol Input Variable Types

The input variable types for pEntr_Mol_Sol are:

Description Variable Type Base Units

Temperature Temperature C

Pressure Pressure bar

Composition Molefraction(*) kmol/kmol

pEntr_Mol_Sol Output Variable Types

The output variable types for pEntr_Mol_Sol are:

Description Variable Type Base Units

Solid molar entropy Entr_mol kJ/kmol/K

Page 115: ACM Library Reference Guide

3 Property Procedures 115

pEntr_Mol_Sol Example

The following is an example of the pEntr_Mol_Sol procedure:

call (ss) = pEntr_Mol_Sol (Ts_in, Ps_in, s_in);

Procedure pFlash pFlash is a physical property procedure that performs a two-phase flash at the given temperature and pressure.

pFlash Input Variable Types

The input variable types for pFlash are:

Description Variable Type Base Units

Temperature Temperature C

Pressure Pressure bar

Composition Molefraction(*) kmol/kmol

pFlash Output Variable Types

The output variable types for pFlash are:

Description Variable Type Base Units

Vapor composition Molefraction(*) kmol/kmol

Liquid composition Molefraction(*) kmol/kmol

Vapor fraction Vapfraction kmol/kmol

Vapor molar enthalpy Enth_mol_vap GJ/kmol

Liquid molar enthalpy Enth_mol_liq GJ/kmol

pFlash Example

The following is an example of the pFlash procedure:

call (y_out, x_out, vf, hv_out, hl_out) = pFlash (T, P, z);

Procedure pFlash3 pFlash3 is a physical property procedure that performs a three-phase flash at the given temperature and pressure.

pFlash3 Input Variable Types

The input variable types for pFlash3 are:

Description Variable Type Base

Units

Temperature Temperature C

Pressure Pressure bar

Composition Molefraction(*) kmol/kmol

Page 116: ACM Library Reference Guide

3 Property Procedures 116

Three-phase flash model type

String

FULL � Fully rigorous, 3-phase

DECANT � 2-phase with water decant

pFlash3 Output Variable Types

The output variable types for pFlash3 are:

Description Variable Type Base Units

Vapor composition Molefraction(*) kmol/kmol

1st phase liquid composition Molefraction(*) kmol/kmol

2nd phase liquid composition Molefraction(*) kmol/kmol

Vapor fraction Vapfraction kmol/kmol

Molar ratio of 2nd liquid phase to feed

Liqfraction kmol/kmol

Vapor molar enthalpy Enth_mol_vap GJ/kmol

1st liquid molar enthalpy Enth_mol_liq GJ/kmol

2nd liquid molar enthalpy Enth_mol_liq GJ/kmol

pFlash3 Example

The following is an example of the pFlash3 procedure:

call (y_out, x_out1, x_out2, vf, lf, hv_out, hl_out1, hl_out2,) = pFlash3 (T, P, z, rigor);

Procedure pFlash3PH pFlash3PH is a physical property procedure that performs a three-phase flash at the given pressure and molar enthalpy.

pFlash3PH Input Variable Types

The input variable types for pFlash3PH are:

Description Variable Type Base

Units

Pressure Pressure bar

Molar enthalpy Enth_mol GJ/kmol

Composition Molefraction(*) kmol/kmol

Three-phase flash model type

String

FULL � Fully rigorous, 3-phase

DECANT � 2-phase with free-water decant

pFlash3PH Output Variable Types

The output variable types for pFlash3PH are:

Description Variable Type Base

U it

Page 117: ACM Library Reference Guide

3 Property Procedures 117

Units

Temperature Temperature C

Vapor fraction Vapfraction kmol/kmol

Vapor composition Molefraction(*) kmol/kmol

First liquid composition Molefraction(*) kmol/kmol

Second liquid composition Molefraction(*) kmol/kmol

Molar ratio of second liquid phase to all phases

Liqfraction kmol/kmol

Vapor molar enthalpy Enth_mol_vap GJ/kmol

First liquid molar enthalpy Enth_mol_liq GJ/kmol

Second liquid molar enthalpy Enth_mol_liq GJ/kmol

pFlash3PH Example

The following is an example of the pFlash3PH procedure:

call (T, VF, Y, X1, X2, LF, HV, HL1, HL2) = pFlash3PH (P, H, Z, rigor);

Procedure pFlash3PV pFlash3PV is a physical property procedure that performs a three-phase flash at the given pressure and vapor fraction.

pFlash3PV Input Variable Types

The input variable types for pFlash3PV are:

Description Variable Type Base

Units

Pressure Pressure bar

Fraction Vapfraction kmol/kmol

Composition Molefraction(*) kmol/kmol

Three-phase flash model type

String

FULL � Fully rigorous, 3-phase

DECANT � 2-phase with free-water decant

pFlash3PV Output Variable Types

The output variable types for pFlash3PV are:

Description Variable Type Base Units

Temperature Temperature C

Vapor composition Molefraction(*) kmol/kmol

First liquid composition Molefraction(*) kmol/kmol

Second liquid composition Molefraction(*) kmol/kmol

Molar ratio of second liquid phase to all phases

Liqfraction kmol/kmol

Page 118: ACM Library Reference Guide

3 Property Procedures 118

Vapor molar enthalpy Enth_mol_vap GJ/kmol

First liquid molar enthalpy Enth_mol_liq GJ/kmol

Second liquid molar enthalpy Enth_mol_liq GJ/kmol

pFlash3PV Example

The following is an example of the pFlash3PV procedure:

call (T, Y, X1, X2, LF, HV, HL1, HL2) = pFlash3PV (P, VF, Z, rigor);

Procedure pFlash3TH pFlash3TH is a physical property procedure that performs a three-phase flash at the given temperature and molar enthalpy.

pFlash3TH Input Variable Types

The input variable types for pFlash3TH are:

Description Variable Type Base Units

Temperature Temperature C

Molar enthalpy Enth_mol GJ/kmol

Composition Molefraction(*) kmol/kmol

Three-phase flash model type

String

FULL � Fully rigorous, 3-phase

DECANT � 2-phase with free-water decant

pFlash3TH Output Variable Types

The output variable types for pFlash3TH are:

Description Variable Type Base

Units

Pressure Pressure bar

Vapor fraction Vapfraction kmol/kmol

Vapor composition Molefraction(*) kmol/kmol

First liquid composition Molefraction(*) kmol/kmol

Second liquid composition Molefraction(*) kmol/kmol

Molar ratio of second liquid phase to all phases

Liqfraction kmol/kmol

Vapor molar enthalpy Enth_mol_vap GJ/kmol

First liquid molar enthalpy Enth_mol_liq GJ/kmol

Second liquid molar enthalpy Enth_mol_liq GJ/kmol

pFlash3TH Example

The following is an example of the pFlash3TH procedure:

Page 119: ACM Library Reference Guide

3 Property Procedures 119

call (P, VF, Y, X1, X2, HV, HL1, HL2) = pFlash3TH (T, H, Z, rigor);

Procedure pFlash3TV pFlash3TV is a physical property procedure that performs a three-phase flash at the given temperature and vapor fraction.

pFlash3TV Input Variable Types

The input variable types for pFlash3TV are:

Description Variable Type Base

Units

Temperature Temperature C

Vapor fraction Vapfraction kmol/kmol

Composition Molefraction(*) kmol/kmol

Three-phase flash model type

String

FULL � Fully rigorous, 3-phase

DECANT � 2-phase with free-water decant

pFlash3TV Output Variable Types

The output variable types for pFlash3TV are:

Description Variable Type Base Units

Pressure Pressure bar

Vapor composition Molefraction(*) kmol/kmol

First liquid composition Molefraction(*) kmol/kmol

Second liquid composition Molefraction(*) kmol/kmol

Molar ratio of second liquid phase to all phases

Liqfraction kmol/kmol

Vapor molar enthalpy Enth_mol_vap GJ/kmol

First liquid molar enthalpy Enth_mol_liq GJ/kmol

Second liquid molar enthalpy Enth_mol_liq GJ/kmol

pFlash3TV Example

The following is an example of the pFlash3TV procedure:

call (P, Y, X1, X2, HV, HL1, HL2) = pFlashTV (T, VF, Z, rigor);

Procedure pFlashPH pFlashPH is a physical property procedure that performs a two-phase flash at the given pressure and molar enthalpy.

Page 120: ACM Library Reference Guide

3 Property Procedures 120

pFlashPH Input Variable Types

The input variable types for pFlashPH are:

Description Variable Type Base Units

Pressure Pressure bar

Molar enthalpy Enth_mol GJ/kmol

Composition Molefraction(*) kmol/kmol

pFlashPH Output Variable Types

The output variable types for pFlashPH are:

Description Variable Type Base

Units

Temperature Temperature C

Vapor fraction Vapfraction kmol/kmol

Vapor composition Molefraction(*) kmol/kmol

Liquid composition Molefraction(*) kmol/kmol

Vapor molar enthalpy Enth_mol_vap GJ/kmol

Liquid molar enthalpy Enth_mol_liq GJ/kmol

pFlashPH Example

The following is an example of the pFlashPH procedure:

call (T, VF, Y, X, HV, HL) = pFlashPH (P, H, Z);

Procedure pFlashPV pFlashPV is a physical property procedure that performs a two-phase flash at the given pressure and vapor fraction.

pFlashPV Input Variable Types

The input variable types for pFlashPV are:

Description Variable Type Base

Units

Pressure Pressure bar

Fraction Vapfraction kmol/kmol

Composition Molefraction(*) kmol/kmol

pFlashPV Output Variable Types

The output variable types for pFlashPV are:

Description Variable Type Base

Units

Temperature Temperature C

Page 121: ACM Library Reference Guide

3 Property Procedures 121

Vapor composition Molefraction(*) kmol/kmol

Liquid composition Molefraction(*) kmol/kmol

Vapor molar enthalpy Enth_mol_vap GJ/kmol

Liquid molar enthalpy Enth_mol_liq GJ/kmol

pFlashPV Example

The following is an example of the pFlashPV procedure:

call (T, Y, X, HV, HL) = pFlashPV (P, VF, Z);

Procedure pFlashTH pFlashTH is a physical property procedure that performs a two-phase flash at the given temperature and molar enthalpy.

pFlashTH Input Variable Types

The input variable types for pFlashTH are:

Description Variable Type Base Units

Temperature Temperature C

Molar enthalpy Enth_mol GJ/kmol

Composition Molefraction(*) kmol/kmol

pFlashTH Output Variable Types

The output variable types for pFlashTH are:

Description Variable Type Base Units

Pressure Pressure bar

Vapor fraction Vapfraction kmol/kmol

Vapor composition Molefraction(*) kmol/kmol

Liquid composition Molefraction(*) kmol/kmol

Vapor molar enthalpy Enth_mol_vap GJ/kmol

Liquid molar enthalpy Enth_mol_liq GJ/kmol

pFlashTH Example

The following is an example of the pFlashTH procedure:

call (P, VF, Y, X, HV, HL) = pFlashTH (T, H, Z);

Procedure pFlashTV pFlashTV is a physical property procedure that performs a two-phase flash at the given temperature and vapor fraction.

pFlashTV Input Variable Types

The input variable types for pFlashTV are:

Page 122: ACM Library Reference Guide

3 Property Procedures 122

Description Variable Type Base Units

Temperature Temperature C

Vapor fractioni Vapfraction kmol/kmol

Composition Molefraction(*) kmol/kmol

pFlashTV Output Variable Types

The output variable types for pFlashTV are:

Description Variable Type Base

Units

Pressure Pressure bar

Vapor composition Molefraction(*) kmol/kmol

Liquid composition Molefraction(*) kmol/kmol

Vapor molar enthalpy Enth_mol_vap GJ/kmol

Liquid molar enthalpy Enth_mol_liq GJ/kmol

pFlashTV Example

The following is an example of the pFlashTV procedure:

call (P, Y, X, HV, HL) = pFlashTV (T, VF, Z);

Procedure pFuga_Sol pFuga_Sol is a physical property procedure that calculates component solid fugacity coefficients.

pFuga_Sol Input Variable Types

The input variable types for pFuga_Sol are:

Description Variable Type Base Units

Temperature Temperature C

Pressure Pressure bar

Composition Molefraction(*) kmol/kmol

pFuga_Sol Output Variable Types

The output variable types for pFuga_Sol are:

Description Variable Type Base Units

Solid fugacity coefficients

Fuga_Sol �

pFuga_Sol Example

The following is an example of the pFuga_Sol procedure:

call (fuga_coeff) = pFuga_Sol (Ts, Ps, w);

Page 123: ACM Library Reference Guide

3 Property Procedures 123

Procedure pGibbs_Mol_IDLGAS pGibbs_Mol_IDLGAS is a physical property procedure that calculates Component Ideal Gas Molar Gibbs Free Energies

pGibbs_Mol_IDLGAS Input Variable Types

The input variable types for pGibbs_Mol_IDLGAS are:

Description Variable Type Base Units

Temperature Temperature C

Composition Molefraction(*) kmol/kmol

pGibbs_Mol_IDLGAS Output Variable Types

The output variable types for pGibbs_Mol_IDLGAS are:

Description Variable Type Base Units

Ideal Gas Molar Gibbs Free Energies

Gibbs_mol_vap(*) kJ/kmol

pGibbs_Mol_IDLGAS Example

The following is an example of the pGibbs_Mol_IDLGAS procedure:

call (GIdeal) = pGibbs_Mol_IDLGAS (Tv_in, Y_in);

Procedure pGibbs_Mol_Sol pGibbs_Mol_Sol is a physical property procedure that calculates solid molar Gibbs Free Energy.

pGibbs_Mol_Sol Input Variable Types

The input variable types for pGibbs_Mol_Sol are:

Description Variable Type Base Units

Temperature Temperature C

Pressure Pressure bar

Composition Molefraction(*) kmol/kmol

pGibbs_Mol_Sol Output Variable Types

The output variable types for pGibbs_Mol_Sol are:

Description Variable Type Base Units

Solid Gibbs Free Energy

Gibbs_mol_sol kJ/kmol

Page 124: ACM Library Reference Guide

3 Property Procedures 124

pGibbs_Mol_Sol Example

The following is an example of the pGibbs_Mol_Sol procedure:

call (Gs) = pGibbs_Mol_Sol (Ts_in, Ps_in, s_in);

Procedure pMolWeight pMolWeight is a physical property procedure that calculates the average molar weight.

pMolWeight Input Variable Types

The input variable types for pMolWeight are:

Description Variable Type Base Units

Composition Molefraction(*) kmol/kmol

pMolWeight Output Variable Types

The output variable types for pMolWeight are:

Description Variable Type Base Units

Molar weights Molweight kg/kmol

pMolWeight Example

The following is an example of the pMolWeight procedure:

call (MWout ) = pMolWeight (zin );

Procedure pMolWeights pMolWeights is a physical property procedure that calculates the component molar weights.

pMolWeights Input Variable Types

There are no input variable types for pMolWeights.

pMolWeights Output Variable Types

The output variable types for pMolWeights are:

Description Variable Type Base Units

Molar weights Molweight(*) kg/kmol

pMolWeights Example

The following is an example of the pMolWeights procedure:

call (Mws) = pMolWeights();

Page 125: ACM Library Reference Guide

3 Property Procedures 125

Procedure ppH ppH is a physical property procedure that calculates pH.

ppH Input Variable Types

The input variable types for ppH are:

Description Variable Type Base Units

Temperature Temperature C

Pressure Pressure bar

Composition Molefraction(*) kmol/kmol

ppH Output Variable Types

The output variable types for ppH are:

Description Variable Type Base Units

pH pH �

ppH Example

The following is an example of the ppH procedure:

call (pH) = ppH (T, P, x);

Procedure pPropZ pPropZ is a physical property procedure that calculates petroleum properties which are a function of composition only. The following four property calculations are available:

Name Description Unit of

Measurement

CETANENO Centane number �

REIDVP Reid vapor pressure bar

SG Specific gravity (60/60 F) �

WAT Watson UOP K-factor �

pPropZ Input Variable Types

The input variable types for pPropZ are:

Description Variable Type Base Units

Property name Stringparameter �

Composition Molefraction(*) kmol/kmol

Page 126: ACM Library Reference Guide

3 Property Procedures 126

pPropZ Output Variable Types

The output variable type for pPropZ is:

Description Variable Type Base Units

Petroleum property RealVariable �

pPropZ Example

The following is an example of the pPropZ procedure:

call (SpecificGravity) = pPropZ ("SG", x);

Procedure pPropZPct pPropZPct is a physical property procedure that calculates petroleum properties which are a function of composition and liquid volume % distilled. The following property calculation is available:

Name Description Unit of

Measurement

D86T ASTM D86 Temperature C

pPropZPct Input Variable Types

The input variable types for pPropZPct are:

Description Variable Type Base Units

Property name Stringparameter �

Composition Molefraction(*) kmol/kmol

Liquid volume % distilled

Vol_percent vol%

pPropZPct Output Variable Types

The output variable type for pPropZPct is:

Description Variable Type Base Units

Petroleum property RealVariable �

pPropZ Example

The following is an example of the pPropZ procedure:

call (D86Temperature) = pPropZPct ("D86T", x, xpct);

Procedure pPropZPPct pPropZPPct is a physical property procedure that calculates petroleum properties which are a function of composition, property pressure, and liquid volume % distilled. The following property calculation is available:

Page 127: ACM Library Reference Guide

3 Property Procedures 127

Name Description Unit of

Measurement

D1160T ASTM D1160 Temperature C

pPropZPPct Input Variable Types

The input variable types for pPropZPPct are:

Description Variable Type Base Units

Property name Stringparameter �

Composition Molefraction(*) kmol/kmol

Pressure Pressure bar

Liquid volume % distilled

Vol_percent vol%

pPropZPPct Output Variable Types

The output variable type for pPropZPPct is:

Description Variable Type Base Units

Petroleum property RealVariable �

pPropZ Example

The following is an example of the pPropZ procedure:

Call (D!1160Temperature) = pPropZPPct(�D1160T�, x, P, xpct);

Procedure pSurf_Tensy pSurf_TensY is a physical property procedure that calculates surface tension using vapor and liquid molefractions.

pSurf_TensY Input Variable Types

The input variable types for pSurf_TensY are:

Description Variable Type Base Units

Temperature Temperature C

Pressure Pressure bar

Liquid composition Molefraction(*) kmol/kmol

Vapor composition Molefraction(*) kmol/kmol

pSurf_TensY Output Variable Types

The output variable types for pSurf_TensY are:

Page 128: ACM Library Reference Guide

3 Property Procedures 128

Description Variable Type Base Units

Surface tension Surf_tens N/m

pSurf_TensY Example

The following is an example of the pSurf_TensY procedure:

call (surfL) = pSurf_TensY (T, P, x, y);

Procedure pTrueCmp2 pTrueCmp2 is a physical properties procedure that calculates the equilibrium true composition in the slurry phase. Note that the true phase is named the �slurry� phase since it may contain precipitated solids as well as liquid. The properties returned are the overall true composition, the liquid true composition, the solid true composition, the true solid mole fraction and the true to apparent mole ratio.

Note that pTrueCmp2 is similar to pTrueComp, but is more straightforward to understand and use. pTrueComp has been retained for backward compatibility.

PTrueCmp2 Input Variable Types

The input variable types for pTrueCmp2 are:

Description Variable Type Base Units

Temperature Temperature C

Pressure Pressure bar

Apparent composition Molefraction(*) kmol/kmol

PTrueCmp2 Output Variable Types

The output variable types for pTrueCmp2 are:

Description Name Variable Type Base

Units

Mole fractions in the total slurry phase

z_out Molefraction(*) kmol/kmol

Mole fractions in the true liquid phase

x_out Molefraction(*) kmol/kmol

Mole fractions in the true solid phase

s_out Molefraction(*) kmol/kmol

True solid mole ratio sfrac ratio_ �

True apparent mole ratio rat ratio_ �

Note: The input apparent composition and output true compositions must all be indexed over the same component list. This component list should contain all of the apparent components, and all of the true components in the simulation. The mole fractions of true components will normally be zero in

Page 129: ACM Library Reference Guide

3 Property Procedures 129

the input composition, and the mole fractions of apparent components will always be zero in the output true compositions.

Procedure pTrueCmpVLS pTrueCmpVLS is a physical properties procedure that calculates the 3-phase equilibrium true composition of the slurry phase. The properties returned are the vapor phase true composition, the liquid true composition, the solid true composition, the true vapor mole fraction, the true solid mole fraction and the true to apparent mole ratio.

pTrueCmpVLS is an extension of pTrueCmp which considers liquid and solid phase only.

PTrueCmpVLS Input Variable Types

The input variable types for pTrueCmpVLS are:

Description Variable Type Base Units

Temperature Temperature C

Pressure Pressure bar

Apparent composition Molefraction(*) kmol/kmol

PTrueCmpVLS Output Variable Types

The output variable types for pTrueCmpVLS are:

Description Name Variable Type Base

Units

Mole fractions in the true vapor phase

y_out Molefraction(*) kmol/kmol

Mole fractions in the true liquid phase

x_out Molefraction(*) kmol/kmol

Mole fractions in the true solid phase

s_out Molefraction(*) kmol/kmol

True vapor mole fraction vfrac vapfraction �

True solid mole fraction sfrac solfraction �

True apparent mole ratio rat ratio_ �

pTrueCmpVLS Example

The following is an example usage of the pTrueCmpVLS procedure:

call (y_out, x_out, s_out, vfrac, sfrac, rat) = pTrueCmpVLS (T, P, z_in);

lfrac = ( 1.0 � sfrac � vfrac );

Procedure pTrueComp pTrueComp is a physical properties procedure that calculates the equilibrium true composition in the slurry phase, along with the solid to true liquid mole

Page 130: ACM Library Reference Guide

3 Property Procedures 130

ratio and the true to apparent liquid mole ratio. Note that the true phase is named the �slurry� phase because it may contain precipitated solids as well as liquid.

pTrueComp Input Variable Types

The input variable types for pTrueComp are:

Description Variable Type Base Units

Temperature Temperature C

Pressure Pressure bar

Apparent composition Molefraction(*) kmol/kmol

pTrueComp Output Variable Types

The output variable types for pTrueComp are:

Description Name Variable Type Base

Units

Mole fractions in the total slurry phase

z_out Molefraction(*) kmol/kmol

True solid to true liquid mole ratio

Srat ratio_ �

True liquid to apparent liquid mole ratio

Irat ratio_ �

Note: The input apparent composition and output true compositions must all be indexed over the same component list. This component list should contain all of the apparent components, and all of the true components in the simulation. The mole fractions of true components will normally be zero in the input composition, and the mole fractions of apparent components will always be zero in the output true compositions.

pTrueComp Example

The following is an example usage of the pTrueComp procedure:

call (z_out, srat, lrat) = pTrueComp (T, P, Z_in);

The following additional examples provide further explanation of the definition and use of the output variables from pTrueComp:

TotalTrueFlow = TotalApparentFlow * lrat * (1 + srat);

TrueFlow(i) = z_out(i) * TotalApparentFlow * lrat * (1 + srat);

Page 131: ACM Library Reference Guide

3 Property Procedures 131

Note that the equation for TrueFlow(i) is valid irrespective of whether �i� is a liquid component or a solid component.

Procedure pTrueCmp2 pTrueCmp2 is a physical properties procedure that calculates the equilibrium true composition in the slurry phase. Note that the true phase is named the "slurry" phase since it may contain precipitated solids as well as liquid. The properties returned are the overall true composition, the liquid true composition, the solid true composition, the true solid mole fraction and the true to apparent mole ratio.

Note that pTrueCmp2 is similar to pTrueComp, but is more straightforward to understand and use.

pTrueComp has been retained for backward compatibility.

pTrueCmp2 Input Variable Types

The input variable types for pTrueCmp2 are: Description Variable Type Base Units

Temperature Temperature C

Pressure Pressure bar

Apparent composition Molefraction(*) kmol/kmol

pTrueCmp2 Output Variable Types

The output variable types for pTrueCmp2 are: Description Name Variable Type Base

Units

Mole fractions in the total slurry phase

z_out Molefraction(*) kmol/kmol

Mole fractions in the true liquid phase

x_out Molefraction(*) kmol/kmol

Mole fractions in the true solid phase

s_out Molefraction(*) kmol/kmol

True solid to true liquid mole ratio

sfrac Fraction �

True liquid to apparent liquid mole ratio

rat ratio_ �

Note: The input apparent composition and output true compositions must all be indexed over the same component list. This component list should contain all of the apparent components, and all of the true components in the simulation. The mole fractions of true components will normally be zero in the input composition, and the mole fractions of apparent components will always be zero in the output true compositions.

Page 132: ACM Library Reference Guide

3 Property Procedures 132

pTrueCmp2 Example

The following is an example of the pTrueCmp2 procedure:

call (z_out, x_out, s_out, sfrac, rat) = pTrueCmp2 (T, P, z_in);

TotalTrueFlow = TotalApparentFlow * rat;

TotalTrueLiquidFlow = TotalApparentFlow * rat * (1-sfrac);

TrueFlow(i) = z_out(i) * TotalApparentFlow * rat;

TrueSolidFlow(i) = s_out(i) * TotalApparentFlow * rat * sfrac;

Procedure pVap_Pressures pVap_Pressures is a physical property procedure that calculates pure component vapor pressures.

pVap_Pressures Input Variable Types

The input variable types for pVap_Pressures are:

Description Variable Type Base Units

Temperature Temperature C

pVap_Pressures Output Variable Types

The output variable types for pVap_Pressures are:

Description Variable Type Base Units

Component vapor pressure

Pressure(*) bar

pVap_Pressures Example

The following is an example of the pVap_Pressures procedure:

call (comp_P_vap) = pVap_Pressures (T_in);

Procedure pVap_Pressure pVap_Pressure is a physical property procedure that calculates total vapor pressure.

pVap_Pressure Input Variable Types

The input variable types for pVap_Pressure are:

Page 133: ACM Library Reference Guide

3 Property Procedures 133

Description Variable Type Base Units

Temperature Temperature C

Liquid composition Molefraction(*) kmol/kmol

pVap_Pressure Output Variable Types

The output variable types for pVap_Pressure are:

Description Variable Type Base Units

Total vapor pressure Pressure bar

pVap_Pressure Example

The following is an example of the pVap_Pressure procedure:

call (P_vp) = pVap_Pressure (In_F_T, In_F_z);

Page 134: ACM Library Reference Guide

4 Physical Properties Submodels 134

4 Physical Properties Submodels

Aspen Custom Modeler includes a number of physical property submodels which you can use to perform physical property and flash calculations within your models.

These submodels provide an alternative approach to the direct calling of physical property and flash procedures, described in Overview of Property Procedures.

The key benefits of these submodels are:

• Their ability to perform flash calculations using equation based or procedural methods.

• Their ability to calculate properties using conventional rigorous property routines, or faster local property models.

This chapter describes these key features submodels, and explains how to use them in your models and simulations.

Key Features

Properties Calculated Given the temperature, pressure and composition of a fluid the property submodels can be used to calculate the following properties:

• Phase molar fractions

• Phase compositions

• Phase and overall molar enthalpy

• Phase molar weights

• Phase molar densities

For each property submodel there is a second model which calculates all of these properties and also calculates overall and phase entropies. Entropy is not needed as often as the other properties, so versions of the submodels have been provided with and without this. You can then choose which is appropriate and avoid unnecessary calculations which slow down your simulation.

Page 135: ACM Library Reference Guide

4 Physical Properties Submodels 135

Local Properties All property submodels can calculate properties using either rigorous or local property methods.

Rigorous properties uses direct calls to the physical property system whenever properties are required.

When using local properties, properties are calculated using relatively simple functions of temperature and pressure. These functions are fast to evaluate, and accurate over a limited range of temperature, pressure, and composition. For example the following equation is used to calculate liquid molar enthalpy.

( )TBAxhl ii

nci

ii ..

1+= ∑

=

=

Where:

hl = Liquid molar enthalpy

xi = Mole fraction of component i

Ai, Bi = Local property parameters for component i

T = Temperature

nc = Number of components

These parameters in these functions are fitted using rigorous physical property values obtained from calls to the AspenTech physical property system.

To ensure good accuracy, parameter values are updated during a dynamic simulation. Also, separate sets of parameters are fitted and used at each location in the flowsheet.

Note: Because it has faster performance, use of local properties is recommended for most dynamic simulations.

The Rigorous properties option is recommended for:

• Steady state simulations.

• Dynamic optimization or dynamic estimation runs.

• Simulation of systems with very non-ideal behavior, such as electrolyte systems.

• Simulation of single component systems where a phase change occurs.

• Simulations where conditions are near to or beyond the critical point.

Local properties requires the use of an integrator which supports tearing, and that procedure tearing is set to Update on the Tearing Tab of the Solver Options dialog.

Local properties can only be used if you are using AspenTech�s physical property package. Local properties does not work if you use another physical property package interfaced directly to Aspen Custom Modeler.

Page 136: ACM Library Reference Guide

4 Physical Properties Submodels 136

Flash Methods Many of the submodels can be used to perform phase equilibrium flash calculations. There are different submodels for each of the following combinations of phases:

• Vapor-Liquid

• Vapor-Liquid-Liquid

• Vapor-Liquid-Water

• Liquid-Liquid

• Liquid-Water

For the Vapor-Liquid-Water and Liquid-Water phase combinations the water phase is assumed to be pure water, which is a useful approach for some petroleum and petrochemical applications.

For all phase combinations the phase equilibrium flash calculations can be performed using a choice of two proprietary equation formulations. For Vapor-Liquid, Vapor-Liquid-Liquid and Vapor-Liquid-Water phase combinations, the flash calculations can also be performed using one of two procedural flash methods.

Each of these flash methods are described in the following table:

Flash Method Description

Equation Formulates the flash as equations. Includes special algorithms to correctly handle the situation where the system is superheated or subcooled.

When PropMode = Local, the Vapor-Liquid-Liquid and Liquid-Liquid flashes include special checks to avoid trivial solutions and ensure that the calculated equilibrium conditions are correct, and represent the minimum Gibbs free energy condition. They also include algorithms to prevent the two liquid phases �flipping� around during a dynamic simulation.

Equation gives good performance and robustness, and is recommended for most situations, especially dynamic simulations.

SmoothEquation Similar to Equation, with the same features. Uses a smoothing technique to handle the phase transitions. This has been shown to be more robust than Equation for models that are exported and run in Aspen Plus. The smoothing introduces a very small error in calculations very close to the phase transitions, that is with phase fractions near 0 or 1. You can reduce the value of the parameter FlashSmoothTol to reduce this error, or increase it to improve robustness. Normally the default of 1e-6 is fine.

Procedure Uses the AspenTech procedural flash subroutine, with temperature and pressure as inputs. This subroutine is also used in Aspen Plus and Aspen Properties. Use of Procedure introduces nested iterations in to the simulation and will usually result in slower performance than Equation. Procedure can work better in converging steady state simulations that have a poor initial estimate. If Procedure is used Rigorous properties are always used.

ProcedurePH The same as Procedure except that the flash subroutine

Page 137: ACM Library Reference Guide

4 Physical Properties Submodels 137

is called with pressure and specific enthalpy as inputs. ProcedurePH can be more robust than Procedure, especially for single component or narrow boiling systems.

ProcedurePV The same as Procedure except that the flash subroutine is called with pressure and vapor molar fraction as inputs. Caution should be exercised when using this method with simulations involving subcooled liquids and/or superheated vapor as the PV flash will only calculate bubble and dew point pressure conditions respectively.

ProcedureTV The same as Procedure except that the flash subroutine is called with temperature and vapor molar fraction as inputs. Caution should be exercised when using this method with simulations involving subcooled liquids and/or superheated vapor as a TV flash will only calculate bubble and dew point temperature conditions respectively.

Flash Efficiencies All of the flash methods support the use of efficiencies. There are two types of efficiency, Vaporization and Murphree. Both adjust the flash results to allow for non-equilibrium conditions, and are most commonly used in distillation stage models.

When Vaporization efficiency is selected the equation

Yi = EFFi.Ki..Xi

is used, where:

EFFi = Efficiency for component i

Ki = Equilibrium K value for component i

Xi = Liquid component mole fraction of component i

Yi = Vapor component mole fraction of component i

When Murphree efficiency is selected the equation

Yi = YINi + EFFi.(Ki.Xi-YINi)

is used, where:

YINi = Inlet vapor component mole fraction of component i

By default Vaporization efficiency is used, with an efficiency of 1. This means that efficiency calculations are not active.

The liquid-liquid and liquid-water equilibrium models use the equation:

X2i = EFFi.Ki..X1i

Where:

X1i = Liquid 1 component mole fraction of component i

X2i = Liquid 2/water component mole fraction of component I

The efficiency values default to 1.

Page 138: ACM Library Reference Guide

4 Physical Properties Submodels 138

Polymers Support The Liquid and Vapor-Liquid property submodels include support for calculating properties of polymer systems, using the Rigorous properties option. Local properties are not supported for polymer systems.

When using these submodels for polymer calculations you need to supply the zeroth moment, segment first moments and second moment for the polymer, as well as temperature, pressure and composition.

Use of this feature requires a license for Polymers Plus.

Units of Measurement All of the property submodels work in the ACM Metric units of measurement set. To use these submodels it is strongly recommended that you write your model in these same units of measurement. The documentation for each submodel shows the units of measurement for each variable.

Summary of Features The following table summarizes the features are available for each submodel:

Phases Submodel name Equation

flash Smooth-Equation flash

Procedure flash

ProcedurePH flash

Polymer support

Entropy calculated

Liquid Props_liquid - - - - Yes No

Props_liq_entr - - - - No Yes

Vapor Props_vapor - - - - No No

Props_vap_entr - - - - No Yes

Vapor-Liquid Props_flash2 Yes Yes Yes Yes Yes No

Props_flash2_entr Yes Yes Yes Yes No Yes

Vapor-Liquid-Liquid Props_flash3 Yes Yes Yes Yes No No

Props_flash3_entr Yes Yes Yes Yes No Yes

Vapor-Liquid-Water Props_flash2w Yes Yes Yes Yes No No

Props_flash2w_entr Yes Yes Yes Yes No Yes

Liquid-Liquid Props_lle Yes Yes No No Yes No

Liquid-Water Props_lwe Yes Yes No No No No

Page 139: ACM Library Reference Guide

4 Physical Properties Submodels 139

Using Submodels within your Models

Instancing a Submodel To use a property submodel within your model you need to create a named instance of the submodel and then relate the variables in the submodel to those within your model.

This example creates an instance of the submodel Props_liquid called pliq.

pliq as Props_liquid (T=T, P=P, x=x, h=hout, Rho=Rhoout);

In the variable list, the first name is that in the submodel, and the second name is that in the model. These may be the same or different , for example the variable Rho in the submodel is related to Rhoout in the model.

In this example, if T, P and x are Fixed in the model, the submodel will calculate hout and Rhoout. It would also be valid to fix P, x and hout and then submodel would then calculate T and Rhoout.

If you do not need to calculate the density in your model you can use the following:

pliq as Props_liquid (T=T, P=P, x=x, h=hout);

Rho is still calculated by the submodel, but it is not related to any variable in the model.

You can also relate variables in your model to those in the submodel using the following syntax:

pliq as Props_liquid;

pliq.T = T;

pliq.P = P

pliq.h = hout;

However declaring the submodel and the variable relationships in a single statement is usually more convenient.

Conditional Instancing You can instance arrays of property submodels. This is useful when you want to conditionally instance a submodel dependant upon some parameter. For

Page 140: ACM Library Reference Guide

4 Physical Properties Submodels 140

example to only instance pliq when the parameter ValidPhases is set to �Liquid�, use the following:

pliq ([1:(ValidPhases == "Liquid")]) as Props_liquid (T=T, P=P, x=x, h=hout, Rho=Rhoout);

The expression ValidPhases == "Liquid" evaluates to false (value of 0) if it is not true, and this make the array index set empty, so nothing is instanced. If the expression is true (value of 1), the index set is 1, and pliq(1) is instanced.

Changing Options You can specify non-default values for the flash method (FlashBasis) and properties mode (PropMode) in the call to the submodel, for example:

Pflash2 as Props_flash2 (T=T, P=P, z=zin, x=x, y=y, hl=hlout, hv=hvout, vf=vf, PropMode:�Rigorous�, FlashBasis:�Procedure�);

Bubble Point and Dew Point Calculations To use one of the submodels to perform a bubble point or dew point calculation you need to specify the required vapor fraction. The calculated vapor fraction variable (vf) does not uniquely define whether the system is at dew point or bubble point, for example a value of 1 could mean that the system is at is dew point, or is superheated.

To handle this situation a separate required vapor fraction variable (vfR) has been introduced. Fixing this to 1 uniquely defines the system to be at its dew point, and fixing it to 0 uniquely defines it to be at bubble point.

To perform a two-phase dew point calculation you can use the following :

Pflash2 as Props_flash2 (T=T, P=P, z=zin, h=hout);

Pflash2.vfR: Fixed, 1;

The second line Fixes vfR to a value of 1 (dew point). By default vfR is not fixed. Note that if you fix vfR you should be careful to directly or indirectly fix only one other of T, P and h.

Running Simulations that use the Submodels Once you have created one or more models that use property models and have assembled a flowsheet that uses these models, you can still control how the property submodels work.

Page 141: ACM Library Reference Guide

4 Physical Properties Submodels 141

You can change the property mode and flash basis for individual submodel instances, or globally for the entire simulation.

To change for an individual submodel, open the AllVariables table for the block, and scroll down until you find the submodel variables and parameters. Then change the value of PropMode or FlashBasis within the submodel as required.

To change the values for all submodels in the simulation globally, open the Simulation Globals form, and change the values of GlobalPropMode or GlobalFlashBasis as required.

You can also change the value of the tolerance used by the SmoothEquation flash method. This is called FlashSmoothTol in the submodel, and GlobalFlashSmoothTol globally.

Physical Property Submodel Details This section describes the model parameters and variables for each property submodel.

Props_liquid Props_liquid calculates liquid phase properties at known composition, pressure, and either temperature or molar enthalpy. It can be used to calculate polymer properties.

Parameter Description Valid values

PropMode The physical property calculation method (defaults to GlobalPropMode, which itself defaults to Local)

Local

Rigorous

PolymerProp Specified whether polymer properties are to be calculated using Polymers Plus. If Yes, Rigorous properties are always used.

Yes

No (Default)

Variable Description Units

T Temperature C

P Pressure bar

x( ) Liquid mole fractions kmol/kmol

h Liquid molar enthalpy GJ/kmol

Rho Liquid molar density kmol/m3

Rhom Liquid mass density kg/m3

MW Liquid molar weight kg/kmol

zmomc Polymer zeroth moment (only present if PolymerProp=�Yes�)

mol/kg

sflowc() Polymer segment flow (only present if PolymerProp=�Yes�)

mol/kg

smomc Polymer second moment (only present if kmol/kg

Page 142: ACM Library Reference Guide

4 Physical Properties Submodels 142

PolymerProp=�Yes�)

Example usage:

pliq as Props_liquid (T=Tout, P=P, x=zout, h=hout, Rho=Rhoout);

Props_liq_entr Props_liq_entr calculates liquid phase properties, including molar entropy, at known composition, pressure, and either temperature, molar enthalpy or molar entropy.

Parameter

Description Valid values

PropMode The physical property calculation method (defaults to GlobalPropMode, which itself defaults to Local)

Local

Rigorous

Variable Description Units

T Temperature C

P Pressure bar

x( ) Liquid mole fractions kmol/kmol

h Liquid molar enthalpy GJ/kmol

s Liquid molar entropy kJ/kmol/K

Rho Liquid molar density kmol/m3

Rhom Liquid mass density kg/m3

MW Liquid molar weight kg/kmol

Example usage:

pliq as Props_liq_entr (T=Tout, P=P, x=zout, h=hout, s=sout, Rho=Rhoout);

Props_vapor Props_vapor calculates vapor phase properties at known composition, pressure, and either temperature or molar enthalpy.

Parameter Description Valid values

PropMode The physical property calculation method (defaults to GlobalPropMode, which itself defaults to Local)

Local

Rigorous

Variable Description Units

T Temperature C

P Pressure bar

Page 143: ACM Library Reference Guide

4 Physical Properties Submodels 143

y( ) Vapor mole fractions kmol/kmol

h Vapor molar enthalpy GJ/kmol

Rho Vapor molar density kmol/m3

MW Vapor molar weight kg/kmol

Example usage:

pvap as Props_vapor (T=Tout, P=P, y=zout, h=hout, Rho=Rhoout);

Props_vap_entr Props_vap_entr calculates vapor phase properties, including entropy, at known composition, pressure, and either temperature, molar enthalpy or molar entropy.

Parameter Description Valid values

PropMode The physical property calculation method (defaults to GlobalPropMode, which itself defaults to Local)

Local

Rigorous

Variable Description Units

T Temperature C

P Pressure bar

y( ) Vapor mole fractions kmol/kmol

h Vapor molar enthalpy GJ/kmol

s Vapor molar entropy kJ/kmol/K

Rho Vapor molar density kmol/m3

MW Vapor molar weight kg/kmol

Example usage:

pvap as Props_vap_entr (T=Tout, P=P, y=zout, h=hout, s=sout, Rho=Rhoout);

Props_flash2 Given the temperature, pressure and composition of a fluid, Props_flash2 performs a vapor-liquid flash and calculates:

• Vapor molar fraction

• Phase compositions

• Phase and overall molar enthalpy

• Phase molar weights

• Phase molar densities

If the overall molar enthalpy or vapor molar fraction is known, these can be specified and temperature or pressure is calculated.

Page 144: ACM Library Reference Guide

4 Physical Properties Submodels 144

Props_flash2 can be used to calculate properties for polymer systems.

Parameter Description Valid values

PropMode The physical property calculation method (defaults to GlobalPropMode, which itself defaults to Local)

Local

Rigorous

FlashBasis The flash method to be used (defaults to GlobalFlashBasis, which itself defaults to Equation)

Equation

SmoothEquation

Procedure

ProcedurePH

ProcedurePV

ProcedureTV

Efftype Efficiency method Vaporization (default)

Murphree

PolymerProp Specified whether polymer properties are to be calculated using Polymers Plus. If Yes, Rigorous properties are always used.

Yes

No (Default)

FlashSmoothTol Tolerance for use by SmoothEquation flash option

0 to 0.1

default=1e-6

Variable Description Units

T Temperature C

P Pressure bar

x( ) Liquid mole fractions kmol/kmol

y( ) Vapor mole fractions kmol/kmol

z( ) Overall mole fractions kmol/kmol

lf Liquid molar fraction kmol/kmol

vf Vapor molar fraction kmol/kmol

vfR Required vapor fraction kmol/kmol

hl Liquid molar enthalpy GJ/kmol

hv Vapor molar enthalpy GJ/kmol

h Overall molar enthalpy GJ/kmol

Rhol Liquid molar density kmol/m3

Rhoml Liquid mass density kg/m3

Rhov Vapor molar density kmol/m3

MWl Liquid molar weight kg/kmol

MWv Vapor molar weight kg/kmol

eff() Component efficiencies Default=1.

yin() Inlet vapor mole fractions (used only when Efftype=Murphree)

kmol/kmol

zmomc Polymer zeroth moment (only present if PolymerProp=�Yes�)

mol/kg

sflowc() Polymer segment flow (only present if PolymerProp=�Yes�)

mol/kg

smomc Polymer second moment (only present if PolymerProp=�Yes�)

kmol/kg

Example usage:

Page 145: ACM Library Reference Guide

4 Physical Properties Submodels 145

pflash2 as Props_flash2 (T=Tout, P=P, z=zout, h=hout, x=xout, y=yout, vf=vf, rhol=rholout, rhov=rhovout);

Props_flash2_entr Given the temperature, pressure and composition of a fluid, Props_flash2 performs a vapor-liquid flash and calculates:

• Vapor molar fraction

• Phase compositions

• Phase and overall molar enthalpy

• Phase and overall molar entropy

• Phase molar weights

• Phase molar densities

If the overall molar enthalpy, molar entropy or vapor molar fraction is known, these can be specified and temperature or pressure is calculated.

Parameter Description Valid values

PropMode The physical property calculation method (defaults to GlobalPropMode, which itself defaults to Local)

Local

Rigorous

FlashBasis The flash method to be used (defaults to GlobalFlashBasis, which itself defaults to Equation)

Equation

SmoothEquation

Procedure

ProcedurePH

ProcedurePV

ProcedureTV

Efftype Efficiency method Vaporization (default)

Murphree

FlashSmoothTol Tolerance for use by SmoothEquation flash option

0 to 0.1

default=1e-6

Variable Description Units

T Temperature C

P Pressure bar

x( ) Liquid mole fractions kmol/kmol

y( ) Vapor mole fractions kmol/kmol

z( ) Overall mole fractions kmol/kmol

lf Liquid molar fraction kmol/kmol

vf Vapor molar fraction kmol/kmol

vfR Required vapor fraction kmol/kmol

hl Liquid molar enthalpy GJ/kmol

hv Vapor molar enthalpy GJ/kmol

h Overall molar enthalpy GJ/kmol

sl Liquid molar entropy kJ/kmol/K

sv Vapor molar entropy kJ/kmol/K

s Overall molar entropy kJ/kmol/K

Page 146: ACM Library Reference Guide

4 Physical Properties Submodels 146

Rhol Liquid molar density kmol/m3

Rhoml Liquid mass density kg/m3

Rhov Vapor molar density kmol/m3

MWl Liquid molar weight kg/kmol

MWv Vapor molar weight kg/kmol

eff() Component efficiencies Default=1.

yin() Inlet vapor mole fractions (used only when Efftype=Murphree)

kmol/kmol

Example usage:

pflash2 as Props_flash2_entr (T=Tout, P=P, z=zout, h=hout, s=sout, x=xout, y=yout, vf=vf, rhol=rholout, rhov=rhovout);

Props_flash3 Given the temperature, pressure and composition of a fluid, Props_flash3 performs a vapor-liquid-liquid flash and calculates:

• Vapor and liquid molar fractions

• Phase compositions

• Phase and overall molar enthalpy

• Phase molar weights

• Phase molar densities

If the overall molar enthalpy or vapor molar fraction is known, these can be specified and temperature or pressure is calculated.

Parameter Description Valid values

PropMode The physical property calculation method (defaults to GlobalPropMode, which itself defaults to Local)

Local

Rigorous

FlashBasis The flash method to be used (defaults to GlobalFlashBasis, which itself defaults to Equation)

Equation

SmoothEquation

Procedure

ProcedurePH

ProcedurePV

ProcedureTV

Efftype Efficiency method Vaporization (default)

Murphree

FlashSmoothTol Tolerance for use by SmoothEquation flash option

0 to 0.1

default=1e-6

Variable Description Units

T Temperature C

P Pressure bar

x1( ) Liquid 1 mole fractions kmol/kmol

x2( ) Liquid 2 mole fractions kmol/kmol

y( ) Vapor mole fractions kmol/kmol

Page 147: ACM Library Reference Guide

4 Physical Properties Submodels 147

z( ) Overall mole fractions kmol/kmol

lf1 Liquid 1 molar fraction kmol/kmol

lf2 Liquid 2 molar fraction kmol/kmol

vf Vapor molar fraction kmol/kmol

vfR Required vapor fraction kmol/kmol

hl1 Liquid 1 molar enthalpy GJ/kmol

hl2 Liquid 2 molar enthalpy GJ/kmol

hv Vapor molar enthalpy GJ/kmol

h Overall molar enthalpy GJ/kmol

Rhol1 Liquid 1 molar density kmol/m3

Rhol2 Liquid 2 molar density kmol/m3

Rhoml1 Liquid 1 mass density kg/m3

Rhoml2 Liquid 2 mass density kg/m3

Rhov Vapor molar density kmol/m3

MWl1 Liquid 1 molar weight kg/kmol

MWl2 Liquid 2 molar weight kg/kmol

MWv Vapor molar weight kg/kmol

eff1() Liquid 1 component efficiencies Default=1.

eff2() Liquid 2 component efficiencies Default=1.

yin() Inlet vapor mole fractions (used only when Efftype=Murphree)

kmol/kmol

Example usage:

pflash3 as Props_flash3 (T=Tout, P=P, z=zout, h=hout, x1=x1out, x2=x2out, y=yout, vf=vf, lf1=lf1, rhol1=rhol1out, rhol2=rhol2out, rhov=rhovout);

Props_flash3_entr Given the temperature, pressure and composition of a fluid, Props_flash3_entr performs a vapor-liquid-liquid flash and calculates:

• Vapor and liquid molar fractions

• Phase compositions

• Phase and overall molar enthalpy

• Phase and overall molar entropy

• Phase molar weights

• Phase molar densities

If the overall molar enthalpy or vapor molar fraction is known, these can be specified and temperature or pressure is calculated.

Parameter Description Valid values

PropMode The physical property calculation method (defaults to GlobalPropMode, which itself defaults to Local)

Local

Rigorous

FlashBasis The flash method to be used (defaults to GlobalFlashBasis, which itself defaults to Equation)

Equation

SmoothEquation

Page 148: ACM Library Reference Guide

4 Physical Properties Submodels 148

Procedure

ProcedurePH

ProcedurePV

ProcedureTV

Efftype Efficiency method Vaporization (default)

Murphree

FlashSmoothTol Tolerance for use by SmoothEquation flash option

0 to 0.1

default=1e-6

Variable Description Units

T Temperature C

P Pressure bar

x1( ) Liquid 1 mole fractions kmol/kmol

x2( ) Liquid 2 mole fractions kmol/kmol

y( ) Vapor mole fractions kmol/kmol

z( ) Overall mole fractions kmol/kmol

lf1 Liquid 1 molar fraction kmol/kmol

lf2 Liquid 2 molar fraction kmol/kmol

vf Vapor molar fraction kmol/kmol

vfR Required vapor fraction kmol/kmol

hl1 Liquid 1 molar enthalpy GJ/kmol

hl2 Liquid 2 molar enthalpy GJ/kmol

hv Vapor molar enthalpy GJ/kmol

h Overall molar enthalpy GJ/kmol

sl1 Liquid 1 molar entropy kJ/kmol/K

sl2 Liquid 2 molar entropy kJ/kmol/K

sv Vapor molar entropy kJ/kmol/K

s Overall molar entropy kJ/kmol/K

Rhol1 Liquid 1 molar density kmol/m3

Rhol2 Liquid 2 molar density kmol/m3

Rhoml1 Liquid 1 mass density kg/m3

Rhoml2 Liquid 2 mass density kg/m3

Rhov Vapor molar density kmol/m3

MWl1 Liquid 1 molar weight kg/kmol

MWl2 Liquid 2 molar weight kg/kmol

MWv Vapor molar weight kg/kmol

eff1() Liquid 1 component efficiencies. Default=1.

eff2() Liquid 2 component efficiencies. Default=1.

yin() Inlet vapor mole fractions (used only when Efftype=Murphree)

kmol/kmol

Example usage:

pflash3_entr as Props_flash3 (T=Tout, P=P, z=zout, h=hout, s=sout, x1=x1out, x2=x2out, y=yout, vf=vf, lf1=lf1, rhol1=rhol1out, rhol2=rhol2out, rhov=rhovout);

Page 149: ACM Library Reference Guide

4 Physical Properties Submodels 149

Props_flash2w Given the temperature, pressure and composition of a fluid, Props_flash2w performs a vapor-liquid-water flash and calculates:

• Vapor and liquid molar fractions

• Phase compositions

• Phase and overall molar enthalpy

• Phase molar weights

• Phase molar densities

If the overall molar enthalpy or vapor molar fraction is known, these can be specified and temperature or pressure is calculated.

This submodel requires that the component water is present in your simulation, and that the name used for this component is assigned to the Global variable WaterID. This enables the submodel to know which component is water. The default value of WaterID is �Water�. If you use a different name, such as �H2O�, the value of WaterID must be changed to match this.

Parameter Description Valid values

PropMode The physical property calculation method (defaults to GlobalPropMode, which itself defaults to Local)

Local

Rigorous

FlashBasis The flash method to be used (defaults to GlobalFlashBasis, which itself defaults to Equation)

Equation

SmoothEquation

Procedure

ProcedurePH

ProcedurePV

ProcedureTV

Efftype Efficiency method Vaporization (default)

Murphree

FlashSmoothTol Tolerance for use by SmoothEquation flash option

0 to 0.1

default=1e-6

Variable Description Units

T Temperature C

P Pressure bar

x1( ) Liquid phase mole fractions kmol/kmol

y( ) Vapor mole fractions kmol/kmol

z( ) Overall mole fractions kmol/kmol

lf1 Liquid molar fraction kmol/kmol

lf2 Water molar fraction kmol/kmol

vf Vapor molar fraction kmol/kmol

vfR Required vapor fraction kmol/kmol

hl1 Liquid molar enthalpy GJ/kmol

hl2 Water molar enthalpy GJ/kmol

hv Vapor molar enthalpy GJ/kmol

Page 150: ACM Library Reference Guide

4 Physical Properties Submodels 150

h Overall molar enthalpy GJ/kmol

Rhol1 Liquid molar density kmol/m3

Rhol2 Water molar density kmol/m3

Rhoml1 Liquid mass density kg/m3

Rhoml2 Water mass density kg/m3

Rhov Vapor molar density kmol/m3

MWl1 Liquid molar weight kg/kmol

MWl2 Water molar weight kg/kmol

MWv Vapor molar weight kg/kmol

eff1() Liquid component efficiencies. Default=1.

eff2 Water component efficiency. Default=1.

yin() Inlet vapor mole fractions (used only when Efftype=Murphree)

kmol/kmol

Example usage:

Pflash2w as Props_flash2w (T=Tout, P=P, z=zout, h=hout, x1=x1out, y=yout, vf=vf, lf1=lf1, rhol1=rhol1out, rhol2=rhol2out, rhov=rhovout);

Props_lle Given the temperature, pressure and composition of a fluid, Props_lle performs a liquid-liquid equilibrium calculation, and calculates:

• Molar fractions of each liquid phase

• Phase compositions

• Phase and overall molar enthalpy

• Phase molar weights

• Phase molar and mass densities

Props_lle includes the option to calculate liquid-liquid equilibrium k values using the following correlation:

Klli = exp(kll_a i + kll_b i /Tabs + kll_c i.ln(Tabs) + kll_d i.Tabs)

Where:

Klli = Liquid-liquid k value for component I

Tabs = Absolute temperature (K)

To use this option set KLLSpec to �KLL correlation�, and enter values for the coefficients kll_a, kll_b, kll_c and kll_d for each component. If KLLSpec is set to �Property method� then the Kll values are calculated using either Local or Rigorous properties as specified by PropMode.

Parameter Description Valid values

PropMode The physical property calculation method (defaults to GlobalPropMode, which itself defaults to Local)

Local

Rigorous

Page 151: ACM Library Reference Guide

4 Physical Properties Submodels 151

FlashBasis The flash method to be used (defaults to GlobalFlashBasis, which itself defaults to Equation)

Equation

SmoothEquation

FlashSmoothTol Tolerance for use by SmoothEquation flash option

0 to 0.1

default=1e-6

KLLSpec Liquid-liquid equilibrium calculation method

Property method (default)

KLL correlation

Variable Description Units

T Temperature C

P Pressure bar

x1( ) Liquid 1 mole fractions kmol/kmol

x2( ) Liquid 2 mole fractions kmol/kmol

z( ) Overall mole fractions kmol/kmol

lf1 Liquid 1 molar fraction kmol/kmol

lf2 Liquid 2 molar fraction kmol/kmol

hl1 Liquid 1 molar enthalpy GJ/kmol

hl2 Liquid 2 molar enthalpy GJ/kmol

h Overall molar enthalpy GJ/kmol

Rhol1 Liquid 1 molar density kmol/m3

Rhol2 Liquid 2 molar density kmol/m3

Rhoml1 Liquid 1 mass density kg/m3

Rhoml2 Liquid 2 mass density kg/m3

MWl1 Liquid 1 molar weight kg/kmol

MWl2 Liquid 2 molar weight kg/kmol

eff() Component equilibrium efficiencies. Default = 1.

kll_a() KLL correlation first polynomial coefficients

kll_b() KLL correlation first polynomial coefficients

kll_c() KLL correlation first polynomial coefficients

kll_d() KLL correlation first polynomial coefficients

Example usage:

plle as Props_lle (T=Tout, P=P, z=zout, h=hout, x1=x1out, x2=x2out, lf1=lf1, rhol1=rhol1out, rhol2=rhol2out);

Props_lwe Given the temperature, pressure and composition of a fluid, Props_lwe performs a liquid-water equilibrium calculation, and calculates:

• Molar fractions of each phase

• Liquid composition

• Phase and overall molar enthalpy

• Phase molar weights

• Phase molar and mass densities

Page 152: ACM Library Reference Guide

4 Physical Properties Submodels 152

Parameter Description Valid values

PropMode The physical property calculation method (defaults to GlobalPropMode, which itself defaults to Local)

Local

Rigorous

FlashBasis The flash method to be used (defaults to GlobalFlashBasis, which itself defaults to Equation)

Equation

SmoothEquation

Procedure

ProcedurePH

ProcedurePV

ProcedureTV

FlashSmoothTol Tolerance for use by SmoothEquation flash option

0 to 0.1

default=1e-6

Variable Description Units

T Temperature C

P Pressure bar

x1( ) Liquid mole fractions kmol/kmol

z( ) Overall mole fractions kmol/kmol

lf1 Liquid molar fraction kmol/kmol

lf2 Water molar fraction kmol/kmol

hl1 Liquid molar enthalpy GJ/kmol

hl2 Water molar enthalpy GJ/kmol

h Overall molar enthalpy GJ/kmol

Rhol1 Liquid molar density kmol/m3

Rhol2 Water molar density kmol/m3

Rhoml1 Liquid mass density kg/m3

Rhoml2 Water mass density kg/m3

MWl1 Liquid molar weight kg/kmol

MWl2 Water molar weight kg/kmol

eff Water equilibrium efficiency. Default = 1.

Example usage:

plwe as Props_lle (T=Tout, P=P, z=zout, h=hout, x1=x1out, lf1=lf1, rhol1=rhol1out, rhol2=rhol2out);

Page 153: ACM Library Reference Guide

5 Utility Routines 153

5 Utility Routines

This chapter describes utility routines that you can use from within code which you interface to Aspen Custom Modeler.

The utility routines are:

• ACM_Print - enables you to display messages within the Aspen Custom Modeler GUI.

• ACM_Rqst - enables you to access the values of simulation options.

ACM_Print Routine This section describes using the ACM_Print routine to display diagnostic messages:

• Calling the ACM_PRINT routine from Fortran code.

• Calling the ACM_Print routine from C code.

Calling Routine ACM_PRINT from Fortran You can call the routine ACM_PRINT in your Fortran code as follows:

Syntax for ACM_PRINT Fortran Interface call ACM_PRINT(status, format, arg1, arg2, arg3, arg4, arg5)

status Integer code that defines the current state of the

simulation:

0 or positive values. Values in this range indicate success or information status. Messages are printed to the Simulation Messages window.

Negative values. Values in this range indicate an error or fatal error. Messages are printed to both the Simulation Messages window and a pop-up dialog box containing the error message.

Always pass a value of 0 or -1 where 0 means generic success and -1 means fatal error for which you return IFAIL=4 in your routine.

Format Character string that contains text and formatting codes that defines the format of the final

Page 154: ACM Library Reference Guide

5 Utility Routines 154

message. The format descriptors are based on the C format codes

argn Values to appear in the message. The order of the arguments must correspond to the order of the formatting codes within the formatting string.

ACM_PRINT Remarks for Fortran Interface

Your syntax must contain five arguments (apart from status and format). You must set any arguments that are not used to 0.

You can use normal C formatting codes (%d, %f, %s, %e, %E, %G), including any field width and decimal place counts.

The following format characters are valid:

Character Explanation

% Percent character. Lead character for format specification.

- Optional minus sign. A minus sign left justifies the number. Without the minus sign, the number is right justified.

d Decimal notation

f Decimal notation of the form [-]mmm.ddd, where the number of d's is specified by the precision. The default precision is 6; a precision of 0 suppresses the decimal point.

e, E Decimal notation of the form [-]m.dddddde+xx or [-]m.ddddddE+xx, where the number of ds is specified by the precision. The default precision is 6; a precision of 0 suppresses the decimal point.

g,G %e or %E is used if the exponent is less than -4 or greater than or equal to the precision; otherwise %f is used. Trailing zeros and a trailing decimal point are not printed.

S Characters from the string are printed until a '\0' is reached or until the number of characters indicated by the precision have been printed.

Example Formats

%10.0f Prints whole numbers, with no decimal digits or exponents.

%10.nf Prints numbers with exponents and with n digits to the right of the decimal point.

%10.nE Prints numbers in exponential notation, with n+1 significant digits.

%5d Prints an integer in 5 places (use this format for integers).

For Fortran, you would typically use the following escape sequences in your message:

Sequence Explanation

\n new line

\\ backslash

\? question mark

\' single quote

\" double quote

Page 155: ACM Library Reference Guide

5 Utility Routines 155

Note: Some Fortran compilers (notably DEC Fortran) pass CHARACTER* variables as two arguments: the string itself, followed by its length. This is correctly handled by ACM_PRINT if the format character is s, but you must reduce the number of arguments by 1 for each CHARACTER* variable passed. Failure to do this will result in an unresolved reference to ACM_PRINT because of the mismatch in the number of its arguments.

Examples of Using ACM_PRINT from Fortran

In the following example, the variable OPEN will be printed to the Simulation Messages window with a value of 1:

DOUBLE PRECISION OPEN

OPEN = 1D0

CALL ACM_PRINT(0,'OPEN = %f',OPEN,0,0,0,0)

The following example shows how to print a message when a fatal error has occurred in your Fortran:

CHARACTER*45 TEXT

INTEGER N

:

TEXT = 'The value %d is outside the valid range.\n'

CALL ACM_PRINT (-1,TEXT,N,0,0,0,0)

IFAIL = 4

Calling Routine ACM_Print from C You can call the routine ACM_Print in your C code as follows:

Syntax for C Interface void ACM_Print(int status, char *_Zform, ...);

status Integer code that defines the current state of the

simulation

0 or positive values. Values in this range indicate success or information status. Messages are printed to the Simulation Messages window.

Negative values. Values in this range indicate an error or fatal error. Messages are printed to both the Simulation Messages window and a pop-up dialog box containing the error message.

Always pass a value of 0 or -1 where 0 means generic success and -1 means fatal error for which you return IFAIL=4 in your routine.

Zform Character string that contains text and formatting

Page 156: ACM Library Reference Guide

5 Utility Routines 156

codes that defines the format of the final message. The format descriptors are based on the C format codes.

� Variable number of arguments that are assumed to be void *. Hence, all variable arguments should be passed by address.

ACM_Print Remarks for C Interface

Your syntax can contain any number of arguments (apart from status and format). You must set any arguments that are not used to be omitted.

You can use normal C formatting codes (%d, %f, %s, %e, %E, %G), including any field width and decimal place counts.

The following format values are valid:

Variable Explanation

% Percent character. Lead character for format specification.

- Optional minus sign. A minus sign left justifies the number. Without the minus sign, the number is right justified.

D Decimal notation

f Decimal notation of the form [-]mmm.ddd, where the number of d's is specified by the precision. The default precision is 6; a precision of 0 suppresses the decimal point.

e, E Decimal notation of the form [-]m.dddddde+xx or [-]m.ddddddE+xx, where the number of ds is specified by the precision. The default precision is 6; a precision of 0 suppresses the decimal point.

g,G %e or %E is used if the exponent is less than -4 or greater than or equal to the precision; otherwise %f is used. Trailing zeros and a trailing decimal point are not printed.

s Characters from the string are printed until a '\0' is reached or until the number of characters indicated by the precision have been printed.

Example Formats

%10.0f Prints whole numbers, with no decimal digits or exponents

%10.nf Prints numbers with exponents and with n digits to the right of the decimal point,

%10.nE Prints numbers in exponential notation, with n+1 significant digits

You can also include the following escape sequences in your message:

Variable Explanation

\a alert (bell) character

\b backspace

\f form feed

\n new line

\r carriage return

\t horizontal tab

\v vertical tab

Page 157: ACM Library Reference Guide

5 Utility Routines 157

\\ backslash

\? question mark

\' single quote

\" double quote

\ooo octal number

\xhh hexadecimal number

Example of Using ACM_PRINT from C

The following example shows using ACM_PRINT from C:

int option = ACM_TIME;

int iinfo;

char *sinfo;

int jflag;

double Time;

/* get the value of the current simulation time */ jflag = ACM_Rqst(&option, &iinfo, &Time, &sinfo);

/* write current time to simulation message � passing by address */

ACM_Print(0, "Current Time = %g",&Time);

ACM_Rqst Routine ACM_Rqst is a supplied Fortran or C utility routine that enables your routines to access the values of parameters that are defined in the Options definition. ACM_Rqst can be called from both Fortran and C. It is supplied in the library atdll.lib in the Procedures folder of the Aspen Custom Modeler installation.

Calling Routine ACM_RQST from Fortran You can call the routine ACM_RQST in your Fortran code as follows:

Syntax for ACM_RQST Fortran Interface call ACM_RQST(REQSTR, IINFO, XINFO, SINFO, JFLAG)

REQSTR For valid values, see Values for REQSTR in Fortran and

ACM_Option Tokens in C on page 5-159.

IINFO Integer*4

XINFO Double precision real

SINFO String

JFLAG An integer flag set by ACM_RQST to inform the calling routine of the type of information requested. On exit from the routine, JFLAG will have one of the following values:

Page 158: ACM Library Reference Guide

5 Utility Routines 158

-1 indicates an illegal request; no information is returned

1 indicates that an integer is returned in IINFO

2 indicates that an double precision real is returned in XINFO

3 indicates that a string is returned in SINFO

4 indicates that a string and an integer are returned in SINFO and IINFO respectively

5 indicates that a string and a double precision real are returned in SINFO and XINFO respectively.

Calling Routine ACM_Rqst from C or C++

You can call the routine ACM_Rqst in your C code as follows:

Syntax for ACM_Rqst C Interface int option = ACM_option; int iinfo; double xinfo; char *sinfo; int jflag; jflag = ACM_Rqst(&option, &iinfo, &xinfo, &sinfo);

ACM_option For valid values, see Values for REQSTR in Fortran

and ACM_Option Tokens in C on page 5-159.

iinfo int xinfo double sinfo char* jflag A return code from ACM_Rqst which indicates what

kind(s) of information have been returned.

Possible vaules for this are #defined in atdll.h, which is in the Procedures folder of your Aspen Custom Modeller installation.

The following values may be returned:

ACM_RQST_ILLEGAL - The ACM_Option requested is not supported. iinfo, xinfo and sinfo values are undefined.

ACM_RQST_INTEGER - An integer value has been returned in iinfo; xinfo and sinfo are undefined.

ACM_RQST_DOUBLE - A double value has been returned in xinfo; iinfo and sinfo are undefined.

ACM_RQST_STRING - A string may have been returned in sinfo (see note below); iinfo and xinfo are undefined

ACM_RQST_STRING_AND_INT - An integer value has been returned in iinfo and a string may have been returned in sinfo. xinfo is undefined.

ACM_RQST_STRING_AND_DOUBLE - A double value has been returned in xinfo and a string may have been returned in sinfo. iinfo is undefined.

Note: When ACM_Rqst returns a string, it will have been allocated off the heap, and should be freed by the user (using delete [] or free()).

If you pass a NULL pointer for the string data, then

Page 159: ACM Library Reference Guide

5 Utility Routines 159

the string will neither be allocated nor returned; use this if you do not need the string form of the data. Note that the return code will still indicate that a string could be returned.

For Example: option = ACM_TIME_UOM;

jflag = ACM_Rqst(&option, &iinfo, &xinfo, &sinfo);

if (jflag == ACM_RQST_STRING_AND_INT)

{

/* xinfo contains the scale factor to convert Time -> hours, sinfo contains the Time UOM */

ACM_Print(0, "Time is measured in %s, scale factor=%g",sinfo,&xinfo);

delete [] sinfo; /* In C: free(sinfo). Do this or you'll have a memory leak */ }

Or, avoiding the allocation of the returned string: option = ACM_TIME_UOM;

jflag = ACM_Rqst(&option, &iinfo, &xinfo,NULL);

if (jflag == ACM_RQST_STRING_AND_INT)

{

/* xinfo contains the scale factor to convert Time -> hours */

ACM_Print(0, "Time scale factor=%g",&xinfo);

}

Values for REQSTR in Fortran and ACM_Option Tokens in C

The following values (Fortran) and tokens (C) are allowed.

C and C++ users will find the tokens are #defined in atdll.h in the Procedures folder of your Aspen Custom Modeller installation.

Strings are returned to Fortran as CHARACTER*40 variables, and to C and C++ as dynamically allocated strings which the caller should delete (for more information see Calling Routine ACM_Rqst from C or C++: Fortran Value

C Token

Description Type of information returned

1 ACM_ABS_TOL Absolute tolerance Double Precision

2 ACM_BOUND_FRAC Bound fraction Double Precision

3 ACM_DOG_LEG Dogleg switch Integer 0=off, 1=on

4 ACM_VAR_CHANGE_TOL Variable Change Tolerence

Double Precision

5 ACM_EVENT_TOL Event tolerance Double Precision (Only used by Gear 11 integrator)

8 ACM_INI_INT_STEP Initial integration step Double Precision

10 ACM_ITERATIONS Iterations Integer

12 ACM_MAX_INT_STEP Maximum integration step

Double Precision

Page 160: ACM Library Reference Guide

5 Utility Routines 160

14 ACM_MAX_STEP_RED Maximum number of consecutive returns

Integer

15 ACM_MAX_VAR_STEP Initial maximum step Double precision real

16 ACM_MIN_NON_ZERO Minimum variable size Double precision real

17 ACM_MIN_INT_STEP Minimum integration step Double precision real

18 ACM_RUN_MODE Current run mode Integer and String:

1 - Steady State

2 - Optimization

3 - Parameter Estimation or Data Reconciliation (returns string 'Estimation')

4 - Dynamic

5 - Initialization

19 ACM_OPT_TOL Optimization tolerance Double precision real

20 ACM_PRINT_LEVEL Print level Integer

21 ACM_PROP_LEVEL Property print level Integer

22 ACM_RANGE_FRAC Range fraction Double precision real

24 ACM_REINIT Reinitialization Integer and String:

0 - Normal

1 - Fast

2 - Save

25 ACM_REL_TOL Relative tolerance Double precision real

26 ACM_RES_TOL Residual tolerance Double precision real

28 ACM_SINGUL_FACT Arbitrary perturbation Double precision real

30� ACM_TEAR Tearing option Integer and String:

0 - Off

1 - Update

2 - Start

3 - Complete

31 ACM_TIME Current integration time Double precision

32 ACM_COMM_INT Communication interval Double precision real

33 ACM_REL_TEAR_TOL Relative tear tolerance Double precision

34 ACM_ABS_TEAR_TOL Absolute tear tolerance Double precision

35 ACM_SOLUTION_MODE Current solution mode Integer and String:

1 - SS

2 - Init

3 - Re-Init

4 - Dyn

36�� ACM_TEAR_ERR_TOL Absolute tear integration error tolerance

Double precision

37 ACM_INTEGRATOR Integrator Integer and String:

1 - ImpEuler 11.1

2 - VSIE 11.1

3 - Explicit Euler

4 - Runge Kutta 4

5 - Gear 11.1

6 - Gear

7 - Implicit Euler

38 ACM_TEAR_METHOD Tearing update method Integer and String:

Page 161: ACM Library Reference Guide

5 Utility Routines 161

0 - Wegstein

1 - Direct

39 ACM_RUN_NUMBER Run number Integer

40���

ACM_TEAR_STATE Indicates if tearing is active

Integer 0 = Inactive 1 = Active

41����

ACM_TIME_UOM The units of measurement of time

Double Precision and String

42�����

ACM_REL_TEAR_ERR_TOL

Relative tear integration error tolerance

Double Precision

� The value returned by ACM_TEAR (30) only depends on the tearing option specified on the Solver Options, Tearing tab. This value may be ignored by some integrators: use ACM_TEAR_STATE (40) to determine if tearing is active. �� Only valid for VSIE(11.1), Implicit Euler and Gear integrators ��� The value returned by ACM_TEAR_STATE (40) indicates whether tearing is active in the current combination of options. The GEAR integrator does not support tearing and will return 0. The other integrators will return 1 unless tearing is OFF in the Solver Options, . Tearing tab. ���� ACM_TIME_UOM (41) returns 2 things: a character string which is the currently selected units of measurement for modelling time in the Run Options. It also returns a double which is the factor required to convert the units of time back to the default modelling time units (Hours), according to: Default Units = Actual Units / factor. ���� Only valid for Implicit Euler and Gear integrators

ACM_GetComponents Routine ACM_ GetComponents is a supplied Fortran or C utility routine that enables your routines to access the names of the components of the relevant stream type. It is intended to be used from procedures that specify PROPERTIES as one of the options in the procedure definition. ACM_ GetComponents can be called from both Fortran and C/C++. It is supplied in the library atdll.lib in the Procedures folder of the Aspen Custom Modeler installation.

Calling Routine ACM_GETCOMPONENTS from Fortran You can call the routine ACM_GETCOMPONENTS from your Fortran as follows:

Syntax for ACM_GETCOMPONENTS Fortran Interface

Call ACM_GETCOMPONENTS(ITYPE, NCOMP, COMPNAMES, STATUS)

ITYPE Integer. This will be passed to your procedure to identify which component list is associated with the procedure.

Page 162: ACM Library Reference Guide

5 Utility Routines 162

NCOMP Integer. The number of components in the component list. This will be the same as the size of one or more array arguments of the procedure.

COMPNAMES Character*40(NCOMP) Array of strings returned by ACM_GETCOMPONENTS

STATUS Integer. A zero or positive value indicates success, a negative value indicates failure.

Calling Routine ACM_GetComponents from C/C++ You can call the routine ACM_GETCOMPONENTS from your C/C++ as follows:

Syntax for ACM_GetComponents C/C++ Interface

Prototype:

EXT_C_AS_C(ULONG) ACM_GetComponents(const int iType,

const int nComps,

char**ppCompList);

#include �atdll.h�

int iType, nComp;// You need to set these to values passed into your procedure

char ** ppCompNames = new char*[nComp];

for (int i=0;i<nComp;i++)

ppCompNames[I] = new char[41];

ULONG status = ACM_GetComponents(iType, nComp, ppCompNames)

iType int. This will be passed to your procedure to identify which component list is associated with the procedure.

nComp int. The number of components in the component list. This will be the same as the size of one or more array arguments of the procedure.

ppCompNames char** array of strings returned by ACM_GetComponent. It is the caller�s responsibility to allocate and de-allocate the memory required. Each string requires at most 41 bytes of memory.

status ULONG. A zero or positive value indicates success, a negative value indicates failure. This is in fact an HRESULT, and the following return values are possible:

E_FAIL � generic failure

Page 163: ACM Library Reference Guide

5 Utility Routines 163

E_NOINTERFACE � routine could not obtain the required interface.

E_INVALIDARG � one or more arguments are invalid.

S_OK � The call succeeded.

Note: The caller must eventually free the memory allocated for the strings: for (int i=0;i<nComp;i++) delete [] ppCompNames[i]; delete [] ppCompNames;

Routines Provided for Compatibility with SPEEDUP 5.5 The following routines are provided for compatibility with SPEEDUP 5.5:

• pSpRMod (returns the current run mode).

• pLMTD (calculates temperature difference).

• pLimit (limits variable values between bounds).

Procedure pSpRMod The pSpRMod procedure type returns the current run mode of the simulation as an integer:

Integer Meaning 1 Steady state

2 Optimization

3 Estimation or data reconciliation

4 Dynamic

5 Initialization

pSpRMod Input Variable Types

pSpRMod has no input variable types.

pSpRMod Output Variable Types

The output variable types for pSpRMod are:

Description Variable Type Base Units

Run mode Notype �

Page 164: ACM Library Reference Guide

5 Utility Routines 164

pSpRMod Example

The following is an example of the pSpRMod procedure type:

Call (RunMode) = psprmod (Alpha);

Procedure pLMTD The pLMTD procedure type calculates the temperature difference.

pLMTD Input Variable Types

The input variable types for pLMTD are:

Description Variable Type Base Units

Side 1 inlet temperature Temperature C

Side 2 inlet temperature Temperature C

Side 1 outlet temperature Temperature C

Side 2 outlet temperature Temperature C

Flow direction: Cocurrent or Countercurrent

StringParameter �

pLMTD Output Variable Types

The output variable types for pLMTD are:

Description Variable Type Base Units

Log mean temperature difference

RealVariable �

pLMTD Example

The following is an example of the pLMTD procedure type:

call (LMTD ) = pLmtd (T, Tmed_in, Out_P.T, Tmed_out, LMTDFlowDir);

Procedure pLimit The pLimit procedure limits variable values between upper and lower bounds.

pLimit Input Variable Types

The input variable types for pLimit are:

Description Variable Type Base Units

Unlimited variable RealVariable �

Lower bound Real �

Upper bound Real �

Page 165: ACM Library Reference Guide

5 Utility Routines 165

pLimit Output Variable Types

The output variable types for pLimit are:

Description Variable Type Base Units

Limited variable RealVariable �

pLimit Example

The following is an example of the pLimit procedure type:

call (Pdropc ) = pLimit(P_drop, dpmin, dpmax);

Page 166: ACM Library Reference Guide

6 Port Types 166

6 Port Types

This chapter describes the port type used to create your own ports:

• MainPort

MainPort Port Type The MainPort port type is used for unknown or mixed phase flow.

MainPort Variable Types

The variable types for MainPort are:

Description Variable Type Physical

Quantity Base Units

Molar flow rate Flow_mol MoleFlow kmol/hr

Mole fractions Molefraction(*) MoleFraction kmol/kmol

Temperature Temperature Temperature C

Pressure Pressure Pressure bar

Molar enthalpy Enth_mol MolarEnthalpy GJ/kmol

MainPort Example

The following is an example of the MainPort port type:

PORT MainPort

F AS flow_mol

Z (componentlist) AS molefraction

T AS temperature

P AS pressure

h AS enth_mol

END

Page 167: ACM Library Reference Guide

7 Variable Types 167

7 Variable Types

The following tables are a complete list of all the variable types arranged alphabetically.

A Variable Types Variable Value Lower

Bound Upper Bound

Physical Quantity

Base Units

act_coeff_liq 1 0 30 � �

angle 0 -7 7 Angle rad

angle_rad USES angle

� � � � �

area 1 0 1E6 Area m2

C Variable Types Variable Value Lower

Bound Upper Bound

Physical Quantity

Base Units

coefficient 1 -50 50 � �

conc_mole 0.5 0 100 MolarDensity kmol/m3

conc_mass 10.0 0 2000 MassDensity kg/m3

control_signal 1 -1E9 1E9 � �

conductivity 1.0 0.001 500 ThermalConductivity

W/m/K

cond_liq 0.20 0.01 10 ThermalConductivity

W/m/K

cond_vap 0.10 0.001 1 ThermalConductivity

W/m/K

constant 1.0 0.0 1E12 � �

cp_mass 1.0 0.1 10.0 MassHeatCapacity kJ/kg/K

cp_mass_liq USES cp_mass

1.0 0.1 10.0 � �

cp_mass_vap USES cp_mass

1.0 0.1 10.0 � �

cp_mol 100 1 1E3 MolarHeatCapacity

kJ/kmol/K

cp_mol_liq 100 1 1E3 � �

Page 168: ACM Library Reference Guide

7 Variable Types 168

USES cp_mol

cp_mol_vap USES cp_mol

100 1 1E3 � �

cv_mol 100 1 1E3 MolarHeatCapacity

kJ/kmol/K

cv_mol_liq USES cv_mol

100 1 1E3 � �

cv_mol_vap USES cv_mol

100 1 1E3 � �

D Variable Types Variable Value Lower

Bound Upper Bound

Physical Quantity

Base Units

delta_p 100 1 1E5 PressureDiffSmall

N/m2

dens_mass 1000 1E-30 25E3 MassDensity kg/m3

dens_mass_sol USES dens_mass

2000 250 25E3 � �

dens_mass_liq USES dens_mass

1000 1E-30 10E3 � �

dens_mass_vap USES dens_mass

1 1E-30 1000 � �

dens_mol 20 1E-30 5E3 MolarDensity kmol/m3

dens_mol_sol USES dens_mol

20 0.1 5E3 � �

dens_mol_liq USES dens_mol

20 0.001 5E3 � �

dens_mol_vap USES dens_mol

0.01 1E-30 250 � �

diffus_liq 1.5E -5 0 8E-5 Diffusivity cm2/s

diffus_vap 0.1 0 1 Diffusivity cm2/s

E Variable Types Variable Value Lower

Bound Upper Bound

Physical Quantity

Base Units

energy_act 1 -1E9 1E9 MolarEnthalpy

GJ/kmol

enthflow 1 -1E5 1E5 HeatFlow GJ/hr

enth_mass 0.5 -10 10 MassEnthalpy MJ/kg

enth_mass_liq USES enth_mass

0.5 -10 10 � �

Page 169: ACM Library Reference Guide

7 Variable Types 169

enth_mass_vap USES enth_mass

0.5 -10 10 � �

enth_mol 0.050 -1000 1000 MolarEnthalpy

GJ/kmol

enth_mol_sol USES enth_mol

0.025 -10 10 � �

enth_mol_liq USES enth_mol

0.025 -1000 1000 � �

enth_mol_vap USES enth_mol

0.060 -1000 1000 � �

entr_mol 0 -1E3 1E3 MolarEntropy kJ/kmol/K

entr_mol_sol USES entr_mol

0 -1E3 1E3 � �

entr_mol_liq USES entr_mol

0 -1E3 1E3 � �

entr_mol_vap USES entr_mol

0 -1E3 1E3 � �

F Variable Types Variable Value Lower

Bound Upper Bound

Physical Quantity

Base Units

flow_mass 1000 0 1E10 MassFlow kg/hr

flow_mass_liq USES flow_mass

1000 0 1E10 � �

flow_mass_vap USES flow_mass

1000 0 1E10 � �

flow_mass_ USES flow_mass

� -1e10 � � �

flow_mass_specific

1 -1E4 1E4 MassSpecificFlow

kg/hr/m2

flow_mol 10 0 1E8 MoleFlow kmol/hr

flow_mol_vap USES flow_mol

10 0 1E8 � �

flow_mol_liq USES flow_mol

10 0 1E8 � �

flow_mol_ USES flow_mol

� -1E8 � � �

flow_vol 1 0 1E12 VolumetricFlow m3/hr

flow_vol_vap USES flow_vol

1 0 1E12 � �

Page 170: ACM Library Reference Guide

7 Variable Types 170

flow_vol_liq USES flow_vol

1 0 1E12 � �

flow_vol_rpm 1 0 1E12 VolFlowPerRPM m3/hr/rpm

flux_mass 1 -1E6 1E6 MassFlux mg/s/m2

flux_mol 1 -1E4 1E4 MolarFlux kmol/s/m2

flux_vol 1 -1E4 1E4 VolumetricFlux m3/s/m2

fraction 0.5 0 1 � �

fricfactor 0.05 1E-5 20 � �

fuga_vap 0.5 0 10 � �

fuga_liq 0.5 0 5 � �

fuga_sol 0.1 0 2 � �

G Variable Types Variable Value Lower

Bound Upper Bound

Physical Quantity

Base Units

gibb_mol_sol 0 -1E3 1E3 MolarGibbs kJ/kmol

gte_one 1 1 1E30 � �

H Variable Types Variable Value Lower

Bound Upper Bound

Physical Quantity

Base Units

head 50 -1E6 1E6 Head kJ/kg

heat_react 1 -100 100 HeatOfReaction GJ/m3/hr

heat_flux 1 -1E5 1E5 HeatFlux kW/m2

heat_flux_liin 1 -1E8 1E8 HeatFluxLinear W/m

heat_trans_coeff 1 0 1E3 HeatTransferCoeff

kW/m2/K

holdup_heat 1 -1E5 1E5 Energy GJ

holdup_heat_liq USES holdup_heat

-1 -1E5 1E5 � �

holdup_heat_vap USES holdup_heat

1 -1E5 1E5 � �

holdup_mass 2.5 0 1E6 Mass kg

holdup_mass_liq USES holdup_mass

2.5 0 1E6 � �

holdup_mass_vap USES holdup_mass

2.5 0 1E6 � �

holdup_mol 2.5 0 1E6 Moles kmol

holdup_mol_liq USES holdup_mol

2.5 0 1E6 � �

holdup_mol_vap 2.5 0 1E6 � �

Page 171: ACM Library Reference Guide

7 Variable Types 171

USES holdup_mol

hookes_const 1E5 1 1E10 HookesConstant N/m

ht_coeff_area 10 1E-20 1E6 HTCoeffArea kW/K

K Variable Types Variable Value Lower

Bound Upper Bound

Physical Quantity

Base Units

k_value 1 1E-14 1E30 � �

L Variable Types Variable Value Lower

Bound Upper Bound

Physical Quantity

Base Units

length 1 0 5E6 Length m

length_delta 10 0 1000 LengthShort mm

length_short 10 0 100 LengthShort mm

liqfraction 0.5 0 1 MoleFraction kmol/kmol

liqmassfraction 0.5 0 1 MassFraction kg/kg

M Variable Types Variable Value Lower

Bound Upper Bound

Physical Quantity

Base Units

mass 10 0 1E7 Mass kg

massfraction 0.5 0 1 MassFraction kg/kg

molefraction 0.5 0 1 MoleFraction kmol/kmol

molweight 75 1 1E8 MolarWeight kg/kmol

moment_inertia 100 1E-3 1E4 MomentOfInertia kg m2

momentum 1 -5E3 5E3 Momentum tonne m/s

N Variable Types Variable Value Lower

Bound Upper Bound

Physical Quantity

Base Units

negative -1 -1E9 -1E-9 � �

neg_small

-1 -500 0 � �

neg_large

-1 -1E30 0 � �

notype 1 -1E30 1E30 � �

notype_small 1 -500 500 � �

Page 172: ACM Library Reference Guide

7 Variable Types 172

P Variable Types Variable Value Lower

Bound Upper Bound

Physical Quantity

Base Units

percent 50 0 100 Percent %

percentu USES percent

1 -1E5 1E5 Percent %

ph 7 -5 20 � �

phasefactor 0 0 1 � �

positive 1 1E-9 1E9 � �

pos_small 1 0 500 � �

pos_large 1 0 1E30 � �

power 10 -1E8 1E8 Power kW

power_electric USES power

10 -1E8 1E8 ElectricPower kW

pressure 1 1E-30 5E6 Pressure bar

press_diff 0.01 -5E6 5E6 PressureDifference

bar

press_drop 0.01 0 5E6 PressureDifference

bar

press_drop_coeff 1 0 1E30 PressureDropCoeff

m1.5 kg0.5/hr/bar0.5

press_drop_coeff2

1 0 1E30 PressureDropCoeff2

bar hr2/kg/m3

press_rise 0.01 0 500 PressureDifference

bar

R Variable Types Variable Value Lower

Bound Upper Bound

Physical Quantity

Base Units

ratio_ 1 0 1E3 � �

reaction 10 -1E6 1E6 MolarReactionRate

kmol/hr/m3

reaction_mass 1000 -1E6 1E6 MassReactionRate

kg/hr/m3

rotation 500 0 2000 AngularVelocity

rad/s

S Variable Types Variable Value Lower

Bound Upper Bound

Physical Quantity

Base Units

surf_tens 0.05 0 1 SurfaceTensio N/m

Page 173: ACM Library Reference Guide

7 Variable Types 173

n

T Variable Types Variable Value Lower

Bound Upper Bound

Physical Quantity

Base Units

temperature 25 -246 5000 Temperature C

temperature_abs

300 27 5273 AbsoluteTemperature

K

temp_diff 10 -1000 1000 TemperatureDifference

C

temp_drop 10 0 100 TemperatureDifference

C

temp_rise 10 0 100 TemperatureDifference

C

time_ 1E-4 0.0 1E4 Time hr

timeMin 1 0.0 1E6 TimeMin min

timeSec 1 0.0 1E8 TimeSec s

V Variable Types Variable Value Lower

Bound Upper Bound

Physical Quantity

Base Units

vapfraction 0.5 0 1 MoleFraction kmol/kmol

vapmassfraction 0.5 0 1 MassFraction kg/kg

velocity 1 0 5E3 Velocity m/s

vel_angular 5000 0 20000 AngularVelocity

rpm

visc_liq 1 1E-30 1E5 Viscosity cP

visc_vap 0.01 1E-30 1E5 Viscosity cP

vol_mass 0.1 2.0E-8 1E30 MassSpecificVolume

m3/kg

vol_mol 0.05 2.0E-4 1E30 MolarVolume m3/kmol

vol_mol_liq USES vol_mol

0.05 2.0E-4 1000 � �

vol_mol_vap USES vol_mol

100 4.0E-3 1E30 � �

volume 10 0 1E5 Volume m3

Page 174: ACM Library Reference Guide

General Information 174

General Information

Copyright Version Number: 2004.1

April 2005

Copyright © 1982-2005 Aspen Technology, Inc, and its applicable subsidiaries, affiliates, and suppliers. All rights reserved. This Software is a proprietary product of Aspen Technology, Inc., its applicable subsidiaries, affiliates and suppliers and may be used only under agreement with AspenTech.

Aspen ACOL�, Aspen Adsim®, Aspen Advisor�, Aspen Aerotran®, Aspen Alarm & Event�, Aspen APLE�, Aspen Apollo Desktop�, Aspen Apollo Online�, Aspen AssetBuilder�, Aspen ATOMS�, Aspen Automated Stock Replenishment�, Aspen Batch Plus®, Aspen Batch.21�, Aspen BatchCAD�, Aspen BatchSep�, Aspen Calc�, Aspen Capable-to-Promise®, Aspen CatRef®, Aspen Chromatography®, Aspen Cim-IO for ACS�, Aspen Cim-IO for Csi VXL�, Aspen Cim-IO for Dow MIF�, Aspen Cim-IO for G2�, Aspen Cim-IO for GSE D/3�, Aspen Cim-IO for Hewlett-Packard RTAP�, Aspen Cim-IO for Hitachi PLC (H04E)�, Aspen Cim-IO for Intellution Fix�, Aspen Cim-IO for Melsec�, Aspen Cim-IO for WonderWare InTouch�, Aspen Cim-IO for Yokogawa Centum CS�, Aspen Cim-IO for Yokogawa Centum XL�, Aspen Cim-IO for Yokogawa EW3�, Aspen Cim-IO Interfaces�, Aspen Cim-IO Monitor�, Aspen Cim-IO�, Aspen Collaborative Demand Management�, Aspen Collaborative Forecasting�, Aspen Compliance.21�, Aspen COMThermo TRC Database�, Aspen COMThermo®, Aspen Cost Factor Manual�, Aspen Crude Manager�, Aspen Crude Margin Evaluation�, Aspen Custom Modeler®, Aspen Data Source Architecture�, Aspen Decision Analyzer�, Aspen Demand Manager�, Aspen DISTIL�, Aspen Distribution Scheduler�, Aspen DMCplus® Composite, Aspen DMCplus® Desktop, Aspen DMCplus® Online, Aspen DPO�, Aspen Dynamics®, Aspen eBRS�, Aspen Enterprise Model�, Aspen ERP Connect�, Aspen FCC®, Aspen FIHR�, Aspen FLARENET�, Aspen Fleet Operations Management�, Aspen Framework�, Aspen FRAN�, Aspen Fuel Gas Optimizer Desktop�, Aspen Fuel Gas Optimizer Online�, Aspen General Construction Standards�, Aspen Hetran®, Aspen HX-Net®, Aspen Hydrocracker®, Aspen Hydrotreater�, Aspen HYSYS Amines�, Aspen HYSYS Crude�, Aspen HYSYS Dynamics�, Aspen HYSYS OLGAS 3-Phase�, Aspen HYSYS OLGAS�, Aspen HYSYS OLI Interface�, Aspen HYSYS Tacite�, Aspen HYSYS Upstream Dynamics�, Aspen HYSYS Upstream�, Aspen HYSYS®, Aspen Icarus Process Evaluator®, Aspen Icarus

Page 175: ACM Library Reference Guide

General Information 175

Project Manager®, Aspen InfoPlus.21®, Aspen Inventory Balancing�, Aspen IQ Desktop�, Aspen IQ Online�, Aspen IQmodel Powertools�, Aspen Kbase®, Aspen LIMS Interface�, Aspen Local Security�, Aspen LPIMS�, Aspen MBO�, Aspen MIMI®, Aspen MPIMS�, Aspen Multivariate Server�, Aspen MUSE�, Aspen NPIMS�, Aspen OnLine®, Aspen Operations Manager - Event Management�, Aspen Operations Manager - Integration Infrastructure�, Aspen Operations Manager - Peformance Scorecarding�, Aspen Operations Manager - Role Based Visualization�, Aspen Order Credit Management�, Aspen Orion Planning�, Aspen Orion�, Aspen PEP Process Library�, Aspen PIMS Blend Model Library�, Aspen PIMS Distributed Processing�, Aspen PIMS Enterprise Edition�, Aspen PIMS Mixed Integer Programming�, Aspen PIMS Simulator Interface�, Aspen PIMS Solution Ranging�, Aspen PIMS Submodel Calculator�, Aspen PIMS XNLP Optimizer�, Aspen PIMS�, Aspen PIPESYS�, Aspen PIPE�, Aspen Planning Accuracy�, Aspen Plant Planner & Scheduler�, Aspen Plant Scheduler Lite�, Aspen Plant Scheduler�, Aspen Plus OLI Interface�, Aspen Plus®, Aspen Polymers Plus®, Aspen PPIMS�, Aspen Process Data�, Aspen Process Explorer�, Aspen Process Manual�, Aspen Process Order�, Aspen Process Plant Construction Standards�, Aspen Process Recipe®, Aspen Process Tools�, Aspen Product Margin & Blending Evaluation�, Aspen Production Control Web Server�, Aspen ProFES® 2P Tran, Aspen ProFES® 2P Wax, Aspen ProFES® 3P Tran, Aspen ProFES® Tranflo, Aspen Properties®, Aspen Pumper Log�, Aspen Q Server�, Aspen RateSep�, Aspen RefSYS CatCracker�, Aspen RefSYS Spiral�, Aspen RefSYS�, Aspen Report Writer�, Aspen Resource Scheduling Optimization�, Aspen RTO Watch Cim-IO Server�, Aspen RTO Watch Server�, Aspen Scheduling & Inventory Management�, Aspen SmartStep Desktop�, Aspen SmartStep Online�, Aspen SQLplus�, Aspen Supply Chain Analytics�, Aspen Supply Chain Connect�, Aspen Supply Planner�, Aspen Tank Management�, Aspen TASC-Mechanical�, Aspen TASC�, Aspen Teams®, Aspen Terminals Management�, Aspen TICP�, Aspen Transition Manager�, Aspen Turbo PIMS�, Aspen Utilities�, Aspen Voice Fulfillment Management�, Aspen Watch Desktop�, Aspen Watch Server�, Aspen Water�, Aspen Web Fulfillment Management�, Aspen WinRace Database�, Aspen XPIMS�, Aspen Zyqad Development Version�, Aspen Zyqad�, SLM�, SLM Commute�, SLM Config Wizard�, the aspen leaf logo, and Plantelligence are trademarks or registered trademarks of Aspen Technology, Inc., Cambridge, MA.

All other brand and product names are trademarks or registered trademarks of their respective companies.

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.

Corporate

Aspen Technology, Inc. Phone: (1) (617) 949-1000

Ten Canal Park Toll Free: (1) (888) 996-7001

Cambridge, MA 02141-2201 Fax: (1) (617) 949-1030

USA URL: http://www.aspentech.com

Page 176: ACM Library Reference Guide

General Information 176

Related Documentation Title Content

Aspen Custom Modeler 2004.1 Getting Started Guide

Contains basic hands-on tutorials to help you become familiar with Aspen Custom Modeler.

Aspen Custom Modeler 2004.1 User Guide Contains a general overview of ACM functionality and more complex and extensive examples of using Aspen Custom Modeler.

Aspen Custom Modeler 2004.1 Modeling Language Reference

Contains detailed reference information about the modeling language, including syntax details and examples.

Aspen Custom Modeler 2004.1 Aspen Modeler Reference

Contains information on using automation, solver options, physical properties, the Control Design Interface (CDI)), Simulation Access eXtensions, online links, and using external nonlinear algebraic solvers.

Aspen Custom Modeler 2004.1 DMCplus® Controllers Interface

Contains information on using DMCplus with Aspen Custom Modeler or Aspen Dynamics�.

Aspen Custom Modeler 2004.1 Polymer Simulations with Polymers Plus

Polymers Plus is a layered product of Aspen Custom Modeler. It provides additional functionality to the properties package, Properties Plus, enabling polymers to be fully characterized in Aspen Custom Modeler models.

Page 177: ACM Library Reference Guide

Technical Support 177

Technical Support

Online Technical Support Center AspenTech customers with a valid license and software maintenance agreement can register to access the Online Technical Support Center at:

http://support.aspentech.com

You use the Online Technical Support Center to:

• Access current product documentation.

• Search for technical 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.

• Search for and review known limitations.

• Send suggestions.

Registered users can also subscribe to our Technical Support e-Bulletins. These e-Bulletins proactively alert you to important technical support information such as:

• Technical advisories.

• Product updates.

• Service Pack announcements.

• Product release announcements.

Page 178: ACM Library Reference Guide

Technical Support 178

Phone and E-mail Customer support is also available by phone, fax, and e-mail for customers who have a current support contract for their product(s). Toll-free charges are listed where available; otherwise local and international rates apply.

For the most up-to-date phone listings, please see the Online Technical Support Center at:

http://support.aspentech.com Support Centers Operating Hours

North America 8:00 � 20:00 Eastern time

South America 9:00 � 17:00 Local time

Europe 8:30 � 18:00 Central European time

Asia and Pacific Region 9:00 � 17:30 Local time

Page 179: ACM Library Reference Guide

Index 179

Index

A

ACM_Print routine 152

ACM_Rqst routine 156

Algorithms 31, 41

ART Reactions Model Wizard 83

available 177

B

Bounds, pLimit for limiting 163

Bubble Point and Dew Point Calculations 139

C

class equations 85

Closed loop tuning 32

Comparator control model 12

Control models

Comparator 12

Dead_time 12

Discretize 13

Feedforward 14

HiLoSelect 15

IAE 16

ISE 17

Lag_1 18

Lead_lag 19

Multiply 21

Noise 21

PID 23, 34

PRBS 47

Ratio 50

Scale 50

SplitRange 52

SteamPtoT 54

Sum 54

time units 11

Transform 55

Valve_dyn 56

creating a new Reactions Model 83

D

Dead_time control model 12

Diagnostic information

ACM_Print routine 152

Discretize control model 13

distributed systems 62

using ART 66

E

Error messages

ACM_Print routine 152

F

Faceplates for PID model 32, 43

Feedforward model 14

H

hierarchy levels

assigning 88

HiLoSelect control model 15

Page 180: ACM Library Reference Guide

Index 180

I

IAE control model 16

ISE control model 17

K

kinetic models

writing 84

L

Lag_1 control model 18

Lead_lag control model 19

lumped systems 62

M

MainPort port type 165

module equations 85

Multiply control model 21

N

Noise control model 21

O

overview of Reactions Model 59

P

pAct_Coeff_Liq procedure 96, 110

pBubt procedure 110

pCond_Liq procedure 96, 111

pCond_Vap procedure 97

pCp_Mol_Liq procedure 97

pCp_Mol_Vap procedure 98

pCv_Mol_Liq procedure 98

pCv_Mol_Vap procedure 99

pDens_Mass_Liq procedure 99

pDens_Mass_Sol procedure 100, 111

pDens_Mass_Vap procedure 100, 111

pDens_Mol_Liq procedure 100

pDens_Mol_Sol procedure 101, 111

pDens_Mol_Vap procedure 101, 112

pDewt procedure 102, 112

pDiffus_Liq procedure 102, 113

pDiffus_Vap procedure 102

pEnth_Mol procedure 103, 113

pEnth_Mol_Liq procedure 103, 113

pEnth_Mol_Sol procedure 103, 113

pEnth_Mol_Vap procedure 103, 114

pEntr_Mol procedure 104, 114

pEntr_Mol_Liq procedure 104, 114

pEntr_Mol_Sol procedure 104, 114

pEntr_Mol_Vap procedure 104, 115

pFlash procedure 105, 115

pFlash3 procedure 105, 115

pFlash3PH procedure 116

pFlash3PV procedure 117

pFlash3TH procedure 118

pFlash3TV procedure 119

pFlashPH procedure 119

pFlashPV procedure 120

pFlashTH procedure 121

pFlashTV procedure 121

pFuga_Liq procedure 105, 122

pFuga_Sol procedure 105, 122

pFuga_Vap procedure 105, 106

pGibb_Mol_Sol procedure 123

pGibbs_Mol_ Vap 106

pGibbs_Mol_Liq 106

Physical Property Submodel Details

Props_flash2 142

Props_flash2_entr 144

Props_flash2w 148

Props_flash3 145

Props_flash3_entr 146

Props_IIe 149

Props_liq_entr 141

Props_liquid 140

Props_lwe 150

Props_vap_entr 142

Page 181: ACM Library Reference Guide

Index 181

Props_vapor 141

PID control model 23, 34

faceplates 32, 43

tuning 32

PID model

faceplates 32, 43

pKllValues procedure 107, 124

pKValues procedure 108

pLimit procedure 163

pLMTD procedure 163

pMolWeight procedure 108, 124

pMolWeights procedure 124

ppH procedure 125

pPropZ procedure 125

pPropZPct procedure 126

pPropZPPct procedure 126

PRBS control model 47

pSpRMod procedure 162

pSurf_Tens procedure 108, 127

pSurf_TensY procedure 109, 127

pTrueComp procedure 128

pVap_Pressure procedure 131

pVisc_Liq procedure 109

pVisc_Vap procedure 109

R

Ratio control model 50

reaction equations 85

Reactions Models

compiling 86

creating 83

Reset windup, defined 29, 42

Run mode

pSpRMod procedure 162

Running Simulations that use the Submodels 139

S

Scale control model 50

Simulation Messages window

ACM_Print routine 152

SplitRange control model 52

SteamPtoT control model 54

stoichiometry

defining 89

syntax 89

Sum control model 54

syntax of stoichiometry 89

T

Temperature difference

pLMTD procedure 163

Time units 11

Transform control model 55

U

Using the ISE and IAE Models with a PID Controller 33, 47

V

Valve_dyn control model 56

Z

Ziegler-Nichols technique 32