gti and erc wave/chemkin interface reference
DESCRIPTION
GTI and ERC WAVE/Chemkin Interface Reference. Version 05-27-04 (contains information about the WAVE/Chemkin interface developed at the ERC). Sponsors and Contributors Chol-Bum Kweon and John Pratapas Gas Technology Institute - PowerPoint PPT PresentationTRANSCRIPT
WAVE/Chemkin InterfaceMay 2002 pg. 1 �
University of Wisconsin – MadisonEngine Research Center
GTI and ERC WAVE/Chemkin Interface Reference
Sponsors and Contributors
Chol-Bum Kweon and John Pratapas Gas Technology Institute
Kushal Narayanaswamy and Randy HesselUniversity of Wisconsin-Madison, Engine Research Center
Version 05-27-04(contains information about the WAVE/Chemkin
interface developed at the ERC)
WAVE/Chemkin InterfaceMay 2002 pg. 2 �
University of Wisconsin – MadisonEngine Research Center
This document discusses the WAVE/Chemkin interface developed at the ERC. The interface was developed by Kushal Narayanaswamy under the sponsorship of the DOE and exercised by Randy Hessel under the sponsorship of the Gas Technology Institute.
This document covers:– description of engine modeled and operating conditions– information passed between WAVE and Chemkin– how the two programs are interfaced– sample results
Introduction
WAVE/Chemkin InterfaceMay 2002 pg. 3 �
University of Wisconsin – MadisonEngine Research Center
Engine description and operating conditions
These conditions are for diesel operation.
WAVE/Chemkin InterfaceMay 2002 pg. 4 �
University of Wisconsin – MadisonEngine Research Center
The WAVE model
Intake surge tank
Intakeducts
Exhaustducts
Dualintakeports
Dualexhaustports
Single cylinder withdirect injection
Exhaust surge tank
This model is for diesel operation.
WAVE/Chemkin InterfaceMay 2002 pg. 5 �
University of Wisconsin – MadisonEngine Research Center
WAVE/Chemkin interface type
WAVE uses Chemkin to estimate the amount of fuel burned each computational time step. In WAVE terminology, this is called a User Burn Rate Model. In our case, WAVE supplies Chemkin with sufficient information to calculate the fuel burn rate at each time step, then Chemkin returns to WAVE the amount of fuel burned.
The group of subroutines written by the user that allow this information to be exchanged between WAVE and Chemkin is called an interface.
WAVE/Chemkin InterfaceMay 2002 pg. 6 �
University of Wisconsin – MadisonEngine Research Center
Simplified flowchart
WAVE Interface Chemkin
WAVE is a self-contained commercial program that can calculate engine performance, 1D gas dynamics and a host of other quantities. WAVE has its own combustion models, but in this application, WAVE will be calling Chemkin through an interface.
Ricardo supplies sample interface subroutines that the user can modify to communicate with their own combustion model. The first subroutine, user_init_comb_case, is used to initialize many quantities and is called only once at the beginning of the simulation. WAVE calls a second subroutine, user_comb, which in turn calls Chemkin at every time step for a current estimate of the amount of fuel burned.
Chemkin is its own set of subroutines and is used to estimate the amount of fuel burned, based on current combustion chamber pressure, temperature and species concentration.
WAVE/Chemkin InterfaceMay 2002 pg. 7 �
University of Wisconsin – MadisonEngine Research Center
Linking the programs together
The user subroutines, that is, the subroutines that constitute the interface and Chemkin, are compiled into a dynamic link library. We used Digital Visual Fortran to build this library, but other compilers can also be used. WAVE uses dynamic link libraries when properly assigned. Assigning is done throughModel Engine Combustion Profile,then selecting User Model and entering the User Model DLL path and file name.
WAVE/Chemkin InterfaceMay 2002 pg. 8 �
University of Wisconsin – MadisonEngine Research Center
Minimum information passed from WAVE to Chemkin
0 cylinder number
1 simulation time [s]
2 cycle number
3 crank angle deg
4 injected and trapped fuel per cycle
kg
5 start of injection deg
6 end of injection deg
7 exhaust valve opens deg
8 engine speed 1/min
9 pressure Pa
10 temperature K
11 change of temperature K/deg
12 cylinder displacement m3
13 mass concentration of oxygen kg/kg
14 fresh air mass fraction kg/kg
15 vaporized fuel mass fraction kg/kg
16 burned air mass fraction kg/kg
17 burned fuel mass fraction kg/kg
18 liquid fuel mass fraction kg/kg
19 total cylinder mass kg
20 start of burning deg
All angle values are measured relative to TDC firing.
These variables arepassed via thewave_to_user array.
Columns are arrayelement, variablename and units.
WAVE/Chemkin InterfaceMay 2002 pg. 9 �
University of Wisconsin – MadisonEngine Research Center
Information that can be passed from Chemkin to WAVE
array element Variable Description Units Remarks
Subroutine user_init_comb_case data passed back to WAVE
0 crank angle at start of burning deg optional
1 user model call frequency required
2 user model profile type required
Subroutine user_comb data passed back to WAVE
0 mass fraction burned kg/kg required
1 crank angle at start of burning deg optional
Our setting: Other options:
0 do not specify start of ignition specify start of ignition
1 call Chemkin every time step call combustion model once at start of combustion and calculate the complete combustion profile based on current conditions
2 return fraction of cumulative burn to WAVE return burn rate fraction to WAVE
0 cumulative mass burn fraction value mass burn rate fraction value
1 do not return the crank angle at start of burning
return the crank angle to WAVE at start of burning
WAVE/Chemkin InterfaceMay 2002 pg. 10 �
University of Wisconsin – MadisonEngine Research Center
How the interface works
The initialization interface subroutine, user_init_comb_case, is called once at the beginning of the simulation. user_init_comb_case has three main purposes. They are:
1. to make variable values defined in WAVE’s constants table available to the combustion model,
2. to specify how frequently the combustion model is to be called, and
3. to tell WAVE whether burn rate fraction, or cumulative burn fraction [(kg burned so far)/(kg injected or trapped in cycle)] values will be passed back to WAVE.
Note that our interface passes back cumulative burn fraction, but since it is dimensionless, the calculation is actually the cumulative heat release divided by the total fuel energy.
4. Upon completion of this subroutine, control returns to WAVE.
WAVE user_init_comb_case
WAVE/Chemkin InterfaceMay 2002 pg. 11 �
University of Wisconsin – MadisonEngine Research Center
How the interface works
The subroutine user_comb is called every engine cycle. The first time user_comb is called, it in turn calls a Chemkin initialization subroutine called wisckinit. wisckinit initializes reaction mechanism and species information based on CHEMKIN interpreter. Note that the interpreter of CHEMKIN is run as a preprocessor to generate the 'cklink‘ file.
WAVE/Chemkin InterfaceMay 2002 pg. 12 �
University of Wisconsin – MadisonEngine Research Center
How the interface works
Some of the things required to initialize for Chemkin via wisckinit are:1. CKLEN gets the length of real, integer and character working arrays.2. CKINIT assigns values to the working arrays, ICKWRK, CCKWRK, and
RCKWORK by reading the linking file.• ICKWRK - Array of integer workspace.• RCKWRK - Array of real work space.• CCKWRK - Array of character work space.
3. CKINDX gets a group of indices that define the size of the particular reaction mechanism.
4. CKSYMS returns the character strings of species names.5. CKWT returns the molecular weights of the species.6. CKRP returns universal gas constants and the pressure of one standard atm.7. Read initial species mass fractions, pressure and temperature from an input
file, ckinp.in. Currently this is set to air, 1 atm and 331 K. Perhaps ckinp.in should be created based on initial conditions at the start of combustion???
8. CKXTY given mole fractions, returns mass fractions.9. CKRHOX given pressure, temperature and mole fraction, returns total density.10. CKHML returns enthalpies in molar units, array ckhk.11. CKHML returns enthalpy of formation by calling with temperature = 298.
WAVE user_comb wisckinit
WAVE/Chemkin InterfaceMay 2002 pg. 13 �
University of Wisconsin – MadisonEngine Research Center
How the interface works
WAVE user_comb wisckinit
comb
ifcombustion
if nocombustion
if 1st call forcombustion
continue in section of user_comb just before where comb is called.
and figure out flow chart below.
WAVE/Chemkin InterfaceMay 2002 pg. 14 �
University of Wisconsin – MadisonEngine Research Center
Questions
I have been going through wiscinit. I see that the initial species specified in ckinp.in are air (0.21 o2 and 0.79 n2), 1 atm pressure and 331 K temperature. The title of this ckinp.in is "Dec's Case 1 2D Bomb c7h16.“
Why are kiva species assigned in user_comb after wisckinit is called? We are using this with WAVE.
Are things hard-coded for a particular mechanism? For example “if(theta2.lt.-5.3) …” in user_comb. This ‘if’ appears more than once. (perfer to use tchop in ‘if’ statement, as is used in the line above this if, but is commented out.
What are these statements in user_comb !mass fraction of fuel vapor+liquid fuel - burned fuel
yc(1)=wave_to_user(15)+wave_to_user(18)-wave_to_user(17)!mass fraction of o2yc(2)=0.2328*wave_to_user(14)!mass fraction of n2 + burned air mass fractionyc(3)=0.7372*wave_to_user(14)+wave_to_user(16)
In user_comb, why have this statement if (icycle.gt.1)then combustion flag cmode is always on (value = 0.0).