PySDM_examples.Abdul_Razzak_Ghan_2000.aerosol

  1from chempy import Substance
  2from pystrict import strict
  3
  4from PySDM.initialisation import spectra
  5from PySDM.initialisation.aerosol_composition import DryAerosolMixture
  6from PySDM.physics import si
  7
  8# not in the paper - guessed and checked to match
  9CONSTANTS_ARG = {
 10    "Mv": 18.015 * si.g / si.mol,
 11    "Md": 28.97 * si.g / si.mol,
 12}
 13
 14
 15@strict
 16class AerosolARG(DryAerosolMixture):
 17    def __init__(
 18        self,
 19        water_molar_volume: float,
 20        M2_sol: float = 0,
 21        M2_N: float = 100 / si.cm**3,
 22        M2_rad: float = 50 * si.nm,
 23    ):
 24        super().__init__(
 25            compounds=("(NH4)2SO4", "insoluble"),
 26            molar_masses={
 27                "(NH4)2SO4": 132.14 * si.g / si.mole,
 28                "insoluble": 44 * si.g / si.mole,
 29            },
 30            densities={
 31                "(NH4)2SO4": 1.77 * si.g / si.cm**3,
 32                "insoluble": 1.77 * si.g / si.cm**3,
 33            },
 34            is_soluble={"(NH4)2SO4": True, "insoluble": False},
 35            ionic_dissociation_phi={"(NH4)2SO4": 3, "insoluble": 0},
 36        )
 37        self.modes = (
 38            {
 39                "kappa": self.kappa(
 40                    mass_fractions={"(NH4)2SO4": 1.0, "insoluble": 0.0},
 41                    water_molar_volume=water_molar_volume,
 42                ),
 43                "spectrum": spectra.Lognormal(
 44                    norm_factor=100.0 / si.cm**3, m_mode=50.0 * si.nm, s_geom=2.0
 45                ),
 46            },
 47            {
 48                "kappa": self.kappa(
 49                    mass_fractions={"(NH4)2SO4": M2_sol, "insoluble": (1 - M2_sol)},
 50                    water_molar_volume=water_molar_volume,
 51                ),
 52                "spectrum": spectra.Lognormal(
 53                    norm_factor=M2_N, m_mode=M2_rad, s_geom=2.0
 54                ),
 55            },
 56        )
 57
 58
 59@strict
 60class AerosolWhitby(DryAerosolMixture):
 61    def __init__(self, water_molar_volume: float):
 62        nuclei = {"(NH4)2SO4": 1.0}
 63        accum = {"(NH4)2SO4": 1.0}
 64        coarse = {"(NH4)2SO4": 1.0}
 65
 66        super().__init__(
 67            ionic_dissociation_phi={"(NH4)2SO4": 3},
 68            molar_masses={
 69                "(NH4)2SO4": Substance.from_formula("(NH4)2SO4").mass
 70                * si.gram
 71                / si.mole
 72            },
 73            densities={"(NH4)2SO4": 1.77 * si.g / si.cm**3},
 74            compounds=("(NH4)2SO4",),
 75            is_soluble={"(NH4)2SO4": True},
 76        )
 77        self.modes = (
 78            {
 79                "kappa": self.kappa(
 80                    mass_fractions=nuclei, water_molar_volume=water_molar_volume
 81                ),
 82                "spectrum": spectra.Lognormal(
 83                    norm_factor=1000.0 / si.cm**3, m_mode=0.008 * si.um, s_geom=1.6
 84                ),
 85            },
 86            {
 87                "kappa": self.kappa(
 88                    mass_fractions=accum, water_molar_volume=water_molar_volume
 89                ),
 90                "spectrum": spectra.Lognormal(
 91                    norm_factor=800 / si.cm**3, m_mode=0.034 * si.um, s_geom=2.1
 92                ),
 93            },
 94            {
 95                "kappa": self.kappa(
 96                    mass_fractions=coarse, water_molar_volume=water_molar_volume
 97                ),
 98                "spectrum": spectra.Lognormal(
 99                    norm_factor=0.72 / si.cm**3, m_mode=0.46 * si.um, s_geom=2.2
100                ),
101            },
102        )
CONSTANTS_ARG = {'Mv': 0.018015, 'Md': 0.02897}
16@strict
17class AerosolARG(DryAerosolMixture):
18    def __init__(
19        self,
20        water_molar_volume: float,
21        M2_sol: float = 0,
22        M2_N: float = 100 / si.cm**3,
23        M2_rad: float = 50 * si.nm,
24    ):
25        super().__init__(
26            compounds=("(NH4)2SO4", "insoluble"),
27            molar_masses={
28                "(NH4)2SO4": 132.14 * si.g / si.mole,
29                "insoluble": 44 * si.g / si.mole,
30            },
31            densities={
32                "(NH4)2SO4": 1.77 * si.g / si.cm**3,
33                "insoluble": 1.77 * si.g / si.cm**3,
34            },
35            is_soluble={"(NH4)2SO4": True, "insoluble": False},
36            ionic_dissociation_phi={"(NH4)2SO4": 3, "insoluble": 0},
37        )
38        self.modes = (
39            {
40                "kappa": self.kappa(
41                    mass_fractions={"(NH4)2SO4": 1.0, "insoluble": 0.0},
42                    water_molar_volume=water_molar_volume,
43                ),
44                "spectrum": spectra.Lognormal(
45                    norm_factor=100.0 / si.cm**3, m_mode=50.0 * si.nm, s_geom=2.0
46                ),
47            },
48            {
49                "kappa": self.kappa(
50                    mass_fractions={"(NH4)2SO4": M2_sol, "insoluble": (1 - M2_sol)},
51                    water_molar_volume=water_molar_volume,
52                ),
53                "spectrum": spectra.Lognormal(
54                    norm_factor=M2_N, m_mode=M2_rad, s_geom=2.0
55                ),
56            },
57        )
AerosolARG( water_molar_volume: float, M2_sol: float = 0, M2_N: float = 99999999.99999999, M2_rad: float = 5.0000000000000004e-08)
18    def __init__(
19        self,
20        water_molar_volume: float,
21        M2_sol: float = 0,
22        M2_N: float = 100 / si.cm**3,
23        M2_rad: float = 50 * si.nm,
24    ):
25        super().__init__(
26            compounds=("(NH4)2SO4", "insoluble"),
27            molar_masses={
28                "(NH4)2SO4": 132.14 * si.g / si.mole,
29                "insoluble": 44 * si.g / si.mole,
30            },
31            densities={
32                "(NH4)2SO4": 1.77 * si.g / si.cm**3,
33                "insoluble": 1.77 * si.g / si.cm**3,
34            },
35            is_soluble={"(NH4)2SO4": True, "insoluble": False},
36            ionic_dissociation_phi={"(NH4)2SO4": 3, "insoluble": 0},
37        )
38        self.modes = (
39            {
40                "kappa": self.kappa(
41                    mass_fractions={"(NH4)2SO4": 1.0, "insoluble": 0.0},
42                    water_molar_volume=water_molar_volume,
43                ),
44                "spectrum": spectra.Lognormal(
45                    norm_factor=100.0 / si.cm**3, m_mode=50.0 * si.nm, s_geom=2.0
46                ),
47            },
48            {
49                "kappa": self.kappa(
50                    mass_fractions={"(NH4)2SO4": M2_sol, "insoluble": (1 - M2_sol)},
51                    water_molar_volume=water_molar_volume,
52                ),
53                "spectrum": spectra.Lognormal(
54                    norm_factor=M2_N, m_mode=M2_rad, s_geom=2.0
55                ),
56            },
57        )
modes
39    @property
40    def modes(self):
41        return self._modes
 60@strict
 61class AerosolWhitby(DryAerosolMixture):
 62    def __init__(self, water_molar_volume: float):
 63        nuclei = {"(NH4)2SO4": 1.0}
 64        accum = {"(NH4)2SO4": 1.0}
 65        coarse = {"(NH4)2SO4": 1.0}
 66
 67        super().__init__(
 68            ionic_dissociation_phi={"(NH4)2SO4": 3},
 69            molar_masses={
 70                "(NH4)2SO4": Substance.from_formula("(NH4)2SO4").mass
 71                * si.gram
 72                / si.mole
 73            },
 74            densities={"(NH4)2SO4": 1.77 * si.g / si.cm**3},
 75            compounds=("(NH4)2SO4",),
 76            is_soluble={"(NH4)2SO4": True},
 77        )
 78        self.modes = (
 79            {
 80                "kappa": self.kappa(
 81                    mass_fractions=nuclei, water_molar_volume=water_molar_volume
 82                ),
 83                "spectrum": spectra.Lognormal(
 84                    norm_factor=1000.0 / si.cm**3, m_mode=0.008 * si.um, s_geom=1.6
 85                ),
 86            },
 87            {
 88                "kappa": self.kappa(
 89                    mass_fractions=accum, water_molar_volume=water_molar_volume
 90                ),
 91                "spectrum": spectra.Lognormal(
 92                    norm_factor=800 / si.cm**3, m_mode=0.034 * si.um, s_geom=2.1
 93                ),
 94            },
 95            {
 96                "kappa": self.kappa(
 97                    mass_fractions=coarse, water_molar_volume=water_molar_volume
 98                ),
 99                "spectrum": spectra.Lognormal(
100                    norm_factor=0.72 / si.cm**3, m_mode=0.46 * si.um, s_geom=2.2
101                ),
102            },
103        )
AerosolWhitby(water_molar_volume: float)
 62    def __init__(self, water_molar_volume: float):
 63        nuclei = {"(NH4)2SO4": 1.0}
 64        accum = {"(NH4)2SO4": 1.0}
 65        coarse = {"(NH4)2SO4": 1.0}
 66
 67        super().__init__(
 68            ionic_dissociation_phi={"(NH4)2SO4": 3},
 69            molar_masses={
 70                "(NH4)2SO4": Substance.from_formula("(NH4)2SO4").mass
 71                * si.gram
 72                / si.mole
 73            },
 74            densities={"(NH4)2SO4": 1.77 * si.g / si.cm**3},
 75            compounds=("(NH4)2SO4",),
 76            is_soluble={"(NH4)2SO4": True},
 77        )
 78        self.modes = (
 79            {
 80                "kappa": self.kappa(
 81                    mass_fractions=nuclei, water_molar_volume=water_molar_volume
 82                ),
 83                "spectrum": spectra.Lognormal(
 84                    norm_factor=1000.0 / si.cm**3, m_mode=0.008 * si.um, s_geom=1.6
 85                ),
 86            },
 87            {
 88                "kappa": self.kappa(
 89                    mass_fractions=accum, water_molar_volume=water_molar_volume
 90                ),
 91                "spectrum": spectra.Lognormal(
 92                    norm_factor=800 / si.cm**3, m_mode=0.034 * si.um, s_geom=2.1
 93                ),
 94            },
 95            {
 96                "kappa": self.kappa(
 97                    mass_fractions=coarse, water_molar_volume=water_molar_volume
 98                ),
 99                "spectrum": spectra.Lognormal(
100                    norm_factor=0.72 / si.cm**3, m_mode=0.46 * si.um, s_geom=2.2
101                ),
102            },
103        )
modes
39    @property
40    def modes(self):
41        return self._modes