2.1.2. User-programmed Subroutines in Reactor Models

User-programmed subroutines (or functions) are used to provide flexibility in specifying problem constraints that may involve an arbitrary function of time, distance, or other reactor variable. Before employing user-subroutine options, users should consider the various piece-wise linear profile options that are readily available through the user interface and require no programming and described in the Chemkin Input Manual Input Manual. These profile options provide similar flexibility to the user routines, but do not require any programming, recompiling and/or linking of code.

For each user routine, there is an associated Input option in the associated Reactor Model input panel, to activate the user routine from the user interface. To view user routine options in the Ansys Chemkin interface, you must first go to the Preferences panel (Edit > Preferences) and check the box that says Display User Routine Options. Once this box is checked, when you open a new input panel, any user-routine options will be displayed among the other input options. When manually assembling Reactor Model Input files, this corresponds to "keyword" that must be included in the input file, which are described in the Chemkin Input Manual Input Manual.

Table 2.1: Keyword and FORTRAN Code Relationships lists the corresponding keywords described in the Chemkin Input Manual Input Manual with the name of the subroutine or function that is turned on by this keyword, and the user routine file in which a template of the function is found. Also listed is the corresponding application program shared object (UNIX) or dynamically linked library (PC) that is used when running the Reactor Model program.


Note:  If a user replaces or modifies a shared-object’s function, that change will apply to all Reactor Models that employ that shared object, when the user routine option is enabled. The table of reactor models (Reactor Class Name column) associated with a particular shared object library (License column) can be found in the ReactorModels.csv file located in the data directory of an Ansys Chemkin install.


Table 2.1: Keyword and FORTRAN Code Relationships

Keyword(s)

FORTRAN code

File name

Shared Object

Always used unless other geometric keywords are given

SUBROUTINE PLGEOM

aurora_user_routines.f

PC: auroradll.dll UNIX: libaurora.so

UIGN

SUBROUTINE PSIGNT

aurora_user_routines.f

PC: auroradll.dll UNIX: libaurora.so

QFUNQFIX

FUNCTION PSQFUN

aurora_user_routines.f

PC: auroradll.dll UNIX: libaurora.so

TTIMTFIX

SUBROUTINE PSTEMPT

aurora_user_routines.f

PC: auroradll.dll UNIX: libaurora.so

VTIM

SUBROUTINE PSVOLT

aurora_user_routines.f

PC: auroradll.dll UNIX: libaurora.so

QXFU

FUNCTION QTRX

aurora_user_routines.f

PC: auroradll.dll UNIX: libaurora.so

USRIN

SUBROUTINE USRINLET

aurora_user_routines.f

PC: auroradll.dll UNIX: libaurora.so

UPROF

SUBROUTINE CRUPROF

creslaf_user_routines.f

PC: creslafdll.dll UNIX: libcreslaf.so

UTRN

SUBROUTINE CRUTRANS

creslaf_user_routines.f

PC: creslafdll.dll UNIX: libcreslaf.so

QFUN

FUNCTION OPQFUN

oppdif_user_routines.f

PC: oppdifdll.dll UNIX: liboppdif.so

UTRN

SUBROUTINE OPUTRANS

oppdif_user_routines.f

PC: oppdifdll.dll UNIX: liboppdif.so

Always used unless keyword APRO is given

FUNCTION AREA

premix_user_routines.f

PC: premixdll.dll UNIX: libpremix.so

QFUN

FUNCTION PRQFUN

premix_user_routines.f

PC: premixdll.dll UNIX: libpremix.so

UTRN

SUBROUTINE PRUTRANS

premix_user_routines.f

PC: premixdll.dll UNIX: libpremix.so