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

Reaction solver functions. More...

Include dependency graph for rxn_solver.c:

Go to the source code of this file.

Macros

#define CAMP_DEBUG_SPEC_   118
 
#define RXN_ARRHENIUS   1
 
#define RXN_TROE   2
 
#define RXN_CMAQ_H2O2   3
 
#define RXN_CMAQ_OH_HNO3   4
 
#define RXN_PHOTOLYSIS   5
 
#define RXN_HL_PHASE_TRANSFER   6
 
#define RXN_AQUEOUS_EQUILIBRIUM   7
 
#define RXN_SIMPOL_PHASE_TRANSFER   10
 
#define RXN_CONDENSED_PHASE_ARRHENIUS   11
 
#define RXN_FIRST_ORDER_LOSS   12
 
#define RXN_EMISSION   13
 
#define RXN_WET_DEPOSITION   14
 
#define RXN_TERNARY_CHEMICAL_ACTIVATION   15
 
#define RXN_WENNBERG_TUNNELING   16
 
#define RXN_WENNBERG_NO_RO2   17
 
#define RXN_CONDENSED_PHASE_PHOTOLYSIS   18
 
#define RXN_SURFACE   19
 

Functions

void rxn_get_used_jac_elem (ModelData *model_data, Jacobian *jac)
 Get the Jacobian elements used by a particular reaction.
 
void rxn_update_ids (ModelData *model_data, int *deriv_ids, Jacobian jac)
 Update the time derivative and Jacobian array ids.
 
void rxn_update_env_state (ModelData *model_data)
 Update reaction data for new environmental state.
 
void rxn_calc_deriv (ModelData *model_data, TimeDerivative time_deriv, realtype time_step)
 Calculate the time derivative \(f(t,y)\).
 
void rxn_calc_deriv_specific_types (ModelData *model_data, TimeDerivative time_deriv, realtype time_step)
 Calculate the time derivative \(f(t,y)\) for only some specific types.
 
void rxn_calc_jac (ModelData *model_data, Jacobian jac, realtype time_step)
 Calculate the Jacobian.
 
void rxn_calc_jac_specific_types (ModelData *model_data, Jacobian jac, realtype time_step)
 Calculate the Jacobian for only some specific types.
 
void rxn_add_condensed_data (int rxn_type, int n_int_param, int n_float_param, int n_env_param, int *int_param, double *float_param, void *solver_data)
 Add condensed data to the condensed data block of memory.
 
void rxn_update_data (int cell_id, int *rxn_id, int update_rxn_type, void *update_data, void *solver_data)
 Update reaction data.
 
void rxn_print_data (void *solver_data)
 Print the reaction data.
 
void rxn_free_update_data (void *update_data)
 Free an update data object.
 

Detailed Description

Reaction solver functions.

Definition in file rxn_solver.c.

Macro Definition Documentation

◆ CAMP_DEBUG_SPEC_

#define CAMP_DEBUG_SPEC_   118

Definition at line 11 of file rxn_solver.c.

◆ RXN_AQUEOUS_EQUILIBRIUM

#define RXN_AQUEOUS_EQUILIBRIUM   7

Definition at line 25 of file rxn_solver.c.

◆ RXN_ARRHENIUS

#define RXN_ARRHENIUS   1

Definition at line 19 of file rxn_solver.c.

◆ RXN_CMAQ_H2O2

#define RXN_CMAQ_H2O2   3

Definition at line 21 of file rxn_solver.c.

◆ RXN_CMAQ_OH_HNO3

#define RXN_CMAQ_OH_HNO3   4

Definition at line 22 of file rxn_solver.c.

◆ RXN_CONDENSED_PHASE_ARRHENIUS

#define RXN_CONDENSED_PHASE_ARRHENIUS   11

Definition at line 27 of file rxn_solver.c.

◆ RXN_CONDENSED_PHASE_PHOTOLYSIS

#define RXN_CONDENSED_PHASE_PHOTOLYSIS   18

Definition at line 34 of file rxn_solver.c.

◆ RXN_EMISSION

#define RXN_EMISSION   13

Definition at line 29 of file rxn_solver.c.

◆ RXN_FIRST_ORDER_LOSS

#define RXN_FIRST_ORDER_LOSS   12

Definition at line 28 of file rxn_solver.c.

◆ RXN_HL_PHASE_TRANSFER

#define RXN_HL_PHASE_TRANSFER   6

Definition at line 24 of file rxn_solver.c.

◆ RXN_PHOTOLYSIS

#define RXN_PHOTOLYSIS   5

Definition at line 23 of file rxn_solver.c.

◆ RXN_SIMPOL_PHASE_TRANSFER

#define RXN_SIMPOL_PHASE_TRANSFER   10

Definition at line 26 of file rxn_solver.c.

◆ RXN_SURFACE

#define RXN_SURFACE   19

Definition at line 35 of file rxn_solver.c.

◆ RXN_TERNARY_CHEMICAL_ACTIVATION

#define RXN_TERNARY_CHEMICAL_ACTIVATION   15

Definition at line 31 of file rxn_solver.c.

◆ RXN_TROE

#define RXN_TROE   2

Definition at line 20 of file rxn_solver.c.

◆ RXN_WENNBERG_NO_RO2

#define RXN_WENNBERG_NO_RO2   17

Definition at line 33 of file rxn_solver.c.

◆ RXN_WENNBERG_TUNNELING

#define RXN_WENNBERG_TUNNELING   16

Definition at line 32 of file rxn_solver.c.

◆ RXN_WET_DEPOSITION

#define RXN_WET_DEPOSITION   14

Definition at line 30 of file rxn_solver.c.

Function Documentation

◆ rxn_add_condensed_data()

void rxn_add_condensed_data ( int  rxn_type,
int  n_int_param,
int  n_float_param,
int  n_env_param,
int *  int_param,
double *  float_param,
void *  solver_data 
)

Add condensed data to the condensed data block of memory.

Parameters
rxn_typeReaction type
n_int_paramNumber of integer parameters
n_float_paramNumber of floating-point parameters
n_env_paramNumber of environment-dependent parameters
int_paramPointer to integer parameter array
float_paramPointer to floating-point parameter array
solver_dataPointer to solver data

Definition at line 658 of file rxn_solver.c.

◆ rxn_calc_deriv()

void rxn_calc_deriv ( ModelData model_data,
TimeDerivative  time_deriv,
realtype  time_step 
)

Calculate the time derivative \(f(t,y)\).

Parameters
model_dataPointer to the model data
time_derivTimeDerivative to use to build derivative array
time_stepCurrent model time step (s)

Definition at line 322 of file rxn_solver.c.

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

◆ rxn_calc_deriv_specific_types()

void rxn_calc_deriv_specific_types ( ModelData model_data,
TimeDerivative  time_deriv,
realtype  time_step 
)

Calculate the time derivative \(f(t,y)\) for only some specific types.

Parameters
model_dataPointer to the model data
time_derivTimeDerivative to use to build derivative array
time_stepCurrent model time step (s)

Definition at line 439 of file rxn_solver.c.

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

◆ rxn_calc_jac()

void rxn_calc_jac ( ModelData model_data,
Jacobian  jac,
realtype  time_step 
)

Calculate the Jacobian.

Parameters
model_dataPointer to the model data
jacThe reaction Jacobian (for one grid cell)
time_stepCurrent model time step (s)

Definition at line 482 of file rxn_solver.c.

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

◆ rxn_calc_jac_specific_types()

void rxn_calc_jac_specific_types ( ModelData model_data,
Jacobian  jac,
realtype  time_step 
)

Calculate the Jacobian for only some specific types.

Parameters
model_dataPointer to the model data
jacThe reaction Jacobian (for one grid cell)
time_stepCurrent model time step (s)

Definition at line 595 of file rxn_solver.c.

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

◆ rxn_free_update_data()

void rxn_free_update_data ( void *  update_data)

Free an update data object.

Parameters
update_dataObject to free

Definition at line 851 of file rxn_solver.c.

◆ rxn_get_used_jac_elem()

void rxn_get_used_jac_elem ( ModelData model_data,
Jacobian jac 
)

Get the Jacobian elements used by a particular reaction.

Parameters
model_dataA pointer to the model data
jacJacobian

Definition at line 42 of file rxn_solver.c.

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

◆ rxn_print_data()

void rxn_print_data ( void *  solver_data)

Print the reaction data.

Parameters
solver_dataPointer to the solver data

Definition at line 769 of file rxn_solver.c.

Here is the call graph for this function:

◆ rxn_update_data()

void rxn_update_data ( int  cell_id,
int *  rxn_id,
int  update_rxn_type,
void *  update_data,
void *  solver_data 
)

Update reaction data.

Update data for one or more reactions. Reactions of a certain type are passed a void pointer to updated data that must be in the format specified by the reaction type. This data could be used to find specific reactions of the specified type and, for example, update rate constants.

Parameters
cell_idId of the grid cell to update
rxn_idId of the reaction (or 0 if unknown)
update_rxn_typeType of the reaction
update_dataPointer to updated data to pass to the reaction
solver_dataPointer to solver data

Definition at line 708 of file rxn_solver.c.

Here is the call graph for this function:

◆ rxn_update_env_state()

void rxn_update_env_state ( ModelData model_data)

Update reaction data for new environmental state.

Parameters
model_dataPointer to the model data with updated env state

Definition at line 224 of file rxn_solver.c.

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

◆ rxn_update_ids()

void rxn_update_ids ( ModelData model_data,
int *  deriv_ids,
Jacobian  jac 
)

Update the time derivative and Jacobian array ids.

Parameters
model_dataPointer to the model data
deriv_idsIds for state variables on the time derivative array
jacJacobian

Definition at line 131 of file rxn_solver.c.

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