CAMP 1.0.0
Chemistry Across Multiple Phases
|
Single particle aerosol representation functions. More...
Go to the source code of this file.
Macros | |
#define | TEMPERATURE_K_ env_data[0] |
#define | PRESSURE_PA_ env_data[1] |
#define | UPDATE_NUMBER 0 |
#define | NUM_LAYERS_ int_data[0] |
#define | AERO_REP_ID_ int_data[1] |
#define | MAX_PARTICLES_ int_data[2] |
#define | PARTICLE_STATE_SIZE_ int_data[3] |
#define | NUMBER_CONC_(x) aero_rep_env_data[x] |
#define | NUM_INT_PROP_ 4 |
#define | NUM_FLOAT_PROP_ 0 |
#define | NUM_ENV_PARAM_ MAX_PARTICLES_ |
#define | LAYER_PHASE_START_(l) (int_data[NUM_INT_PROP_+l]-1) |
#define | LAYER_PHASE_END_(l) (int_data[NUM_INT_PROP_+NUM_LAYERS_+l]-1) |
#define | TOTAL_NUM_PHASES_ (LAYER_PHASE_END_(NUM_LAYERS_-1)-LAYER_PHASE_START_(0)+1) |
#define | NUM_PHASES_(l) (LAYER_PHASE_END_(l)-LAYER_PHASE_START_(l)+1) |
#define | PHASE_STATE_ID_(l, p) (int_data[NUM_INT_PROP_+2*NUM_LAYERS_+LAYER_PHASE_START_(l)+p]-1) |
#define | PHASE_MODEL_DATA_ID_(l, p) (int_data[NUM_INT_PROP_+2*NUM_LAYERS_+TOTAL_NUM_PHASES_+LAYER_PHASE_START_(l)+p]-1) |
#define | PHASE_NUM_JAC_ELEM_(l, p) int_data[NUM_INT_PROP_+2*NUM_LAYERS_+2*TOTAL_NUM_PHASES_+LAYER_PHASE_START_(l)+p] |
Functions | |
int | aero_rep_single_particle_get_used_jac_elem (ModelData *model_data, int aero_phase_idx, int *aero_rep_int_data, double *aero_rep_float_data, bool *jac_struct) |
Flag Jacobian elements used in calcualtions of mass and volume. | |
void | aero_rep_single_particle_get_dependencies (int *aero_rep_int_data, double *aero_rep_float_data, bool *state_flags) |
Flag elements on the state array used by this aerosol representation. | |
void | aero_rep_single_particle_update_env_state (ModelData *model_data, int *aero_rep_int_data, double *aero_rep_float_data, double *aero_rep_env_data) |
Update aerosol representation data for new environmental conditions. | |
void | aero_rep_single_particle_update_state (ModelData *model_data, int *aero_rep_int_data, double *aero_rep_float_data, double *aero_rep_env_data) |
Update aerosol representation data for a new state. | |
void | aero_rep_single_particle_get_effective_radius__m (ModelData *model_data, int aero_phase_idx, double *radius, double *partial_deriv, int *aero_rep_int_data, double *aero_rep_float_data, double *aero_rep_env_data) |
Get the effective particle radius \(r_{eff}\) (m) | |
void | aero_rep_single_particle_get_number_conc__n_m3 (ModelData *model_data, int aero_phase_idx, double *number_conc, double *partial_deriv, int *aero_rep_int_data, double *aero_rep_float_data, double *aero_rep_env_data) |
Get the particle number concentration \(n\) ( \(\mbox{\si{\#\per\cubic\metre}}\)) | |
void | aero_rep_single_particle_get_aero_conc_type (int aero_phase_idx, int *aero_conc_type, int *aero_rep_int_data, double *aero_rep_float_data, double *aero_rep_env_data) |
Get the type of aerosol concentration used. | |
void | aero_rep_single_particle_get_aero_phase_mass__kg_m3 (ModelData *model_data, int aero_phase_idx, double *aero_phase_mass, double *partial_deriv, int *aero_rep_int_data, double *aero_rep_float_data, double *aero_rep_env_data) |
Get the total mass in an aerosol phase \(m\) ( \(\mbox{\si{\kilogram\per\cubic\metre}}\)) | |
void | aero_rep_single_particle_get_aero_phase_avg_MW__kg_mol (ModelData *model_data, int aero_phase_idx, double *aero_phase_avg_MW, double *partial_deriv, int *aero_rep_int_data, double *aero_rep_float_data, double *aero_rep_env_data) |
Get the average molecular weight in an aerosol phase \(m\) ( \(\mbox{\si{\kilo\gram\per\mol}}\)) | |
bool | aero_rep_single_particle_update_data (void *update_data, int *aero_rep_int_data, double *aero_rep_float_data, double *aero_rep_env_data) |
Update aerosol representation data. | |
void | aero_rep_single_particle_print (int *aero_rep_int_data, double *aero_rep_float_data) |
Print the Single Particle reaction parameters. | |
void * | aero_rep_single_particle_create_number_update_data () |
Create update data for new particle number. | |
void | aero_rep_single_particle_set_number_update_data__n_m3 (void *update_data, int aero_rep_id, int particle_id, double number_conc) |
Set number update data (#/m3) | |
Single particle aerosol representation functions.
Definition in file aero_rep_single_particle.c.
#define AERO_REP_ID_ int_data[1] |
Definition at line 24 of file aero_rep_single_particle.c.
#define LAYER_PHASE_END_ | ( | l | ) | (int_data[NUM_INT_PROP_+NUM_LAYERS_+l]-1) |
Definition at line 32 of file aero_rep_single_particle.c.
#define LAYER_PHASE_START_ | ( | l | ) | (int_data[NUM_INT_PROP_+l]-1) |
Definition at line 31 of file aero_rep_single_particle.c.
#define MAX_PARTICLES_ int_data[2] |
Definition at line 25 of file aero_rep_single_particle.c.
#define NUM_ENV_PARAM_ MAX_PARTICLES_ |
Definition at line 30 of file aero_rep_single_particle.c.
#define NUM_FLOAT_PROP_ 0 |
Definition at line 29 of file aero_rep_single_particle.c.
#define NUM_INT_PROP_ 4 |
Definition at line 28 of file aero_rep_single_particle.c.
#define NUM_LAYERS_ int_data[0] |
Definition at line 23 of file aero_rep_single_particle.c.
#define NUM_PHASES_ | ( | l | ) | (LAYER_PHASE_END_(l)-LAYER_PHASE_START_(l)+1) |
Definition at line 34 of file aero_rep_single_particle.c.
#define NUMBER_CONC_ | ( | x | ) | aero_rep_env_data[x] |
Definition at line 27 of file aero_rep_single_particle.c.
#define PARTICLE_STATE_SIZE_ int_data[3] |
Definition at line 26 of file aero_rep_single_particle.c.
#define PHASE_MODEL_DATA_ID_ | ( | l, | |
p | |||
) | (int_data[NUM_INT_PROP_+2*NUM_LAYERS_+TOTAL_NUM_PHASES_+LAYER_PHASE_START_(l)+p]-1) |
Definition at line 36 of file aero_rep_single_particle.c.
#define PHASE_NUM_JAC_ELEM_ | ( | l, | |
p | |||
) | int_data[NUM_INT_PROP_+2*NUM_LAYERS_+2*TOTAL_NUM_PHASES_+LAYER_PHASE_START_(l)+p] |
Definition at line 37 of file aero_rep_single_particle.c.
#define PHASE_STATE_ID_ | ( | l, | |
p | |||
) | (int_data[NUM_INT_PROP_+2*NUM_LAYERS_+LAYER_PHASE_START_(l)+p]-1) |
Definition at line 35 of file aero_rep_single_particle.c.
#define PRESSURE_PA_ env_data[1] |
Definition at line 19 of file aero_rep_single_particle.c.
#define TEMPERATURE_K_ env_data[0] |
Definition at line 18 of file aero_rep_single_particle.c.
#define TOTAL_NUM_PHASES_ (LAYER_PHASE_END_(NUM_LAYERS_-1)-LAYER_PHASE_START_(0)+1) |
Definition at line 33 of file aero_rep_single_particle.c.
#define UPDATE_NUMBER 0 |
Definition at line 21 of file aero_rep_single_particle.c.
void * aero_rep_single_particle_create_number_update_data | ( | ) |
Create update data for new particle number.
Definition at line 442 of file aero_rep_single_particle.c.
void aero_rep_single_particle_get_aero_conc_type | ( | int | aero_phase_idx, |
int * | aero_conc_type, | ||
int * | aero_rep_int_data, | ||
double * | aero_rep_float_data, | ||
double * | aero_rep_env_data | ||
) |
Get the type of aerosol concentration used.
Single particle concentrations are per-particle.
aero_phase_idx | Index of the aerosol phase within the representation |
aero_conc_type | Pointer to int that will hold the concentration type code (0 = per particle mass concentrations; 1 = total particle mass concentrations) |
aero_rep_int_data | Pointer to the aerosol representation integer data |
aero_rep_float_data | Pointer to the aerosol representation floating-point data |
aero_rep_env_data | Pointer to the aerosol representation environment-dependent parameters |
Definition at line 250 of file aero_rep_single_particle.c.
void aero_rep_single_particle_get_aero_phase_avg_MW__kg_mol | ( | ModelData * | model_data, |
int | aero_phase_idx, | ||
double * | aero_phase_avg_MW, | ||
double * | partial_deriv, | ||
int * | aero_rep_int_data, | ||
double * | aero_rep_float_data, | ||
double * | aero_rep_env_data | ||
) |
Get the average molecular weight in an aerosol phase \(m\) ( \(\mbox{\si{\kilo\gram\per\mol}}\))
The single particle mass is set for each new state as the sum of the masses of the aerosol phases that compose the particle
model_data | Pointer to the model data, including the state array |
aero_phase_idx | Index of the aerosol phase within the representation |
aero_phase_avg_MW | Average molecular weight in the aerosol phase ( \(\mbox{\si{\kilogram\per\mole}}\)) |
partial_deriv | \(\frac{\partial m}{\partial y}\) where \(y\) are the species on the state array |
aero_rep_int_data | Pointer to the aerosol representation integer data |
aero_rep_float_data | Pointer to the aerosol representation floating-point data |
aero_rep_env_data | Pointer to the aerosol representation environment-dependent parameters |
Definition at line 331 of file aero_rep_single_particle.c.
void aero_rep_single_particle_get_aero_phase_mass__kg_m3 | ( | ModelData * | model_data, |
int | aero_phase_idx, | ||
double * | aero_phase_mass, | ||
double * | partial_deriv, | ||
int * | aero_rep_int_data, | ||
double * | aero_rep_float_data, | ||
double * | aero_rep_env_data | ||
) |
Get the total mass in an aerosol phase \(m\) ( \(\mbox{\si{\kilogram\per\cubic\metre}}\))
The single particle mass is set for each new state as the sum of the masses of the aerosol phases that compose the particle
model_data | Pointer to the model data, including the state array |
aero_phase_idx | Index of the aerosol phase within the representation |
aero_phase_mass | Total mass in the aerosol phase, \(m\) ( \(\mbox{\si{\kilogram\per\cubic\metre}}\)) |
partial_deriv | \(\frac{\partial m}{\partial y}\) where \(y\) are the species on the state array |
aero_rep_int_data | Pointer to the aerosol representation integer data |
aero_rep_float_data | Pointer to the aerosol representation floating-point data |
aero_rep_env_data | Pointer to the aerosol representation environment-dependent parameters |
Definition at line 282 of file aero_rep_single_particle.c.
void aero_rep_single_particle_get_dependencies | ( | int * | aero_rep_int_data, |
double * | aero_rep_float_data, | ||
bool * | state_flags | ||
) |
Flag elements on the state array used by this aerosol representation.
The single particle aerosol representation functions do not use state array values
aero_rep_int_data | Pointer to the aerosol representation integer data |
aero_rep_float_data | Pointer to the aerosol representation floating-point data |
state_flags | Array of flags indicating state array elements used |
Definition at line 86 of file aero_rep_single_particle.c.
void aero_rep_single_particle_get_effective_radius__m | ( | ModelData * | model_data, |
int | aero_phase_idx, | ||
double * | radius, | ||
double * | partial_deriv, | ||
int * | aero_rep_int_data, | ||
double * | aero_rep_float_data, | ||
double * | aero_rep_env_data | ||
) |
Get the effective particle radius \(r_{eff}\) (m)
model_data | Pointer to the model data, including the state array |
aero_phase_idx | Index of the aerosol phase within the representation |
radius | Effective particle radius (m) |
partial_deriv | \(\frac{\partial r_{eff}}{\partial y}\) where \(y\) are species on the state array |
aero_rep_int_data | Pointer to the aerosol representation integer data |
aero_rep_float_data | Pointer to the aerosol representation floating-point data |
aero_rep_env_data | Pointer to the aerosol representation environment-dependent parameters |
Definition at line 153 of file aero_rep_single_particle.c.
void aero_rep_single_particle_get_number_conc__n_m3 | ( | ModelData * | model_data, |
int | aero_phase_idx, | ||
double * | number_conc, | ||
double * | partial_deriv, | ||
int * | aero_rep_int_data, | ||
double * | aero_rep_float_data, | ||
double * | aero_rep_env_data | ||
) |
Get the particle number concentration \(n\) ( \(\mbox{\si{\#\per\cubic\metre}}\))
This single particle number concentration is set by the aerosol model prior to solving the chemistry. Thus, all \(\frac{\partial n}{\partial y}\) are zero. Also, there is only one set of particles in the single particle representation, so the phase index is not used.
model_data | Pointer to the model data, including the state array |
aero_phase_idx | Index of the aerosol phase within the representation (not used) |
number_conc | Particle number concentration, \(n\) ( \(\mbox{\si{\#\per\cubic\metre}}\)) |
partial_deriv | \(\frac{\partial n}{\partial y}\) where \(y\) are the species on the state array |
aero_rep_int_data | Pointer to the aerosol representation integer data |
aero_rep_float_data | Pointer to the aerosol representation floating-point data |
aero_rep_env_data | Pointer to the aerosol representation environment-dependent parameters |
Definition at line 212 of file aero_rep_single_particle.c.
int aero_rep_single_particle_get_used_jac_elem | ( | ModelData * | model_data, |
int | aero_phase_idx, | ||
int * | aero_rep_int_data, | ||
double * | aero_rep_float_data, | ||
bool * | jac_struct | ||
) |
Flag Jacobian elements used in calcualtions of mass and volume.
aero_rep_int_data | Pointer to the aerosol representation integer data |
aero_rep_float_data | Pointer to the aerosol representation floating-point data |
model_data | Pointer to the model data |
aero_phase_idx | Index of the aerosol phase to find elements for |
jac_struct | 1D array of flags indicating potentially non-zero Jacobian elements. (The dependent variable should have been chosen by the calling function.) |
Definition at line 52 of file aero_rep_single_particle.c.
void aero_rep_single_particle_print | ( | int * | aero_rep_int_data, |
double * | aero_rep_float_data | ||
) |
Print the Single Particle reaction parameters.
aero_rep_int_data | Pointer to the aerosol representation integer data |
aero_rep_float_data | Pointer to the aerosol representation floating-point data |
Definition at line 414 of file aero_rep_single_particle.c.
void aero_rep_single_particle_set_number_update_data__n_m3 | ( | void * | update_data, |
int | aero_rep_id, | ||
int | particle_id, | ||
double | number_conc | ||
) |
Set number update data (#/m3)
update_data | Pointer to an allocated number update data object |
aero_rep_id | Id of the aerosol representation(s) to update |
particle_id | Id of the computational particle |
number_conc | New particle number (#/m3) |
Definition at line 458 of file aero_rep_single_particle.c.
bool aero_rep_single_particle_update_data | ( | void * | update_data, |
int * | aero_rep_int_data, | ||
double * | aero_rep_float_data, | ||
double * | aero_rep_env_data | ||
) |
Update aerosol representation data.
Single particle aerosol representation update data is structured as follows:
update_data | Pointer to the updated aerosol representation data |
aero_rep_int_data | Pointer to the aerosol representation integer data |
aero_rep_float_data | Pointer to the aerosol representation floating-point data |
aero_rep_env_data | Pointer to the aerosol representation environment-dependent parameters |
Definition at line 383 of file aero_rep_single_particle.c.
void aero_rep_single_particle_update_env_state | ( | ModelData * | model_data, |
int * | aero_rep_int_data, | ||
double * | aero_rep_float_data, | ||
double * | aero_rep_env_data | ||
) |
Update aerosol representation data for new environmental conditions.
The single particle aerosol representation does not use environmental conditions
model_data | Pointer to the model data |
aero_rep_int_data | Pointer to the aerosol representation integer data |
aero_rep_float_data | Pointer to the aerosol representation floating-point data |
aero_rep_env_data | Pointer to the aerosol representation environment-dependent parameters |
Definition at line 108 of file aero_rep_single_particle.c.
void aero_rep_single_particle_update_state | ( | ModelData * | model_data, |
int * | aero_rep_int_data, | ||
double * | aero_rep_float_data, | ||
double * | aero_rep_env_data | ||
) |
Update aerosol representation data for a new state.
model_data | Pointer to the model data, include the state array |
aero_rep_int_data | Pointer to the aerosol representation integer data |
aero_rep_float_data | Pointer to the aerosol representation floating-point data |
aero_rep_env_data | Pointer to the aerosol representation environment-dependent parameters |
Definition at line 129 of file aero_rep_single_particle.c.