SPYRO® Advanced Process Control Manual
SPYRO® Advanced Process Control Manual
USER MANUAL
PYROTEC DIVISION
TECHNIP BENELUX B.V.
BOERHAAVELAAN 31
2713 HA ZOETERMEER
THE NETHERLANDS
SAPC
®
SPYRO FOR ADVANCED PROCESS CONTROL
(USER MANUAL)
A0158-00325-08
No part of this document may be reproduced in any form, by print, photo print, microfilm or any other
means without written permission of the publishers. The information contained in this document is
subject to change without notice and should not be construed as a commitment by Technip Benelux
B.V.
SPYRO®, TES® and FIREBOX® are registered trademarks of Technip Benelux B.V.
PYROTEC
A DIVISION OF TECHNIP BENELUX B.V.
P.O. BOX 31 - BOERHAAVELAAN 31
2700 AB ZOETERMEER
THE NETHERLANDS
A0158-00325-08
ON-LINE SPYRO® , USER MANUAL REVISION NOTES
APRIL 2010 PAGE 3
REVISION NOTES
Revision 1
• This document complies with the work instructions WI0158-103 revision 1 and WI0158-104
revision 1.
Revision 2
• Adjustment parameters HCOE and FRIC are now read from the binary geometry file if they are
omitted from the argument header.
• Fixed unit bug with flux, being returned in kcal/s/m2 instead of kcal/hr/m2 as it should be.
Revision 3
• Input argument 129 extended from message level detail flag to a binary operator flag to also
indicate reported location of the (maximum) TMT.
• Output element 129 now contains the pressure drop over the radiant coil.
• Error -3006 reported when the binary geometry file (*.KTI) cannot be found / opened.
• When no unit number to an open log file is passed, the default log file [Link] is used.
• Error -118 reported when the IOB log file number is not valid.
Revision 4
• Add warning for exceptional flow velocities. They indicate an erroneous flow specification.
Revision 7
Revision 8
A0158-00325-08
SAPC - SPYRO® FOR ADVANCED PROCESS CONTROL, USER MANUAL TABLE OF CONTENTS
APRIL 2010 PAGE 4
TABLE OF CONTENTS
1 INTRODUCTION 5
2 SAPC INTERFACE 6
2.1 SAPC INPUT DATA 6
2.1.1 GEOMETRY DEFINITION 7
2.1.2 SPYIN0 8
2.1.3 SPYIN 9
2.2 SAPC OUTPUT DATA 14
2.2.1 SPYOUT 14
2.3 SAPC ERROR MESSAGES 15
2.3.1 NON-FATAL ERRORS (WARNINGS) 15
2.3.2 FATAL ERRORS 15
2.3.3 FATAL ERRORS IN SOLVER 16
3 USRWFC INTERFACE 17
3.1 CLASSIFICATION OF FEEDSTOCKS & INPUT DATA 17
3.2 INPUT DATA 18
3.2.1 WFCIN 18
3.3 OUTPUT DATA 19
3.3.1 WFCOUT 19
3.4 ERROR MESSAGES 19
4 COMPONENT LIST 20
A0158-00325-08
SAPC - SPYRO® FOR ADVANCED PROCESS CONTROL, USER MANUAL INTRODUCTION
APRIL 2010 PAGE 5
1 INTRODUCTION
SAPC provides access to the SPYRO® 6 model from Advanced Process Control Systems. SAPC is a
statically linked library with the FORTRAN runtime libraries. The library exports a routine for a single
SPYRO® run simulation: SAPC. Dependent on the type of feed license a second routine may be
exported for the characterisation of a liquid feed: USRWFC. The routines are described in the next
chapters.
To use the library in an application, the library and the available routines can be linked to the
application. The library provides the interface(s). The routine(s) can be statically or dynamically linked
by the application. In case the routine(s) are statically linked the [Link] will provide the
interfaces for the linker.
The SAPC software is licensed as with either a LPG, AGO (default) or HGO license, which defines the
set of components that can be used to specify the hydrocarbon feed. The use of the LPG license, the
default AGO license or the HGO extension may have an impact on the availability of some component
ranges in the feed composition, as indicated in the last chapter.
A0158-00325-08
SAPC - SPYRO® FOR ADVANCED PROCESS CONTROL, USER MANUAL SAPC INTERFACE
APRIL 2010 PAGE 6
2 SAPC INTERFACE
Access to the radiant coil model, SAPC, is provided through the following FORTRAN subroutine:
SAPC(FGEOM,SPYIN0,SPYIN,SPYOUT,IRET)
The table below gives a brief description of the type and purpose of the variables passed to the SAPC
routine. More detailed documentation is given under individual sections.
The library contains compiled FORTRAN code with the default setting to export the SAPC routine. This
has a special implication for the character string: an additional argument has to be added after each
string argument mentioning the length of the Fortran string.
To link to a program that is written in C++ use the following syntax for the header definition:
extern "C" __declspec(dllimport) void __stdcall SAPC(char *FGEOM, int
FGEOM_Len, double SPYIN0[], double SPYIN[], double SPYOUT[], int *IRET);
To call the SAPC routine from a CPP file use the next syntax:
char MyFGEOM[128];
double MySPYIN0[9];
double MySPYIN[162];
double MySPYOUT[170];
int MyIRET;
…
SAPC(MyFGEOM,strlen(MyFGEOM),&MySPYIN0[0],&MySPYIN[0],&MySPYOUT[0],&MyIRET);
…
To link to a program that is written in VBA use the following syntax for the header definition:
Private Declare Sub SAPC Lib "SAPC" (ByVal lpszFileName As String, ByVal
nFileNameLen As Long, aSpyIn0 As Double, aSpyIn As Double, aSpyOut As Double,
aRetVal As Long)
To call the SAPC routine from a CPP file use the next syntax:
Dim GeometryFileName As String
Const FileNameLength = 128
Dim SPYIN0(1 To 9) As Double
Dim SPYIN(1 To 162) As Double
Dim SPYOUT(1 To 170) As Double
Dim iRet As Long
…
Call SAPC(GeometryFileName,FileNameLength,SPYIN0(1),SPYIN(1),SPYOUT(1),iRet)
…
1
Dependent on the chosen license option, with or without coking profile.
A0158-00325-08
SAPC - SPYRO® FOR ADVANCED PROCESS CONTROL, USER MANUAL SAPC INTERFACE
APRIL 2010 PAGE 7
FGEOM is used to initialise the furnace geometry from the encrypted binary geometry file. It contains
the file name of encrypted geometry file without the .KTI extension. This string may contain the fully
qualified path to the binary geometry file or just be the file name of the file itself.
In case only a file name is supplied, SAPC will look for the geometry file in several places in the
following order:
1. The “current” folder. The concept “current” directory may differ based on the invoking application,
or even the method used to invoke this program.
2. The folder pointed at by the SPYRO_APC environment variable.
3. The folder pointed at by the SPYRO environment variable.
4. The folder in which the “invoking module” resides. Like the “current” directory, this is also a
Windows concept and in a multi-module application this may be the main EXE or a DLL.
A0158-00325-08
SAPC - SPYRO® FOR ADVANCED PROCESS CONTROL, USER MANUAL SAPC INTERFACE
APRIL 2010 PAGE 8
2.1.2 SPYIN0
General input variables for SAPC are passed in via the SPYIN0 array of dimension 9.
Name Description
1 IOB Log file unit number
2 NSTEP Number of integration steps for SPYRO®
3 - Reserved
4 NKEY Key component number for conversion calculations
5 CONOP1 Convergence option for severity
6 CONVAL1 Convergence value for severity
7 CONOP2 Convergence option for COP
8 CONVAL1 Convergence value for COP
9 TOLF Convergence tolerance
(only used when CONOP1 ≠ 0 and/or CONOP2 ≠ 0)
Note: Integers 1, 32, 38 cannot be used since they are used internally by the library. Integers 0, 5, 6
cannot be used since they are used by the system.
Sharing a log file between the calling program and SAPC is only possible when both share the exact
same instance of the FORTRAN run-time library [Link]. This means that when the applied
version of SAPC is linked statically against the FORTRAN run-time library, SAPC will always open the
[Link].
Since each tube must be represented by a whole number of steps, and some steps are reserved for
the transfer line volume, the number of actual steps for the coil is likely to be less than the number of
steps given with NSTEP. The distribution of steps is as follows:
A0158-00325-08
SAPC - SPYRO® FOR ADVANCED PROCESS CONTROL, USER MANUAL SAPC INTERFACE
APRIL 2010 PAGE 9
SPYIN0(5) Description
0 Calculate at Radiant Wall Temperature specified by SPYIN(134) [no convergence]
1 Converge on coil outlet temperature defined by SPYIN0(6)
2 Converge on Ultimate P/E (see SPYRO manual) defined by SPYIN0(6)
3 Converge on P/E defined by SPYIN0(6)
4 Converge on M/P defined by SPYIN0(6)
5 Converge on conversion of key component [SPYIN0(4)], defined by SPYIN0(6)
6 Converge on absorbed duty specified by SPYIN0(6)
SPYIN0(7) Description
0 Calculate at specified coil inlet pressure specified by SPYIN(133) [no
convergence]
1 Converge on coil outlet pressure specified by SPYIN0(8)
2.1.3 SPYIN
Operating conditions for the given furnace for SPYRO® calculations are passed in via the SPYIN array
of dimension 162. The feed composition (position 1 through 128) must be given in weight percent.
A0158-00325-08
SAPC - SPYRO® FOR ADVANCED PROCESS CONTROL, USER MANUAL SAPC INTERFACE
APRIL 2010 PAGE 10
For example, to switch bit 1 on, the value SPYIN(129) = 1 has to be set.
A0158-00325-08
SAPC - SPYRO® FOR ADVANCED PROCESS CONTROL, USER MANUAL SAPC INTERFACE
APRIL 2010 PAGE 11
If SPYIN0(5) is set to 0, SAPC will run the SPYRO® model at the specified radiant wall temperature
and not converge to coil outlet temperature, severity or key component conversion.
If SPYIN0(5) is set to any other value, SPYIN(134) will be used as the first estimate by SAPC to
achieve the required coil outlet temperature, severity or conversion.
Fouling of the interior of the coil by solid deposits is an ongoing process that affects the process
conditions and available reaction volume. The SPYRO® model simulates a single time step and gives
estimates for the coke rates just then. Based upon these coke rates the coke layer can be
(cumulatively) estimated at a subsequent point in time. At start of run, just after decoking operation the
furnace can be assumed to be at clean condition.
A0158-00325-08
SAPC - SPYRO® FOR ADVANCED PROCESS CONTROL, USER MANUAL SAPC INTERFACE
APRIL 2010 PAGE 12
Heat
Flux
FLUXP = 0.2
FLUXP = 0.1 (DEFAULT)
FLUXP = 0.0001
SPYIN(157) is used to tune the heat flux profile for the SPYRO model and the maximum valid range
is from -1 to +1, the actual range is subject to the tube diameter and number of parallel tubes of the
first and last section. A positive number will result in higher heat flux at the beginning of the coil
section. The default value is 0.10 for most vertical coils.
This parameter is physically limited, an indication of this limitation is given by the following equation:
A0158-00325-08
SAPC - SPYRO® FOR ADVANCED PROCESS CONTROL, USER MANUAL SAPC INTERFACE
APRIL 2010 PAGE 13
The composition of tube metal is known to influence the rate of coking because of the catalytic effect of
some elements in the material. SPYRO® does not directly take this into account. Instead, the user may
tune the simulation to account for the effect of different tube metal compositions by adjusting the
coking rate parameter and/or the coke thermal conductivity adjustment parameter. It is also known that
with age there are changes in the composition of the tubes and in the condition of the inside surface.
This is due to the depletion of components (such as nickel) from the tube alloy due to cycles of coking
and decoking. This phenomenon can also be considered in simulations through the use of these
parameters.
Passivation compounds like dimethylsulfide are sometimes used to poison the catalytic sites on the
tube surface, in order to reduce the coking rate. While SPYRO® does not allow a direct specification of
these compounds in the input, an indirect way is to use the coking rate adjustment parameter to tune
the simulation to plant data.
A parameter is a value used directly in the calculation. An adjustment multiplier is a multiplication factor
on the calculated value.
A0158-00325-08
SAPC - SPYRO® FOR ADVANCED PROCESS CONTROL, USER MANUAL SAPC INTERFACE
APRIL 2010 PAGE 14
2.2.1 SPYOUT
Pos Description
1 Coil outlet temperature (°C)
2 Reserved
3 P/E Severity
4 M/P Severity
5 Conversion of specified component - NC5 if component is not specified (%)
6 Absorbed duty (kcal/h/coil)
7 Pressure drop across coil (kg/cm2)
8 Maximum TMT across all coils (°C)
9 Maximum coking rate across all coils (mm/30 days)
10 Final radiant wall temperature (°C)
11 Final coil inlet pressure (kg/cm2)
12.. 20 Reserved
21..148 Effluent Composition. See the Component library for details.
149..150 Reserved
1
151..170 Coking Rate (Tube 1 through NTUBE) [mm/30 days]
1
Dependent on the applicable license option, with or without coking profile.
A0158-00325-08
SAPC - SPYRO® FOR ADVANCED PROCESS CONTROL, USER MANUAL SAPC INTERFACE
APRIL 2010 PAGE 15
The integer flag IRET is used to pass back information to the calling routine about any errors that
occurred during the On-line Furnace Model execution. The error message is printed in the error log file
defined by SPYIN0(1). A positive error code implies a non-fatal error and a negative error code
indicates a fatal error.
This table contains the non-fatal errors (warnings) returned from SAPC.
A0158-00325-08
SAPC - SPYRO® FOR ADVANCED PROCESS CONTROL, USER MANUAL SAPC INTERFACE
APRIL 2010 PAGE 16
This table contains the fatal errors returned from the solver used in SAPC.
A0158-00325-08
ON-LINE SPYRO® , USER MANUAL USRWFC INTERFACE
APRIL 2010 PAGE 17
3 USRWFC INTERFACE
The Feed Characterisation Utility is an on-line subroutine version of TECHNIP's proprietary liquid Feed
Characterisation Utility for Ethylene pyrolysis used in the off-line version of SPYRO®. It accepts ASTM
D86 and PINA information and predicts a detailed feed composition. This utility has been validated for
Naphtha, Gas Oil and Wide Boiling feedstock characterisations up to a final boiling point of 550°C. For
the standard AGO license, a final boiling point of 350°C is the limit. A wide boiling feed is a feed with
both a naphtha fraction and a gas oil fraction.
Dependent on the chosen license this routine can be lacking. This routine is available only to the AGO
or the HGO license, for the LPG license this routine is omitted.
USRWFC is an interface to the feedstock characterisation routine that generates a good estimate of
feedstock components from simple, readily available physical properties identified in the input data.
The routine's classification of liquid feedstock is based on the ASTM D-86 boiling ranges. The
definition of each feed class, naphtha, gas oil and wide boiling is given in individual sections.
Access to the feed characterisation routine is provided through the following subroutine
SUBROUTINE USRWFC(WFCIN,WFCOUT,IOB,IRET)
The table below gives a brief description of the type and purpose of the variables passed to the
USRWFC routine. More thorough documentation is found under the individual sections.
The table included below shows the way a feedstock is classified in USRWFC. Feed classification is
done automatically based on the values specified for IBP and FBP.
A0158-00325-08
ON-LINE SPYRO® , USER MANUAL USRWFC INTERFACE
APRIL 2010 PAGE 18
Naphtha’s can have a long tail ending over 180°C, but this would trigger USRWFC into treating the
feed as wide boiling feed. Therefore, feeds are classified as naphtha based on the 95% boiling point
being lower than 180 °C. This 95% boiling point must be entered in the field of the FBP.
3.2.1 WFCIN
USRWFC generates detailed composition of the feed from PINA, specific gravity and ASTM D-86 data.
The input data is passed through the WFCIN array with dimension 16. When omitted, values default to
0.0.
Position Description
1 ASTM Initial Boiling Point (°C)
2 ASTM 10% (°C)
3 ASTM 30% (°C)
4 ASTM 50% (°C)
5 ASTM 70% (°C)
6 ASTM 90% (°C)
7 ASTM Final Boiling Point (°C)
8 PINA Normal Paraffins (wt% basis)
9 PINA ISO Paraffins (wt% basis)
10 PINA Naphtenics (wt% basis)
11 PINA Aromatics (wt% basis)
12 Specific gravity (15°C /15°C)
13 H to C ratio (molar basis)
14 Sulphur Content (wt% basis)
15 Reserved
16 Total C4 (wt%) in naphtha feedstock
A0158-00325-08
ON-LINE SPYRO® , USER MANUAL USRWFC INTERFACE
APRIL 2010 PAGE 19
3.3.1 WFCOUT
WFCOUT returns the calculated feed composition in weight fractions. Paragraphs Error! Reference
source not found. and Error! Reference source not found. detail those components that are used
respectively for the naphtha feed and the gas oil feed. A wide boiling feed contains both these groups.
Position Description
1...128 Feed Composition. See the Component Library for details.
129...130 Reserved
A0158-00325-08
SAPC - SPYRO® FOR ADVANCED PROCESS CONTROL, USER MANUAL COMPONENT LIST
APRIL 2010 PAGE 20
4 COMPONENT LIST
The numbers refer to the order in the index in the array used as arguments SPYIN and SPYOUT to the
routine SAPC. The SPYRO® License defines the scope of the elements that can be used to describe a
feed at the inlet. The column “license” indicates which components can be used for which feed. It
should be noted that AGO includes LPG, and HGO includes both AGO and LPG. The output of
SPYRO® can always use the complete component list to describe the effluent.
A0158-00325-08
SAPC - SPYRO® FOR ADVANCED PROCESS CONTROL, USER MANUAL COMPONENT LIST
APRIL 2010 PAGE 21
A0158-00325-08
SAPC - SPYRO® FOR ADVANCED PROCESS CONTROL, USER MANUAL COMPONENT LIST
APRIL 2010 PAGE 22
A0158-00325-08
SAPC - SPYRO® FOR ADVANCED PROCESS CONTROL, USER MANUAL COMPONENT LIST
APRIL 2010 PAGE 23
A0158-00325-08