ODT
Loading...
Searching...
No Matches
simple_dlr.cc
Go to the documentation of this file.
1/*
2 * @file simple_dlr.cc
3 * @brief Source file for two-step methane/hydrogen/air chemical mechanism
4 */
5
6#include <vector>
7#include <cmath>
8#include <iostream>
9#include<stdlib.h>
10
11using namespace std;
12
13void getProblemSpecificRR(double rho, double temp, double pres, double *yi, double *rrsp) {
22// CH4 + 2 O2 => CO2 + 2 H2O
23// H2 + 1/2 O2 => H2O
24
25 int iH2 = 0;
26 int iO2 = 1;
27 int iH2O = 2;
28 int iCH4 = 3;
29 int iCO2 = 4;
30 int iN2 = 5;
31
32 double dt = 6E-5;
33 double k1 = 1000.0/dt;
34 double k2 = 1000.0/dt;
35
36 double cO2 = rho*yi[iO2] /31.9988; // kmol/m3
37 double cCH4 = rho*yi[iCH4]/16.0426; // kmol/m3
38 double cH2 = rho*yi[iH2] /2.0158; // kmol/m3
39
40 double r1 = k1 * cCH4 * cO2;
41 double r2 = k2 * cH2 * cO2;
42
43 rrsp[iH2] = -r2; // kmol/m3*s
44 rrsp[iCH4] = -r1;
45 rrsp[iO2] = -2*r1 - 0.5*r2;
46 rrsp[iH2O] = 2*r1 + r2;
47 rrsp[iCO2] = r1;
48 rrsp[iN2] = 0.0;
49
50}
51
void getProblemSpecificRR(double rho, double temp, double pres, double *yi, double *rrsp)
Definition simple_dlr.cc:13