added README_changes.txt
[wrffire.git] / wrfv2_fire / chem / KPP / kpp / kpp-2.1 / util / UserRateLaws.c
blob9e0c3b547e445bd71c750acfbbb52602fe505d5e
1 /* User-defined Rate Law functions
2 Note: the default argument type for rate laws, as read from the equations file, is single precision
3 but all the internal calculations are performed in double precision
4 */
5 /* Arrhenius */
6 KPP_REAL ARR( float A0, float B0, float C0 )
8 double ARR_RES;
10 ARR_RES = (double)A0 * exp( -(double)B0/TEMP )
11 * pow( (TEMP/300.0), (double)C0 );
13 return (KPP_REAL)ARR_RES;
17 /* Simplified Arrhenius, with two arguments */
18 /* Note that the argument B0 has a changed sign when compared to ARR */
19 KPP_REAL ARR2( float A0, float B0 )
21 double ARR_RES;
23 ARR_RES = (double)A0 * exp( (double)B0/TEMP );
25 return (KPP_REAL)ARR_RES;
29 KPP_REAL EP2( float A0, float C0, float A2, float C2, float A3, float C3)
31 double K0, K2, K3, EP2_RES;
33 K0 = (double)A0 * exp( -(double)C0/TEMP );
34 K2 = (double)A2 * exp( -(double)C2/TEMP );
35 K3 = (double)A3 * exp( -(double)C3/TEMP );
36 K3 = K3*CFACTOR*1.0e+6;
37 EP2_RES = K0 + K3/( 1.0+K3/K2 );
39 return (KPP_REAL)EP2_RES;
43 KPP_REAL EP3( float A1, float C1, float A2, float C2)
45 double K1, K2, EP3_RES;
47 K1 = (double)A1 * exp(-(double)C1/TEMP);
48 K2 = (double)A2 * exp(-(double)C2/TEMP);
49 EP3_RES = K1 + K2*(1.0e+6*CFACTOR);
51 return (KPP_REAL)EP3_RES;
55 KPP_REAL FALL ( float A0, float B0, float C0, float A1, float B1, float C1, float CF)
57 double K0, K1, FALL_RES;
59 K0 = (double)A0 * exp(-(double)B0/TEMP)* pow( (TEMP/300.0), (double)C0 );
60 K1 = (double)A1 * exp(-(double)B1/TEMP)* pow( (TEMP/300.0), (double)C1 );
61 K0 = K0*CFACTOR*1.0e+6;
62 K1 = K0/K1;
63 FALL_RES = (K0/(1.0+K1))*
64 pow( (double)CF, ( 1.0/( 1.0+pow( (log10(K1)),2 ) ) ) );
66 return (KPP_REAL)FALL_RES;