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

Aerosol representation functions. More...

Include dependency graph for aero_rep_solver.c:

Go to the source code of this file.

Macros

#define AERO_REP_SINGLE_PARTICLE   1
 
#define AERO_REP_MODAL_BINNED_MASS   2
 

Functions

int aero_rep_get_used_jac_elem (ModelData *model_data, int aero_rep_idx, int aero_phase_idx, bool *jac_struct)
 Flag Jacobian elements used to calculated mass, volume, etc. More...
 
void aero_rep_get_dependencies (ModelData *model_data, bool *state_flags)
 Get state array elements used by aerosol representation functions. More...
 
void aero_rep_update_env_state (ModelData *model_data)
 Update the aerosol representations for new environmental conditions. More...
 
void aero_rep_update_state (ModelData *model_data)
 Update the aerosol representations for a new state. More...
 
void aero_rep_get_effective_layer_radius__m (ModelData *model_data, int aero_rep_idx, int aero_phase_idx, double *layer_radius, double *partial_deriv)
 Get the effective radius of a specified layer, \(r_{layer}\) (m) More...
 
void aero_rep_get_effective_radius__m (ModelData *model_data, int aero_rep_idx, int aero_phase_idx, double *radius, double *partial_deriv)
 Get the effective particle radius, \(r_{eff}\) (m) More...
 
void aero_rep_get_interface_surface_area__m2 (ModelData *model_data, int aero_rep_idx, int aero_phase_idx_first, int aero_phase_idx_second, double *surface_area, double *partial_deriv)
 Get the surface area of interfacial layer between two phases (m^2) More...
 
void aero_rep_get_layer_thickness__m (ModelData *model_data, int aero_rep_idx, int aero_phase_idx, double *layer_thickness, double *partial_deriv)
 Get the thickness of a particle layer (m) More...
 
void aero_rep_get_number_conc__n_m3 (ModelData *model_data, int aero_rep_idx, int aero_phase_idx, double *number_conc, double *partial_deriv)
 Get the particle number concentration \(n\) ( \(\mbox{\si{\#\per\cubic\metre}}\)) More...
 
int aero_rep_get_aero_conc_type (ModelData *model_data, int aero_rep_idx, int aero_phase_idx)
 Check whether aerosol concentrations are per-particle or total for each phase. More...
 
void aero_rep_get_aero_phase_mass__kg_m3 (ModelData *model_data, int aero_rep_idx, int aero_phase_idx, double *aero_phase_mass, double *partial_deriv)
 Get the total mass of an aerosol phase in this representation \(m\) ( \(\mbox{\si{\kilogram\per\cubic\metre}}\)) More...
 
void aero_rep_get_aero_phase_avg_MW__kg_mol (ModelData *model_data, int aero_rep_idx, int aero_phase_idx, double *aero_phase_avg_MW, double *partial_deriv)
 Get the average molecular weight of an aerosol phase in this representation \(m\) ( \(\mbox{\si{\micro\gram\per\cubic\metre}}\)) More...
 
void aero_rep_add_condensed_data (int aero_rep_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 for aerosol representations. More...
 
void aero_rep_update_data (int cell_id, int *aero_rep_id, int update_aero_rep_type, void *update_data, void *solver_data)
 Update aerosol representation data. More...
 
void aero_rep_print_data (void *solver_data)
 Print the aerosol representation data. More...
 
void aero_rep_free_update_data (void *update_data)
 Free an update data object. More...
 

Detailed Description

Aerosol representation functions.

Definition in file aero_rep_solver.c.

Macro Definition Documentation

◆ AERO_REP_MODAL_BINNED_MASS

#define AERO_REP_MODAL_BINNED_MASS   2

Definition at line 20 of file aero_rep_solver.c.

◆ AERO_REP_SINGLE_PARTICLE

#define AERO_REP_SINGLE_PARTICLE   1

Definition at line 19 of file aero_rep_solver.c.

Function Documentation

◆ aero_rep_add_condensed_data()

void aero_rep_add_condensed_data ( int  aero_rep_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 for aerosol representations.

Parameters
aero_rep_typeAerosol representation 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 582 of file aero_rep_solver.c.

◆ aero_rep_free_update_data()

void aero_rep_free_update_data ( void *  update_data)

Free an update data object.

Parameters
update_dataObject to free

Definition at line 728 of file aero_rep_solver.c.

◆ aero_rep_get_aero_conc_type()

int aero_rep_get_aero_conc_type ( ModelData *  model_data,
int  aero_rep_idx,
int  aero_phase_idx 
)

Check whether aerosol concentrations are per-particle or total for each phase.

Parameters
model_dataPointer to the model data
aero_rep_idxIndex of aerosol representation to use for calculation
aero_phase_idxIndex of the aerosol phase within the aerosol representation
Returns
0 for per-particle; 1 for total for each phase

Definition at line 431 of file aero_rep_solver.c.

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

◆ aero_rep_get_aero_phase_avg_MW__kg_mol()

void aero_rep_get_aero_phase_avg_MW__kg_mol ( ModelData *  model_data,
int  aero_rep_idx,
int  aero_phase_idx,
double *  aero_phase_avg_MW,
double *  partial_deriv 
)

Get the average molecular weight of an aerosol phase in this representation \(m\) ( \(\mbox{\si{\micro\gram\per\cubic\metre}}\))

Calculates total aerosol phase mass, \(m\) ( \(\mbox{\si{\micro\gram\per\cubic\metre}}\)), as well as the set of \(\frac{\partial m}{\partial y}\) where \(y\) are variables on the solver state array.

Parameters
model_dataPointer to the model data
aero_rep_idxIndex of aerosol representation to use for calculation
aero_phase_idxIndex of the aerosol phase within the aerosol representation
aero_phase_avg_MWPointer to hold calculated average MW in the aerosol phase ( \(\mbox{\si{\kilogram\per\mole}}\))
partial_derivPointer to the set of partial derivatives to be calculated \(\frac{\partial m}{\partial y}\), or a NULL pointer if no partial derivatives are needed

Definition at line 537 of file aero_rep_solver.c.

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

◆ aero_rep_get_aero_phase_mass__kg_m3()

void aero_rep_get_aero_phase_mass__kg_m3 ( ModelData *  model_data,
int  aero_rep_idx,
int  aero_phase_idx,
double *  aero_phase_mass,
double *  partial_deriv 
)

Get the total mass of an aerosol phase in this representation \(m\) ( \(\mbox{\si{\kilogram\per\cubic\metre}}\))

Calculates total aerosol phase mass, \(m\) ( \(\mbox{\si{\kilogram\per\cubic\metre}}\)), as well as the set of \(\frac{\partial m}{\partial y}\) where \(y\) are variables on the solver state array.

Parameters
model_dataPointer to the model data
aero_rep_idxIndex of aerosol representation to use for calculation
aero_phase_idxIndex of the aerosol phase within the aerosol representation
aero_phase_massPointer to hold calculated aerosol-phase mass, \(m\) ( \(\mbox{\si{\kilogram\per\cubic\metre}}\))
partial_derivPointer to the set of partial derivatives to be calculated \(\frac{\partial m}{\partial y}\), or a NULL pointer if no partial derivatives are needed

Definition at line 485 of file aero_rep_solver.c.

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

◆ aero_rep_get_dependencies()

void aero_rep_get_dependencies ( ModelData *  model_data,
bool *  state_flags 
)

Get state array elements used by aerosol representation functions.

Parameters
model_dataA pointer to the model data
state_flagsAn array of flags the length of the state array indicating species used

Definition at line 69 of file aero_rep_solver.c.

Here is the call graph for this function:

◆ aero_rep_get_effective_layer_radius__m()

void aero_rep_get_effective_layer_radius__m ( ModelData *  model_data,
int  aero_rep_idx,
int  aero_phase_idx,
double *  layer_radius,
double *  partial_deriv 
)

Get the effective radius of a specified layer, \(r_{layer}\) (m)

Calculates the effective radius of a specified layer \(r_{layer}\) (m), as well as the set of \(\frac{\partial r_{layer}}{\partial y}\) where \(y\) are variables on the solver state array.

Parameters
model_dataPointer to the model data
aero_rep_idxIndex of aerosol representation to use for calculation
aero_phase_idxIndex of the aerosol phase within the aerosol representation
layer_radiusPointer to hold effective layer radius (m)
partial_derivPointer to the set of partial derivatives to be calculated \(\frac{\partial r_{eff}}{\partial y}\), or a NULL pointer if no partial derivatives are needed

Definition at line 198 of file aero_rep_solver.c.

Here is the call graph for this function:

◆ aero_rep_get_effective_radius__m()

void aero_rep_get_effective_radius__m ( ModelData *  model_data,
int  aero_rep_idx,
int  aero_phase_idx,
double *  radius,
double *  partial_deriv 
)

Get the effective particle radius, \(r_{eff}\) (m)

Calculates effective particle radius \(r_{eff}\) (m), as well as the set of \(\frac{\partial r_{eff}}{\partial y}\) where \(y\) are variables on the solver state array.

Parameters
model_dataPointer to the model data
aero_rep_idxIndex of aerosol representation to use for calculation
aero_phase_idxIndex of the aerosol phase within the aerosol representation
radiusPointer to hold effective particle radius (m)
partial_derivPointer to the set of partial derivatives to be calculated \(\frac{\partial r_{eff}}{\partial y}\), or a NULL pointer if no partial derivatives are needed

Definition at line 246 of file aero_rep_solver.c.

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

◆ aero_rep_get_interface_surface_area__m2()

void aero_rep_get_interface_surface_area__m2 ( ModelData *  model_data,
int  aero_rep_idx,
int  aero_phase_idx_first,
int  aero_phase_idx_second,
double *  surface_area,
double *  partial_deriv 
)

Get the surface area of interfacial layer between two phases (m^2)

Calculates surface area of a interfacial layer (m^2), as well as the set of \(\frac{\partial A}{\partial y}\) where \(y\) are variables on the solver state array.

Parameters
model_dataPointer to the model data
aero_rep_idxIndex of aerosol representation to use for calculation
aero_phase_idx_firstIndex of the first aerosol phase within the aerosol representation
aero_phase_idx_secondIndex of the second aerosol phase within the aerosol representation
surface_areaPointer to surface area of interfacial layer (m^2)
partial_derivPointer to the set of partial derivatives to be calculated \(\frac{\partial A}{\partial y}\), or a NULL pointer if no partial derivatives are needed

Definition at line 296 of file aero_rep_solver.c.

Here is the call graph for this function:

◆ aero_rep_get_layer_thickness__m()

void aero_rep_get_layer_thickness__m ( ModelData *  model_data,
int  aero_rep_idx,
int  aero_phase_idx,
double *  layer_thickness,
double *  partial_deriv 
)

Get the thickness of a particle layer (m)

Parameters
model_dataPointer to the model data, including the state array
aero_rep_idxIndex of aerosol representation to use for calculation
aero_phase_idxIndex of the aerosol phase within the representation
layer_thicknessEffective layer thickness (m)
partial_deriv\(\frac{\partial r_{eff}}{\partial y}\) where \(y\) are species on the state array

Definition at line 338 of file aero_rep_solver.c.

Here is the call graph for this function:

◆ aero_rep_get_number_conc__n_m3()

void aero_rep_get_number_conc__n_m3 ( ModelData *  model_data,
int  aero_rep_idx,
int  aero_phase_idx,
double *  number_conc,
double *  partial_deriv 
)

Get the particle number concentration \(n\) ( \(\mbox{\si{\#\per\cubic\metre}}\))

Calculates particle number concentration, \(n\) ( \(\mbox{\si{\#\per\cubic\metre}}\)), as well as the set of \(\frac{\partial n}{\partial y}\) where \(y\) are variables on the solver state array.

Parameters
model_dataPointer to the model data
aero_rep_idxIndex of aerosol representation to use for calculation
aero_phase_idxIndex of the aerosol phase within the aerosol representation
number_concPointer to hold calculated number concentration, \(n\) ( \(\mbox{\si{\#\per\cubic\metre}}\))
partial_derivPointer to the set of partial derivatives to be calculated \(\frac{\partial n}{\partial y}\), or a NULL pointer if no partial derivatives are required

Definition at line 389 of file aero_rep_solver.c.

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

◆ aero_rep_get_used_jac_elem()

int aero_rep_get_used_jac_elem ( ModelData *  model_data,
int  aero_rep_idx,
int  aero_phase_idx,
bool *  jac_struct 
)

Flag Jacobian elements used to calculated mass, volume, etc.

Parameters
model_dataA pointer to the model data
aero_rep_idxIndex of aerosol representation to use for calculation
aero_phase_idxIndex of the aerosol phase within the aerosol representation
jac_struct1D array of flags indicating potentially non-zero Jacobian elements. (The dependent variable should have been chosen by the calling function.)
Returns
Number of Jacobian elements flagged

Definition at line 33 of file aero_rep_solver.c.

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

◆ aero_rep_print_data()

void aero_rep_print_data ( void *  solver_data)

Print the aerosol representation data.

Parameters
solver_dataPointer to the solver data

Definition at line 685 of file aero_rep_solver.c.

Here is the call graph for this function:

◆ aero_rep_update_data()

void aero_rep_update_data ( int  cell_id,
int *  aero_rep_id,
int  update_aero_rep_type,
void *  update_data,
void *  solver_data 
)

Update aerosol representation data.

Parameters
cell_idId of the grid cell to update
aero_rep_idAerosol representation id (or 0 if unknown)
update_aero_rep_typeAerosol representation type to update
update_dataPointer to data needed for update
solver_dataPointer to solver data

Definition at line 631 of file aero_rep_solver.c.

Here is the call graph for this function:

◆ aero_rep_update_env_state()

void aero_rep_update_env_state ( ModelData *  model_data)

Update the aerosol representations for new environmental conditions.

Parameters
model_dataPointer to the model data

Definition at line 105 of file aero_rep_solver.c.

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

◆ aero_rep_update_state()

void aero_rep_update_state ( ModelData *  model_data)

Update the aerosol representations for a new state.

Parameters
model_dataPointer to the model data

Definition at line 146 of file aero_rep_solver.c.

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