API

SteadyStateSolvers module

HSSModel.SteadyStateSolvers.hox_ss_solverFunction
hox_ss_solver(no::Real, no2::Real, phox::Real, vocr::Real, alpha::Real; no2_no::Real=4, options::SteadyStateOptions=SteadyStateOptions())::SteadyStateResult

Solve the NOx-HOx steady state system for a given set of NOx, P(HOx), VOC reactivity, and RO2 branching ratio. The positional inputs are:

  • no - NO concentration in molec. cm$^{-3}$
  • no2 - NO2 concentration in molec. cm$^{-3}$
  • phox - HOx production rate in molec. cm$^{-3}$ s$^{-1}$
  • alpha - NO + RO2 branching ratio

options must be a SteadyStateOptions instance, it can be used to change more detailed options in the model.

This returns a SteadyStateResult instance which contains the final state of the model.

HSSModel.SteadyStateSolvers.SteadyStateOptionsType
SteadyStateOptions(;T::Real=298, M::Real=2e19, rh::Real=0.01, 
                    k_RO2NO::Real=8e-12, k_RO2HO2::Real=8e-12, k_RO2RO2::Real=6.8e-14,
                    k4::Real=1.1e-11, k2eff::Real=8e-12, k5eff::Real=5e-12)

Construct a SteadyStateOptions instance, that is a structure that controls the options for the HOx steady state solver. All parameters are keyword arguments. Available parameters and their default values are:

  • T (default: 298) - air temperature in Kelvin
  • M (default: $2 × 10^{19}$) - number density of air in molec. cm$^{-3}$.
  • rh (default: 0.01) - mole fraction of H2O in the air, i.e. rh * M is the number density of H2O used in the model.
  • k_RO2NO (default: $8 × 10^{-12}$) - fixed rate constant for the NO + RO2 → NO2 + RO reaction. Since this needs to be an effective rate for the mixing of RO2 radicals, it is just used as a fixed value and doesn't change with T and M. Units of molec$^{-1}$ cm$^{3}$ s$^{-1}$.
  • k_RO2HO2 (default: $8 × 10^{-12}$) - fixed rate constant for the RO2 + HO2 loss pathway. Like k_RO2NO, this doesn't vary with T and M. Units of molec$^{-1}$ cm$^{3}$ s$^{-1}$.
  • k_RO2RO2 (default: $6.8 × 10^{-14}$) - fixed rate constant for the RO2 + RO2 loss pathway. Like k_RO2NO, this doesn't vary with T and M. Units of molec$^{-1}$ cm$^{3}$ s$^{-1}$.
  • k4 (default: $1.1 × 10^{-11}$) - rate constant for NO2 + OH → HNO3 reaction only in the initial guess for OH. Units of molec$^{-1}$ cm$^{3}$ s$^{-1}$.
  • k2eff (default: $8 × 10^{-12}$) - effective rate constant for the NO + RO2 → NO2 + RO reaction only in the initial guess for OH. Units of molec$^{-1}$ cm$^{3}$ s$^{-1}$.
  • k5eff (default: $5 × 10^{-12}$) - effective rate constant for the RO2 and HO2 self-reaction only in the initial guess for OH. Units of molec$^{-1}$ cm$^{3}$ s$^{-1}$.
HSSModel.SteadyStateSolvers.SteadyStateResultType

Struct to hold the final state of the NOx-HOx steady state model. All concentrations are in molec. cm$^{-3}$ s$^{-1}$. The following fields have the steady state solution:

  • oh - OH steady-state concentration
  • ho2 - HO2 steady-state concentration
  • ro2 - RO2 steady-state concentration

Additional fields store input or internal variables to aid in plotting, calculating derived quantities, or debugging:

  • no - NO concentration (from input)
  • no2 - NO2 concentration (from input)
  • vocr - VOC reactivity in s$^{-1}$
  • phox - HOx production rate in molec. cm$^{-3}$ s$^{-1}$
  • alpha - NO + RO2 branching ratio
  • rates - a dictionary of all rate constants (both specified and calculated) used in the solution
  • options - the input SteadyStateOptions structure.
  • solver_results - the NLSolve.SolverResults structure returned by the solver that found the optimum solution to the NOx-HOx steady state equations.
HSSModel.SteadyStateSolvers.nonlin_nox_analytic_modelFunction
nonlin_nox_analytic_model(no::Real, no2::Real; kwargs...)::Real

Compute OH concentrations given NO and NO2 concentrations along with additional kinetics parameters defined by the keyword argument. All concentrations are in molec. cm$^{-3}$.

This uses the steady state model described in Murphy et al., ACP, 2006: "The weekend effect within and downwind of Sacramento: Part 2. Observational evidence for chemical and dynamical contributions" (doi: 10.5194/acpd-6-11971-2006). See Eqs. 3, 4, and 5.

The keyword arguments, with defaults in are:

  • phox (6.25e6) - HOx production rate in molec. cm$^{-3}$ s$^{-1}$.
  • vocr (5.8) - Total VOC OH reactivity in s$^{-1}$
  • alpha (0.04) - RO2 + NO branching ratio, unitless.
  • k4 (1.1e-11) - Rate constant for OH + NO2 –> HNO3 in cm$^3$ molec$^{-1}$ s$^{-1}$
  • k2eff (8e-12) - Effective reaction rate of NO with RO2 in cm$^3$ molec$^{-1}$ s$^{-1}$
  • k5eff (5e-12) - Effective reaction rate of RO2 and HO2 self reaction in cm$^3$ molec$^{-1}$ s$^{-1}$
nonlin_nox_analytic_model(nox::Real; no2_no::Real=4, kwargs...)::Real

Compute OH concentration from NOx concentration and an NO2:NO ratio, which defaults to 4:1.

DerivedQuantities module

HSSModel.DerivedQuantities.nox_lifetimeFunction
nox_lifetime(result::SteadyStateSolvers.SteadyStateResult)::Dict

Compute NOx lifetimes from a steady state model result. The return value is a dictionary with keys "total", "hno3", and "ans" which correspond to the overall lifetime, lifetime w.r.t. loss to HNO3, and lifetime w.r.t. loss to alkyl nitrates, respectively. Lifetimes are in hours.

HSSModel.DerivedQuantities.ozone_prod_efficiencyFunction
ozone_prod_efficiency(result::SteadyStateSolvers.SteadyStateResult)

Compute the OPE at the final steady state balance returned by a single run of the steady state model. Returns the OPE as a scalar value. OPE is calculated as:

$\mathrm{OPE} = \frac{P(\mathrm{O_3})}{L(\mathrm{NO_x})} = \frac{k_\mathrm{NO+HO2}[\mathrm{NO}][\mathrm{HO_2}] + (1-\alpha)k_\mathrm{NO+RO2}[\mathrm{NO}][\mathrm{RO_2}]}{k_\mathrm{NO2+OH}[\mathrm{NO_2}][\mathrm{OH}] + \alpha k_\mathrm{NO+RO2}[\mathrm{NO}][\mathrm{RO_2}]}$

This follows the basic formulation described in Kleinman et al. 2002, but calculates each component more directly (since the precise HO2 and RO2 concentrations from the model are available) and accounts for alkyl nitrate formation.

HSSModel.DerivedQuantities.ozone_prodFunction
ozone_prod(result::SteadyStateSolvers.SteadyStateResult)

Calculates the rate of ozone production given a steady state returned by the model. Returns a scalar value in units of molec. cm$^{-3}$ s$^{-1}$. This is calculated as:

$P(\mathrm{O_3}) = k_\mathrm{NO+HO2}[\mathrm{NO}][\mathrm{HO_2}] + (1-\alpha)k_\mathrm{NO+RO2}[\mathrm{NO}][\mathrm{RO_2}]$

HSSModel.DerivedQuantities.nox_lossFunction
nox_loss(result::SteadyStateSolvers.SteadyStateResult)

Calculates the rate of NOx loss given a steady state returned by the model. Returns a scale value in units of molec. cm$^{-3}$ s$^{-1}$. This is calculated as:

$L(\mathrm{NO_x}) = k_\mathrm{NO2+OH}[\mathrm{NO_2}][\mathrm{OH}] + \alpha k_\mathrm{NO+RO2}[\mathrm{NO}][\mathrm{RO_2}]$