API reference

aerosolpy

aerosolpy.integrate_dx_dlogdp(dj, dx_dlogdp)

integrates function with logarithmical infintesemal element

Parameters:
  • dj (np.1darray) – diameter array

  • dx_dlogdp (np.1darray) – distribution array

Returns:

integral

Return type:

float

aerosolpy.matlab_to_datetime(matlab_datenum)

converts matlab timestamp to python datetime

Parameters:

matlab_datenum (array_like) – matlab timestamp as either array or float

Returns:

python datetime as either pandas.Series or datetime

Return type:

array_like

aerosolpy.dayofyear_to_datetime(year, day_of_year)

converts day of year and its fraction (e.g. 128.27) to datetime for given year

Parameters:
  • year (int) – base year

  • day_of_year (array_like of floa) – Day of year with fraction of day

Returns:

pandas datetime

Return type:

array_like of pd.datetime

aerosolpy.ppt_to_percm3(pptv, temp_kelvin=293.15, pres_hpa=1013.25)

unit coversion from pptv to molecules per cm3

Parameters:
  • pptv (array_like) – mixing ratio of trace component in [pptv]

  • temp_kelvin (float) – temperature in [K]

  • pres_hpa (float) – pressure in [hPa]

Returns:

gas concentration in [molec. cm-3]

Return type:

array_like

aerosolpy.mugprom3_to_ppb(mug_pro_m3, molmass, temp_kelvin=293.15)

unit concersion from mug cm-3 to ppbv

Parameters:
  • mug_pro_m3 (array_like) – gas concentration in [mug m-3]

  • molmass (float) – molare mass of gas in [g mol-1]

  • temp_kelvin (float, optional) – Temperature in [K]

Returns:

gas concentration in ppbv, dimless

Return type:

array_like

aerosolpy.lpm_to_m3pers(lpm)

unit conversion for flow in liter per minute to m3 per s

Parameters:

lpm (array_like) – flow in [l min-1]

Returns:

flow in [m3 s-1]

Return type:

array_like

class aerosolpy.AerosolMechanics(temp_kelvin=296.15, pres_hpa=1013.3)

a class defining aerosol mechanics depending on ambient temperature and pressure

Parameters:
  • temp_kelvin (float, optional) – Temperature in [K] used for calculations, default 296.15 K (23 deg C)

  • pres_hpa (float, optional) – Pressure in [hPa] used for calculations, default 101.33 hPa

temp_ref

reference Temperature, 296.15 K (23 deg C)

Type:

float

pres_ref

reference Pressure, 101.33 hPa

Type:

float

temp_kelvin

Temperature in [K] used for calculations, default 296.15 K (23 deg C)

Type:

float

pres_hpa

Pressure in [hPa] used for calculations, default 101.33 hPa

Type:

float

_temp_corr

Temperature correction factor for T different than T0

Type:

float, hidden

mfp

Mean free path of molecules in air, T dependent, in [nm]

Type:

float

airvisc

Viscosity of air, in [kg m-1 s-1]

Type:

float

Notes

The derivation of the air viscosity and mean free path temperature dependence are taken from ISO15900, the parametrization can be found in [1]

References

a_function(dp)

calculates the a-function according to [5]

Parameters:

dp (array_like) – particle diameter in [nm]

Returns:

a-function, i.e. inverse of psi-function

Return type:

array_like

References

charge_prob(dp, i, method='wiedensohler')

steady-state charging probability according to [11] or [12]

Parameters:
  • dp (array_like) – particle diameter in [nm]

  • i (integer) – charging state, also negative

  • method (str) – method used for caclulation, default ‘wiedensohler’

Returns:

charging probability (between 0 and 1), dimless

Return type:

array_like

Notes

method ‘wiedensohler’ assumes: assumes Z+ = 1.34x10^(-4) m2 V-1 s-1 assumes Z- = 1.60x10^(-4) m2 V-1 s-1 assumes m+ = 140 amu assumes m- = 101 amu for i>2 and i<-2 only valid above 25 nm and according to [12]

coefficients paramters_1[4] and parameters_2[5] are slightly different from [11] and given as in ISO15900

method ‘flagan’: incldues an improved three-body trapping, see [13] validity for i=+/-2 down to 5.9 nm validity for i=+/-3 down to 17 nm validity for i=+/-4 down to 28 nm validity for i=+/-5 down to 59 nm

calculation are done in terms of a particle radii, which is different from the Wiedensohler Fit [12], this method takes that into account and divides the input by 2

Raises:

TypeError – If charging state is not int

References

diff_coeff_p(dp)

calculation of the diameter dependent diffusion coefficient of an aerosol particle according to [6]

Parameters:

dp (array_like) – particle diameter in [nm]

Returns:

diffusion coefficient in [m2 s-1]

Return type:

array_like

References

diff_coeff_v(mv=98.08, diff_vol_v=51.96)

calculation of the diffusion coefficient of a trace vapor in air following the method from [7]

Parameters:
  • mv (float, optional) – molecular mass of trace vapor in [g mol-1], default H2SO4, i.e. 98.08

  • diff_vol_v (float, optional) – diffusion volume of trace vapor, default H2SO4, i.e. 1*22.9+2*2.31+4*6.11 = 51.96

Returns:

diffusion coefficient of trace vapor in air [m2 s-1]

Return type:

float

Notes

The diffusion volume of a trace gas is found by summing atomic diffusion volumes. These atomic parameters were determined by a regression analysis of many experimental data. A few are listed here: C:15.9, H:2.31, O:6.11, N:4.54, S:22.9

Attention: There are many different expressions of this equation in literature (often using slightly different constants) or including/ not including the factor sqrt(2) from the reduced mass.

For the often used H2SO4, using mv=134 and diff_vol_v=72.42 assuming a doubly hydrated sulfuric acid monomer, the results are in good agreement with Hanson and Eisele at RH=60

References

diff_loss(dp, l_q_ratio)

diffusional losses in straight tube according to [10]

Parameters:
  • dp (array_like) – particle diameter in [nm]

  • l_q_ratio (float) – ratio of tube length L [m] and flow Q [m3 s-1], i.e. l_q_ratio [s m-2]

Returns:

survival probability (between 0 and 1), dimless

Return type:

array_like

Notes

uses the length L divided by flow Q as input, where L is the tube length in [m] and Q the flow in [m3 s-1]

References

dp_to_zp(dp, i=1)

calculates particle electrical mobility from particle diameter

Parameters:
  • dp (array_like) – particle diameter in [nm]

  • i (integer, optional) – number of charges carried by particle

Returns:

electrical mobility zp in [m2 V-1 s-1]

Return type:

array_like

dp_to_zp_approx(dp)

calculates electrical mobility from particle diameter with the appoximation from [8]

Parameters:

dp (array_like) – particle diameter in [nm]

Returns:

electrical mobility zp in [m2 V-1 s-1]

Return type:

array_like

Notes

Only valid for dp<5-10 nm and singly charged particles

Raises:

warnings.warn if dp is larger than 10 nm

References

mfp_v(mv=98.08, diff_vol_v=51.96)

calculates mean free path of a trace vapor in air

Parameters:
  • mv (float, optional) – molecular mass of trace vapor in [g mol-1], default H2SO4, i.e. 98.08

  • diff_vol_v (float, optional) – diffusion volume of trace vapor, default H2SO4, i.e. 1*22.9+2*2.31+4*6.11 = 51.96

Returns:

mean free path of trace vapor in air [m]

Return type:

float

psi_function(dp)

calculates the Psi-function according to [4]

Parameters:

dp (array_like) – particle diameter in [nm]

Returns:

  • array_like – psi-function, i.e. derivative of log mobility diameters towards log mobility

  • See also

  • ———-

  • aerosolpy.AerosolMechanics.a_function

References

set_pres(pres_hpa)

set new pressure for calculations an recalculates dependent attributes

Parameters:

pres_hpa (float) – new Pressure in [hPa]

set_temp(temp_kelvin)

set new temperature for calculations an recalculates dependent attributes

Parameters:

temp_kelvin (float) – new Temperature in [K]

slipcorr(dp)

calculates the Cunnigham slip correction factor [2]

Parameters:

dp (array_like) – particle diameter in [nm]

Returns:

Cunningham slip correction, dimless

Return type:

array_like

Notes

[3] provides a slightly different parametrization 1.0 + Kn*(1.257+0.4*np.exp(-1.1/Kn)) differences are however negligible

References

zp_to_dp(zp, i=1)

calculates particle diameter from electrical mobility by using a root- finding algorithm

Parameters:
  • zp (array_like) – electrical mobility in [m2 V-1 s-1]

  • i (integer,optional) – number of charges carried by particle

Returns:

particle diameter in [nm]

Return type:

array_like

See also

scipy.optimize.brentq

zp_to_dp_approx(zp)

calculates particle diameter from electrical mobility with the appoximation from [9]

Parameters:

zp (array_like) – electrical mobility in [m2 V-1 s-1]

Returns:

particle diameter in [nm]

Return type:

array_like

Notes

Only valid for dp<5-10 nm and singly charged particles

References

class aerosolpy.AerosolKinetics(temp_kelvin=296.15, pres_hpa=1013.3, **kwargs)

base class for kinetics calculations

Parameters:
  • temp_kelvin (float, optional) – temperature in [K], default 296.15 K (23 deg C)

  • pres_pha (float, optional) – pressure in [hPa], default 1013.3 hPa

coll_kernel_pp(di, dj, rhoi=1000, rhoj=1000)

calculates the coagulation kernel for particles of different size

Parameters:
  • di (array_like) – vapour molecule equivalent diameter in [nm]

  • dj (array_like) – particle diameter of collision partner in [nm]

  • rhoi (float, optional) – density of particle in [kg m-3],default 1000 (unit density)

  • rhoj (float, optional) – density of particle in [kg m-3], default 1000 (unit density)

  • alpha (float) – accomodation coefficient, between 0 and 1, dimless

Returns:

collision kernel in m3 s-1 yielding collision frequency when multiplied by the two concentrations of the two collision partners

Return type:

array_like

Notes

calculations follow chapter 13.3.1.2 pp. 547-549 of [14]

References

coll_kernel_vp(dv, dp, rhov=1000, rhop=1000, alpha=1, diff_coeff_v=None, dynamic_regime='transition', mv=None)

coagulation kernel for vapour molecules with particles

Parameters:
  • dv (array_like) – vapour molecule equivalent diameter in [nm]

  • dp (array_like) – particle diameter of collision partner in [nm]

  • rhov (float, optional) – density of vapour molecule in [kg m-3], defaul 1000 (unit density)

  • rhop (float, optional) – density of particle in [kg m-3], default 1000 (unit density)

  • alpha (float, optional) – accomodation coefficient, between 0 and 1, dimless, default 1

  • diff_coeff_v (float, optional) – diffusion coefficient of vapour in [m2 s-1], might be calculated differently than diffusion coefficient of particle

  • mv (float, optional) – molecular mass [in amu] of vapor, default None (calculate from diameter)

  • dynamic_regime (str, optional) – Knudsen number regime for calculations, default transition

Returns:

collision kernel in [m3 s-1] yielding collision frequency when multiplied by the two concentrations of the two collision partners

Return type:

array_like

Notes

mean free path and Knudsen number are assumed to follow [15], which takes into account that vapour and particle size can be of similar magnitude, which is different to the classical approach of [16] and [17]

The collison kernel can also be defined from the free molecular regime collision kernel as basis and a correction factor gamma is used This is found by equating the kernels for the free molecular regime with the kernel for the contiuum regime. This is done e.g. in [18], but both approaches are equivalent.

References

coll_kernel_vp_vdw(dv, dp, rhov=1000, rhop=1000, hamaker=5.2e-20, diff_coeff_v=None, method='sceats', dynamic_regime='transition')

calculates the collision kernel inculuding collison enhancement according to [20] and [21] (method=’sceats’) or alternatively [22] (method=’fuchs’)

Parameters:
  • dv (float) – diameter of vapor molecule in [nm]

  • dp (array_like of float) – diameter of particle in [nm]

  • rhov (float, optional) – density of vapor [kg m-3], default 1000

  • rhop (float, optional) – density of particle [kg m-3], default 1000

  • hamaker (float, optional) – Hamaker constant in [J], default 5.2e-20 (H2SO4)

  • diff_coeff_v (float, optional) – diffusivity of vapor [m2 s-1], default None

  • method (str, optional) – method for kernel calculation, default ‘sceats’

  • dynamic_regime (str, optional) – Knudsen number regime for calculations, default transition

Returns:

collision frequency in [m3 s-1]

Return type:

array_like of float

References

condensation_sink(dp, dn_dlogdp)

calculates condensation sink according to [19]

Parameters:
  • pp (array_like) – diameter discretization of size distribution in [nm]

  • dn_dlogdp (array_like) – size distribution in dN/dlogDp

Returns:

  • float – condensation sink (CS) in [s-1]

  • np.ndarray – 1-d array with size resolved CS contribution

References

aerosolpy.instr

class aerosolpy.instr.Dma(cal_const, penetration=None, **kwargs)

a base class for differential mobility analyzers

Parameters:
  • cal_const (float) – calibration constant v_ref/(1/zp)_ref [cm3 s-1] with v_ref in [V] and (1/zp)_ref in [V s cm-2]

  • penetration (float or array_like or callable, optional) – if float, needs to be expressed as L/Q [m/(m3/s)]

cal_const

calibration factor for voltage-mobility relation

Type:

float

_penetration_func

function calculating the penetration efficiency for given diameter

Type:

callable, hidden

Raises:

TypeError – If the penetration parameter is neither float, nor numpy.ndarray, pandas.DataFrame, nor callable

dp_to_v(dp, i=1)

calculates voltage from given diameter

Parameters:
  • dp (array_like of float) – diameter in [nm]

  • i (int, optional) – charging state of particle

Returns:

voltage in [V]

Return type:

array_like

:raises TypeError : charging state must be integer:

dp_transfunc(dp, dp_prime, shape='unity')

calculates transferfuncion of DMA in dp-space

Parameters:
  • dp (array_like of float) – particle diameter in [nm]

  • dp_prime (float) – reference centroid diameter in [nm] corresponding to voltage at DMA

  • shape (str, optional) – shape of the transferfunction, default ‘unity’

Returns:

transferfunction at diameter dp

Return type:

array_like of float

Notes

parent class dummy method.

See also

aerosolpy.instr.DmaCylindrical.dp_transfunc

pen_eff(dp)

calculates penetration efficiency of DMA

Parameters:

dp (array_like) – particle diameter in [nm]

Returns:

penetration probability between 0 and 1 dimensionless

Return type:

array_like

v_to_dp(v, i=1)

calculates particle diameter from set voltage at DMA

Parameters:
  • v (array_like) – volatage in [V] at DMA

  • i (int, optional) – charging state of particle

Returns:

  • array_like

  • particle diameter in [nm]

:raises TypeError : charging state must be integer:

v_to_zp(v)

calculates electrical mobility from set volatage at DMA

Parameters:

v (array_like) – volatage in [V] at DMA

Returns:

electrical mobility in [m2 V-1 s-1]

Return type:

array_like

zp_to_v(zp)

calculates voltage at DMA from electrical mobility

Parameters:

zp (array_like of float) – electrical mobility in [m2 V-1 s-1]

Returns:

voltage in [V]

Return type:

array_like of float

class aerosolpy.instr.Cpc(activation=None, **kwargs)

a class for performing CPC evaluations, provides pre-defined CPC models and their corresponding counting efficiency

Parameters:

activation (string or tuple or array_like or callable, optional) – activation efficiency of the used CPC. Can be either defined by a string specifying the model of the CPC, by a tuple giving the 4 parameters

_activation_func

function describing the activation efficiency of a CPC, dimless

Type:

callable

Notes

Hard coded activation efficiencies are all taken from [24] , only silver seed particles and CPC 3776 and 3772 froM TSI Inc. are implemented

References

count_eff(dp)

the counting efficiency of the CPC

Parameters:

dp (array_like of float) – diameter in [nm]

Returns:

the counting efficiency of a CPC, dimless between 0 and 1

Return type:

array_like of float

wiedensohler_fit(dp, a, d1, d2, R=0)

function describing the activation efficiency of a CPC according to [25]_

Parameters:
  • dp (array_like of float) – particle diameter in [nm]

  • a (float) – parameter one

  • d1 (float) – parameter two

  • d2 (float) – parameter three

Returns:

activation efficiency of CPC, dimless between 0 and 1

Return type:

array_like

Notes

optional fourth parameter is a diffusion loss ration (length divided by flow)

References

class aerosolpy.instr.Mpss(channels, dma, cpc=None, inlet_loss=None, polarity='neg', volts_channels=False, **kwargs)

a class for mobility particle size spectrometers (DMPS/SMPS) providing data inversion basics such as inversion kernels

Parameters:
  • channels (array_like) – array of sampled sizes assuming singly charged particles if only voltages are known, use aerosolpy.instr.Dma.v_to_dp for coversion

  • dma (aerosolpy.instr.Dma) – DMA to be used within the Mpss

  • cpc (aerosolpy.instr.Cpc, optional) – CPC to be used within the Mpss, default None

  • inlet_loss (float or array_like or callable, optional) – losses in the inlet lines of the Mpss, default None if float it is line length in [m] divided by flow in [m-3 s] if 2d (np.array or pd.DateFrame) first index gives size, second loss

  • polarity (str, optional) – polarity of the particles sampled with the DMA

  • volts_channels (bool, optional) – if channels are given in volts, induces automatic conversion using aerosolpy.instr.dma.v_to_dp

  • Raises

  • -------

  • TypeError – channels need to be of type int or array_like dma needs to be of type aerosolpy.instr.Dma

  • also (See)

  • ---------

  • aerosolpy.instr.Dma

c_expected(f_dNdlogDp, imax=1, xmin=1, xmax=1000)

calculates expected concentration in size channel from a known size-distribution

Parameters:
  • f_dNdlogDp (callable) – size_distribution dNdlog/Dp as function of diameter dp with dp in [nm]

  • imax (int, optional) – maximum number of charges to be considered, default 1, i.e. consider only singly charged particles

  • xmin (float, optional) – minimum diameter [nm] considered for transfunc integration, default 1

  • xmax (float, optional) – maximum diameter [nm] considered for transfunc integration, default 1000

Returns:

expected concentration in every size-channel

Return type:

array_like of float

kernel(discretizations=128, dj_low=1, dj_high=1000)

creates inversion kernel matrix for this instrument

Parameters:
  • discretizations (int, or np.array, optional) – number of discretizations for the inversion or np.ndarray of doimension 1 with pre-defined diameters, default 128

  • dj_low (float, optional) – lower diameter in [nm] for discretization, default 1

  • dj_high (float, optional) – higher diameter in [nm] for discretization, default 1000

Returns:

  • array_like of float – discretization diameters dj

  • np.ndarray of float – 2d array fo kernel function evaluated at all discretizations

Notes

kernel is discretized on logarithmic intervals if not specified

n_expected(f_dNdlogDp, q_sample, t_res, imax=1, xmin=1, xmax=1000)

calculates number of counts in size channel from a known size-distribution

Parameters:
  • f_dNdlogDp (callable) – size_distribution dNdlog/Dp as function of diameter dp with dp in [nm]

  • q_sample (float) – sample flow in [lpm]

  • t_res (array_like) – time resolution of mpss channels

  • imax (int, optional) – maximum number of charges to be considered, default 1, i.e. consider only singly charged particles

  • xmin (float, optional) – minimum diameter [nm] considered for transfunc integration, default 1

  • xmax (float, optional) – maximum diameter [nm] considered for transfunc integration, default 1000

Returns:

expected number of counts in every size-channel for the corresponding measurement time t_res and counter flow q_sample

Return type:

array_like of float

std_inv(Craw, imax=1, interpolation='cubic')

standard point-by-point inversion of a MPSS response using multiple charge correction

Parameters:
  • Craw (np.array) – instrument response as recorded in concentration [cm-3]

  • imax (int) – maximum number of charges to be considered for inversion

Returns:

tuple – inverted size-distribution, dp in first column, dNdlog/Dp in second column

Return type:

(array_like of float, array_like of float)

Raises:

TypeError – Mpss needs to have a Dma of Type aerosolpy.dma.DmaCylindrical

Notes

assumes constant size-distribution and efficiencies across the width of the transfer function

tot_eff(dp)

calculates total instrument efficiency

Parameters:

dp (array_like of float) – particle diameter in [nm]

Returns:

total detection efficiency, dimless, between 0 and 1

Return type:

array_like of float

tot_transfunc(ch, imax=5)

defines total transfer function of instrument channel k

Extended Summary

combines losses, DMA transferfunction and cpc activation

param ch:

channel number or centroid diameter of channel

type ch:

int or float

param imax:

maximum charging states to be considered, default 5

type imax:

int, optional

returns:

total transfer function of Mobility Sizer including measurement time and counter flow

rtype:

callable

raises ValueError:

channel specifier ch needs to be either int or float imax needs to be positive int polarity needs to be either “pos” or “neg”

Notes

The returned function is the kernel function for every instrument inversion

aerosolpy.growth

class aerosolpy.growth.KineticLimit(mv, rhov, temp_kelvin=293.15, **kwargs)

calculates kinetic growth for arbitrary vapor following [25]_

Parameters:
  • mv (float) – molecular mass of dry vapor [g mol-1]

  • rhov (float, optional) – density of vapor in [kg m-3]

  • temp_kelvin (float, optional) – temperature in [k], default 293.15 K

References

growth_rate(dp, cv, diff_coeff_v=None, hamaker=5.2e-20, kernel='hard sphere', dynamic_regime='transition')

calculates growth rates at diameter dp and vapor concentration Cv

Parameters:
  • dp (array_like of float) – particle mass diameter in [nm], subtract 0.3 from mob. diameter

  • Cv (array_like of float) – vapor concentration in [cm-3]

  • Hamaker (float, optional) – Hamaker Constant in [J]

  • kernel (str, optional) – collision kernel formulation

  • dynamic_regime (str, optional) – Knudsen number regime for calculations, default transition

Returns:

growth rates of nanoparticles at the kinetic limit in [nm h-1]

Return type:

array_like

Raises:

Value – kernel and dynamic regime only allows specific key words

class aerosolpy.growth.SulfuricAcid(temp_kelvin=293.15, rh=60, mv_dry=98.0, mv_wet=134.0, **kwargs)

calculates kinetic growth from H2SO4, H2O, NH3 following [26]

Parameters:
  • temp_kelvin (float, optional) – temperature in [k], default 293.15 K

  • rh (float, optional) – relative humidity in percent, default 60

  • mv_dry (float) – molecular mass of dry vapor [g mol-1], default 98 (H2SO4 monomer)

  • mv_wet (float) – molecular mass of hydrated vapor [g mol-1], default 134

Raises:

aeropy.InputError – rh needs to be between 0 and 100

References

diff_coeff_h2so4()

calculates the diffusion ceofficient of hydrated gas phase sulfuric acid

Returns:

diffusion coefficient in [m2 s-1]

Return type:

array_like of float

Notes

calculation according to [28]

References

dln_rho_wt_ddp(dp, model='mabnag')

calculates the size derivative of the product rho wt

Parameters:
  • dp (array_like of float) – diameter in [nm]

  • model (str, optional) – model to be used for hygroscopicity, defaul mabnag

Returns:

size derivative of log(w rho)

Return type:

array_like of float

gf(dp, model='mabnag')

calculates sulfuric acid hygroscopic growth factor from models

Parameters:
  • dp (array_like of float) – diameter in [nm]

  • model (str, optional) – model to be used for hygroscopicity, defaul mabnag

Returns:

sulfuric acid hygroscopic growth factor

Return type:

array_like of float

growth_rate(dp, cv, hamaker=5.2e-20, kernel='hard sphere', hydration='naive')

calculates sulfuric acid growth rates at diameter dp and vapor concentration Cp

Parameters:
  • dp (array_like of float) – particle mass diameter in [nm], subtract 0.3 from mob. diameter

  • Cv (array_like of float) – vapor concentration in [cm-3]

  • Hamaker (float) – Hamaker Constant

  • kernel (str) – collision kernel formulation

  • hydration (str) – treatment of H2SO4 hydration

Returns:

growth rates of nanoparticles from sulfuric acid in [nm h-1]

Return type:

array_like

Raises:

ValueError – kernel and hydration only allow specific key words

rho_h2so4(wt)

calculates the density of a sulfuric acid water mixture

Parameters:

wt (float) – mass fraction of sulfuric acid

Returns:

density in [kg m-3]

Return type:

float

Notes

Coefficients rho[j][i] and calculation taken from [27]

References

wt(dp, model='mabnag')

sulfuric acid mass fraction derived from diameter, relative humidity and temperature

Parameters:
  • dp (array_like of float) – diameter in [nm]

  • model (str) – underlying model used to calculate the mass fraction, default mabnag

Returns:

sulfuric acid mass fraction in water solution, dimless, between 0 and 1

Return type:

array_like of float

Notes

empirical fits to the SAWNUC or MABNAG results, only vaild between 1 and 10 nm function only defined for either 38 or 60 percent RH and 278.15 and 293.15 K and at 5 percent RH for 293 K (dry sheath flow conditions)

Raises:

ValueError – when (rh, temp_kelvin) tuple of ap.growth.SulfuricAcid instance is not pre-defined through mabnag or sawnuc calculations

class aerosolpy.growth.SimpolVolatility

class for calculating volatility through a group-contribution approach, the SIMPOL model [29]

Notes

is currently not configured to handle nitrogen related functionality, no full SIMPOL model.

References

log_c(temp_kelvin, n_c, n_h, n_o, nonaromaticring=0, hydroxyl=0, aldehyde=0, ketone=0, carboxylicacid=0, hydroperoxide=0, carbonylperoxyacid=0, peroxide=0)
Parameters:
  • temp_kelvin (float) – temperature in [K].

  • n_c (int) – number of carbon atoms in molecule.

  • n_h (int) – number of hydrogen atoms in molecule.

  • n_o (int) – number of oxygen atoms in molecule.

  • nonaromaticring (int, optional) – number of nonaromaticrings in molecule. The default is 0.

  • hydroxyl (int, optional) – number of hydroxyl groups in molecule. The default is 0.

  • aldehyde (int, optional) – number of aldehyde groups in molecule. The default is 0.

  • ketone (int, optional) – number of ketone groups in molecule. The default is 0.

  • carboxylicacid (int, optional) – number of carboxylic acid groups in molecule. The default is 0.

  • hydroperoxide (int, optional) – number of hydroperoxide groups in molecule. The default is 0.

  • carbonylperoxyacid (int, optional) – number of carbonylperoxyacid groups in molecule. The default is 0.

  • peroxide (int, optional) – number of peroxide groups in molecule. The default is 0.

Returns:

log10_c – log10 of saturation mass concentration in [ug m-3].

Return type:

float

class aerosolpy.growth.TwoDimVolatility(n_c0=25, b_c=0.475, b_o=2.3, b_co=-0.3, b_n=2.5, model=None)

volatility models for describing the 2D-volatility basis set, following the equations of [30]

Parameters:
  • nC0 (float, optional) – carbon backbone reference, default 25

  • bC (float, optional) – effect on volatility per carbon atom, default 0.475

  • bO (float, optional) – effect on volatility per oxygen atom, default 2.3

  • bCO (float, optional) – non-linearity parameter, default -0.3

  • bN (float, optional) – effect on volatility per nitrogen atom, default 2.5

  • model (str, optional) – using a pre-defined model to set nC0, bC, bO, bCO, bN. Unless None, makes all other definitions obsolete, default None

References

log_c(temp_kelvin, n_c, n_o, n_h=0, n_n=0, a=-5.7, b=129, dimers=False)

calculates the volatility at a given temperature for known molecular composition

Parameters:
  • temp_kelvin (array_like of float) – temperature in [K]

  • n_c (array like of int) – number of carbon atoms in molecule.

  • n_o (array_like of int) – number of oxygen atoms in molecule.

  • n_h (array_like of int, optional) – number of hydrogen atoms in molecule. Default is 0.

  • n_n (Array_like of int, optional) – number of nitrogen atoms in molecule. Default is 0.

  • a (float, optional) – slope of deltaHvap-logC300 relation, default -5.7

  • b (float, optional) – offset at 1 mug m-3 of the deltaHvap-volatility relation, default 129

  • dimers (bool, optional) – if dimer/monomer differntiation should be done. Default is False.

Returns:

log10 c0 [mug m-3] of molecule at temp_kelvin

Return type:

array_like of float

log_c_300(n_c, n_o, n_h=0, n_n=0, dimers=False)

calculates the volatility at 300 K according to the set values of nC0, bC, bO, bCO, bN and the carbon, oxygen and nitrogen number of a specific molecule

Parameters:
  • nC (array-like of int) – number of carbon atoms in molecule

  • nO (array-like of int) – number of oxygen atoms in molecule

  • nN (array-like of int, optional) – number of nitrogen atoms in molecule, default 0

  • nH (array-like of int, optional) – number of hydrogen atoms in molecule, default 0

  • dimers (bool, optional) – if dimer/monomer differntiation should be done. Default is False.

Returns:

log10 c0 [mug m-3] of molecule at 300K

Return type:

array_like of float

Notes

provides different pre-defined parameters to be used for different systems

log_c_300_to_log_c_temp(temp_kelvin, log_c_300, a=-5.7, b=129)

calculates the volatility at a given temperature T assuming log c is known at 300 K

Parameters:
  • temp_kelvin (float) – temperature in [K]

  • logC300 (array_like of float) – reference volatility in log10 c [mug m-3] at 300 K

  • a (float, optional) – slope of deltaHvap-logC300 relation, default -5.7

  • b (float, optional) – offset at 1 mug m-3 of the deltaHvap-volatility relation, default 129

Returns:

log10 c0 [mug m-3] of molecule at specified T

Return type:

array_like of float

log_n(temp_kelvin, n_c, n_o, n_h, n_n, a=-5.7, b=129, dimers=False)
Parameters:
  • temp_kelvin (array_like of float) – temperature in [K]

  • n_c (array like of int) – number of carbon atoms in molecule.

  • n_o (array_like of int) – number of oxygen atoms in molecule.

  • n_h (array_like of int, optional) – number of hydrogen atoms in molecule. Default is 0.

  • n_n (Array_like of int, optional) – number of nitrogen atoms in molecule. Default is 0.

  • a (float, optional) – slope of deltaHvap-logC300 relation, default -5.7

  • b (float, optional) – offset at 1 mug m-3 of the deltaHvap-volatility relation, default 129

  • dimers (bool, optional) – if dimer/monomer differntiation should be done. Default is False.

Returns:

log10 n0 [cm-3] of molecule at temp_kelvin

Return type:

array_like of float

class aerosolpy.growth.VbsModel(time, vbs_traces, vbs_mass, vbs_logC, sa_trace='None', activity='unity', particle_reactions='None', particle_diffusion='None', temp_kelvin=300, **kwargs)

a class for simulating monodisperse aerosol growth from volatility basis set (VBS), sulfuric acid and particle phase reactions

Parameters:
  • time (array_like) – time steps at which vapor concentrations are measured in [min], must be given as array even if vbs_traces and sa_traces are 1d/0d

  • vbs_traces (array_like) – 1d or 2d array of vapor concentrations in [cm-3] per VBS bin

  • vbs_mass (array_like) – mean molecular mass of each VBS bin

  • vbs_logC (array_like) – logarithm of saturation mass concentration [ug m-3] of each VBS bin

  • sa_trace (string or array_like, optional) – whether to include sulfuric acid or not into the calculations default is ‘None’, if array_like 1d array of sulfurci acid concentrations in [cm-3]

  • activity (string or 3-tuple, optional) – whether to solve for particle phase activity coefficients or not default is ‘unity’, if tuple, it contains the O-C non-linearity coefficient to be used, nC and nO for each volatility bin

  • particle_reactions (string or float or 3-tuple) – whether to calculate particle phase reactions or not. default is ‘None’.

  • particle_diffusion (string or float) – whether to take into account particle-phase diffusion limitations. float is diffusion coefficient in [cm2 s-1] default is ‘None’.

  • temp_kelvin (float, optional) – temperature in [K], default 300 K

  • rh (float, optional) – relative humidity as fraction of 1, default 0.5 only important if sa_traces is not ‘None’

Notes

ordinary differential equation solver using Eulerian forward integration solver operates with time in the scale of minutes, solver time step can be set by user in _solve function

The system is solved in log-space to avoid negative growth rates.

particle_reactions and particle_diffusion should not be used simultaneously as the solution for the particle-phase diffusion assume a negligible reactivity of the solute. Moreover, activity coefficients are set to 1 if particle_diffusion is calculated

calc_vbs_dynamics()

calls VBS growth solver, calculates the system state variables for each diameter including growth rates

Returns:

tuple

system state variables for each time/diameter step: diameter [nm], total growth rate [nm h-1], growth rate per vbs bin (including SA) [nm h-1], time of the step [min]

growth_rate(dp)

calculates VBS growth rates at diameter dp and set-up conditions of the VbsModel

Parameters:

dp (array_like of float) – particle mass diameter in [nm], subtract 0.3 from mob. diameter

Returns:

growth rates of nanoparticles from VbsModel in [nm h-1]

Return type:

array_like

Notes

Uses numpy.gradient to determine the growth rate from the model solution which is given in condensed mass produced at certain times