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

Modal mass aerosol representation functions. More...

Include dependency graph for aero_rep_modal_binned_mass.c:

Go to the source code of this file.

Macros

#define TEMPERATURE_K_   env_data[0]
 
#define PRESSURE_PA_   env_data[1]
 
#define UPDATE_GMD   0
 
#define UPDATE_GSD   1
 
#define BINNED   1
 
#define MODAL   2
 
#define NUM_SECTION_   (int_data[0])
 
#define INT_DATA_SIZE_   (int_data[1])
 
#define FLOAT_DATA_SIZE_   (int_data[2])
 
#define AERO_REP_ID_   (int_data[3])
 
#define NUM_INT_PROP_   4
 
#define NUM_FLOAT_PROP_   0
 
#define NUM_ENV_PARAM_   0
 
#define MODE_INT_PROP_LOC_(x)   (int_data[NUM_INT_PROP_ + x] - 1)
 
#define MODE_FLOAT_PROP_LOC_(x)   (int_data[NUM_INT_PROP_ + NUM_SECTION_ + x] - 1)
 
#define SECTION_TYPE_(x)   (int_data[MODE_INT_PROP_LOC_(x)])
 
#define NUM_BINS_(x)   (int_data[MODE_INT_PROP_LOC_(x) + 1])
 
#define NUM_PHASE_(x)   (int_data[MODE_INT_PROP_LOC_(x) + 2])
 
#define PHASE_STATE_ID_(x, y, b)    (int_data[MODE_INT_PROP_LOC_(x) + 3 + b * NUM_PHASE_(x) + y] - 1)
 
#define PHASE_MODEL_DATA_ID_(x, y, b)
 
#define PHASE_NUM_JAC_ELEM_(x, y, b)
 
#define BIN_DP_(x, b)   (float_data[MODE_FLOAT_PROP_LOC_(x) + b * 3])
 
#define GMD_(x)   (aero_rep_env_data[x])
 
#define GSD_(x)   (aero_rep_env_data[NUM_SECTION_ + x])
 
#define NUMBER_CONC_(x, b)   (float_data[MODE_FLOAT_PROP_LOC_(x) + b * 3 + 1])
 
#define EFFECTIVE_RADIUS_(x, b)    (float_data[MODE_FLOAT_PROP_LOC_(x) + b * 3 + 2])
 
#define PHASE_MASS_(x, y, b)
 
#define PHASE_AVG_MW_(x, y, b)
 

Functions

int aero_rep_modal_binned_mass_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. More...
 
void aero_rep_modal_binned_mass_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. More...
 
void aero_rep_modal_binned_mass_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. More...
 
void aero_rep_modal_binned_mass_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. More...
 
void aero_rep_modal_binned_mass_get_effective_layer_radius__m (ModelData *model_data, int aero_phase_idx, double *layer_radius, double *partial_deriv, int *aero_rep_int_data, double *aero_rep_float_data, double *aero_rep_env_data)
 Get the effective radius of a specified layer \(r_{layer}\) (m) More...
 
void aero_rep_modal_binned_mass_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) More...
 
void aero_rep_modal_binned_mass_get_phase_volume__m3_m3 (ModelData *model_data, int aero_phase_idx, double *phase_volume, double *partial_deriv, int *aero_rep_int_data, double *aero_rep_float_data, double *aero_rep_env_data)
 Get the phase volume \(V_{phase}\) (m³/m³) More...
 
void aero_rep_modal_binned_mass_get_interface_surface_area__m2 (ModelData *model_data, int aero_phase_idx_first, int aero_phase_idx_second, double *surface_area, double *partial_deriv, int *aero_rep_int_data, double *aero_rep_float_data, double *aero_rep_env_data)
 Get the effective particle surface area \(r_{eff}\) (m) More...
 
void aero_rep_modal_binned_mass_get_layer_thickness__m (ModelData *model_data, int aero_phase_idx, double *layer_thickness, double *partial_deriv, int *aero_rep_int_data, double *aero_rep_float_data, double *aero_rep_env_data)
 Get the thickness of a particle layer (m) More...
 
void aero_rep_modal_binned_mass_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}}\)) More...
 
void aero_rep_modal_binned_mass_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. More...
 
void aero_rep_modal_binned_mass_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}}\)) More...
 
void aero_rep_modal_binned_mass_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{\kilogram\per\mole}}\)) More...
 
bool aero_rep_modal_binned_mass_update_data (void *update_data, int *aero_rep_int_data, double *aero_rep_float_data, double *aero_rep_env_data)
 Update the aerosol representation data. More...
 
void aero_rep_modal_binned_mass_print (int *aero_rep_int_data, double *aero_rep_float_data)
 Print the mass-only modal/binned reaction parameters. More...
 
void * aero_rep_modal_binned_mass_create_gmd_update_data ()
 Create update data for new GMD. More...
 
void aero_rep_modal_binned_mass_set_gmd_update_data (void *update_data, int aero_rep_id, int section_id, double gmd)
 Set GMD update data. More...
 
void * aero_rep_modal_binned_mass_create_gsd_update_data ()
 Create update data for new GSD. More...
 
void aero_rep_modal_binned_mass_set_gsd_update_data (void *update_data, int aero_rep_id, int section_id, double gsd)
 Set GSD update data. More...
 

Detailed Description

Modal mass aerosol representation functions.

Definition in file aero_rep_modal_binned_mass.c.

Macro Definition Documentation

◆ AERO_REP_ID_

#define AERO_REP_ID_   (int_data[3])

Definition at line 31 of file aero_rep_modal_binned_mass.c.

◆ BIN_DP_

#define BIN_DP_ (   x,
 
)    (float_data[MODE_FLOAT_PROP_LOC_(x) + b * 3])

Definition at line 59 of file aero_rep_modal_binned_mass.c.

◆ BINNED

#define BINNED   1

Definition at line 25 of file aero_rep_modal_binned_mass.c.

◆ EFFECTIVE_RADIUS_

#define EFFECTIVE_RADIUS_ (   x,
 
)     (float_data[MODE_FLOAT_PROP_LOC_(x) + b * 3 + 2])

Definition at line 69 of file aero_rep_modal_binned_mass.c.

◆ FLOAT_DATA_SIZE_

#define FLOAT_DATA_SIZE_   (int_data[2])

Definition at line 30 of file aero_rep_modal_binned_mass.c.

◆ GMD_

#define GMD_ (   x)    (aero_rep_env_data[x])

Definition at line 62 of file aero_rep_modal_binned_mass.c.

◆ GSD_

#define GSD_ (   x)    (aero_rep_env_data[NUM_SECTION_ + x])

Definition at line 63 of file aero_rep_modal_binned_mass.c.

◆ INT_DATA_SIZE_

#define INT_DATA_SIZE_   (int_data[1])

Definition at line 29 of file aero_rep_modal_binned_mass.c.

◆ MODAL

#define MODAL   2

Definition at line 26 of file aero_rep_modal_binned_mass.c.

◆ MODE_FLOAT_PROP_LOC_

#define MODE_FLOAT_PROP_LOC_ (   x)    (int_data[NUM_INT_PROP_ + NUM_SECTION_ + x] - 1)

Definition at line 36 of file aero_rep_modal_binned_mass.c.

◆ MODE_INT_PROP_LOC_

#define MODE_INT_PROP_LOC_ (   x)    (int_data[NUM_INT_PROP_ + x] - 1)

Definition at line 35 of file aero_rep_modal_binned_mass.c.

◆ NUM_BINS_

#define NUM_BINS_ (   x)    (int_data[MODE_INT_PROP_LOC_(x) + 1])

Definition at line 40 of file aero_rep_modal_binned_mass.c.

◆ NUM_ENV_PARAM_

#define NUM_ENV_PARAM_   0

Definition at line 34 of file aero_rep_modal_binned_mass.c.

◆ NUM_FLOAT_PROP_

#define NUM_FLOAT_PROP_   0

Definition at line 33 of file aero_rep_modal_binned_mass.c.

◆ NUM_INT_PROP_

#define NUM_INT_PROP_   4

Definition at line 32 of file aero_rep_modal_binned_mass.c.

◆ NUM_PHASE_

#define NUM_PHASE_ (   x)    (int_data[MODE_INT_PROP_LOC_(x) + 2])

Definition at line 43 of file aero_rep_modal_binned_mass.c.

◆ NUM_SECTION_

#define NUM_SECTION_   (int_data[0])

Definition at line 28 of file aero_rep_modal_binned_mass.c.

◆ NUMBER_CONC_

#define NUMBER_CONC_ (   x,
 
)    (float_data[MODE_FLOAT_PROP_LOC_(x) + b * 3 + 1])

Definition at line 66 of file aero_rep_modal_binned_mass.c.

◆ PHASE_AVG_MW_

#define PHASE_AVG_MW_ (   x,
  y,
 
)
Value:
(float_data[MODE_FLOAT_PROP_LOC_(x) + (3 + NUM_PHASE_(x)) * NUM_BINS_(x) + \
b * NUM_PHASE_(x) + y])
#define MODE_FLOAT_PROP_LOC_(x)
#define NUM_PHASE_(x)
#define NUM_BINS_(x)

Definition at line 79 of file aero_rep_modal_binned_mass.c.

◆ PHASE_MASS_

#define PHASE_MASS_ (   x,
  y,
 
)
Value:
(float_data[MODE_FLOAT_PROP_LOC_(x) + 3 * NUM_BINS_(x) + b * NUM_PHASE_(x) + \
y])

Definition at line 73 of file aero_rep_modal_binned_mass.c.

◆ PHASE_MODEL_DATA_ID_

#define PHASE_MODEL_DATA_ID_ (   x,
  y,
 
)
Value:
(int_data[MODE_INT_PROP_LOC_(x) + 3 + NUM_BINS_(x) * NUM_PHASE_(x) + \
b * NUM_PHASE_(x) + y] - \
1)
#define MODE_INT_PROP_LOC_(x)

Definition at line 48 of file aero_rep_modal_binned_mass.c.

◆ PHASE_NUM_JAC_ELEM_

#define PHASE_NUM_JAC_ELEM_ (   x,
  y,
 
)
Value:
int_data[MODE_INT_PROP_LOC_(x) + 3 + 2 * NUM_BINS_(x) * NUM_PHASE_(x) + \
b * NUM_PHASE_(x) + y]

Definition at line 54 of file aero_rep_modal_binned_mass.c.

◆ PHASE_STATE_ID_

#define PHASE_STATE_ID_ (   x,
  y,
 
)     (int_data[MODE_INT_PROP_LOC_(x) + 3 + b * NUM_PHASE_(x) + y] - 1)

Definition at line 46 of file aero_rep_modal_binned_mass.c.

◆ PRESSURE_PA_

#define PRESSURE_PA_   env_data[1]

Definition at line 20 of file aero_rep_modal_binned_mass.c.

◆ SECTION_TYPE_

#define SECTION_TYPE_ (   x)    (int_data[MODE_INT_PROP_LOC_(x)])

Definition at line 37 of file aero_rep_modal_binned_mass.c.

◆ TEMPERATURE_K_

#define TEMPERATURE_K_   env_data[0]

Definition at line 19 of file aero_rep_modal_binned_mass.c.

◆ UPDATE_GMD

#define UPDATE_GMD   0

Definition at line 22 of file aero_rep_modal_binned_mass.c.

◆ UPDATE_GSD

#define UPDATE_GSD   1

Definition at line 23 of file aero_rep_modal_binned_mass.c.

Function Documentation

◆ aero_rep_modal_binned_mass_create_gmd_update_data()

void * aero_rep_modal_binned_mass_create_gmd_update_data ( )

Create update data for new GMD.

Returns
Pointer to a new GMD update data object

Definition at line 850 of file aero_rep_modal_binned_mass.c.

◆ aero_rep_modal_binned_mass_create_gsd_update_data()

void * aero_rep_modal_binned_mass_create_gsd_update_data ( )

Create update data for new GSD.

Returns
Pointer to a new GSD update data object

Definition at line 884 of file aero_rep_modal_binned_mass.c.

◆ aero_rep_modal_binned_mass_get_aero_conc_type()

void aero_rep_modal_binned_mass_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.

Modal mass concentrations are per-mode or per-bin.

Parameters
aero_phase_idxIndex of the aerosol phase within the representation
aero_conc_typePointer to int that will hold the concentration type code
aero_rep_int_dataPointer to the aerosol representation integer data
aero_rep_float_dataPointer to the aerosol representation floating-point data
aero_rep_env_dataPointer to the aerosol representation environment-dependent parameters

Definition at line 607 of file aero_rep_modal_binned_mass.c.

Here is the caller graph for this function:

◆ aero_rep_modal_binned_mass_get_aero_phase_avg_MW__kg_mol()

void aero_rep_modal_binned_mass_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{\kilogram\per\mole}}\))

Parameters
model_dataPointer to the model data, including the state array
aero_phase_idxIndex of the aerosol phase within the representation
aero_phase_avg_MWAverage 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_dataPointer to the aerosol representation integer data
aero_rep_float_dataPointer to the aerosol representation floating-point data
aero_rep_env_dataPointer to the aerosol representation environment-dependent parameters

Definition at line 698 of file aero_rep_modal_binned_mass.c.

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

◆ aero_rep_modal_binned_mass_get_aero_phase_mass__kg_m3()

void aero_rep_modal_binned_mass_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}}\))

Parameters
model_dataPointer to the model data, including the state array
aero_phase_idxIndex of the aerosol phase within the representation
aero_phase_massTotal 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_dataPointer to the aerosol representation integer data
aero_rep_float_dataPointer to the aerosol representation floating-point data
aero_rep_env_dataPointer to the aerosol representation environment-dependent parameters

Definition at line 635 of file aero_rep_modal_binned_mass.c.

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

◆ aero_rep_modal_binned_mass_get_dependencies()

void aero_rep_modal_binned_mass_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 modal mass aerosol representation functions do not use state array values

Parameters
aero_rep_int_dataPointer to the aerosol representation integer data
aero_rep_float_dataPointer to the aerosol representation floating-point data
state_flagsArray of flags indicating state array elements used

Definition at line 139 of file aero_rep_modal_binned_mass.c.

Here is the caller graph for this function:

◆ aero_rep_modal_binned_mass_get_effective_layer_radius__m()

void aero_rep_modal_binned_mass_get_effective_layer_radius__m ( ModelData *  model_data,
int  aero_phase_idx,
double *  layer_radius,
double *  partial_deriv,
int *  aero_rep_int_data,
double *  aero_rep_float_data,
double *  aero_rep_env_data 
)

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

The modal mass aerosol representation does not assume any internal structure for modes or bins, so the layer radius function always returns the radius of the particle.

Parameters
model_dataPointer to the model data, including the state array
aero_phase_idxIndex of the aerosol phase within the representation
layer_radiusEffective layer radius (m)
partial_deriv\(\frac{\partial r_{layer}}{\partial y}\) where \(y\) are species on the state array
aero_rep_int_dataPointer to the aerosol representation integer data
aero_rep_float_dataPointer to the aerosol representation floating-point data
aero_rep_env_dataPointer to the aerosol representation environment-dependent parameters

Definition at line 285 of file aero_rep_modal_binned_mass.c.

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

◆ aero_rep_modal_binned_mass_get_effective_radius__m()

void aero_rep_modal_binned_mass_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)

The modal mass effective radius is calculated for a log-normal distribution where the geometric mean diameter ( \(\tilde{D}_n\)) and geometric standard deviation ( \(\sigma_g\)) are set by the aerosol model prior to solving the chemistry. Thus, all \(\frac{\partial r_{eff}}{\partial y}\) are zero. The effective radius is calculated according to the equation given in Table 1 of Zender [12] :

\[ \tilde{\sigma_g} \equiv ln( \sigma_g ) \]

\[ D_s = D_{eff} = \tilde{D_n} e^{5 \tilde{\sigma}_g^2 / 2} \]

\[ r_{eff} = \frac{D_{eff}}{2} \]

For bins, \(r_{eff}\) is assumed to be the bin radius.

Parameters
model_dataPointer to the model data, including the state array
aero_phase_idxIndex of the aerosol phase within the representation
radiusEffective particle radius (m)
partial_deriv\(\frac{\partial r_{eff}}{\partial y}\) where \(y\) are species on the state array
aero_rep_int_dataPointer to the aerosol representation integer data
aero_rep_float_dataPointer to the aerosol representation floating-point data
aero_rep_env_dataPointer to the aerosol representation environment-dependent parameters

Definition at line 336 of file aero_rep_modal_binned_mass.c.

Here is the caller graph for this function:

◆ aero_rep_modal_binned_mass_get_interface_surface_area__m2()

void aero_rep_modal_binned_mass_get_interface_surface_area__m2 ( ModelData *  model_data,
int  aero_phase_idx_first,
int  aero_phase_idx_second,
double *  surface_area,
double *  partial_deriv,
int *  aero_rep_int_data,
double *  aero_rep_float_data,
double *  aero_rep_env_data 
)

Get the effective particle surface area \(r_{eff}\) (m)

The surface area interface that exists between two specified phases within the modal/binned aerosol representation always returns an error, because no specific internal structure is assumed for phases within modes or bins.

Parameters
model_dataPointer to the model data, including the state array
aero_phase_idx_firstIndex of the first aerosol phase within the representation
aero_phase_idx_secondIndex of the second aerosol phase within the representation
surface_areaEffective surface area of interface between phases (m^2)
partial_deriv\(\frac{\partial sa_{eff}}{\partial y}\) where \(y\) are species on the state array
aero_rep_int_dataPointer to the aerosol representation integer data
aero_rep_float_dataPointer to the aerosol representation floating-point data
aero_rep_env_dataPointer to the aerosol representation environment-dependent parameters

Definition at line 445 of file aero_rep_modal_binned_mass.c.

Here is the caller graph for this function:

◆ aero_rep_modal_binned_mass_get_layer_thickness__m()

void aero_rep_modal_binned_mass_get_layer_thickness__m ( ModelData *  model_data,
int  aero_phase_idx,
double *  layer_thickness,
double *  partial_deriv,
int *  aero_rep_int_data,
double *  aero_rep_float_data,
double *  aero_rep_env_data 
)

Get the thickness of a particle layer (m)

The thickness of a particle layer within the modal/binned aerosol representation always returns the radius.

Parameters
model_dataPointer to the model data, including the state array
aero_phase_idxIndex of the aerosol phase within the representation
layer_thicknessLayer thickness which is equivalent to radius (m)
partial_deriv\(\frac{\partial r_{eff}}{\partial y}\) where \(y\) are species on the state array
aero_rep_int_dataPointer to the aerosol representation integer data
aero_rep_float_dataPointer to the aerosol representation floating-point data
aero_rep_env_dataPointer to the aerosol representation environment-dependent parameters

Definition at line 473 of file aero_rep_modal_binned_mass.c.

Here is the caller graph for this function:

◆ aero_rep_modal_binned_mass_get_number_conc__n_m3()

void aero_rep_modal_binned_mass_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}}\))

The modal mass number concentration is calculated for a log-normal distribution where the geometric mean diameter ( \(\tilde{D}_n\)) and geometric standard deviation ( \(\tilde{\sigma}_g\)) are set by the aerosol model prior to solving the chemistry. The number concentration is calculated according to the equation given in Table 1 of Zender [12] :

\[ n = N_0 = \frac{6V_0}{\pi}\tilde{D}_n^{-3}e^{-9 ln(\tilde{\sigma}_g)^2/2} \]

\[ V_0 = \sum_i{\frac{m_i}{\rho_i}} \]

where \(\rho_i\) and \(m_i\) are the density and total mass of species \(i\) in the specified mode.

The binned number concentration is calculated according to:

\[ n = V_0 / V_p \]

\[ V_p = \frac{4}{3}\pi r^{3} \]

where \(r\) is the radius of the size bin and \(V_0\) is defined as above.

Parameters
model_dataPointer to the model data, including the state array
aero_phase_idxIndex of the aerosol phase within the representation
number_concParticle number concentration, \(n\) ( \(\mbox{\si{\#\per\cubic\centi\metre}}\))
partial_deriv\(\frac{\partial n}{\partial y}\) where \(y\) are the species on the state array
aero_rep_int_dataPointer to the aerosol representation integer data
aero_rep_float_dataPointer to the aerosol representation floating-point data
aero_rep_env_dataPointer to the aerosol representation environment-dependent parameters

Definition at line 541 of file aero_rep_modal_binned_mass.c.

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

◆ aero_rep_modal_binned_mass_get_phase_volume__m3_m3()

void aero_rep_modal_binned_mass_get_phase_volume__m3_m3 ( ModelData *  model_data,
int  aero_phase_idx,
double *  phase_volume,
double *  partial_deriv,
int *  aero_rep_int_data,
double *  aero_rep_float_data,
double *  aero_rep_env_data 
)

Get the phase volume \(V_{phase}\) (m³/m³)

The phase volume is calculated as the sum of the volumes of each species in the phase, which are calculated by dividing the mass of each species by its density. The mass of each species is calculated from the state array and model data using the aero_phase_get_mass function.

Parameters
model_dataPointer to the model data, including the state array
aero_phase_idxIndex of the aerosol phase within the representation
phase_volumePhase volume (m³/m³)
partial_deriv\(\frac{\partial V_{phase}}{\partial y}\) where \(y\) are species on the state array
aero_rep_int_dataPointer to the aerosol representation integer data
aero_rep_float_dataPointer to the aerosol representation floating-point data
aero_rep_env_dataPointer to the aerosol representation environment-dependent parameters

Definition at line 385 of file aero_rep_modal_binned_mass.c.

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

◆ aero_rep_modal_binned_mass_get_used_jac_elem()

int aero_rep_modal_binned_mass_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.

Parameters
model_dataPointer to the model data
aero_rep_int_dataPointer to the aerosol representation integer data
aero_rep_float_dataPointer to the aerosol representation floating-point data
aero_phase_idxIndex of the aerosol phase to find elements for
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 95 of file aero_rep_modal_binned_mass.c.

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

◆ aero_rep_modal_binned_mass_print()

void aero_rep_modal_binned_mass_print ( int *  aero_rep_int_data,
double *  aero_rep_float_data 
)

Print the mass-only modal/binned reaction parameters.

Parameters
aero_rep_int_dataPointer to the aerosol representation integer data
aero_rep_float_dataPointer to the aerosol representation floating-point data

Definition at line 836 of file aero_rep_modal_binned_mass.c.

Here is the caller graph for this function:

◆ aero_rep_modal_binned_mass_set_gmd_update_data()

void aero_rep_modal_binned_mass_set_gmd_update_data ( void *  update_data,
int  aero_rep_id,
int  section_id,
double  gmd 
)

Set GMD update data.

Parameters
update_dataPointer to an allocated GMD update data object
aero_rep_idId of the aerosol representation(s) to update
section_idId of the mode to update
gmdNew mode GMD (m)

Definition at line 866 of file aero_rep_modal_binned_mass.c.

◆ aero_rep_modal_binned_mass_set_gsd_update_data()

void aero_rep_modal_binned_mass_set_gsd_update_data ( void *  update_data,
int  aero_rep_id,
int  section_id,
double  gsd 
)

Set GSD update data.

Parameters
update_dataPointer to an allocated GSD update data object
aero_rep_idId of the aerosol representation(s) to update
section_idId of the mode to update
gsdNew mode GSD (unitless)

Definition at line 900 of file aero_rep_modal_binned_mass.c.

◆ aero_rep_modal_binned_mass_update_data()

bool aero_rep_modal_binned_mass_update_data ( void *  update_data,
int *  aero_rep_int_data,
double *  aero_rep_float_data,
double *  aero_rep_env_data 
)

Update the aerosol representation data.

The model mass aerosol representation update data is structured as follows:

  • int aero_rep_id (Id of one or more aerosol representations set by the host model using the camp_aero_rep_modal_binned_mass::aero_rep_modal_binned_mass_t::set_id function prior to initializing the solver.)
  • int update_type (Type of update to perform. Can be UPDATE_GMD or UPDATE_GSD.)
  • int section_id (Index of the mode to update.)
  • double new_value (Either the new GMD (m) or the new GSD (unitless).)
Parameters
update_dataPointer to the updated aerosol representation data
aero_rep_int_dataPointer to the aerosol representation integer data
aero_rep_float_dataPointer to the aerosol representation floating-point data
aero_rep_env_dataPointer to the aerosol representation environment-dependent parameters
Returns
Flag indicating whether this is the aerosol representation to update

Recalculate the effective radius [m]

Equation based on [12] Table 1 effective diameter \((D_s, D_{eff}\)) equations:

\[ \tilde{\sigma_g} \equiv ln( \sigma_g ) \]

\[ D_s = D_{eff} = \tilde{D_n} e^{5 \tilde{\sigma}_g^2 / 2} \]

\[ r_{eff} = \frac{D_{eff}}{2} \]

where \(\tilde{D_n}\) is the geometric mean diameter [m], \(\sigma_g\) is the geometric standard deviation [unitless], and \(r_{eff}\) is the effective radius [m].

Definition at line 767 of file aero_rep_modal_binned_mass.c.

Here is the caller graph for this function:

◆ aero_rep_modal_binned_mass_update_env_state()

void aero_rep_modal_binned_mass_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 modal mass aerosol representation is not updated for new environmental conditions

Parameters
model_dataPointer to the model data
aero_rep_int_dataPointer to the aerosol representation integer data
aero_rep_float_dataPointer to the aerosol representation floating-point data
aero_rep_env_dataPointer to the aerosol representation environment-dependent parameters

Definition at line 160 of file aero_rep_modal_binned_mass.c.

Here is the caller graph for this function:

◆ aero_rep_modal_binned_mass_update_state()

void aero_rep_modal_binned_mass_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.

The modal mass aerosol representation recalculates effective radius and number concentration for each new state.

Parameters
model_dataPointer to the model data, including the state array
aero_rep_int_dataPointer to the aerosol representation integer data
aero_rep_float_dataPointer to the aerosol representation floating-point data
aero_rep_env_dataPointer to the aerosol representation environment-dependent parameters

Definition at line 183 of file aero_rep_modal_binned_mass.c.

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