Vous êtes sur la page 1sur 32

User Kinetic References

See User Models Reference Manual for more detailed information

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

1997 AspenTech. All rights reserved.

User Kinetics: Workshop 7

Objective: To model a Power Law expression using a User Kinetics routine.

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

1997 AspenTech. All rights reserved.

User Kinetics: Workshop 7

Setup two RCSTR reactors.


Use the standard Power Law expression
Use a User kinetic routine of the Power Law expression
Reaction
Acetone + Allyl Alcohol N-Propyl Propionate
r = K*EXP(-E/RT)*CACB0.5
Where
CA = Concentration of Allyl-Alcohol, in kmol/m3
CB = Concentration of Acetone, in kmol/m 3

11/4/16

Reactor
Reactor
Modeling
Modeling
with Aspen
with Aspen
Plus Plus

Slide 3

1997 AspenTech. All rights reserved.

User Kinetics: Workshop 7

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

1997 AspenTech. All rights reserved.

User Kinetics: Workshop 7

Property Method : NRTL-RK


A template has been supplied for the User kinetic routine, USRKIN.F.
Calculate the rate of reaction for all the components from the information gi
ven.
Save file as WK7-USERKIN.BKP

11/4/16

Reactor
Reactor
Modeling
Modeling
with Aspen
with Aspen
Plus Plus

Slide 5

1997 AspenTech. All rights reserved.

Reach Your

True

Potential

User Kinetics
Objective:
How to write you own User Kinetics Fortran routine

Aspen Plus References:


User Models Reference Manual, Chapter 11. User Kinetics
Subroutines

1997 AspenTech. All rights reserved.

User Kinetic Subroutines


When your reaction kinetic doesnt fit the standard Aspen Plus expressions.

The following models allow you to supply a kinetic subroutine to calculate th


e reaction rates

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

1997 AspenTech. All rights reserved.

The Goal of the Kinetics Routine


For reactor models
Calculate rate of generation for each component in each substream
Make sure rates are in mass balance
For stage separation models
Calculate the rate of generation for each component on a given stage.
Make sure rates are in mass balance

11/4/16

Reactor
Reactor
Modeling
Modeling
with Aspen
with Aspen
Plus Plus

Slide 8

1997 AspenTech. All rights reserved.

User Kinetic: Subroutine

All units are in SI


Have access to
Aspen Plus physical property system through the physical property moni
tors.
Pure component physical property parameters
Parameters specific to a reactor

11/4/16

Reactor
Reactor
Modeling
Modeling
with Aspen
with Aspen
Plus Plus

Slide 9

1997 AspenTech. All rights reserved.

User Kinetic Reactions

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

1997 AspenTech. All rights reserved.

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

1997 AspenTech. All rights reserved.

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

1997 AspenTech. All rights reserved.

Points to Remember about Reaction Rates


We recommend that when calculating the final rates, use the reaction volum

e variables, RPROPS_VLIQ and RPROPS_VVAP from common RXN_RPR


OPS. This guarantees :
That RCSTR behaves the same way with or without the user kinetics sub
routine. (in terms of the behavior of the parameters VOL and REAC-VO
L)
That the same subroutine can be used for all types of reactor blocks.

11/4/16

Reactor
Reactor
Modeling
Modeling
with Aspen
with Aspen
Plus Plus

Slide 13

1997 AspenTech. All rights reserved.

User Kinetics: Physical Properties

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

1997 AspenTech. All rights reserved.

User Kinetics: Physical Properties

Vapor, Liquid and Solids transport properties are also available.

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

1997 AspenTech. All rights reserved.

Passing Parameters
User constants and variables are available to kinetics routine in the real and
integer vectors.

They can be defined in two places.


Reactions Reactions Subroutine sheet

Global variables
Vector names in subroutine REALR and INTR

The User Subroutine Kinetics sheet, for the RCSTR, RBatch and RPlug r
eactors

Local to that reactor


Vector names in subroutine REAL and INT
11/4/16

Reactor
Reactor
Modeling
Modeling
with Aspen
with Aspen
Plus Plus

Slide 16

1997 AspenTech. All rights reserved.

Useful Argument List Parameters

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

1997 AspenTech. All rights reserved.

SOUT: Stream Vector

11/4/16

Array Index

Description

1,,NCC

Component mole flows (kmol/s)

NCC+1

Total mole flow (kmol/s)

NCC+2

Temperature (K)

NCC+3

Pressure (N/m2)

NCC+4

Mass enthalpy (J/kg)

NCC+5

Molar Vapor Fraction

NCC+6

Molar Liquid Fraction

NCC+7

Mass entropy (J/kg-K)

NCC+8

Mass Density (kg/m )

NCC+9

Molecular weight (kg/kmol)

Reactor
Reactor
Modeling
Modeling
with Aspen
with Aspen
Plus Plus

Slide 18

1997 AspenTech. All rights reserved.

Useful Argument List Parameters

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

1997 AspenTech. All rights reserved.

Component Mole Fractions

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

1997 AspenTech. All rights reserved.

Accessing Universal Constants


All physical property parameters used in the simulation are available to a us

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

1997 AspenTech. All rights reserved.

User Kinetics: Universal Constants


can access the following universal constants
YouName
Definition

11/4/16

MW

Molecular weight(kg/kgmole)

TC

Critical Temperature (K)

PC

Critical Pressure (N/m2)

VC

Critical volume (m3/kgmole)

OMEGA

Pitzer acentric factor

DHFORM

Standard heat of formation of ideal gas at 298.15 K (J/kgmole)

DGFORM

Standard energy of formation of ideal gas at 298.15 K (J/kgmole)

TB

Normal boiling point (K)

VB

Liquid molar volume at TB (m3/kgmole)

TFP

Normal freezing point (K)

DELTA

Solubility parameter at 298.15 K (J/m3)1/2


Reactor
Reactor
Modeling
Modeling
with Aspen
with Aspen
Plus Plus

Slide 22

1997 AspenTech. All rights reserved.

User Kinetics:Universal Constants

11/4/16

Name

Definition

MUP

Dipole moment (J*m3)1/2

RGYR

Radius of gyration (m)

CHI

Stiel polar factor

CHARGE

Ionic charge number

Reactor
Reactor
Modeling
Modeling
with Aspen
with Aspen
Plus Plus

Slide 23

1997 AspenTech. All rights reserved.

Practical Steps Required to Get a Value


Include the labeled common DMS_PLEX in the model
Find the parameters name.
See page 6-13 of User Model Reference Manual for a list of common p

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

1997 AspenTech. All rights reserved.

Practical Steps Required to Get a Value


Use statement functions to find the offset of any component:

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

1997 AspenTech. All rights reserved.

Reactor Specific Parameters

Different parameters are available for each reactor unit operation


RPlug

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

1997 AspenTech. All rights reserved.

Reactor Specific Parameters

RBatch

11/4/16

COMMON Block

Description

RBTC_RBATI

Reactor Type

RBTC_VOLRB

Reactor volume (m3)

Reactor
Reactor
Modeling
Modeling
with Aspen
with Aspen
Plus Plus

Slide 27

1997 AspenTech. All rights reserved.

Reactor Specific Parameters

RCSTR

11/4/16

COMMON Block

Description

RCST_RCSTRI

Reactor Type

RXN_RCSTRR

Reactor volume (m3),


Reactor volume fraction

Reactor
Reactor
Modeling
Modeling
with Aspen
with Aspen
Plus Plus

Slide 28

1997 AspenTech. All rights reserved.

Reactor Specific Parameters

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

1997 AspenTech. All rights reserved.

Using a Fortran Routine

You must compile on the Aspen Plus server with the command aspcomp <fi
lename>.

Place the compiled object files in the run directory.

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

1997 AspenTech. All rights reserved.

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

1997 AspenTech. All rights reserved.

User Kinetic References

See User Models Reference Manual for more detailed information

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

1997 AspenTech. All rights reserved.

Vous aimerez peut-être aussi