Académique Documents
Professionnel Documents
Culture Documents
Templates are provided for many user subroutines. By default they are loca
ted in the Program Files\AspenTech\ap100\user directory
11/4/16
Reactor
Reactor
Modeling
Modeling
with Aspen
with Aspen
Plus Plus
Slide 1
CSTR-PL
DUPL
FEED
FEEDPL
PRODUCT
FEEDUK
CSTR-UK
PRODUK
Filename: WK7-USERKIN.BKP
11/4/16
Reactor
Reactor
Modeling
Modeling
with Aspen
with Aspen
Plus Plus
Slide 2
11/4/16
Reactor
Reactor
Modeling
Modeling
with Aspen
with Aspen
Plus Plus
Slide 3
Reaction Kinetics
Pre-Exponential Factor =52860000 m3**0.5/kmol**0.5-Sec
Activation Energy =62E6 J/kmol
Reactor Conditions
Temperature = 25 C
Pressure
= 1 Atm
Volume
= 300 Liters
Feed Conditions
Acetone
= 75 kg/hr
Allyl Alcohol = 50 kg/hr
Temperature = 25 C
Pressure
= 1 Atm
11/4/16
Reactor
Reactor
Modeling
Modeling
with Aspen
with Aspen
Plus Plus
Slide 4
11/4/16
Reactor
Reactor
Modeling
Modeling
with Aspen
with Aspen
Plus Plus
Slide 5
Reach Your
True
Potential
User Kinetics
Objective:
How to write you own User Kinetics Fortran routine
11/4/16
Model Name
Reaction Type
RPlug
USER
RCSTR
USER
RBatch
USER
Pres Relief
USER
RadFrac
REAC-DIST or USER
RateFrac
REAC-DIST or USER
BatchFrac
REAC-DIST
Reactor
Reactor
Modeling
Modeling
with Aspen
with Aspen
Plus Plus
Slide 7
11/4/16
Reactor
Reactor
Modeling
Modeling
with Aspen
with Aspen
Plus Plus
Slide 8
11/4/16
Reactor
Reactor
Modeling
Modeling
with Aspen
with Aspen
Plus Plus
Slide 9
Fortran subroutine
Name maximum 6 characters in length
Uses real variables in double precision
On the Reactions Reactions sheets specify
Reaction stoichiometry
Subroutine name
Input variables through the INT and REAL vectors
11/4/16
Reactor
Reactor
Modeling
Modeling
with Aspen
with Aspen
Plus Plus
Slide 10
Reaction Rates
Units of reaction rates are different in different blocks:
For RBatch and RCSTR
Conventional components:
(kgmole/m3-s)(m3) = kgmole/s
Note:
Rates per unit volume are multiplied by the volume occupied by the reacting
phase
11/4/16
Reactor
Reactor
Modeling
Modeling
with Aspen
with Aspen
Plus Plus
Slide 11
Reaction Rates
For RPLUG
Conventional components:
(kgmole/m3-s)(m2) = kgmole/m-s
Note:
Rates per unit volume are multiplied by the cross-sectional area covered by
the reacting phase.
11/4/16
Reactor
Reactor
Modeling
Modeling
with Aspen
with Aspen
Plus Plus
Slide 12
11/4/16
Reactor
Reactor
Modeling
Modeling
with Aspen
with Aspen
Plus Plus
Slide 13
Use the ASPEN PLUS monitor routines to access the Aspen Plus physical
property system.
Monitors are available to calculate the following pure component and mixtur
e thermodynamic properties for either vapor, liquid or solid
Fugacity coefficients
Enthalpies
Entropies
Free energies
Molar volumes
K-values
Ideal gas properties.
11/4/16
Reactor
Reactor
Modeling
Modeling
with Aspen
with Aspen
Plus Plus
Slide 14
See the User Models Reference Manual Chapter 3 for more details
11/4/16
Reactor
Reactor
Modeling
Modeling
with Aspen
with Aspen
Plus Plus
Slide 15
Passing Parameters
User constants and variables are available to kinetics routine in the real and
integer vectors.
Global variables
Vector names in subroutine REALR and INTR
The User Subroutine Kinetics sheet, for the RCSTR, RBatch and RPlug r
eactors
Reactor
Reactor
Modeling
Modeling
with Aspen
with Aspen
Plus Plus
Slide 16
SOUT - Vector containing information about the reactor contents at the time
of calling the Fortran routine
Total and component flow rates
Temperature and Pressure
Total mass enthalpy & entropy
Vapor and liquid molar fractions
Mass density
Molecular weight
Detailed list of contents and units in this array see User Models reference m
anual, Appendix C
11/4/16
Reactor
Reactor
Modeling
Modeling
with Aspen
with Aspen
Plus Plus
Slide 17
11/4/16
Array Index
Description
1,,NCC
NCC+1
NCC+2
Temperature (K)
NCC+3
Pressure (N/m2)
NCC+4
NCC+5
NCC+6
NCC+7
NCC+8
NCC+9
Reactor
Reactor
Modeling
Modeling
with Aspen
with Aspen
Plus Plus
Slide 18
Arrays, Y, X, X1 and X2. Vapor, liquid, liquid1 and liquid2 mole fraction array
s.
Mole fraction arrays are packed vectors of length NCOMP.
Contain only components with non zero fractions
IDX vector defines the order of components with respect to the Compon
ents Specifications Selection sheet
Example.
If NCOMP=2 and IDX(1,3)
Then Y(2) is the vapor mole fraction of
the third component on t
he Components
Specifications Selection sheet
11/4/16
Reactor
Reactor
Modeling
Modeling
with Aspen
with Aspen
Plus Plus
Slide 19
Size = NCOMP
X
0.3
0.3
0.4
11/4/16
IDX
1
2
4
Size = NC
Order Components.Main
1
Water
2
Ethanol
3
Methanol
4
Benzene
5
Nitrogen
Reactor
Reactor
Modeling
Modeling
with Aspen
with Aspen
Plus Plus
Stream Liquid
Mole Fractions
0.3
0.3
0
0.4
0
Slide 20
er routine.
Stored in a labeled common call the DMS_PLEX.
Each parameter occupies a continuous area within the PLEX
To access a parameter you will need to know
The name of the parameter.
The offset of the parameter in the PLEX
The structure of that area
11/4/16
Reactor
Reactor
Modeling
Modeling
with Aspen
with Aspen
Plus Plus
Slide 21
11/4/16
MW
Molecular weight(kg/kgmole)
TC
PC
VC
OMEGA
DHFORM
DGFORM
TB
VB
TFP
DELTA
Slide 22
11/4/16
Name
Definition
MUP
RGYR
CHI
CHARGE
Reactor
Reactor
Modeling
Modeling
with Aspen
with Aspen
Plus Plus
Slide 23
arameters
Determine the offset of the parameter.
Use the functions DMS_IFCMNC or DMS_IFCMN
LMW = DMS_IFCMNC(MW)
This line must appear before any executable code.
The MW values start from B(LMW + 1) and will be in the same order as c
omponents on Components Specifications sheet
11/4/16
Reactor
Reactor
Modeling
Modeling
with Aspen
with Aspen
Plus Plus
Slide 24
XMW(I) = LMW + I
Define XMW as an integer
INTEGER XMW
Use the parameter in your equation
SUM=0
DO 10 I=1,NC
SUM=SUM+B(XMW(I))
10 CONTINUE
11/4/16
Reactor
Reactor
Modeling
Modeling
with Aspen
with Aspen
Plus Plus
Slide 25
11/4/16
COMMON Block
Description
RPLG_RPLUGI
Integer configuration
parameters, Number of
reactor tubes
RPLG_RPLUGR
Reactor length
Reactor diameter
Reactor
Reactor
Modeling
Modeling
with Aspen
with Aspen
Plus Plus
Slide 26
RBatch
11/4/16
COMMON Block
Description
RBTC_RBATI
Reactor Type
RBTC_VOLRB
Reactor
Reactor
Modeling
Modeling
with Aspen
with Aspen
Plus Plus
Slide 27
RCSTR
11/4/16
COMMON Block
Description
RCST_RCSTRI
Reactor Type
RXN_RCSTRR
Reactor
Reactor
Modeling
Modeling
with Aspen
with Aspen
Plus Plus
Slide 28
11/4/16
General properties
COMMON Block
Description
RXN_RPROPS
Reactor temperature,
pressure, molar vapor
fraction, BETA, Volume of
vapor, liquid or liquid and
solid
Reactor
Reactor
Modeling
Modeling
with Aspen
with Aspen
Plus Plus
Slide 29
You must compile on the Aspen Plus server with the command aspcomp <fi
lename>.
Alternatively
Write a Dynamic Linking Options (DLOPT) file which specifies the object
s to use.
11/4/16
Reactor
Reactor
Modeling
Modeling
with Aspen
with Aspen
Plus Plus
Slide 30
Fortran Compiler
To develop user kinetics routines on the PC you require a Digital Visual Fort
ran 5.0 compiler
End users do not required a compiler, distribute file as as shared library.
Create shared libraries with the command:
asplink
11/4/16
Reactor
Reactor
Modeling
Modeling
with Aspen
with Aspen
Plus Plus
Slide 31
Templates are provided for many user subroutines. By default they are loca
ted in the Program Files\AspenTech\ap100\user directory
11/4/16
Reactor
Reactor
Modeling
Modeling
with Aspen
with Aspen
Plus Plus
Slide 32