CAMP 1.0.0
Chemistry Across Multiple Phases
Macros | Functions
rxn_wennberg_no_ro2.c File Reference

Wennberg NO + RO2 reaction solver functions. More...

Include dependency graph for rxn_wennberg_no_ro2.c:

Go to the source code of this file.

Macros

#define TEMPERATURE_K_   env_data[0]
 
#define PRESSURE_PA_   env_data[1]
 
#define NUM_REACT_   int_data[0]
 
#define NUM_ALKOXY_PROD_   int_data[1]
 
#define NUM_NITRATE_PROD_   int_data[2]
 
#define X_   float_data[0]
 
#define Y_   float_data[1]
 
#define a0_   float_data[2]
 
#define n_   float_data[3]
 
#define CONV_   float_data[4]
 
#define ALKOXY_RATE_CONSTANT_   rxn_env_data[0]
 
#define NITRATE_RATE_CONSTANT_   rxn_env_data[1]
 
#define NUM_INT_PROP_   3
 
#define NUM_FLOAT_PROP_   5
 
#define NUM_ENV_PARAM_   2
 
#define REACT_(x)   (int_data[NUM_INT_PROP_ + x] - 1)
 
#define PROD_(x)   (int_data[NUM_INT_PROP_ + NUM_REACT_ + x] - 1)
 
#define DERIV_ID_(x)
 
#define JAC_ID_(x)
 
#define YIELD_(x)   float_data[NUM_FLOAT_PROP_ + x]
 

Functions

void rxn_wennberg_no_ro2_get_used_jac_elem (int *rxn_int_data, double *rxn_float_data, Jacobian *jac)
 Flag Jacobian elements used by this reaction.
 
void rxn_wennberg_no_ro2_update_ids (ModelData *model_data, int *deriv_ids, Jacobian jac, int *rxn_int_data, double *rxn_float_data)
 Update the time derivative and Jacbobian array indices.
 
double calculate_A (double T, double M, double n)
 Calculates the Troe-like parameter A(T, [M], n)
 
void rxn_wennberg_no_ro2_update_env_state (ModelData *model_data, int *rxn_int_data, double *rxn_float_data, double *rxn_env_data)
 Update reaction data for new environmental conditions.
 
void rxn_wennberg_no_ro2_calc_deriv_contrib (ModelData *model_data, TimeDerivative time_deriv, int *rxn_int_data, double *rxn_float_data, double *rxn_env_data, double time_step)
 Calculate contributions to the time derivative \(f(t,y)\) from this reaction.
 
void rxn_wennberg_no_ro2_calc_jac_contrib (ModelData *model_data, Jacobian jac, int *rxn_int_data, double *rxn_float_data, double *rxn_env_data, double time_step)
 Calculate contributions to the Jacobian from this reaction.
 
void rxn_wennberg_no_ro2_print (int *rxn_int_data, double *rxn_float_data)
 Print the Wennberg NO + RO2 reaction parameters.
 

Detailed Description

Wennberg NO + RO2 reaction solver functions.

Definition in file rxn_wennberg_no_ro2.c.

Macro Definition Documentation

◆ a0_

#define a0_   float_data[2]

Definition at line 26 of file rxn_wennberg_no_ro2.c.

◆ ALKOXY_RATE_CONSTANT_

#define ALKOXY_RATE_CONSTANT_   rxn_env_data[0]

Definition at line 29 of file rxn_wennberg_no_ro2.c.

◆ CONV_

#define CONV_   float_data[4]

Definition at line 28 of file rxn_wennberg_no_ro2.c.

◆ DERIV_ID_

#define DERIV_ID_ (   x)
Value:
x]
#define NUM_REACT_
#define NUM_ALKOXY_PROD_
#define NUM_INT_PROP_
#define NUM_NITRATE_PROD_

Definition at line 36 of file rxn_wennberg_no_ro2.c.

◆ JAC_ID_

#define JAC_ID_ (   x)
Value:

Definition at line 39 of file rxn_wennberg_no_ro2.c.

◆ n_

#define n_   float_data[3]

Definition at line 27 of file rxn_wennberg_no_ro2.c.

◆ NITRATE_RATE_CONSTANT_

#define NITRATE_RATE_CONSTANT_   rxn_env_data[1]

Definition at line 30 of file rxn_wennberg_no_ro2.c.

◆ NUM_ALKOXY_PROD_

#define NUM_ALKOXY_PROD_   int_data[1]

Definition at line 22 of file rxn_wennberg_no_ro2.c.

◆ NUM_ENV_PARAM_

#define NUM_ENV_PARAM_   2

Definition at line 33 of file rxn_wennberg_no_ro2.c.

◆ NUM_FLOAT_PROP_

#define NUM_FLOAT_PROP_   5

Definition at line 32 of file rxn_wennberg_no_ro2.c.

◆ NUM_INT_PROP_

#define NUM_INT_PROP_   3

Definition at line 31 of file rxn_wennberg_no_ro2.c.

◆ NUM_NITRATE_PROD_

#define NUM_NITRATE_PROD_   int_data[2]

Definition at line 23 of file rxn_wennberg_no_ro2.c.

◆ NUM_REACT_

#define NUM_REACT_   int_data[0]

Definition at line 21 of file rxn_wennberg_no_ro2.c.

◆ PRESSURE_PA_

#define PRESSURE_PA_   env_data[1]

Definition at line 19 of file rxn_wennberg_no_ro2.c.

◆ PROD_

#define PROD_ (   x)    (int_data[NUM_INT_PROP_ + NUM_REACT_ + x] - 1)

Definition at line 35 of file rxn_wennberg_no_ro2.c.

◆ REACT_

#define REACT_ (   x)    (int_data[NUM_INT_PROP_ + x] - 1)

Definition at line 34 of file rxn_wennberg_no_ro2.c.

◆ TEMPERATURE_K_

#define TEMPERATURE_K_   env_data[0]

Definition at line 18 of file rxn_wennberg_no_ro2.c.

◆ X_

#define X_   float_data[0]

Definition at line 24 of file rxn_wennberg_no_ro2.c.

◆ Y_

#define Y_   float_data[1]

Definition at line 25 of file rxn_wennberg_no_ro2.c.

◆ YIELD_

#define YIELD_ (   x)    float_data[NUM_FLOAT_PROP_ + x]

Definition at line 42 of file rxn_wennberg_no_ro2.c.

Function Documentation

◆ calculate_A()

double calculate_A ( double  T,
double  M,
double  n 
)

Calculates the Troe-like parameter A(T, [M], n)

k0 = 2e-22 e^n kinf = 0.43 * (T/298)^-8 A = k0 [M] / ( 1 + k0 [M] / kinf ) * 0.41^( 1 / ( 1 + [ log10( k0 [M] / kinf ) ]^2 ) )

Parameters
Ttemperature [K]
Mair density [#/cc]
nnumber of heavy atoms in RO2 species

Definition at line 111 of file rxn_wennberg_no_ro2.c.

Here is the caller graph for this function:

◆ rxn_wennberg_no_ro2_calc_deriv_contrib()

void rxn_wennberg_no_ro2_calc_deriv_contrib ( ModelData model_data,
TimeDerivative  time_deriv,
int *  rxn_int_data,
double *  rxn_float_data,
double *  rxn_env_data,
double  time_step 
)

Calculate contributions to the time derivative \(f(t,y)\) from this reaction.

Parameters
model_dataModel data
time_derivTimeDerivative object
rxn_int_dataPointer to the reaction integer data
rxn_float_dataPointer to the reaction floating-point data
rxn_env_dataPointer to the environment-dependent parameters
time_stepCurrent time step being computed (s)

Definition at line 161 of file rxn_wennberg_no_ro2.c.

Here is the call graph for this function:

◆ rxn_wennberg_no_ro2_calc_jac_contrib()

void rxn_wennberg_no_ro2_calc_jac_contrib ( ModelData model_data,
Jacobian  jac,
int *  rxn_int_data,
double *  rxn_float_data,
double *  rxn_env_data,
double  time_step 
)

Calculate contributions to the Jacobian from this reaction.

Parameters
model_dataModel data
jacReaction Jacobian
rxn_int_dataPointer to the reaction integer data
rxn_float_dataPointer to the reaction floating-point data
rxn_env_dataPointer to the environment-dependent parameters
time_stepCurrent time step being calculated (s)

Definition at line 221 of file rxn_wennberg_no_ro2.c.

Here is the call graph for this function:

◆ rxn_wennberg_no_ro2_get_used_jac_elem()

void rxn_wennberg_no_ro2_get_used_jac_elem ( int *  rxn_int_data,
double *  rxn_float_data,
Jacobian jac 
)

Flag Jacobian elements used by this reaction.

Parameters
rxn_int_dataPointer to the reaction integer data
rxn_float_dataPointer to the reaction floating-point data
jacJacobian

Definition at line 50 of file rxn_wennberg_no_ro2.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rxn_wennberg_no_ro2_print()

void rxn_wennberg_no_ro2_print ( int *  rxn_int_data,
double *  rxn_float_data 
)

Print the Wennberg NO + RO2 reaction parameters.

Parameters
rxn_int_dataPointer to the reaction integer data
rxn_float_dataPointer to the reaction floating-point data

Definition at line 278 of file rxn_wennberg_no_ro2.c.

Here is the caller graph for this function:

◆ rxn_wennberg_no_ro2_update_env_state()

void rxn_wennberg_no_ro2_update_env_state ( ModelData model_data,
int *  rxn_int_data,
double *  rxn_float_data,
double *  rxn_env_data 
)

Update reaction data for new environmental conditions.

For Wennberg NO + RO2 reaction this only involves recalculating the rate constant.

Parameters
model_dataPointer to the model data
rxn_int_dataPointer to the reaction integer data
rxn_float_dataPointer to the reaction floating-point data
rxn_env_dataPointer to the environment-dependent parameters

Definition at line 129 of file rxn_wennberg_no_ro2.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rxn_wennberg_no_ro2_update_ids()

void rxn_wennberg_no_ro2_update_ids ( ModelData model_data,
int *  deriv_ids,
Jacobian  jac,
int *  rxn_int_data,
double *  rxn_float_data 
)

Update the time derivative and Jacbobian array indices.

Parameters
model_dataPointer to the model data
deriv_idsId of each state variable in the derivative array
jacJacobian
rxn_int_dataPointer to the reaction integer data
rxn_float_dataPointer to the reaction floating-point data

Definition at line 76 of file rxn_wennberg_no_ro2.c.

Here is the call graph for this function:
Here is the caller graph for this function: