CAMP 1.0.0
Chemistry Across Multiple Phases
aero_phase_solver.c File Reference

Aerosol phase functions. More...

Include dependency graph for aero_phase_solver.c:

Go to the source code of this file.

Macros

#define MINIMUM_MASS_   1.0e-25L
 Minimum aerosol-phase mass concentration [kg m-3].
 
#define MINIMUM_MW_   0.1L
 Minimum mass assumed molecular weight [kg mol-1].
 
#define MINIMUM_DENSITY_   1800.0L
 Minimum mass assumed density [kg m-3].
 
#define CHEM_SPEC_UNKNOWN_TYPE   0
 
#define CHEM_SPEC_VARIABLE   1
 
#define CHEM_SPEC_CONSTANT   2
 
#define CHEM_SPEC_PSSA   3
 
#define CHEM_SPEC_ACTIVITY_COEFF   4
 
#define NUM_STATE_VAR_   (int_data[0])
 
#define NUM_INT_PROP_   1
 
#define NUM_FLOAT_PROP_   0
 
#define SPEC_TYPE_(x)
 
#define MW_(x)
 
#define DENSITY_(x)
 

Functions

int aero_phase_get_used_jac_elem (ModelData *model_data, int aero_phase_idx, int state_var_id, bool *jac_struct)
 Flag Jacobian elements used in calculations of mass and volume.
 
void aero_phase_get_mass__kg_m3 (ModelData *model_data, int aero_phase_idx, double *state_var, double *mass, double *MW, double *jac_elem_mass, double *jac_elem_MW)
 Get the mass and average MW in an aerosol phase.
 
void aero_phase_get_volume__m3_m3 (ModelData *model_data, int aero_phase_idx, double *state_var, double *volume, double *jac_elem)
 Get the volume of an aerosol phase.
 
void aero_phase_add_condensed_data (int n_int_param, int n_float_param, int *int_param, double *float_param, void *solver_data)
 Add condensed data to the condensed data block for aerosol phases.
 
void aero_phase_print_data (void *solver_data)
 Print the aerosol phase data.
 

Detailed Description

Aerosol phase functions.

Definition in file aero_phase_solver.c.

Macro Definition Documentation

◆ CHEM_SPEC_ACTIVITY_COEFF

#define CHEM_SPEC_ACTIVITY_COEFF   4

Definition at line 27 of file aero_phase_solver.c.

◆ CHEM_SPEC_CONSTANT

#define CHEM_SPEC_CONSTANT   2

Definition at line 25 of file aero_phase_solver.c.

◆ CHEM_SPEC_PSSA

#define CHEM_SPEC_PSSA   3

Definition at line 26 of file aero_phase_solver.c.

◆ CHEM_SPEC_UNKNOWN_TYPE

#define CHEM_SPEC_UNKNOWN_TYPE   0

Definition at line 23 of file aero_phase_solver.c.

◆ CHEM_SPEC_VARIABLE

#define CHEM_SPEC_VARIABLE   1

Definition at line 24 of file aero_phase_solver.c.

◆ DENSITY_

#define DENSITY_ ( x)
Value:
(float_data[NUM_FLOAT_PROP_ + NUM_STATE_VAR_ + x])
#define NUM_FLOAT_PROP_
#define NUM_STATE_VAR_

Definition at line 34 of file aero_phase_solver.c.

◆ MINIMUM_DENSITY_

#define MINIMUM_DENSITY_   1800.0L

Minimum mass assumed density [kg m-3].

Definition at line 20 of file aero_phase_solver.c.

◆ MINIMUM_MASS_

#define MINIMUM_MASS_   1.0e-25L

Minimum aerosol-phase mass concentration [kg m-3].

Definition at line 16 of file aero_phase_solver.c.

◆ MINIMUM_MW_

#define MINIMUM_MW_   0.1L

Minimum mass assumed molecular weight [kg mol-1].

Definition at line 18 of file aero_phase_solver.c.

◆ MW_

#define MW_ ( x)
Value:
(float_data[NUM_FLOAT_PROP_ + x])

Definition at line 33 of file aero_phase_solver.c.

◆ NUM_FLOAT_PROP_

#define NUM_FLOAT_PROP_   0

Definition at line 31 of file aero_phase_solver.c.

◆ NUM_INT_PROP_

#define NUM_INT_PROP_   1

Definition at line 30 of file aero_phase_solver.c.

◆ NUM_STATE_VAR_

#define NUM_STATE_VAR_   (int_data[0])

Definition at line 29 of file aero_phase_solver.c.

◆ SPEC_TYPE_

#define SPEC_TYPE_ ( x)
Value:
(int_data[NUM_INT_PROP_ + x])
#define NUM_INT_PROP_

Definition at line 32 of file aero_phase_solver.c.

Function Documentation

◆ aero_phase_add_condensed_data()

void aero_phase_add_condensed_data ( int n_int_param,
int n_float_param,
int * int_param,
double * float_param,
void * solver_data )

Add condensed data to the condensed data block for aerosol phases.

Parameters
n_int_paramNumber of integer parameters
n_float_paramNumber of floating-point parameters
int_paramPointer to the integer parameter array
float_paramPointer to the floating-point parameter array
solver_dataPointer to the solver data

Definition at line 175 of file aero_phase_solver.c.

◆ aero_phase_get_mass__kg_m3()

void aero_phase_get_mass__kg_m3 ( ModelData * model_data,
int aero_phase_idx,
double * state_var,
double * mass,
double * MW,
double * jac_elem_mass,
double * jac_elem_MW )

Get the mass and average MW in an aerosol phase.

Parameters
model_dataPointer to the model data (state, env, aero_phase)
aero_phase_idxIndex of the aerosol phase to use in the calculation
state_varPointer the aerosol phase on the state variable array
massPointer to hold total aerosol phase mass ( \(\mbox{\si{\kilogram\per\cubic\metre}}\) or \(\mbox{\si{\kilogram\per particle}}\))
MWPointer to hold average MW of the aerosol phase ( \(\mbox{\si{\kilogram\per\mol}}\))
jac_elem_massWhen not NULL, a pointer to an array whose length is the number of Jacobian elements used in calculations of mass and volume of this aerosol phase returned by aero_phase_get_used_jac_elem and whose contents will be set to the partial derivatives of mass by concentration \(\frac{dm}{dy_i}\) of each component species \(y_i\).
jac_elem_MWWhen not NULL, a pointer to an array whose length is the number of Jacobian elements used in calculations of mass and volume of this aerosol phase returned by aero_phase_get_used_jac_elem and whose contents will be set to the partial derivatives of total molecular weight by concentration \(\frac{dMW}{dy_i}\) of each component species \(y_i\).

Definition at line 93 of file aero_phase_solver.c.

Here is the caller graph for this function:

◆ aero_phase_get_used_jac_elem()

int aero_phase_get_used_jac_elem ( ModelData * model_data,
int aero_phase_idx,
int state_var_id,
bool * jac_struct )

Flag Jacobian elements used in calculations of mass and volume.

Parameters
model_dataPointer to the model data(state, env, aero_phase)
aero_phase_idxIndex of the aerosol phase to find elements for
state_var_idIndex in the state array for this aerosol phase
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 46 of file aero_phase_solver.c.

Here is the caller graph for this function:

◆ aero_phase_get_volume__m3_m3()

void aero_phase_get_volume__m3_m3 ( ModelData * model_data,
int aero_phase_idx,
double * state_var,
double * volume,
double * jac_elem )

Get the volume of an aerosol phase.

Parameters
model_dataPointer to the model data (state, env, aero_phase)
aero_phase_idxIndex of the aerosol phase to use in the calculation
state_varPointer to the aerosol phase on the state variable array
volumePointer to hold the aerosol phase volume ( \(\mbox{\si{\cubic\metre\per\cubic\metre}}\) or \(\mbox{\si{\cubic\metre\per particle}}\))
jac_elemWhen not NULL, a pointer to an array whose length is the number of Jacobian elements used in calculations of mass and volume of this aerosol phase returned by aero_phase_get_used_jac_elem and whose contents will be set to the partial derivatives of total phase volume by concentration \(\frac{dv}{dy_i}\) of each component species \(y_i\).

Definition at line 144 of file aero_phase_solver.c.

Here is the caller graph for this function:

◆ aero_phase_print_data()

void aero_phase_print_data ( void * solver_data)

Print the aerosol phase data.

Parameters
solver_dataPointer to the solver data

Definition at line 210 of file aero_phase_solver.c.