CAMP 1.0.0
Chemistry Across Multiple Phases
|
Emission reaction solver functions. More...
Go to the source code of this file.
Macros | |
#define | TEMPERATURE_K_ env_data[0] |
#define | PRESSURE_PA_ env_data[1] |
#define | RXN_ID_ (int_data[0]) |
#define | SPECIES_ (int_data[1] - 1) |
#define | DERIV_ID_ int_data[2] |
#define | SCALING_ float_data[0] |
#define | RATE_ (rxn_env_data[0]) |
#define | BASE_RATE_ (rxn_env_data[1]) |
#define | NUM_INT_PROP_ 3 |
#define | NUM_FLOAT_PROP_ 1 |
#define | NUM_ENV_PARAM_ 2 |
Functions | |
void | rxn_emission_get_used_jac_elem (int *rxn_int_data, double *rxn_float_data, Jacobian *jac) |
Flag Jacobian elements used by this reaction. | |
void | rxn_emission_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. | |
bool | rxn_emission_update_data (void *update_data, int *rxn_int_data, double *rxn_float_data, double *rxn_env_data) |
Update reaction data. | |
void | rxn_emission_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_emission_calc_deriv_contrib (ModelData *model_data, TimeDerivative time_deriv, int *rxn_int_data, double *rxn_float_data, double *rxn_env_data, realtype time_step) |
Calculate contributions to the time derivative \(f(t,y)\) from this reaction. | |
void | rxn_emission_calc_jac_contrib (ModelData *model_data, Jacobian jac, int *rxn_int_data, double *rxn_float_data, double *rxn_env_data, realtype time_step) |
Calculate contributions to the Jacobian from this reaction. | |
void | rxn_emission_print (int *rxn_int_data, double *rxn_float_data) |
Print the reaction parameters. | |
void * | rxn_emission_create_rate_update_data () |
Create update data for new emission rates. | |
void | rxn_emission_set_rate_update_data (void *update_data, int rxn_id, double base_rate) |
Set rate update data. | |
Emission reaction solver functions.
Definition in file rxn_emission.c.
#define BASE_RATE_ (rxn_env_data[1]) |
Definition at line 25 of file rxn_emission.c.
#define DERIV_ID_ int_data[2] |
Definition at line 22 of file rxn_emission.c.
#define NUM_ENV_PARAM_ 2 |
Definition at line 28 of file rxn_emission.c.
#define NUM_FLOAT_PROP_ 1 |
Definition at line 27 of file rxn_emission.c.
#define NUM_INT_PROP_ 3 |
Definition at line 26 of file rxn_emission.c.
#define PRESSURE_PA_ env_data[1] |
Definition at line 18 of file rxn_emission.c.
#define RATE_ (rxn_env_data[0]) |
Definition at line 24 of file rxn_emission.c.
#define RXN_ID_ (int_data[0]) |
Definition at line 20 of file rxn_emission.c.
#define SCALING_ float_data[0] |
Definition at line 23 of file rxn_emission.c.
#define SPECIES_ (int_data[1] - 1) |
Definition at line 21 of file rxn_emission.c.
#define TEMPERATURE_K_ env_data[0] |
Definition at line 17 of file rxn_emission.c.
void rxn_emission_calc_deriv_contrib | ( | ModelData * | model_data, |
TimeDerivative | time_deriv, | ||
int * | rxn_int_data, | ||
double * | rxn_float_data, | ||
double * | rxn_env_data, | ||
realtype | time_step | ||
) |
Calculate contributions to the time derivative \(f(t,y)\) from this reaction.
model_data | Pointer to the model data, including the state array |
time_deriv | TimeDerivative object |
rxn_int_data | Pointer to the reaction integer data |
rxn_float_data | Pointer to the reaction floating-point data |
rxn_env_data | Pointer to the environment-dependent parameters |
time_step | Current time step being computed (s) |
Definition at line 133 of file rxn_emission.c.
void rxn_emission_calc_jac_contrib | ( | ModelData * | model_data, |
Jacobian | jac, | ||
int * | rxn_int_data, | ||
double * | rxn_float_data, | ||
double * | rxn_env_data, | ||
realtype | time_step | ||
) |
Calculate contributions to the Jacobian from this reaction.
model_data | Pointer to the model data |
jac | Reaction Jacobian |
rxn_int_data | Pointer to the reaction integer data |
rxn_float_data | Pointer to the reaction floating-point data |
rxn_env_data | Pointer to the environment-dependent parameters |
time_step | Current time step being calculated (s) |
Definition at line 160 of file rxn_emission.c.
void * rxn_emission_create_rate_update_data | ( | ) |
Create update data for new emission rates.
Definition at line 192 of file rxn_emission.c.
void rxn_emission_get_used_jac_elem | ( | int * | rxn_int_data, |
double * | rxn_float_data, | ||
Jacobian * | jac | ||
) |
Flag Jacobian elements used by this reaction.
rxn_int_data | Pointer to the reaction integer data |
rxn_float_data | Pointer to the reaction floating-point data |
jac | Jacobian |
Definition at line 36 of file rxn_emission.c.
void rxn_emission_print | ( | int * | rxn_int_data, |
double * | rxn_float_data | ||
) |
Print the reaction parameters.
rxn_int_data | Pointer to the reaction integer data |
rxn_float_data | Pointer to the reaction floating-point data |
Definition at line 179 of file rxn_emission.c.
void rxn_emission_set_rate_update_data | ( | void * | update_data, |
int | rxn_id, | ||
double | base_rate | ||
) |
Set rate update data.
update_data | Pointer to an allocated rate update data object |
rxn_id | Id of emission reactions to update |
base_rate | New pre-scaling emission rate |
Definition at line 207 of file rxn_emission.c.
bool rxn_emission_update_data | ( | void * | update_data, |
int * | rxn_int_data, | ||
double * | rxn_float_data, | ||
double * | rxn_env_data | ||
) |
Update reaction data.
Emission reactions can have their base (pre-scaling) rates updated from the host model based on the calculations of an external module. The structure of the update data is:
camp_rxn_emission::rxn_emission_t::set_rxn_id
function prior to initializing the solver.)update_data | Pointer to the updated reaction data |
rxn_int_data | Pointer to the reaction integer data |
rxn_float_data | Pointer to the reaction floating-point data |
rxn_env_data | Pointer to the environment-dependent data |
Definition at line 82 of file rxn_emission.c.
void rxn_emission_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 emission reactions this only involves recalculating the rate.
model_data | Pointer to the model data |
rxn_int_data | Pointer to the reaction integer data |
rxn_float_data | Pointer to the reaction floating-point data |
rxn_env_data | Pointer to the environment-dependent parameters |
Definition at line 109 of file rxn_emission.c.
void rxn_emission_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.
model_data | Pointer to the model data |
deriv_ids | Id of each state variable in the derivative array |
jac | Jacobian |
rxn_int_data | Pointer to the reaction integer data |
rxn_float_data | Pointer to the reaction floating-point data |
Definition at line 52 of file rxn_emission.c.