Sei sulla pagina 1di 77

Users Guide

AVL User Coding Interface


v2014.1

Contents
1. Get Started......................................................................................................... 3
1.1. What is AUCI?..................................................................................................................3
1.2. Tutorials............................................................................................................................ 3
1.2.1. Aftertreatment .................................................................................................... 3
1.3. Examples........................................................................................................................ 14
1.3.1. Catalytic Reaction Mechanisms........................................................................14
1.3.2. Regeneration Reaction Mechanisms................................................................26
1.3.3. Transfer Models................................................................................................28

2. Documentation................................................................................................. 31
2.1. Graphical User Interface ............................................................................................... 31
2.1.1. General............................................................................................................. 31
2.1.2. Catalytic Reaction Mechanism......................................................................... 42
2.1.3. Regeneration Reaction Mechanism..................................................................56
2.1.4. Transfer Models................................................................................................62
2.2. Basics in C and AUCI User Coding...............................................................................68
2.2.1. The programming language C .........................................................................68
2.2.2. AUCI APIs and Predefined Constants..............................................................69
2.3. Prerequisites................................................................................................................... 70
2.4. Literature.........................................................................................................................70

3. FAQ....................................................................................................................72
3.1. General........................................................................................................................... 72
3.1.1. How to convert volume based simulation variables into absolute values?........72
3.1.2. How to use the AUCI message system? ........................................................ 73
3.1.3. How to improve performance and stability?..................................................... 75
3.2. Reaction Rate Formulation.............................................................................................75
3.2.1. How to code rate formulations depending on a single species
concentration?........................................................................................................75
3.2.2. How to code rate formulations depending on two gas species?.......................76
3.2.3. How to code rate formulations that comprise different cases?......................... 76

AVL User Coding Interface

1. Get Started

1. Get Started
1.1. What is AUCI?
The AVL User Coding Interface (AUCI) is a common user model development platform, which
supports different applications for several AST software products.
For the development of user models dedicated graphical user interfaces are available, in which
the essence of a user model is specified.
Out of the user model input dynamic link libraries (DLL) can be compiled for several target
platforms. The user is in full control of the degregge of encapsulation of AUCI models: from
exposing all model details up to ryestricting models to consist of DLLs only, from publishing
model parameters fgup to hiding them in a non-disclosure model.
The generic concept of the AUCI is available for the following applications:
Catalytic Reaction Mechanism page [42]
Regeneration Reaction Mechanism page [56]
Transfer Models page [62]
Figure 1. AVL User Coding Interface - a common user model development platform.

1.2. Tutorials
1.2.1. Aftertreatment
1.2.1.1. Setting up a Simple Catalytic Reaction Mechanism
This tutorial exemplifies in detail how to set up a user defined catalytic reaction mechanism in the
AVL User Coding Interface and how to load it in a BOOST Aftertreatment model. Additionally, it is
shown how a variation of reaction mechanism parameters can be performed.
Example
The simple catalytic reaction mechanism comprises three reactions. The first one accounts for
the oxidation of propene:
Another two reactions describe the storage of oxygen on ceria and its regeneration by oxidation
of carbon monoxide:

The rate formulations for the above reactions are as follows:


(1)

AVL User Coding Interface

1. Get Started
(2)
(3)
Here, the reaction rate constants are of Arrhenius type:
(4)

In the above rate formulation T is the reaction temperature , yk is the molar fraction of gas
species k and Zj is the surface coverage fraction of the surface site species j. The reaction rate
parameters Ki and Ei are the frequency factor and the activation temperature, respectively.
AUCI Catalytic Reaction Mechanism Interface
1. Start
How to launch the AVL User Coding Interface can be found in the documentation

page [31]

general project information and save user coding project file.


2. Enter
The general project information
comprise the Name of the Catalytic Reaction
page [43]

Mechanism, Author and Date of creation, and a Comment which could be, e.g., a summary of
the mechanism or its literature reference:

In order to save the user coding project select "Save" or "Save as" from the "File" menu :

A file browser dialog is opened in which you can select the location and path of the
user coding project. In the example below, the name of the user coding project is

AVL User Coding Interface

1. Get Started
"Tutorial_CatalyticReactionMechanism". By saving the user coding project, the ucp-file
"Tutorial_CatalyticReactionMechanism.ucp" is created:

information about the storage site "Cerium".


3. Enter
The storage of oxygen on ceria and its regeneration by oxidation of carbon monoxide is
modeled by storage reactions that take place on a storage site called "Cerium".
page [43]
In order to add a surface site to the reaction mechanism go to the page Washcoat
and
add a row in the table of section "Storage Sites".

In the tree on the left hand side expand the tree element "Washcoat" and select the page
page [44]
New Storage Site
.
Now, all information concerning the surface site can be entered. First of all enter the Name
"Cerium". After that, specify the Storage Capacity which indicates how many moles of the
2
oxygen can be stored in the washcoat. In this case it's 0.06 mol/m . In order to be able to
do parameter variation later on in the simulation, enable the "Public" check-box next to the
Storage Capacity input.

In the table "Storage Site Species", set up the number and details of the stored species.
In order to ensure mass conservation, it is recommended to consider the free surface site

AVL User Coding Interface

1. Get Started
as an individual surface site species and to use it in the reaction stoichiometry accordingly
whenever a storage site is occupied or released.
Note: Always declare the empty/free site species as the first entry in the table.
This free surface site is named "Ce(S)" in our example.
The oxygen stored on ceria is represented by the storage site species "O2(S)". For the two
storage site species their molecular weights need to be provided: the free surface site is
assumed to have a molecular weight of 0 g/mol so the molecular weight of stored oxygen
can be set to the same value as that of an oxygen molecule (~32 g/mol). In addition, also set
values for the initial coverage fractions of the two: 1 ([-]) for the free surface site and 0 ([-]) for
the stored oxygen, meaning that initially the entire storage site is free and available for storing
oxygen onto it.

reactants.
4. Select
From the reaction equations we can determine the following gas species (either educts or
products): C3H6, CO, CO2, H2O and O2. The rate formulation of reaction 1 also uses the
molar fraction of NO in its denominator as an inhibitor. These species are added to the
page [46]
reaction mechanism on the page Gas and Liquid Species
in the table "Gas Species"
by selecting the species in the left hand side column and clicking "Add" (you can type some
letters into the "Filter" to find the desired ones more quickly). In the right hand side column all
species available in the reaction mechanism are listed:

variables required for the rate formulations.


5. Choose
The reaction rate formulations are functions of physical variables that generally change during
the simulation, like temperature and gas species molar fraction etc.. The AUCI provides an
interface for accessing these variables, independent of the simulation software in which the
AUCI model is used. The interface, that is, the definition of variables, their names and their
page [47]
meanings, can be found on the page Global Variables and Parameters
.
6

AVL User Coding Interface

1. Get Started
In the table "Simulation Variables Mapping", variable declarations for the required physical
variables are added by introducing new rows. In the left column "Name", the variable name
can be chosen, which will later be used in the actual rate formulation code.
Note: Since the rate formulation is written in ANSI C, the variable names must
follow the ANSI C code standards for variable naming.
In the right column, a pull-down menu provides all available simulation variables, from which
the required variable is selected. Next to each simulation variable the unit is written in which it
will be passed to the reaction mechanism during simulation:

Note: The variable name for the reaction rate itself is already pre-defined and
cannot be changed.
information about reactions.
6. Enter
The reaction mechanism comprises three reactions. They are added on the page Reactions
page [49]

by inserting rows into the table. Check the "Publish reaction switches" box if you want
to be able to switch reactions on/off later on, from the BOOST interface.

Now, information about all three reactions can be provided. In the following steps, this is
page
shown only for the first reaction as an example. Each reaction has its own page Reaction
[49]
. Here, first of all, general information is provided like a name and optionally a comment.
The type of the reaction can be selected: the first reaction, which describes the oxidation of
propene, is a "Conversion" reaction. The reaction rate unit is converter surface based:

AVL User Coding Interface

1. Get Started
After that, the reaction stoichiometry specified; add as many rows to the "Reaction
Stoichiometry" table as there are reactants in the reaction. In the left column select the gas
species (or storage site species) from a pull-down menu (1). In the right column enter the
stoichiometric coefficients (2).
Note: The educts' coefficients have a negative sign, whereas products' coefficients
have a positive sign.

At the bottom of that page, graphics for the reaction equation and reaction rate formulation
can be added to the user coding project. These graphics are not only visible in the AUCI
graphical user interface, but also later on when loading the model in the simulation software.
In order to add graphics, click the "Insert Picture" button and select the graphic in the file
browser.

AVL User Coding Interface

1. Get Started

Each Reaction page has two sub-pages: one for specifying the heat of reaction and one for
providing the rate formulation.
The heat of reaction of the first reaction is -1925479.3 J/mol. Therefore, select Heat of
reaction as "Const" from the drop-down menu to the left of the input field (1) and enter the
value into the field (2) [mind the unit!]:

For the rate formulation first of all the reaction rate parameters are added to the model.
Please compare the figure below for their values and units. In the very first column of this
table the variable name of the parameter is typed in as it will be used when coding the rate
formulation below. The last two columns are related to publishing reaction parameters: if the
parameter shall be published, tick the check-box and type a public label into the right column,
by which the parameter can easily be identified later on, when loaded in the simulation tool:

Finally, the reaction rate formulation can be added in the section "Rate Formulation". The rate
formulation should be entered in ANSI C code format. Additional declaration can be added
in the "Declaration" input field, the rate formulation itself is entered in the "Code" input field.
For the reaction rate the variable rate has been specified. The rate formulation is assigned

AVL User Coding Interface

1. Get Started
to this variable. In the assignment of the rate formulation the other variables and the above
reaction rate parameters are being used.

The details and rate formulation of the other two reactions shall be added in the same
manner. Please select "Storage" as Reaction type for them.
Double-check public model parameters.

7. All model parameters that are public are collected on the Public Model Parameters

page [52]

page. In order to display them, click the "Update" button:

The resulting tree structure of sub-pages and their content reflects the Model Parameter
interface by means of which parameters can be accessed later on in the simulation tool. For
example, the reaction rate parameters of reaction 1 (C3H6 Oxidation) are public, amongst
others:

10

AVL User Coding Interface

1. Get Started

8. Select degree of model encapsulation.

9.

On this page, the contents of the simulation summary file, the simulation results and
additional contents of the archive (uca) file can be selected. For this tutorial, all of the options
page
should be left in the checked state. For more information see section Model Encapsulation
[52]
.
Compile model.
To compile the model finished model into a library which can be used by the simulation
kernel, go to the "Build Model" page and click on the "Build Model" button.

After the model is compiled successfully ("AUCI model is compiled"), a line is added to the
"Current Project Status" table indicating the platform and architecture of the library. The green
checkmark symbol in the "Status" column indicates that the library was built successfully.
Now click on the "Save" button in the toolbar (or use the Menu: File > Save) to store the
library just built in the archive (this step is important; otherwise the archive will not contain the
library and will not be usable in the simulation tool).

AVL User Coding Interface

11

1. Get Started

catalytic reaction mechanism.


10. Load
Now, load the catalytic reaction mechanism in a BOOST Aftertreatment catalyst element.
You can use the DOC_Lightoff.bwf from the BOOST Aftertreatment examples as a starting
point. Double-click the catalyst element, navigate to the subpage Catalyst > Washcoat >
[1]: My_Reaction and deselect the pre-defined Reaction Model "Diesel Oxidation Catalyst
(DOC)", since the user-coded mechanism shall be used instead (1). Then, in the table "User
Defined Reactions" below, select "Yes" in the "Enabled" column (2) and click on "Select
Archive" below the table (3).

11.
12

Navigate to the place where the ucp file created earlier resides and select it.
Adjust public model parameter.
Click on "Model Parameters" below the table.

AVL User Coding Interface

1. Get Started

In the new window which opens, you see all the public model parameters just the way you
page [10]
saw them in Step 7
in the second screenshot (there, under the tree node "Public
Model Parameters"):

Select e.g. the "Rate Formulation" subnode of the C3H6 Oxidation. You will be presented
a list of all the rate parameters belonging to this reaction, any of which you may edit simply
by entering a different value. You may even assign a Case Parameter (a general BOOST
functionality) to any of the values.

Now go to the O2 Adsorption > Rate Formulation page and reduce the K6 to 210000 kmol/
2
(m s), then close the dialog again.

simulation.
12. Run
Now you can start the simulation just as any other simulation (

13.

or in the top menu


Simulation > Run).
Simulation summary.
The case directory contains a simulation summary file in xml format, atm_summary.xml,
which you can view by opening it in your web browser (we recommend to use a recent
browser version which supports displaying svg vector graphics for this purpose, e.g. Firefox).
A summary of the employed user reactions can be found in chapter 5.1.6, "Catalytic
Reactions: My_Reaction". This can be used, e.g., to review the rate parameters employed in
the simulation.

AVL User Coding Interface

13

1. Get Started

14. Post-processing.
Open Impress Chart (menu: Simulation > Show Results). In the figure below, the Overall
Conversion of C3H6 and the Overall Surface Fraction of O2 and the empty site are depicted
as representative results of the first two reactions:

1.3. Examples
1.3.1. Catalytic Reaction Mechanisms
The following installation examples are available:
1.3.1.1. DOC_AST_Predefined.ucp
This model comprises the Diesel Oxidation Catalyst reaction mechanism which is provided as a
pre-defined kinetic model in BOOST and FIRE. Below the mechanism is described in detail. The
page [71]
page [71]
rate equations and kinetic parameters are mainly based on literature, [4
,5
].
Kinetic Model
R1
R2
R3, approach 1
R3, approach 2
The corresponding reaction rates for the reactions 1 and 2 are defined as follows:
(5)

(6)

where
(7)

14

AVL User Coding Interface

1. Get Started
(8)

The corresponding reaction rate for the reaction 3 is defined as follows:


(9)
approach 1:
(10)
approach 2:
where:
(11)

(12)

(13)

1.3.1.2. LNT_AST_Predefined.ucp
This model comprises the Lean NOx Trap reaction mechanism, which is provided as a predefined kinetic model in BOOST and FIRE. Below the mechanism is described in detail. The rate
page [71]
page [71]
equations and kinetic parameters are mainly based on literature, [6
,7
].
Kinetic Model
R1
R2
R3
R4
R5
R6
R7
R8
R9
R10
R11
R12
R13
R14

AVL User Coding Interface

15

1. Get Started
R15
R16
For all reaction rates the following definition applies:
(14)

The corresponding reaction rates for the catalytic reactions 1-10 are defined as follows:
(15)

(16)

(17)

(18)

(19)
(20)

(21)
(22)

(23)

(24)

Storage and release of O2 is described by reaction 11 and depends on the surface oxygen ratio:
(25)
(26)

16

AVL User Coding Interface

1. Get Started
where the engine lambda eng is evaluated from the species composition in the bulk gas
page [70]
according to Brinkmeier [1
] is described by the equation
(27)

A fuel CHx with ratio of x=1.814 is assumed and the mole fraction of oxygen in air yO2,air is
assumed to be 0.2095.
Storage and release of nitric oxides is described by reactions 12 to 16:
(28)
(29)
(30)
(31)
(32)

1.3.1.3. SCRS_AST_Predefined.ucp
This model comprises the Selective Catalytic Reduction (SCR), Steady Approach reaction
mechanism which is provided as a pre-defined kinetic model in BOOST and FIRE. Below the
mechanism is described in detail. The rate equations and kinetic parameters are mainly based on
page [71]
page [71]
literature, [8
,9
].
Kinetic Model
R1
R2
R3
R4
R5
R6
R7, approach 1
R7, approach 2
The corresponding reaction rates for the reactions 1-6 are defined as follows:
(33)
(34)

AVL User Coding Interface

17

1. Get Started

(35)

(36)

(37)
(38)
where:
(39)

The rate for reaction 7 results from:


approach 1:

approach 2:
where:
(40)

(41)

(42)

1.3.1.4. SCRT_AST_Predefined.ucp
This model comprises the Selective Catalytic Reduction (SCR), Transient Approach reaction
mechanism which is provided as a pre-defined kinetic model in BOOST and FIRE. Below the
mechanism is described in detail. The rate equations and kinetic parameters are mainly based on
page [71]
literature, [9
].
Kinetic Model
R1
R2
R3
R4
18

AVL User Coding Interface

1. Get Started
R5
R6
R7
R8
R9, approach 1
R9, approach 2
R10
The corresponding reaction rates for the reactions 1-8 are defined as follows:
(43)
(44)
(45)
(46)

(47)

(48)

(49)
(50)
where:
(51)

The rate for reaction 9 results from:


approach 1:

approach 2:
where:
(52)

(53)

AVL User Coding Interface

19

1. Get Started

(54)

The rate for reaction 10 results from:

1.3.1.5. TWC_AST_Predefined.ucp
This model comprises the Three Way Catalyst reaction mechanism which is provided as a predefined kinetic model in BOOST and FIRE. Below the mechanism is described in detail. The rate
page [71]
page [71]
page [71]
equations and kinetic parameters are mainly based on literature, [10
,4
,5
,6
page [71]
].
Kinetic Model
R1
R2
R3
R4
R5, approach 1
R5, approach 2
R6
R7
R8
R9
Cerium Storage Reactions:
R10
R11
R12
R13
Rhodium Storage Reactions:
R14
R15
R16
R17
R18
R19
20

AVL User Coding Interface

1. Get Started
Barium Storage Reactions:
R20
R21
Hydrocarbon (HC) Storage Reaction:
R22
The corresponding reaction rates are defined as follows:
(55)

(56)

(57)

(58)

(59)

(60)

(61)

(62)

(63)
(64)
(65)
(66)
(67)

AVL User Coding Interface

(68)
21

1. Get Started
(69)
(70)
(71)
(72)
(73)
(74)
where
(75)

(76)
(77)

The equilibrium constants in reactions 6, 8 and 9 are determined by:


(78)

(79)

(80)

The rate for reaction 5 results from:


approach 1:

approach 2:
where:
(81)

(82)

(83)
22

AVL User Coding Interface

1. Get Started

The rate for reaction 22 (HC storage) is defined as:


(84)

where

is obtained from the correlation:


(85)

1.3.1.6. TWC_Brinkmeier.ucp
This model comprises a reaction mechanism for a Three Way Catalyst as presented by
page [70]
Brinkmeier [1
] including 11 conversion reactions and oxygen storage and release.
1.3.1.7. urea_thermal_decomposition_ebrahimian2012.ucp
This model comprises a reaction mechanism for a detailed Urea decomposition model as
page [71]
page [71]
presented in [11
, 12
]. In this mechanism the formation and decomposition of urea,
biuret, cyanuric acid and ammelide are taken into account.

Figure 2. Chemical structure of reactants considered in Urea decomposition model


The following reactions are considered:
R1
R2
R3
R4
R5
R6
R7
R8
R9
R10
R11
R12
1.3.1.8. Water_condensation_evaporation.ucp
This model allows for a simple treatment of the effects of water condensation on and evaporation
from a substrate, using a pseudo-reaction
(86)
The 'reaction' is associated with a reaction enthalpy corresponding to the heat of evaporation.
The rate of the reaction is proportional to the difference between the water concentration and
the saturation pressure at a given temperature. The saturation pressure is calculated according
page [71]
to [3
]. The parameter psat_depression_factor can be used to reduce this calculated

AVL User Coding Interface

23

1. Get Started
saturation pressure in order to primitively account for enhanced condensation in capillaries on a
porous substrate. A value smaller than 1 accounts for porosity, while a value of 1 corresponds to
condensation on a smooth surface.
1.3.1.9. DPF-Catalytic_CO-HC-NO-oxidation.ucp
This model comprises reactions for oxidation of carbon monoxide, hydrocarbons (propene and
propane) and nitrogen monoxide. It is meant to serve as a drop-in replacement for the predefined CO, HC, NO Oxidation reaction set to be used in the DPF. The rate equations and kinetic
page [71]
page [71]
parameters are mainly based on literature [4
,5
].
R1
R2
R3
R4 (approach 1)
R5 (approach 2)
The reaction rates are defined as follows:
(87)
CO oxidation:

(88)
Propene oxidation:

(89)
Propane oxidation:

In these three reactions, the inhibition term is defined as


(90)

In this formula, yHC is substituted for yC3H6 for reactions 1 and 2, while yC3H8 is used for reaction 3.
Note that the parameters E'2-5 and K'2-5 are defined as global parameters in the ucp, since they
are meant to be common to all of the inhibitor terms.
For the NO oxidation rate, two approaches are available:
(91)
NO oxidation, approach 1:

(92)

(93)
NO oxidation, approach 2:
24

AVL User Coding Interface

1. Get Started

(94)

1.3.1.10. DPF-Catalytic_SCR.ucp
This model comprises the Selective Catalytic Reduction (SCR), Transient Approach reaction
mechanism. It is meant to serve as a drop-in replacement of the pre-defined SCR mechanism in
the DPF. Below, the mechanism is described in detail. The rate equations and kinetic parameters
page [71]
are mainly based on literature, [9
].
R1
R2
R3
R4
R5
R6 (transient)
R7 (steady-state)
R8 (approach 1)
R9 (approach 2)
The rates of these reactions are defined as follows:
(95)

(96)
NH3 desorption:

(97)
Standard SCR:

(98)
Fast SCR:

(99)

AVL User Coding Interface

25

1. Get Started
Slow SCR:

(100)
NH3 oxidation, transient approach:

(101)
NH3 oxidation, steady-state approach:

The NO oxidation is available in two different rate approaches. If NO oxidation is desired,


either R8 or R9 should be used (i.e. they are not meant to be both at the same time). The rate
approaches are formulated as follows:
(102)
NO oxidation, approach 1:

(103)

(104)
NO oxidation approach 2:

(105)

1.3.2. Regeneration Reaction Mechanisms


The following installation examples are available:
1.3.2.1. DPF-Regeneration_O2-thermal.ucp
This regeneration model comprises two soot oxidation reactions with oxygen:
Kinetic Model
R1
R2
The corresponding rates are calculated using the following formulas:
(106)
Soot oxidation with O2 to CO:
26

AVL User Coding Interface

1. Get Started

(107)
Soot oxidation with O2 to CO2:

In this model, K1 and E1 are common to both reactions, which is why they are defined as global
parameters rather than as individual reaction parameters. The term fCO is used in both rate
formulations and is therefore set up as a global variable. Hence, its value has to be calculated
only once by means of a global function with the function parameters k f , q f and E f .
(108)

1.3.2.2. DPF-Regeneration_O2-fuel-additive.ucp
page [26]
This regeneration model is basically the same as the DPF-Regeneration_O2-thermal.ucp
model, the only difference being different default values for K1 and E1.
1.3.2.3. DPF-Regeneration_O2-NO2.ucp
This regeneration model comprises four soot oxidation reactions, two with oxygen and two using
nitrogen dioxide:
Kinetic Model
R1
R2
R3
R4
The reaction rates of the reactions involving oxygen are described in section DPFpage [26]
Regeneration_O2-thermal.ucp
. The rates of reactions 3 and 4 are calculated with:
(109)
Soot oxidation with NO2 to CO:

(110)
Soot oxidation with NO2 to CO2:

1.3.2.4. DPF-Regeneration_O2-NO2-NO2-catalytic.ucp
This regeneration model comprises four soot oxidation reactions, two with oxygen and two using
nitrogen dioxide, and an NO oxidation reaction regenerating the NO2:
Kinetic Model
R1
R2

AVL User Coding Interface

27

1. Get Started
R3
R4
R5

The reaction rates of the reactions involving oxygen are described in section DPFpage [26]
Regeneration_O2-thermal.ucp
, those involving nitrogen dioxide in section DPFpage [27]
Regeneration_O2-NO2.ucp
. The rate of the NO oxidation is calculated by:
(111)
NO oxidation:

(112)

1.3.2.5. DPF-Regeneration_soot_order_variation.ucp
This regeneration model illustrates how regeneration reactions proportional to a certain soot
order can be modelled with AUCI.
The example comprises one soot oxidation reaction:

The reaction rate depends on soot concentration only with a certain order (n), multiplied with a
regeneration constant k. The rate of the CO2 production is calculated by:
(113)

1.3.3. Transfer Models


The following installation examples are available:
1.3.3.1. Washcoat_EffectivePoreDiffusionModel.ucp
This model comprises the effective pore diffusion model which is provided as a pre-defined
washcoat pore diffusion model in BOOST and FIRE. Below the model is described in detail:
A simple approach to take into account the hindered molecular movement in the porous medium
is described by the effective pore diffusion model. The interaction of the gas molecules with the
solid walls result in a higher diffusion resistance and longer diffusion paths. The tortuosity wcl
describes the locally averaged ratio of actual diffusion length to direct diffusion length. Thus, the
effective diffusion coefficient Dk,eff of the species is smaller than the free gas diffusion coefficient
Dk,g of species k, as described by the equation
(114)

1.3.3.2. Washcoat_ParallelPoreModel.ucp
This model comprises the parallel pore model (PPM) which is provided as a pre-defined
page [71]
washcoat pore diffusion model in BOOST and FIRE. Below the model developed by [15
]
is described in detail:
28

AVL User Coding Interface

1. Get Started
The model composes the transport effects of the pure gas phase and Knudsen diffusion
assuming both transport effects taking place in parallel. With this, the effective diffusion
coefficient is defined as
(115)

where DKn is the Knudsen diffusion coefficient depending on pore diameter dpor, molar mass M of
the considered species and temperature Ts, as described by the equation
(116)

1.3.3.3. Washcoat_RandomPoreModel.ucp
This model comprises the random pore model (RPM) which is provided as a pre-defined
page [71]
washcoat pore diffusion model in BOOST and FIRE. Below the model developed by [16
]
is described in detail:
Assuming that the washcoat features two distinct characteristic pore size diameters, called
macro- and micro-pores, the approach of the PPM is first applied to both pores sizes individually.
In a second step, the two macro and micro pore diffusion coefficients, DM and
, are combined
applying probabilistic and geometrical considerations. This leads to an effective diffusion
coefficient according to the equations
(117)

1.3.3.4. BoundaryLayer_Hawthorn.ucp
This model comprises the heat and mass transfer mechanism according to Hawthorn's equation
page [71]
[18
].
1.3.3.5. BoundaryLayer_Hausen.ucp
This model comprises the heat and mass transfer mechanism according to Hausen equation [17
page [71]
].
1.3.3.6. BoundaryLayer_Martin.ucp
This model comprises the heat and mass transfer mechanism according to Hawthorn's equation
page [71]
page [71]
[19
,20
].
1.3.3.7. Sieder-Tate.ucp
page
This model comprises the heat and mass transfer mechanism according to Sieder-Tate [17
[71]
].
The heat transfer coefficient is calculated according to:
(118)

while the mass transfer coefficient is evaluated by:


(119)

AVL User Coding Interface

29

1. Get Started

30

AVL User Coding Interface

2. Documentation

2. Documentation
2.1. Graphical User Interface
On the below pages the AUCI graphical user interface is described in detail. General and
common functionalities are described on the the next page. Specific features of the single
interfaces are described on designated pages.

2.1.1. General
2.1.1.1. Launching AUCI
On this page it is described, how the AVL User Coding Interface can be launched in the following
simulation softwares:
BOOST page [31]
CRUISE M page [33]
FIRE page [33]

BOOST
The AVL User Coding Interface can be launched from the BOOST GUI menu bar option
"Utilities":

The AUCI launcher is started and the desired interface can be selected:

There are also designated links to start the specific AUCI where ever an AUCI model can be
loaded. For example:
User defined heat and mass transfer models at the Catalyst Physical Properties page:

AVL User Coding Interface

31

2. Documentation

User defined catalytic reaction mechanism at the Washcoat -> My_Reaction page:

User defined pore diffusion model at the Washcoat -> My_Transport page:

32

AVL User Coding Interface

2. Documentation
User defined regeneration reaction mechanism at the DPF Reactions -> My_Regeneration
page:

CRUISE M
The AVL User Coding Interface can be launched in CRUISE M from the Catalyst Substrate
elements page Washcoat Reactions:

FIRE
The AVL User Coding Interface can be launched form the Module "Aftertreatment TNG" ->
Catalyst -> Washcoat -> My_Reaction:
2.1.1.2. Project Organization
Project Structure
An AUCI project consists of several files, namely:
ucp file
The user coding project comprises all data required for an AUCI model and which are
shown in the below figure. The ucp file always contains ALL data and is therefore not
encapsulated.

AVL User Coding Interface

33

2. Documentation
uca file
The user coding archive comprises only the DLLs plus that content which has been
indicated by the user at the Model Encapsulation page in each AUCI interface. The
additional content can be external resources (for example thermodynamic data file) and the
public model parameters.
uci file
page [39]
The user coding interface comprises all Public Model Parameters
. It is included in
the ucp file and optionally in the uca file. It is possible to export parameter to a uci file from a
simulation software (e.g. BOOST), and to import parameter to a simulation software or to an
AUIC model.
Figure 3. AUCI project structure

External Resources
At several locations external resources can be added to a user coding project that hold additional
information. In the below list external resources are detailed:
External Resource

File Format

Description

Thermodynamic data file

ASCII

The thermodynamic data file


comprises a list of polynomial
coefficients for the calculation
of specific heats, enthalpies
and entropies. A detailed
description of the file format
page [34]
can be found here
.

Transport property data file

ASCII

The transport property


data file comprises a list
of molecular parameters
for the calculation of
species viscosities, thermal
conductivities and diffusion
coefficients of a multicomponent gas mixture. A
detailed description of the file
page
format can be found here
[36]
.

2.1.1.2.1. Thermodynamic Data File


The Thermodynamic data file is a database that comprises the polynomial coefficients to
calculate the specifc heat, the standard state enthalpy and the standard state enthropy of a
species according the NASA polynomials.
page [71]
The file format is the commonly used format described in 13
: The file starts with 2 header
lines, the first containing the keyword THERMO followed by the second line providing the
three temperatures used in the fitting process (low temperature, break temperature and high
34

AVL User Coding Interface

2. Documentation
temperature), which can be overruled for individual species. An arbitrary number of Species data
follows (4 line blocks) according to the format table below and ends with the keyword END in the
last line.
Line No.

Content

Format

Column

Species name (must start in Column 1)

18A1

1-18

Date (not used)

6A1

19-24

Atomic symbols and formula

4(2A1,I3)

25-44

Phase of species (S, L, or G for solid, liquid, or


gas, respectively)

A1

45

Low temperature

E10.0

46-55

High temperature

E10.0

56-65

Common temperature (if not default according


to header, otherwise blank)

E8.0

66 to 73

Atomic symbols and formula (if needed, else


blank)

2A1,I3

74-78

The integer 1

I1

80

Coefficients a1 up to a5 in polynomial fit for the 5(E15.8)


upper temperature interval

1 to 75

The integer 2

I1

80

Coefficients a6, a7 for the upper temperature


interval, and a1, a2 and a3 for the lower
temperature interval

5(E15.8)

1 to 75

The integer 3

I1

80

Coefficients a4, a5, a6 and a7 for the lower


temperature interval

4(E15.8)

1 to 60

The integer 4

I1

80

The below example shows the definition of the thermodynamic data for the species O2 and H2O:
THERMO
300.000 1000.000 5000.000
O2
121386O
2
G 0300.00
5000.00
1000.00
1
0.03697578E+02 0.06135197E-02-0.12588420E-06
0.01775281E-09-0.11364354E-14
2
-0.12339301E+04 0.03189165E+02 0.03212936E+02
0.11274864E-02-0.05756150E-05
3
0.13138773E-08-0.08768554E-11-0.10052490E+04 0.06034737E+02
4
H2O
20387H
2O
1
G 0300.00
5000.00
1000.00
1
0.02672145E+02 0.03056293E-01-0.08730260E-05
0.12009964E-09-0.06391618E-13
2
-0.02989921E+06 0.06862817E+02 0.03386842E+02
0.03474982E-01-0.06354696E-04
3

AVL User Coding Interface

35

2. Documentation
0.06968581E-07-0.02506588E-10-0.03020811E+06 0.02590232E+02
4
END
2.1.1.2.2. Transport Property Data File
The Transport property data file is a database that comprises molecular parameter to calculate
the viscosity, the thermal conductivity and the diffusion coefficient of a species in a multicomponent gas.
page [71]
The file format is the commonly used format described in 14
: The file holds the molecular
parameter for an arbitrary number of Species (1 line each) according to the format table below.
Although the format of the molecular parameter is free, one must stick to the order defined by the
below listing.
Content

Format

Column

Species name (must start in Column 1)

16A1

1-16

Geometrical configuration identifier (0, 1 or 2) of the


molecule:
0: molecule is a single atom.
1: molecule has linear geometrical configuration.
2: molecule has nonlinear geometrical configuration.

free

17-

Lennard-Jones potential well depth

free
free

Lennard-Jones collision diameter

free

Dipole moment

free

Polarizability
Rotational relaxation collision number
298 Kelvin

at

Optional Comment

free

-80

free

80-

The below example shows the definition of the transport property data for the species O2 and
H2O:
O2
H2O

1
2

107.400
572.400

3.458
2.605

0.000
1.844

1.600
0.000

3.800
4.000

2.1.1.3. Menu Bar


Menu
File

Submenu

Shortcut

Icon

New

Ctrl+N

Start a new
project.

Open

Ctrl+O

Load a saved
project (.ucp).

Save

Ctrl+S

Save the current


project (.ucp).

Save as

36

Description

Save the current


project (.ucp) with

AVL User Coding Interface

2. Documentation
a new name to
the same folder.

Edit

Help

Export Archive

Create a model
archive (.uca).

Import
Parameters

Import model
parameters from
a user coding
interface (.uci)
file.

Quit

Ctrl+Q

Exit the program.

Undo

Ctrl+Z

Undo the last


step.

Redo

Ctrl+Y

Repeat the last


step.

Manual

Access this
Users Guide.

About

Display version
information.

2.1.1.4. Common Features


General Project Information

At the very first page in the AUCI general


information on the user coding project is
required.
Name
Specify the name of the user coding model.
This name is NOT a file name but should
rather be a human-readable name by which
the model can be identified by the application
engineer for example in the simulation
summary file.
Author
Specify the author of the user coding model.
Date
Specify a date. By default the date of creation
is provided.
Comment
Specify a comment on the user coding model.
page [39]
The comment can be made public
.

Model Parameter

Besides pre-defined input parameter, a


generic interface is available to define arbitrary
model parameter of different type. The
required input is defined as follows:
Name
This is the name the parameter will be
referenced by in the C code. Therefore, its
naming scheme must be compatible with the
naming of variables in ANSI C (i.e. no spaces

AVL User Coding Interface

37

2. Documentation
or special characters, must not start with a
number etc.).
Value
The parameter's value in case its Type is set
to Const.
Unit
This serves to accomodate a human-readable
string indicating the unit of the parameter.
Type
page [38]
Select the input type
of the global
parameter from a drop-down menu.
Public
page [39]
Make this parameter public
together
with its Public Label and with its Unit.
Public Label
This serves to accomodate a human-readable
string to shortly describe the parameter's
purpose.
Type

For various input data the input type can be


chosen out of a comprehensive list:
Const
Specify a scalar value for the input parameter.
The parameter's value will be a double type
constant value throughout the course of the
simulation.
Table
Specify a tabular input for the parameter.
In some cases the unit group of the domain
of definition can be chosen out of a given
selection, for example temperature, GHSV or
time.
Lines can be added and removed by clicking
and , and can be copied and pasted using
the buttons and . A table's contents can
be saved
to file and opened
from file
(plain text file, each line containing a spaceseparated x/y value pair).
Function
A parameter of this type will have the purpose
of modifying one or more parameter of type
Variable. This is achieved by assigning a
value to the variable parameter in the Code
window of the Function Formulation using
ANSI C code.
For flexibility the function provides the
possibility to add Function Parameters, that
can be added and removed by clicking and

38

AVL User Coding Interface

2. Documentation
, and can be copied and pasted using the
buttons and .
API
Specify a generic C function of type double.
It can have an arbitrary number of arguments
passed to it, out of which the return value of
this function can be calculated.
API Arguments can be added/removed with
and . Each API argument can be of double
or int type.
The return value a parameter of type API will
have is declared in the code window under API
Formulation by assigning a value to the predefined keyword return_value using ANSI C.
Variable
The parameter's value is declared to be
variable and is changed by a corresponding
parameter of type Function.
Thermal Database
No special input is required. The input
parameter is calculated internally as specified.
Publish / Public

The degree of model encapsulation and data


nondisclosure is controlled using the publish
function. In general there are two classes of
objects that can be published:
If comments are published, they are
translated into the generated C code and can
be accessed by the application that loads the
AUCI user model. Public comments can be
written to the simulation summary file.
If model parameters get published, they are
are accessible via the graphical user interface
of the simulation software, in which the AUCI
page
model is loaded (cf. Model Parameters
[39]
). In addition, they can be written to the
simulation summary file.
Public model parameters typically have a label
and a unit, by which they can be identified.
Label and unit can either be specified by the
user, or they are pre-defined in AUCI.

Public Model Parameters

The Public Model Parameters page and


its sub-pages displays all public model
parameters as they are accessible in the
simulation software, in which the AUCI model
is loaded.
The structure of the sub-pages refers to the
structure of input pages in AUCI and helps to
better organize the public model parameters.
Graphics that have been added to the model
are shown as well and support the application
engineer in using this model.
39
AVL User Coding Interface

2. Documentation
The content of the Public Model Parameter
pages is refreshed by pressing the 'Update'
button.
Code Input

The code input of for example reaction rates,


global functions and so on, requires the below
page [68]
input. The programming language is C
.
Declaration
Declare any helping variables, constants etc.
needed in the rate formulation here.
Code Typing Assistant
A drop-down list providing:
Math functions
AUCI API functions page [69]
Pre-defined constants page [69]
Variables
Model Parameters
Code
Type the actual formulation as ANSI C code
here.

Build Model

The final step in creating an user coding


model is the Build Model step. All the
specified input will be compiled into binaries
(dynamic-link-libraries and shared-objects,
respectively), that are loaded during the
simulation.
Build Settings
The compiler environment for the build
process can be adjusted in this section.
Build platform
Select this option to control the platform
settings or environment setup scripts
explicitly, as opposed to using defaults.
Using defaults requires that the compiler
can be called from any system command
shell or interpreter without any additional
preparation steps.
The platform selector offers all supported
platforms for which Build Model can be
performed, depending on the current
platform. On a 64-bit Operating System
you may select a 32-bit platform and
compile 32-bit binaries. Compiling
Windows binaries on Linux, or Linux
binaries on Windows, is not supported.
Environment setup file
Select this option if the compiler cannot
be called from any system command
shell or interpreter without additional
preparation steps. On Windows you
will find the drop-down selector on the
left of the input field quite handy, it

40

AVL User Coding Interface

2. Documentation
offers existing Microsoft Visual Studio
environment setup files which exist on
your computer. Alternatively you can
select User defined path and use the file
browser button on the right to select an
arbitrary environment setup file.
Linux only: If you need to pass an
argument to the setup file you might try
to explicitly double-quote <setup file>
<arg(s)>, for instance, specify
"/usr/local//iccvars.sh ia32"
rather than
/usr/local//iccvars.sh ia32
Environment arguments (Windows
only)
On Windows environment setup files
typically take an argument. Select this
option if you need to specify such an
argument. The default argument which
you get after changing the Environment
setup file above is supposed to be
exactly what you need.
Current Project Status
The table summarizes all platforms for which
the User Model has already been compiled
and the status of the related binaries. It shows
whether the existing binaries are:
Current build platform.
Successfully built.
Not built at all, due to a build error.
Potentially obsolete. It was built
successfully, however the model has been
modified since then.
Build Model
The model can be compiled by pressing the
Build Model button.
Messages
Displays the AUCI build messages.
Log file
Displays the compiler messages.
2.1.1.5. Global vs. Local Simulation Variables
Some of the variables provided with the Simulation Variables Mapping have the supplement
global or local in their name: the meaning is explained in this section.

AVL User Coding Interface

41

2. Documentation
Global Simulation Variables
A simulation variable with the supplement global provides access to the variable used by the
client (e.g. BOOST) in the simulation when solving the related balance equations.
For example, the Washcoat bulk density (global) in AUCI Catalytic Reaction Mechanism is the
density of the washcoat used in the enthalpy balance equation of the solid substrate.
Local Simulation Variables
A simulation variable with the supplement local provides access to the variable defined with
the AUCI model. Its value may be different from the global variable, depending in the actual
simulation model set-up.
For example, the Washcoat bulk density (local) in AUCI Catalytic Reaction Mechanism is the
page [43]
Washcoat bulk density specified at Washcoat | Washcoat Properties
.

2.1.2. Catalytic Reaction Mechanism


Description
The AUCI Catalytic Reaction Mechanism offers the possibility to model heterogeneous chemical
reactions in catalysts, and adsorption and desorption processes at the catalysts surface, from
elementary reactions up to macro-kinetic reaction mechanisms.
The target is to provide the reaction rate formulations which are evaluated during the simulation
and which serve as source and sink terms to the balance equations solved by the simulation
software.
Availability

BOOST

CRUISE M

FIRE
Application
Catalyst
Filter with Catalytic Wall
Features
Design of catalytic reaction mechanisms
Arbitrary number of reactions
Arbitrary number of species
Arbitrary number of storage site
Deposition and decomposition of liquid species
Model Database
Diesel Oxidation Catalyst
Selective Catalytic Reduction
NOx Trap
Three Way Catalyst
... check out Examples page [14] for more
Details
The following sections explain the input required in the graphical user interface to set up a userdefined catalytic reaction mechanism:

42

AVL User Coding Interface

2. Documentation
2.1.2.1. New Catalytic Reaction Mechanism
page [37]
Refer to the general description of the General Project Information
.
2.1.2.2. Washcoat
Washcoat Properties
In this section details of the washcoat for which the catalytic reaction mechanism is designed can
be provided.
Typical Range
Edit washcoat properties

Enable this check-box, if


details of the washcoat shall
be provided.

Washcoat bulk density

Enter a value for the washcoat 400-2000 (kg/m3)


bulk density. This value can be
page [39]
made public
.

Washcoat porosity

Enter a value for the washcoat 0-1 ([-])


porosity. This value can be
page [39]
made public
.

Washcoat thickness

Enter a value for the washcoat 0-1e-03 ([m])


thickness. This value can be
page [39]
made public
.

Ratio of active catalytic


area to converter geometric
area

This value specifies the ratio


1-100 ([-])
of the catalytically active
washcoat surface to the
converter's inner geometric
area. It will only have an
effect on: a) Reactions with
page
a Reaction rate unit
[50]
of type Washcoat surface
based, b) Storage sites with
page [44]
a Storage capacity
of
type Washcoat surface based.
This value can be made public
page [39]
.

Storage Sites
In this section, the number of storage sites in the catalytic reaction mechanism is specified.
page [34]
Thermodynamic data of the storage site species can be specified using a therm.dat file
, in
which they need to have the phase label 'S'.
Storage sites are added and deleted by clicking and . An entire storage site can be copied
and pasted using the buttons and .
Typical Range
Use custom file

Enable this feature to load a


custom thermodynamic data
file to be included in the AUCI
model.

Thermodynamic data file

Optionally provide a
page
thermodynamic data file
[34]
as external resource. By

AVL User Coding Interface

43

2. Documentation
default the file therm.dat from
the installation is selected.
Site Name

Input field to specify the name


of the surface site, e.g. CuZeolite, Cerium, Barium, ...

Catalytic Sites
In this section the composition of the washcoat with respect to catalytic sites, like for example
noble metals, can be specified.
Typical Range
Edit catalytic sites
specification

Enable this check-box, if


details of catalytic sites in the
washcoat shall be provided.

Site density

Enter a value for the density


of catalytic sites in the
washcoat. This value can be
page [39]
made public
.

Catalytic Sites table


Site Name

Enter the name of a catalytic


site that is part of the
washcoat, e.g. Rh, Pd, Pt, ...

Fraction

Enter the weight fraction


of the catalytic site in the
washcoat.

2.1.2.2.1. New Storage Site


At this page the details of a storage site are required. This includes specification of species
stored at the storage site and their properties.
Typical Range

44

Name

Input field to specify the name


of the storage site.

Storage capacity

Input of the maximum amount


of species that can be stored
on the site relative to an entity
which can be selected from a
drop down menu on the left
edge of the input field:
Converter Surface
2
Based (mol/m )
Converter Volume Based
3
(mol/m )
Washcoat Volume Based
3
(mol/m )
Washcoat Mass Based
(mol/kg) (if Washcoat
Properties are provided)
Washcoat Surface Based
2
(mol/m ) (if a Ratio of
active catalytic area to
converter geometric area
page [43]
is provided)

AVL User Coding Interface

2. Documentation
The storage capacity can
page [39]
be made public
; the
label for the storage sites
storage capacity is created
dynamically and not editable.
Storage Site Species table
Input of all data concerning storage site species. Storage site species are added and deleted
by clicking and .
Note: The first storage site species must be the empty storage site, e.g. Cerium.
Name

Input field to specify the name


of the storage site species.

Molecular Weight

Input field to specify the


molecular weight of the
storage site species. In
general the molecular weight
of the storage site species
referring to the empty site can
be set to 0 g/mol, non-empty
sites will then have the net
molecular weight of the stored
species.

Formation Enthalpy

Input field to specify the


formation enthalpy of the
storage site species.

Type

Select input type


input
type of formation enthalpy:
Const
Table (function of
temperature)
Function
Thermal Database

Initial Loading Ratio

Input of the initial loading ratio


of the storage site species.
The sum of initial loading
ratios of all storage site
species needs to be equal to
one.

0 - 1 ([-])

Maximum Loading Ratio

Input of the maximum loading


ratio of the storage site
species.

0 - 1 ([-])

Type

Select input type


input
type of maximum loading ratio:
Const
Table (function of
temperature)

Public

Make the maximum loading


page [39]
ratio public
.

Correct Initial Loading


Ratios

Correct the initial loading ratio


of the selected species so that
the sum of initial loading ratios

page [38]

page [38]

AVL User Coding Interface

45

2. Documentation
of all storage site species is
equal to one.
Publish initial loading
ratios

Make the initial loading ratios


of all storage site species
page [39]
public
; the label for
each storage site species
initial loading ratio is created
dynamically and not editable.

2.1.2.3. Gas and Liquid Species


At this page the user specifies the gas and liquid species used in the catalytic reaction
mechanism.
Each species, selected from a list of available species on the left and added to the list on the
right gives rise to a set of reaction variables like e.g. the species' molar density/mass/fraction
which may later be mapped to variable tokens to be used when coding the actual reaction rates.
For each group of species, gas and liquid, a separate file holding thermodynamic data may be
specified.
Typical Range
Gas Species
Use custom file

Enable this feature to load a


custom thermodynamic data
file to be included in the AUCI
model.

Thermodynamic data file

Optionally provide a
page
thermodynamic data file
[34]
as external resource. By
default the file therm.dat from
the installation is selected.

Available Species

This list displays all species


with phase label 'G' available
in the thermodynamic data file
selected above.

Selected Species

This list displays all species


that can be used in the
catalytic reaction mechanism
and that have been selected
from the list "Available".
Use the "Add" or "Remove"
button to add or remove
species to and from this list.

Liquid Species

46

Use custom file

Enable this feature to load a


custom thermodynamic data
file to be included in the AUCI
model.

Thermodynamic data file

Optionally provide a
page
thermodynamic data file
[34]
as external resource. By
default the file liquid_therm.dat

AVL User Coding Interface

2. Documentation
from the installation is
selected.
Available Species

This list displays all species


with phase label 'L' available
in the thermodynamic data file
selected above.

Selected Species

This list displays all species


that can be used in the
catalytic reaction mechanism
and that have been selected
from the list "Available".
Use the "Add" or "Remove"
button to add or remove
species to and from this list.

2.1.2.4. Global Variables and Parameters


Simulation Variables Mapping
In this table, variables are defined whose values will come from or be input into the simulation
kernel e.g. the individual species' molar density/mass/fraction, the cell's washcoat volume or the
current simulation time etc..
Click / , to add/remove a variable, to/from the table. The string you enter in the Name column
will be the one used for accessing this variable in the C code. Therefore, its naming scheme
must be compatible with the naming of variables in ANSI C (i.e. no spaces or special characters,
must not start with a number etc.). Use the drop-down box in the column Assigned Simulation
Variable to select the meaning of the variable.
The following simulation variables are available:
Simulation
Variable

Unit

Reaction Rate

selected at
page
Reaction

Catalyst
output

Filter
output

Catalyst
output

Catalyst
output

[50]

Catalytic site
density

kg/m

Cell monolith
volume

Cell washcoat m
volume

Excess
oxygen ratio

[-]

Excess
oxygen ratio
(ICVT)

[-]

Formation
enthalpy of
Gas Species

J/kg

Formation
enthalpy of
Storage Site
Species

J/kg

AVL User Coding Interface

47

2. Documentation
Simulation
Variable

Unit

Catalyst

Filter

Catalyst

Gas hourly
1/s
space velocity
(GHSV)
2

Geometrical
surface area

m /m

Gibbs free
energy/RT of
Gas Species

[-]

Gibbs free
energy/RT of
Storage Site
Species

[-]

Loading ratio
of Storage
Site Species

kmol/kmol

Mass density
of Gas
Species

kg/m

Mass density
of Liquid
Species

kg/m

Maximum
loading ratio
of Storage
Site Species

kmol/kmol

Molar density

kmol/m

Molar density
of Gas
Species

kmol/m

Molar fraction
of Gas
Species

kmol/kmol

Molar mass of kg/kmol


Gas Species

48

Molar
concentration
of Liquid
Species

kmol/m

Storage site
density of
Storage Site

mol/m

Substrate
temperature

Time

AVL User Coding Interface

Catalyst

2. Documentation
Simulation
Variable

Unit

Washcoat
bulk density
page [42]
(local
)

kg/m

Washcoat
bulk density
page [42]
(global
)

kg/m

Catalyst

Filter

Catalyst

Catalyst

(a)

(a)

(a)

: available
: not available; a dummy-value is passed instead, or feature cannot be selected
(a): if defined within AUCI model
Here, Gas Species, Liquid Species, Storage Site and Storage Site Species are replaced by the
page [46]
species selected at the Gas and Liquid Species
page, and the storage sites and their
page [43]
page [44]
storage site species specified on the Washcoat
page and New Storage Site
page,
respectively.
Global Parameters
In this section, global parameters can be defined. 'Global' means the values of the parameters
defined here will be accessible in all user-entered code blocks, e.g. in all reaction rate
formulations so that they will not have to be redefined separately for each reaction.
For detailed information on the required input refer to the general description of Model Parameter
page [37]
.
Global parameters are added and deleted by clicking and , and can be copied and pasted
using the buttons and .
2.1.2.5. Reactions
You can add reactions to the mechanism by clicking (click to remove selected reactions).
Reactions can be copied and pasted using the buttons and . Each reaction listed in that table
will have its own sub-page on which further details of the reaction can be entered.
Typical Range
Name

Input field to specify the name


of the reaction.

Select

This check-box serves as a


'reaction switch' to enable /
disable the reaction in the
simulation.

Publish reaction switches

Make the reaction switches


page [39]
public
.

2.1.2.5.1. New Reaction


General Information
Typical Range
Name

Specify the name of the


reaction.

AVL User Coding Interface

49

2. Documentation

50

Comment

An arbitrary comment may be


entered here. The comment
page [39]
can be made public
.

Reaction type

The rates of Conversion type


reactions will be affected by
the Effective catalyst loading
multiplier, while rates of
Storage type reactions will
remain unaffected.

Reaction rate unit

Choose the unit of the


reaction rate here:
Converter Surface
2
Based (kmol/(m s))
Converter Volume Based
3
(kmol/(m s))
Washcoat Volume Based
3
(kmol/(m s))
Washcoat Mass Based
(kmol/(kgs)) (if Washcoat
page [43]
Properties
are
provided)
Washcoat Surface Based
2
(kmol/(m s)) (if a Ratio
of active catalytic area to
converter geometric area
page [43]
is provided)
Unit conversion is done
automatically by the
calculation kernel.
For the unit group
Washcoat Mass Based
the washcoat (wcl) bulk
density is required. In
case of a full washcoat
model the wcl density
is taken from the client
where the model is
applied. However if no
full washcoat model is
selected the wcl density
provided with the AUCI
model is used. If for
some reasons the wcl
density from the AUCI
model shall be taken into
account in any case (full
washcoat model or not)
the unit conversion from
washcoat mass based
to converter surface
based may be performed
manually and the reaction
rate unit then needs to be

AVL User Coding Interface

2. Documentation
set to Converter Surface
Based.
Reaction Stoichiometry
Use this table to define the reaction's stoichiometry. Add/remove reaction species using the
buttons / .
Note: It is necessary that gas, liquid or storage site species have been set up in the
relevant preceding pages in order to be able to define a meaningful stoichiometry here.
In case there are alternatives to choose from for the species, they can be selected by clicking
on the species name to be altered in the Reactant Name column and select the desired species
from the drop-down box. In the column labeled Stoichiometric Coefficient, the reaction
stoichiometry can be defined by entering numbers. Negative numbers mean the species will be
consumed (left/educts side of the reaction equation) while positive number mean the species
will be produced (right/products side of the reaction equation). E.g. the values in the table below
describe the oxidation of carbon monoxide: CO + 1/2 O2
CO2.
Table 1: Reaction Stoichiometry example
Reactant Name

Stoichiometric Coefficient

CO

-1

O2

-0.5

CO2

Reaction Equation Graphic


An image file depicting the reaction can be inserted here. Accepted formats are png, bmp, jpg
and gif.
page [39]
The reaction equation graphic is used in the Public Model Parameter
dialog.
Reaction Rate Formulation Graphic
An image file depicting the reaction rate formula can be inserted here. Accepted formats are png,
bmp, jpg and gif.
page [39]
The reaction rate graphic is used in the Public Model Parameter
dialog.
2.1.2.5.1.1. Heat of Reaction
page [38]
The input type
of the heat of reaction can be selected from a drop-down menu:
Const
Table (function of temperature)
Function
Thermal Database:
Note: The heat of reaction is calculated from the difference of the formation
enthalpies of reaction products and reactants, respectively. The enthalpies of
gas and surface species are calculated from the data given in the respective
thermodynamic data files. For surface species, these formation enthalpies may be
overridden (by a constant, table, or function).
Note: Exothermal reactions' enthalpies carry a negative sign, whereas those of
endothermal reactions have a positive sign.
The input below is required dependent on the above selection:

AVL User Coding Interface

51

2. Documentation
Typical Range
Heat of reaction

Enter a value for the heat of


reaction.

Heat of reaction table


Temperature

Enter a value for the


temperature.

Heat of reaction

Enter a value for the heat of


reaction at the temperature
specified.

Heat of reaction function


Comment

Enter an optional comment.

Heat of Reaction Function


Parameters

Enter parameter used in


the heat of reaction function
formulation.
These parameter can have
Type:
Const
Table
Parameters can be made
page [39]
public
.

Heat of Reaction Function


Formulation

Enter the heat of reaction


function formulation. Refer to
page [40]
section Code Input
for
details.

2.1.2.5.1.2. Rate Formulation


Reaction Rate Parameters
For detailed information on the required input refer to the general description of Model Parameter
page [37]
.
Rate Formulation
The actual reaction rate has to be coded in ANSI C. For detailed information on the required
page [40]
input refer to the general description of Code Input
.
The reaction rate will have the value which is assigned to the rate variable. Its unit is set on the
parent page.
2.1.2.6. Public Model Parameters
page [39]
Refer to the general description of the Public Model Parameters
page.
2.1.2.7. Model Encapsulation
The AUCI model can be encapsulated with respect to different aspects:
model parameters that are accessible and modifiable during the simulation via a GUI
model results that are visible after the simulation and stored in simulation results files
model specification details that are visible after the simulation in the simulation logfile
The page "Model Encapsulation" summarizes several check-boxes steering the degree of
encapsulation. The check-boxes are collected in different groups, each of them providing a
button and a
button, with which all check-boxes of a group can be enabled and
disabled by one click.

52

AVL User Coding Interface

2. Documentation
Content of Simulation Summary File
This group steers model encapsulation regarding model specification details visible in the
simulation logfile.
Washcoat properties

Enables/disables writing the washcoat


properties to the simulation summary file

Storage sites specification

Enables/disables writing the storage site


specification to the simulation summary file

Catalytic sites specification

Enables/disables writing the catalytic sites


specification to the simulation summary file

Reactions specification

Enables/disables writing the reaction


specification to the simulation summary file

Global parameters

Enables/disables writing global parameters to


the simulation summary file

Public comments

Enables/disables writing public comments to


the simulation summary file

Content of Simulation Results


This group steers model encapsulation regarding model results stored in simulation results files.
Reaction rates

Enables/disables writing reaction rates to the


simulation summary results

Gas species rates

Enables/disables writing gas species rates to


the simulation summary results

Liquid species rates

Enables/disables writing liquid species rates to


the simulation summary results

Enthalpy rate

Enables/disables writing the enthalpy rate to


the simulation summary results

Storage site densities

Enables/disables writing storage site densities


to the simulation summary results

Storage site species fractions

Enables/disables writing storage site species


fractions to the simulation summary results

Storage site species loadings

Enables/disables writing storage site species


loadings to the simulation summary results

Additional Content of Exported Archive (uca)


page [33]
This group steers the content of the User Coding Archive (uca)
file. In addition to the
compiled model, external resources, i.e. the various thermodynamic data files, and the public
model parameters can be stored.
Gas species thermodynamic data file

Enables/disables storing the gas species


thermodynamic data file "therm.dat" to the uca
file

Liquid species thermodynamic data file

Enables/disables storing the liquid species


thermodynamic data file "liquid_therm.dat" to
the uca file

AVL User Coding Interface

53

2. Documentation
Storage site species thermodynamic data file

Enables/disables storing the storage


site species thermodynamic data file
"surf_therm.dat" to the uca file

Public model parameters

Enables/disables storing the public model


parameter file to the uca file. If enabled the
public model parameter are accessible during
the simulation and can be modified via a GUI.

2.1.2.8. Build Model


page [40]
Refer to the general description of Build Model
page.
2.1.2.9. Import Surface Chemkin Mechanism
page [71]
Even though AUCI does not make use of the Surface Chemkin [21
] program package
directly, the data contained in Surface Chemkin mechanism files can be imported into AUCI.
The importer takes care of setting up the mechanism, i.e. it supplies the extracted data to the
appropriate fields in the GUI automatically. This includes:
adding given surface sites with their names, site densities and surface species
adding gas species used in the mechanism
setting up global reaction variables and parameters required for the reaction rate
formulations
setting up the reactions with their stoichiometries, their rate parameters, and the C code
which describes the reaction rate.
After importing a mechanism, the model just has to be built (compiled), saved as a ucp or uca
file, then it is ready for use. Of course, the model may also be edited just as one set up manually
may be.
Import dialog
To open the import dialog choose File > Import Surface Chemkin mechanism from the menu.
The process of importing a Surface Chemkin mechanism into AUCI consists of two steps:
1. parsing the mechanism file
2. importing the mechanism
Step 1: parsing the mechanism file
The first thing you usually do is to select a Surface Chemkin mechanism file containing the
information about the mechanism like surface site data, surface species, reactions etc. as text
data. Next, you have options regarding the thermodynamic data of gas species and surface
species.
For the gas species thermodynamic data, you may choose from three options:
Use default (builtin) thermodynamic data. AUCI has a builtin thermodynamic data base
comprising many common gas species. This is the default option.
Use data included in selected mechanism. Select this option if your mechanism file has a
section containing thermodynamic data for the gas species used in that mechanism.
Use data from separate data file. Select this if you want to use a different file containing
thermodynamic data in the therm.dat format. In this case, you are required to choose such a
file.
For the surface species thermodynamic data, you may choose from two options (analogous to
the last two of the gas species thermodynamic data):
Use data included in selected mechanism. Select this option if your mechanism file has a
section containing thermodynamic data for the surface species used in that mechanism.
This is the default option.
Use data from separate data file. Select this if surface species thermodynamic data
(therm.dat format) is contained in a separate file. Again, if you choose this option, the file
chooser line must not be empty.
54

AVL User Coding Interface

2. Documentation
As in practice a lot of Surface Chemkin files make use of common gas species, and
thermodynamic data for surface species is contained in the mechanism input file, it may
be sufficient to only select the mechanism file. To finish step 1, click on the button Parse
mechanism to parse the file, i.e. to extract the data contained therein.
Step 2: importing the mechanism
Messages. After the information contained in the mechanism file has been extracted (i.e.
after 'Parse mechanism' has been clicked), the 'Importer messages' text window may contain
messages regarding the importing process, such as warnings or errors, e.g., if the mechanism
page [55]
contains unsupported keywords (see Table Table 2: Unsupported functionality
).
Reactions. The reactions extracted from the mechanism will be automatically shown in the
Selected column of the selection widget on the Reactions tab. In this widget, you may adjust
the order of the reactions or choose to import only a subset of the reactions extracted from the
mechanism file. Individual reactions making use of unsupported functionality (such as plasma
reactions making use of a reaction yield multiplier etc.) will not be available for importing.
Surface Sites. On the Surface Sites tab, you can see a list of extracted surface site information
if the mechanism has surface sites declared. Each site's surface site density is shown in the
column right to the site's name.
2

Note: Surface Chemkin's site density has units of mol/cm (washcoat), that is, it is
related to the catalyst washcoat's actual surface area. AUCI's default surface site
density, at present, is converter surface based, i.e. based on the converter's geometrical
2
surface area with associated units of kmol/m (converter). Therefore, to account for
an uneven and thus larger surface area of a catalyst washcoat than the geometrical
converter surface area, for convenience, all site densities may be scaled upon importing
2
by changing the factor in the input field f_cat_geo (which has units of m (washcoat)/
2
m (converter)) above the table accordingly. Moreover, this factor is used to convert all
reaction rates from washcoat based to converter based units. Default is not to scale
2
the surface site densities (or rates), i.e. use a conversion factor of 1.0 m (washcoat)/
2
m (converter).
If the reaction mechanism contains surface species, these species' molecular weights may
be calculated automatically from the elemental composition information provided in the
thermodynamic data file. To omit calculation of their molecular weights, uncheck the check box
Calculate molecular weights of surface species at the bottom of the import dialog.
To start the importing process, click on OK

Unsupported functionality
Some of the functionality of Surface Chemkin is not supported by the importer. See the following
table for more information:
Table 2: Unsupported functionality
Functionality

Related keyword

Information

Materials

MATERIAL

At present, AUCI does


not support the notion of a
'material'. Thus, the importer
will merge the information
given in each MATERIAL
section into one single
mechanism without discerning
the materials it comes from.

Bulk phases

BULK

Bulk phases are currently not


supported in AUCI. Therefore,
mechanisms containing the

AVL User Coding Interface

55

2. Documentation
BULK keyword can not be
imported.
Surface site nonconservation

NONCON

AUCI requires the number of


surface sites to be conserved,
i.e. the site density to remain
constant. For this reason,
mechanisms stating NONCON
on the REACTIONS line can
not be imported.

Ion-enhanced reaction
yields

YIELD, #

Plasma reactions making use


of the yield multiplier # will not
be available for importing.

Bohm velocity correction

BOHM

Reactions requesting a Bohm


velocity correction for positive
ionic species will not be
available for importing.

Cation energy dependence

ENRGDEP

Reactions specifying rate


constant dependence on a
positive ionic species will not
be available for importing.

2.1.3. Regeneration Reaction Mechanism


Description
The AUCI Regeneration Reaction Mechanism offers the possibility to model heterogeneous
chemical reactions in soot particle filters.
The target is to provide the reaction rate formulations which are evaluated during the simulation
and which serve as source and sink terms to the balance equations solved by the simulation
software.
Availability

BOOST
Application
Filter Regeneration
Features
Design of soot regeneration reaction mechanisms
Arbitrary number of reactions
Arbitrary number of species
Consideration of particle structure
Model Database
Regeneration with Oxygen
Regeneration with Oxygen and Notric Oxides
... check out Examples page [26] for more
Details
The following sections explain the input required in the graphical user interface to set up a userdefined regeneration reaction mechanism:
56

AVL User Coding Interface

2. Documentation
2.1.3.1. New Regeneration Reaction Mechanism
page [37]
Refer to the general description of the General Project Information
.
2.1.3.2. Gas and Solid Species
At this page the user specifies the gas and solid species used in the regeneration reaction
mechanism.
Each species, selected from a list of available species on the left and added to the list on the
right gives rise to a set of reaction variables like e.g. the species' molar density/mass/fraction
which may later be mapped to variable tokens to be used when coding the actual reaction rates.
For gas species a separate file holding thermodynamic data may be specified.
Typical Range
Gas Species
Use custom file

Enable this feature to load a


custom thermodynamic data
file to be included in the AUCI
model.

Thermodynamic data file

Optionally provide a
page
thermodynamic data file
[34]
as external resource. By
default the file therm.dat from
the installation is selected.

Available Species

This list displays all species


with phase label 'G' available
in the thermodynamic data file
selected above.

Selected Species

This list displays all species


that can be used in the
regeneration reaction
mechanism and that have
been selected from the list
"Available".
Use the "Add" or "Remove"
button to add or remove
species to and from this list.

Solid Species
Available

This list displays all available


solid species.

Selected Species

This list displays all species


that can be used in the
regeneration reaction
mechanism.
Note: The only
possible and always
required solid
species is soot
('C(S)').

AVL User Coding Interface

57

2. Documentation
2.1.3.3. Global Variables and Parameters
Simulation Variables Mapping
In this table, variables are defined whose values will come from or be input into the simulation
kernel e.g. the individual species' molar density/mass/fraction, the substrate temperature or the
current simulation time etc..
Click / , to add/remove a variable, to/from the table. The string you enter in the Name column
will be the one used for accessing this variable in the C code. Therefore, its naming scheme
must be compatible with the naming of variables in ANSI C (i.e. no spaces or special characters,
must not start with a number etc.). Use the drop-down box in the column Assigned Simulation
Variable to select the meaning of the variable.
The following calculation variables are available:
Simulation Variable

Unit

Filter
3

Reaction Rate

kmol/m /s

Cell monolith volume

Excess oxygen ratio

[-]

Excess oxygen ratio (ICVT)

[-]

Formation enthalpy of Gas


Species

J/kg

Gas molar density

kmol/m

Geometrical surface area

m /m

Layer thickness of Solid


Species

Mass concentration of Solid


Species

kg/m

Mass density of Gas Species

kg/m

Molar density of Gas Species

kmol/m

Molar fraction of Gas Species

kmol/kmol

Molar mass of Gas Species

kg/kmol

Substrate temperature

Time

output

3
3

: available
: not available; a dummy-value is passed instead, or feature cannot be selected
Here, Gas Species and Solid Species are replaced by the species selected at the Gas and Solid
page [57]
Species
page.

58

AVL User Coding Interface

2. Documentation
Global Parameters
In this section, global parameters can be defined. 'Global' means the values of the parameters
defined here will be accessible in all user-entered code blocks, e.g. in all reaction rate
formulations so that they will not have to be redefined separately for each reaction.
For detailed information on the required input refer to the general description of Model Parameter
page [37]
.
Global parameters are added and deleted by clicking and , and can be copied and pasted
using the buttons and .
2.1.3.4. Reactions
You can add reactions to the mechanism by clicking (click to remove selected reactions).
Reactions can be copied and pasted using the buttons and . Each reaction listed in that table
will have its own sub-page on which further details of the reaction can be entered.
Typical Range
Name

Input field to specify the name


of the reaction.

Select

This check-box serves as a


'reaction switch' to enable /
disable the reaction in the
simulation.

Publish reaction switches

Make the reaction switches


page [39]
public
.

2.1.3.4.1. New Reaction


General Information
Typical Range
Name

Input field to specify the name


of the reaction.

Comment

An arbitrary comment may be


entered here. The comment
page [39]
can be made public
.

Reaction type

The reaction is always of type


Regeneration.

Reaction Stoichiometry
Use this table to define the reaction's stoichiometry. Add/remove reaction species using the
buttons / .
Note: It is necessary that gas or solid species have been set up in the relevant
preceding pages in order to be able to define a meaningful stoichiometry here.
In case there are alternatives to choose from for the species, they can be selected by clicking
on the species name to be altered in the Reactant Name column and select the desired species
from the drop-down box. In the column labeled Stoichiometric Coefficient, the reaction
stoichiometry can be defined by entering numbers. Negative numbers mean the species will be
consumed (left/educts side of the reaction equation) while positive number mean the species
will be produced (right/products side of the reaction equation). E.g. the values in the table below
describe the oxidation of carbon monoxide: C(S) + O2
CO2.
Table 3: Reaction Stoichiometry example

AVL User Coding Interface

59

2. Documentation
Reactant Name

Stoichiometric Coefficient

C(S)

-1

O2

-1

CO2

Reaction Equation Graphic


An image file depicting the reaction can be inserted here. Accepted formats are png, bmp, jpg
and gif.
page [39]
The reaction equation graphic is used in the Public Model Parameter
dialog.
Reaction Rate Formulation Graphic
An image file depicting the reaction rate formula can be inserted here. Accepted formats are png,
bmp, jpg and gif.
page [39]
The reaction rate graphic is used in the Public Model Parameter
dialog.
2.1.3.4.1.1. Heat of Reaction
page [38]
The input type
of the heat of reaction can be selected from a drop-down menu:
Const
Table (function of temperature)
Function
Thermal Database:
Note: The heat of reaction is calculated from the difference of the formation
enthalpies of reaction products and reactants, respectively. The enthalpies of
gas and surface species are calculated from the data given in the respective
thermodynamic data files. For surface species, these formation enthalpies may be
overridden (by a constant, table, or function).
Note: Exothermal reactions' enthalpies carry a negative sign, whereas those of
endothermal reactions have a positive sign.
The input below is required dependent on the above selection:
Typical Range
Heat of reaction

Enter a value for the heat of


reaction.

Heat of reaction table


Temperature

Enter a value for the


temperature.

Heat of reaction

Enter a value for the heat of


reaction at the temperature
specified.

Heat of reaction function

60

Comment

Enter an optional comment.

Heat of Reaction Function


Parameters

Enter parameter used in


the heat of reaction function
formulation.
These parameter can have
Type:

AVL User Coding Interface

2. Documentation
Const
Table
Parameters can be made
page [39]
public
.
Heat of Reaction Function
Formulation

Enter the heat of reaction


function formulation. Refer to
page [40]
section Code Input
for
details.

2.1.3.4.1.2. Rate Formulation


Reaction Rate Parameters
For detailed information on the required input refer to the general description of Model Parameter
page [37]
.
Rate Formulation
The actual reaction rate has to be coded in ANSI C. For detailed information on the required
page [40]
input refer to the general description of Code Input
.
The reaction rate will have the value which is assigned to the rate variable. Its unit is set on the
parent page.
2.1.3.5. Public Model Parameters
page [39]
Refer to the general description of the Public Model Parameters
page.
2.1.3.6. Model Encapsulation
The AUCI model can be encapsulated with respect to different aspects:
model parameter, that are accessible and modifiable during the simulation via a GUI
model results, that are visible after the simulation and stored in simulation results files
model specification details, that are visible after the simulation in the simulation logfile
The page "Model Encapsulation" summarizes several check-boxes steering the degree of
encapsulation. The check-boxes are collected in different groups, each of them providing a
button and a
button, with which all check-boxes of a group can be enabled and
disabled by one click.
Content of Simulation Summary File
This group steers model encapsulation regarding model specification details visible in the
simulation logfile.
Reactions specification

Enables/disables writing reaction specification


to the simulation summary file

Public model parameters

Enables/disables writing public model


parameters to the simulation summary file

Public comments

Enables/disables writing public comments to


the simulation summary file

Content of Simulation Results


This group steers model encapsulation regarding model results stored in simulation results files.
Reaction rates

Enables/disables writing reaction rates to the


simulation summary results

Gas species rates

Enables/disables writing gas species rates to


the simulation summary results

AVL User Coding Interface

61

2. Documentation
Enthalpy rate

Enables/disables writing enthalpy rate to the


simulation summary results

Additional Content of Exported Archive (uca)


page [33]
This group steers the content of the User Coding Archive (uca)
file. In addition to the
compiled model external resources, i.e. the various thermodynamic data files, and the public
model parameter can be stored.
Gas species thermodynamic data file

Enables/disables storing the gas species


thermodynamic data file "therm.dat" to the uca
file

Public model parameter

Enables/disables storing the public model


parameter file to the uca file. If enabled the
public model parameter are accessible during
the simulation and can be modified via a GUI.

2.1.3.7. Build Model


page [40]
Refer to the general description of Build Model
page.

2.1.4. Transfer Models


Description
The AUCI Transfer Models offers the possibility to model heat and mass transfer at the gassolid interface boundary layer on the one hand, and washcoat pore diffusion models on the other
hand.
The target is to provide the heat transfer coefficient, mass transfer coefficient and/or effective
pore diffusion coefficient, that are evaluated during the simulation and considered in the related
source and sink terms of the balance equations solved by the simulation software.
The AUCI Transfer Models does not support publication of model information.
Availability

BOOST
Application
Boundary Layer Transfer (Catalyst, Filter)
Washcoat Pore Diffusion (Catalyst)
Features
Design of heat transfer models
Design of mass transfer models
Design of pore diffusion models
Model Database
Sieder-Tate Heat & Mass Transfer
Effective Pore Diffusion Model
... check out Examples page [28] for more
Details
The following sections explain the input required in the graphical user interface to set up userdefined heat and mass transfer and pore diffusion models:

62

AVL User Coding Interface

2. Documentation
2.1.4.1. New Transfer Model
page [37]
Refer to the general description of the General Project Information
.
2.1.4.2. Gas Species
At this page the user specifies the gas species for which a designated mass transfer model and/
or pore diffusion model shall be implemented.
Each species, selected from a list of available species on the left and added to the list on the
right may later be selected at the mass transfer model and/or pore diffusion model pages.
For the gas species a separate file holding transport property data may be specified.
Typical Range
Gas Species
Use custom file

Enable this feature to load a


custom transport property data
file to be included in the AUCI
model.

Transport property data file

Optionally provide a transport


page [36]
property data file
as
external resource. By default
the file trans.dat from the
installation is selected.

Available Species

This list displays all species


available in the transport
property data file selected
above.

Selected Species

This list displays all species


that can be used in the
transfer model and that have
been selected from the list
"Available".
Use the "Add" or "Remove"
button to add or remove
species to and from this list.

2.1.4.3. Global Variables and Parameters


Simulation Variables Mapping
In this table, variables are defined whose values will come from or be input into the simulation
kernel e.g. the Reynolds number, the gas temperature, the species diffusion coefficient or the
current simulation time etc..
Click / , to add/remove a variable, to/from the table. The string you enter in the Name column
will be the one used for accessing this variable in the C code. Therefore, its naming scheme
must be compatible with the naming of variables in ANSI C (i.e. no spaces or special characters,
must not start with a number etc.). Use the drop-down box in the column Assigned Simulation
Variable to select the meaning of the variable.
The following calculation variables are available:
Simulation
Variable

Unit

Heat Transfer
Coefficient

W/m /K

Catalyst
Heat & Mass
Transfer
2

Filter
Washcoat Pore
Diffusion

Mass Transfer

output

AVL User Coding Interface

63

2. Documentation
Simulation
Variable

Unit

Mass Transfer
Coefficient

m/s

Effective
Pore Diffusion
Coefficient

m/s

Distance from
inlet

Catalyst
Heat & Mass
Transfer

Filter
Washcoat Pore
Diffusion

output

output
output

DPF channel ID
3

DPF soot
concentration

kg/m

DPF soot height

Gas dynamic
viscosity

Pa.s

Gas heat
conductivity

W/m/K

Gas mass
density

kg/m

Gas specific heat J/kg/K


capacity
Gas temperature

Gas velocity

m/s

Geometrical
surface area

m /m

Hydraulic
diameter

Peclet number
for heat transfer

[-]

Peclet number
for species mass
transfer

[-]

Prandtl number

[-]

Reynolds
number

[-]

Schmidt number

[-]

Species
m /s
effective diffusion
coefficient in
mixture
Species density
64

Mass Transfer

kg/m

AVL User Coding Interface

2. Documentation
Simulation
Variable

Unit

Species molar
mass

kg/kmol

Species reaction
rate

kg/(m s)

Substrate
temperature

Time

Wall velocity

m/s

Washcoat
porosity (global
page [42]
)

[-]

Catalyst
Heat & Mass
Transfer

Filter
Washcoat Pore
Diffusion

Mass Transfer

Washcoat
[-]
page
porosity (local
[42]
)
Washcoat
temperature

: available
: not available
Global Parameters
In this section, global parameters can be defined. 'Global' means the values of the parameters
defined here will be accessible in all user-entered code blocks, e.g. in all transfer model
formulations so that they will not have to be redefined separately for each one of them.
For detailed information on the required input refer to the general description of Model Parameter
page [37]
.
Global parameters are added and deleted by clicking and , and can be copied and pasted
using the buttons and .
2.1.4.4. Heat Transfer Model
General Information
Some general information on the heat transfer model can be provided:
Typical Range
Name

The name of the heat transfer


model is fixed.

Comment

Enter a comment or short


notice on this model.

Heat Transfer Model Parameter


For detailed information on the required input refer to the general description of Model Parameter
page [37]
.

AVL User Coding Interface

65

2. Documentation
Heat Transfer Model Formulation
The actual model formulation has to be coded in ANSI C. For detailed information on the required
page [40]
input refer to the general description of Code Input
.
The heat transfer coefficient will have the value which is assigned to the alpha variable.
2.1.4.5. Mass Transfer Models
You can add / remove mass transfer models to the mechanism by clicking / . Mass transfer
models can be copied and pasted using the buttons and . Each mass transfer model listed in
that table will have its own sub-page on which further details of the model can be entered.
Typical Range
Model Name

Input field to specify the name


of the mass transfer model.

2.1.4.5.1. Mass Transfer Model (default)


Note: The default mass transfer model applies to all species in the simulation set-up,
which are not affected by another mass transfer model in the user coding project.
General Information
Some general information on the mass transfer model can be provided:
Typical Range
Name

The name of the default mass


transfer model is fixed.

Comment

Enter a comment or short


notice on this model.

Mass Transfer Model Parameter


For detailed information on the required input refer to the general description of Model Parameter
page [37]
.
Mass Transfer Model Formulation
The actual model formulation has to be coded in ANSI C. For detailed information on the required
page [40]
input refer to the general description of Code Input
.
The mass transfer coefficient will have the value which is assigned to the beta variable.
2.1.4.5.2. Mass Transfer Model
General Information
Some general information on the mass transfer model can be provided:
Typical Range

66

Name

Provide the name the mass


transfer model.

Comment

Enter a comment or short


notice on this model.

Affected Gas Species

Add and select species to


which this mass transfer
model should apply.

AVL User Coding Interface

2. Documentation
Mass Transfer Model Parameter
For detailed information on the required input refer to the general description of Model Parameter
page [37]
.
Mass Transfer Model Formulation
The actual model formulation has to be coded in ANSI C. For detailed information on the required
page [40]
input refer to the general description of Code Input
.
The mass transfer coefficient will have the value which is assigned to the beta variable.
2.1.4.6. Pore Diffusion Models
You can add / remove pore diffusion models to the mechanism by clicking / . Pore diffusion
models can be copied and pasted using the buttons and . Each pore diffusion model listed in
that table will have its own sub-page on which further details of the model can be entered.
Typical Range
Washcoat porosity

Specify the porosity of the


washcoat to which the pore
diffusion models apply.

0 - 1 ([-])

Washcoat thickness

Enter a value for the washcoat 0-1e-03 ([m])


thickness.

Model Name

Input field to specify the name


of the pore diffusion model.

2.1.4.6.1. Pore Diffusion Model (default)


Note: The default pore diffusion model applies to all species in the simulation set-up,
which are not affected by another pore diffusion model in the user coding project.
General Information
Some general information on the pore diffusion model can be provided:
Typical Range
Name

The name of the default pore


diffusion model is fixed.

Comment

Enter a comment or short


notice on this model.

Pore Diffusion Model Parameter


For detailed information on the required input refer to the general description of Model Parameter
page [37]
.
Pore Diffusion Model Formulation
The actual model formulation has to be coded in ANSI C. For detailed information on the required
page [40]
input refer to the general description of Code Input
.
The effective pore diffusion coefficient will have the value which is assigned to the DiffCoeff
variable.
2.1.4.6.2. Pore Diffusion Model
General Information
Some general information on the pore diffusion model can be provided:

AVL User Coding Interface

67

2. Documentation
Typical Range
Name

Provide the name of the pore


diffusion model.

Comment

Enter a comment or short


notice on this model.

Affected Gas Species

Add and select species to


which this pore diffusion model
should apply.

Pore Diffusion Model Parameter


For detailed information on the required input refer to the general description of Model Parameter
page [37]
.
Pore Diffusion Model Formulation
The actual model formulation has to be coded in ANSI C. For detailed information on the required
page [40]
input refer to the general description of Code Input
.
The effective pore diffusion coefficient will have the value which is assigned to the DiffCoeff
variable.
2.1.4.7. Model Encapsulation
The AUCI model can be encapsulated with respect to different aspects:
model parameter, that are accessible and modifiable during the simulation via a GUI
model results, that are visible after the simulation and stored in simulation results files
model specification details, that are visible after the simulation in the simulation logfile
The page "Model Encapsulation" summarizes several check-boxes steering the degree of
encapsulation. The check-boxes are collected in different groups, each of them providing a
button and a
button, with which all check-boxes of a group can be enabled and
disabled by one click.
Additional Content of Exported Archive (uca)
page [33]
This group steers the content of the User Coding Archive (uca)
file. In addition to the
compiled model external resources, i.e. the transport property data file, can be stored.
Gas species transport property data file

Enables/disables storing the gas species


transport property data file "trans.dat" to the
uca file

2.1.4.8. Build Model


page [40]
Refer to the general description of Build Model
page.

2.2. Basics in C and AUCI User Coding


This section provides base information about the programming language C that is used in AUCI.
The predefined constants and functions (APIs) provided with AUCI are explained as well in detail.

2.2.1. The programming language C


page [40]

All Code Input


fields require ANSI C as programming language. For comprehensive
documentation refer to the ANSI C standard: http://www.open-std.org/jtc1/sc22/wg14/www/
standards.
The following table comprises mathematical operations from the C standard library math.h, that
are common in reaction rate formulations. Further mathematical operations from math.h can be
used according to their declaration.
68

AVL User Coding Interface

2. Documentation
C Function

Description

atan(x)

Returns arctangent of variable x.

exp(x)

Evaluates exponential function for variable x.

fabs(x)

Returns absolute value of variable x.

log(x)

Returns natural logarithm of variable x.

pow(x,p)

Returns variable x to the power of p.

sqrt(x)

Returns square root of variable x.

2.2.2. AUCI APIs and Predefined Constants


The AUCI for Catalytic Reaction Mechanisms, Regeneration Reaction Mechanisms and Transfer
Models offers several predefined physical and mathematical constants, as well as some
predefined functions.
Predefined Constants
Name
F_PATM

Value

Description

1.013E+02

Unit

Atmospheric pressure
Mathematical constant

F_PI
3.14159265359
F_RMOL

8.3144

Ideal gas constant

F_SMALL

1.0E-10

Epsilon limiter of order of magnitude


of -10

F_TINY

1.0E-12

Epsilon limiter of order of magnitude


of -12

APIs
Arrhenius function
Declaration

double Arrhenius(double, double, double,


double);

Usage

rate = Arrhenius(T,K,E,p);

Description:

Evaluates Arrhenius according to

Equilibrium constant evaluation


Declaration

double EquiConst(double, double, double, double,


double, double, double, double);

Usage

Keq = EquiConst(T,A,B,C,D,E,p,R);

Description:

Evaluates a fit function to the equilibrium constant of the following


form:

AVL User Coding Interface

69

2. Documentation
The argument R serves as a lower/upper cut-off to the argument
of the exponential function.
Signum function
Declaration

double CATLIB_dsign(double, double);

Usage

signum = CATLIB_dsign(x,y);

Description:

Evaluates the signum function.

max function
Declaration

double max(double, double);

Usage

z = max(x,y);

Description:

Returns maximum of x and y.

min function
Declaration

double min(double, double);

Usage

z = min(x,y);

Description:

Returns minimum of x and y.

2.3. Prerequisites
Compiler
The AUCI requires a C compiler to be installed. Refer to the Supported Platforms section of the
AWS Installation Guide for the compiler version specification.
Compatibility
The figure below shows the compatibility matrix between the AUCI version used to create the
dynamic link libraries and the corresponding AST software products where these dlls can be
linked.
The rows indicate the internal AUCI Version numbers. The respective AST Product versions,
where AUCI is released with, are marked with a cross. All compatible AUCI and AST Product
Versions are highlighted green.
Figure 4. Compatibility Matrix AUCI/AST Product Version

2.4. Literature
1. Brinkmeier C., Automotive Three-Way Exhaust Aftertreatment under Transient Conditions
Measurements, Modeling and Simulation, 2006, PhD Thesis, University of Stuttgart.
70

AVL User Coding Interface

2. Documentation
2. Lindholm A., Currier N. W., Li J., Yezerets A., Olsson L., Detailed kinetic modeling of NOx
storage and reduction with hydrogen as the reducing agent and in the presence of CO2 and
H2O over a Pt/Ba/Al catalyst, J. Catal. 258:273-288, 2008.
3. Wurzenberger, J. C., PhD Thesis, Graz University of Technology, 2001.
4. Koltsakis G. C. and Stamatelos, A. M. 'Modeling dynamic phenomena in 3-way catalytic
converters', Chemical Engineering Science 54, 1999, 4567-4578.
5. Koltsakis G. C., Konstantinidis, P.A. and Stamatelos A. M.. 'Development and application
range of mathematical models for 3-way catalysts',Applied Catalysis B. Environmental 12,
1997, 161-191.
6. Tuttlies U., Schmeisser V. and Eigenberger G. 'A mechanistic simulation model for NOx
storage catalyst dynamics', Chemical Engineering Science, 59, 2004, 4731-4738.
7. Hauff C. H. 'Implementierung des Modells eines NOx-Speicherkatalysators in das
Simulationstool BOOST', Master thesis at ICVT, Stuttgart University, 2007.
8. Winkler C. and Floerchinger P., Patil, M.D., Gieshoff, J., Spurk, P., Pfeifer, M., 'Modeling of
SCR DeNOx Catalyst - Looking at the Impact of Substrate Attributes', SAE 2003-01-0845.
9. Wurzenberger J. C. and Wanker R. 'Multi-Scale SCR Modeling, 1D Kinetic Analysis and 3D
System Simulation', SAE 2005-01.
10. Hughes K. W. and Floerchinger P., 'Ultra Thinwall Light-off Performance - Varying
Substrates, Catalysts, and Flow Rates; Models and Engine Testing', SAE 2002-1-352.
11. Ebrahimian V. 'Development of multi-component evaporation models and 3D modeling of
NOx-SCR reduction system', PhD thesis, LUniversit de Toulouse, 2011.
12. Ebrahimian V. et al. 'Detailed modeling of the evaporation and thermal decomposition of
urea-water solution in SCR systems', AIChE J., 58, 2012, 1998-2009.
13. Kee R.J., Rupley F.M., and Miller J.A. 'Chemkin-II: A Fortran Chemical Kinetics Package for
the Analysis of Gas-Phase Chemical Kinetics', Sandia Report SAND89-8009.UC-401, 1989.
14. Kee R.J., Dixon-Lewis G., Warnatz J., Coltrin M.E., Miller J.A., and Moffat H.K. 'A Fortran
Computer Code Package for the Evaluation of Gas-Phase Multicomponent Transport
Properties', Sandia Report SAND86-8246, 1986.
15. Wheeler A., In P.H. Emmett (Ed.), Catalysis, Reinhold New York, Vol II: 105, 1955.
16. Wakao W., Smith J.M, 'Diffusion in catalyst pellets', Chemical Engineering Science 17
(1962): 825-834, 1962.
17. Perry R. and Green D., 'Perry's Chemical Engineer's Handbook'. New York, McGraw Hill
Book Company, 6. Edition, 1984.
18. Ahn T., Pinczewski V. and Trimm D.L., 'Transient Performance of Catalytic Combustors for
Gas Turbine Applications.' Chemical Engineering Science 41, 1986, 55-64.
19. Verein Deutscher Ingenieure (Ed.) VDI-Waermeatlas, Berechnungsblaetter fuer den
th
Warmeuebergang. 7 Edition, VDI Verlag, Duesseldorf, 1994.
20. Kirchner T. and Eigenberger G., 'Optimization of the Cold-Start Behaviour of Automotive
Catalysts Using an Electrically Heated Pre-Catalyst', Chemical Engineering Science 51,
1996, 2409-2418.
21. Kee R. J., Rupley F. M., Miller J. A., Coltrin M. E., Grcar J. F., Meeks E., Moffat H. K., Lutz
A. E., Dixon-Lewis G., Smooke M. D., Warnatz J., Evans G. H., Larson R. S., Mitchell R. E.,
Petzold L. R., Reynolds W. C., Caracotsios M., Stewart W. E., Glarborg P., Wang C., and
Adigun O., CHEMKIN Collection, Release 3.5, Reaction Design, Inc., San Diego, CA (2000).

AVL User Coding Interface

71

3. FAQ

3. FAQ
3.1. General
3.1.1. How to convert volume based simulation variables into absolute values?
It may occur that absolute instead of volume based simulation variables are needed to calculate
reaction rates (e.g. soot mass or gas species mass within a monolith cell). This can be done
most effectively via defining Global Variables where the volume based variable is multiplied
with the according cell volume, which is an available simulation variable. "Global" means in that
context that the values of the parameters defined here will be accessible in all reaction rate
formulations so that they will not have to be redefined separately for each reaction. For detailed
page [37]
information on that refer to the general description of Model Parameter
.
Example: Calculation of the absolute soot mass out of the soot mass concentration in the
current calculation cell
In the below figures an example is given, how the absolute soot mass can be calculated out of
the already available soot mass concentration.
First, the simulation variables "Mass concentration of C(S)" and "Cell monolith volume" need to
be introduced at Simulation Variables Mapping.
Second, a Global Parameter of type Variable needs to be introduced that shall be the absolute
soot mass. Furthermore, a Global Parameter of type Function is required, in which the
conversion of the variables is done.
Figure 5. Definition of simulation and global variables and the global conversion function

In the global function (named "calc_soot_mass") the absolute soot mass - variable "soot_mass"
is calculated. After that this variable can be used in reaction rate formulations.

72

AVL User Coding Interface

3. FAQ
Figure 6. Declaration of the global conversion function and calculation of the absolute value.

3.1.2. How to use the AUCI message system?


AUCI provides an interface to connect to the message system of the simulation tools in which an
AUCI model is run. In this topic the usage of this message system is presented.
The AUCI message system
The AUCI message system allows to send messages of the following kind via the simulation
tools message system to be printed to the tools simulation output (i.e. logfile, messages file).
All AUCI message system functions are of kind T_AUCI_MESSAGE, that is declared as:
typedef int (T_AUCI_MESSAGE)(char*);
It declares functions of type int that have an char-argument, that can be for example a string.
Following is a list of the available AUCI message system functions:
Information messages:
An information message can be used to provide informative content to the AUCI model user.
This type of message is printed to the simulation output files only in verbose mode.
The declaration of the related AUCI message system function is as follows:
T_AUCI_MESSAGE* auci_send_runinfo;
Warning messages:
A warning message can be used to warn the AUCI model user about certain problems. This
type of message is printed to the simulation output files only in verbose mode.
The declaration of the related AUCI message system function is as follows:
T_AUCI_MESSAGE* auci_send_warning;
Error messages:
An error message can be used to indicate a severe problem. This type of message is printed
to the simulation output files in concise as well as verbose mode.
The declaration of the related AUCI message system function is as follows:
T_AUCI_MESSAGE* auci_send_error;
Fatal error messages that force the simulation to stop:
This kind of message can be used not only to indicate a severe problem, but also to stop the
entire simulation run if required. This type of message is printed to the simulation output files
in concise as well as verbose mode.
The declaration of the related AUCI message system function is as follows:
T_AUCI_MESSAGE* auci_send_stop;

AVL User Coding Interface

73

3. FAQ
Example: Usage of the AUCI message system
This example shall demonstrate the usage of AUCI message system functions.
For that purpose, a reaction mechanism shall be perform the following two checks:
The molar fraction of CO shall be monitored and in case it exceeds the maximum allowed
range a warning shall be send; for example to indicate the species range used for calibrating
the kinetic parameter.
The substrate temperature shall be monitored and in case it reaches the maximum
allowed value the simulation shall be stopped; for example to avoid thermal damage of the
converter.
Below the relevant AUCI model set-up is explained in order to realize these requirements:
1. In the AUCI model the Simulation Variables page [47] that shall be monitored need to be added,
page [49]
page [38]
as well as a Global Parameter
of type Function
that does the monitoring and
sends the messages.
In this example, the Simulation Variables "Substrate temperature (K)" and "Molar fraction of
CO (kmol_i/kmol_tot)" have been selected; the Global Function is named "checkRange":
Figure 7. AUCI model input at page "Global Variables and Parameters"

2. In the Global Function "checkRange" the maximum values of CO molar fraction and
substrate temperature have been defined as Function Parameters.
page [40]
In the Code-block
of the Function Formulation the above conditions are formulated as
if-clauses:
Figure 8. AUCI model input for Global Function "checkRange"

For the CO-range-check the AUCI message system function auci_send_warning is


used, whereas for the temperature-range-check the function auci_send_stop is used that
additionally stops the simulation.
The provided message strings help to identify the reason for the warning and simulation stop
respectively.
74

AVL User Coding Interface

3. FAQ
Note: The Function Parameters do not have to be public like in this example.
3. At "Build Model" the AUCI model has to be compiled for the required target platforms.

3.1.3. How to improve performance and stability?


This section highlights general remarks related to solver performance and stability.
Performance
Another key issue of good programming practices is performance orientated programming. By
that the design of fast and numerically efficient code is meant. The below list comprises some
guidelines for performance orientated programming:
Avoid printf("...") statements as they slow down the execution of the code
considerably. Use them only in case you need them e.g. for debugging purposes.
Avoid string comparisons in rate formulations.
Avoid multiple calculation of the same expression; instead declare a variable, assign
expression to this variable and use it within the code.
log(), exp()and pow() functions tend to be computationally expensive, try to minimize
their use.
Specify abort criteria in loops.
Kernel and solver stability
Good programming practices are essential for kernel and solver stability. The very base of it is
floating point exception handling. In the following list, actions are describes how to avoid floating
point exceptions, segmentation faults and numerical discontinuities:
Avoid bad memory access; i.e. out of range access to vector- and memory-elements; invalid
pointers.
Avoid Not-a-Number (NaN) calculations and floating-point errors by using :
Division by zero
1/max(x, 1e-12)
Invalid arguments to intrinsic functions. These can be avoided by preventing the
argument from becoming negative using the max() function and a small positive
number:
Argument of square root must not be < 0.0
sqrt( max(x, 1e-12) )
Argument of power function must not be < 0.0 if exponent is a non-integer number
pow( max(x, 1e-12), 0.7) )
Argument of logarithm function must be > 0.0
log( max(x, 1e-12) )
Avoid introducing hard limits/discontinuities to your reaction rates. This includes, e.g.
not setting a reaction rate to zero when a species rate becomes negative. The solver
algorithm can cope with (temporarily) negative concentrations despite them being physically
unreasonable. In fact, this computational flexibility is desirable.

3.2. Reaction Rate Formulation


3.2.1. How to code rate formulations depending on a single species concentration?
Depending on the applied numerical solution method species concentrations can and actually
may become negative for a few solver-internal steps during time integration. The rate will also
become negative resulting in the reaction reversing, thus re-populating the species concentration
in question. The same applies to surface fractions.
Anyhow, when species concentrations and mole fractions respectively are being passed as
arguments of mathematical functions, in some cases it may lead to a floating point exception if
the passed argument is negative. This can be omitted by applying the suggestions from General
page [68]
User Coding Guidelines
section.

AVL User Coding Interface

75

3. FAQ
3.2.2. How to code rate formulations depending on two gas species?
In the case where the rate formulation depends on two and more species, special precautions
have to be taken. If, e.g., the concentrations of two species used in a rate formulation become
negative at the same time, the negative signs cancel each other (i.e. the resulting rate does
not become negative). So the solver never notices that condition leading to an even higher
consumption of these two species which will eventually result in the simulation diverging (Fig. 9
page [76]
, left plot).

Figure 9. Sign of the reaction rate depending on species concentrations.


Therefore, when coding such a reaction rate it needs to be multiplied with the appropriate sign
manually. The example below shows how this can be achieved easily:
d_sign = ( y_CO < 0.0 && y_O2 < 0.0 ) ? -1.0 : 1.0;
rate = d_sign * K * y_CO * y_O2 / D;
The ternary operator provides that d_sign only becomes negative when both species
concentrations are negative and is positive in all other cases where the rate would end up with
page [76]
the correct sign automatically (Fig. 9
, right plot).

3.2.3. How to code rate formulations that comprise different cases?


When case dependent rate formulations are avoided, the simulation will usually be much more
stable and also faster. Case dependency means that for one and same reaction the rate is
formulated differently dependent on the values of variables which are integrated by the solver
(i.e. temperatures, species concentrations, pressure). E.g. a rate r1 is applied at temperatures
below 400 K and a rate r2 is applied at temperatures higher than 400 K. Particularly in the
proximity of the specified transition state, the resulting numeric problem can become numerically
stiff which forces the solver to apply smaller time steps, thus increasing the computational effort.
In the worst case, the solver even diverges.
The approach to circumvent this type of numerical problem consists of two steps. First,
the transition between the two rate approaches needs to be investigated with respect to
discontinuities in terms of rate values and also rate gradients. If discontinuities cannot be avoided
(given rate laws) it is recommended to introduce transition functions. The transition functions can
be of arbitrary length as long as they provide no rate discontinuities.

76

AVL User Coding Interface

3. FAQ
Figure 10. Smooth transition of reaction rates.

AVL User Coding Interface

77

Potrebbero piacerti anche