PySDM_examples.Lowe_et_al_2019.aerosol_code

  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
  9@strict
 10class AerosolMarine(DryAerosolMixture):
 11    # cd MAV
 12    # MODAL_PARS.CONC         = [223  137];   %[number/cm3]
 13    # MODAL_PARS.GSD          = [1.68 1.68];
 14    # MODAL_PARS.GEOMEAN_DIAM = [0.0390  0.139];     %[um]
 15    # DENSITY(4:5)            = 0.852;  %Set organic density. Palmitic acid 256.4 [gmol-1]
 16    # MASS_FRAC               = [0 0.8 0 0.2 0 0 0 0.0;...
 17    #                            0 0.0 0 0.2 0 0 0 0.8];
 18    # NAT                     = 2;
 19    # NMODE                   = [1 1];
 20    # DENSITY                 = [1.841, 1.78, 1.77, 0.852, 1.5, 2., 2.65, 2.165]; %[gcm-3]
 21
 22    def __init__(
 23        self, water_molar_volume: float, Forg: float = 0.2, Acc_N2: float = 137
 24    ):
 25        Aitken = {
 26            "palmitic": Forg,
 27            "(NH4)2SO4": (1 - Forg),
 28            "NaCl": 0,
 29        }
 30        Accumulation = {
 31            "palmitic": Forg,
 32            "(NH4)2SO4": 0,
 33            "NaCl": (1 - Forg),
 34        }
 35
 36        super().__init__(
 37            ionic_dissociation_phi={
 38                "palmitic": 1,
 39                "(NH4)2SO4": 3,
 40                "NaCl": 2,
 41            },
 42            is_soluble={
 43                "palmitic": False,
 44                "(NH4)2SO4": True,
 45                "NaCl": True,
 46            },
 47            densities={
 48                "palmitic": 0.852 * si.g / si.cm**3,
 49                "(NH4)2SO4": 1.78 * si.g / si.cm**3,
 50                "NaCl": 2.165 * si.g / si.cm**3,
 51            },
 52            compounds=("palmitic", "(NH4)2SO4", "NaCl"),
 53            molar_masses={
 54                "palmitic": 256.4 * si.g / si.mole,
 55                "(NH4)2SO4": Substance.from_formula("(NH4)2SO4").mass
 56                * si.gram
 57                / si.mole,
 58                "NaCl": Substance.from_formula("NaCl").mass * si.gram / si.mole,
 59            },
 60        )
 61        self.modes = (
 62            {
 63                "f_org": 1 - self.f_soluble_volume(Aitken),
 64                "kappa": self.kappa(
 65                    mass_fractions=Aitken, water_molar_volume=water_molar_volume
 66                ),
 67                "nu_org": self.nu_org(Aitken),
 68                "spectrum": spectra.Lognormal(
 69                    norm_factor=223 / si.cm**3, m_mode=19.6 * si.nm, s_geom=1.68
 70                ),
 71            },
 72            {
 73                "f_org": 1 - self.f_soluble_volume(Accumulation),
 74                "kappa": self.kappa(
 75                    mass_fractions=Accumulation, water_molar_volume=water_molar_volume
 76                ),
 77                "nu_org": self.nu_org(Accumulation),
 78                "spectrum": spectra.Lognormal(
 79                    norm_factor=Acc_N2 / si.cm**3, m_mode=69.5 * si.nm, s_geom=1.68
 80                ),
 81            },
 82        )
 83
 84    color = "dodgerblue"
 85
 86
 87@strict
 88class AerosolBoreal(DryAerosolMixture):
 89    #     cd HYY
 90    #     MODAL_PARS.CONC         = [1110   540];
 91    #     MODAL_PARS.GSD          = [1.75   1.62];
 92    #     MODAL_PARS.GEOMEAN_DIAM = [0.0453 0.1644];
 93    #     DENSITY(4:5)            = [1.2 1.4];                  %Set organic density
 94    #     DENSITY(1)              = 1.72;
 95    #     INORG_MASS_RATIO        = 0.1515/0.1559;  %ammonium sulfate:ammonium nitrate  mass
 96    #     FORG                    = 0.60;
 97    #     MASS_FRAC               = [(1-FORG)/(1+INORG_MASS_RATIO) 0 ...
 98    #                               INORG_MASS_RATIO*(1-FORG)/(1+INORG_MASS_RATIO) FORG...
 99    #                               0 0 0 0;...
100    #                               (1-FORG)/(1+INORG_MASS_RATIO) 0 ...
101    #                               INORG_MASS_RATIO*(1-FORG)/(1+INORG_MASS_RATIO) 0 ...
102    #                               FORG 0 0 0];
103    #     NAT                     = 2;
104    #     NMODE                   = [1 1];
105
106    # DENSITY                     = [1.841, 1.78, 1.77, 1.5, 1.5, 2., 2.65, 2.165]; %[gcm-3]
107    # DENSITY                     = [1.72, 1.78, 1.77, 1.2, 1.4, 2., 2.65, 2.165]; %[gcm-3]
108
109    def __init__(
110        self, water_molar_volume: float, Forg: float = 0.668, Acc_N2: float = 540
111    ):
112        # TODO #1247: SOA1 or SOA2 unclear from the paper
113        # TODO #1247: CAN'T FIND WHERE NH4NO3 PROPERTIES ARE DEFINED IN ICPM
114        INORG_MASS_RATIO = 0.1515 / 0.1559
115        Aitken = {
116            "SOA1": Forg,
117            "SOA2": 0,
118            "(NH4)2SO4": INORG_MASS_RATIO * (1 - Forg) / (1 + INORG_MASS_RATIO),
119            "NH4NO3": (1 - Forg) / (1 + INORG_MASS_RATIO),
120        }
121        Accumulation = {
122            "SOA1": 0,
123            "SOA2": Forg,
124            "(NH4)2SO4": INORG_MASS_RATIO * (1 - Forg) / (1 + INORG_MASS_RATIO),
125            "NH4NO3": (1 - Forg) / (1 + INORG_MASS_RATIO),
126        }
127
128        super().__init__(
129            ionic_dissociation_phi={
130                "SOA1": 1,
131                "SOA2": 1,
132                "(NH4)2SO4": 3,
133                "NH4NO3": 2,
134            },
135            molar_masses={
136                "(NH4)2SO4": Substance.from_formula("(NH4)2SO4").mass
137                * si.gram
138                / si.mole,
139                "NH4NO3": Substance.from_formula("NH4NO3").mass * si.gram / si.mole,
140                "SOA1": 190 * si.g / si.mole,  # TODO #1247: 190 OR 200?
141                "SOA2": 368.4 * si.g / si.mole,  # TODO #1247: 368.4 OR 200?
142            },
143            densities={
144                "SOA1": 1.2 * si.g / si.cm**3,
145                "SOA2": 1.4 * si.g / si.cm**3,
146                "(NH4)2SO4": 1.77 * si.g / si.cm**3,
147                "NH4NO3": 1.72 * si.g / si.cm**3,
148            },
149            compounds=("SOA1", "SOA2", "(NH4)2SO4", "NH4NO3"),
150            is_soluble={
151                "SOA1": False,
152                "SOA2": False,
153                "(NH4)2SO4": True,
154                "NH4NO3": True,
155            },
156        )
157        self.modes = (
158            {
159                "f_org": 1 - self.f_soluble_volume(Aitken),
160                "kappa": self.kappa(
161                    mass_fractions=Aitken, water_molar_volume=water_molar_volume
162                ),
163                "nu_org": self.nu_org(Aitken),
164                "spectrum": spectra.Lognormal(
165                    norm_factor=1110 / si.cm**3, m_mode=22.65 * si.nm, s_geom=1.75
166                ),
167            },
168            {
169                "f_org": 1 - self.f_soluble_volume(Accumulation),
170                "kappa": self.kappa(
171                    mass_fractions=Accumulation, water_molar_volume=water_molar_volume
172                ),
173                "nu_org": self.nu_org(Accumulation),
174                "spectrum": spectra.Lognormal(
175                    norm_factor=Acc_N2 / si.cm**3,
176                    m_mode=82.2 * si.nm,
177                    s_geom=1.62,
178                ),
179            },
180        )
181
182    color = "yellowgreen"
183
184
185@strict
186class AerosolNascent(DryAerosolMixture):
187    # cd NUM
188    # MODAL_PARS.CONC         = [2000  30];
189    # MODAL_PARS.GSD          = [1.71  1.703];
190    # MODAL_PARS.GEOMEAN_DIAM = [0.023 0.200];
191    # DENSITY(4:5)            = [1.2 1.24];                  %Set organic density
192    # MASS_FRAC               = [0 0 0.48 0.52 0 0 0 0;...
193    #                            0 0 0.70 0.0 0.3 0 0 0];
194    # NAT                     = 2;
195    # NMODE                   = [1 1];
196
197    # DENSITY                 = [1.841, 1.78, 1.77, 1.2, 1.24, 2., 2.65, 2.165]; %[gcm-3]
198
199    def __init__(
200        self, water_molar_volume: float, Acc_Forg: float = 0.3, Acc_N2: float = 30
201    ):
202        # TODO #1247: CAN'T FIND WHEN PHI IS MULTIPLIED FOR KÖHLER B IN ICPM CODE
203        Ultrafine = {
204            "SOA1": 0.52,
205            "SOA2": 0,
206            "(NH4)2SO4": 0.48,
207        }
208        Accumulation = {
209            "SOA1": 0,
210            "SOA2": Acc_Forg,
211            "(NH4)2SO4": (1 - Acc_Forg),
212        }
213        super().__init__(
214            ionic_dissociation_phi={
215                "SOA1": 1,
216                "SOA2": 1,
217                "(NH4)2SO4": 3,
218            },
219            molar_masses={
220                "SOA1": 190 * si.g / si.mole,  # TODO #1247: 190 OR 200?
221                "SOA2": 368.4 * si.g / si.mole,  # TODO #1247: 368.4 OR 200?
222                "(NH4)2SO4": Substance.from_formula("(NH4)2SO4").mass
223                * si.gram
224                / si.mole,
225            },
226            densities={
227                "SOA1": 1.2 * si.g / si.cm**3,
228                "SOA2": 1.24 * si.g / si.cm**3,
229                "(NH4)2SO4": 1.77 * si.g / si.cm**3,
230            },
231            compounds=("SOA1", "SOA2", "(NH4)2SO4"),
232            is_soluble={
233                "SOA1": False,
234                "SOA2": False,
235                "(NH4)2SO4": True,
236            },
237        )
238        self.modes = (
239            {
240                "f_org": 1 - self.f_soluble_volume(Ultrafine),
241                "kappa": self.kappa(
242                    mass_fractions=Ultrafine, water_molar_volume=water_molar_volume
243                ),
244                "nu_org": self.nu_org(Ultrafine),
245                "spectrum": spectra.Lognormal(
246                    norm_factor=2000 / si.cm**3, m_mode=11.5 * si.nm, s_geom=1.71
247                ),
248            },
249            {
250                "f_org": 1 - self.f_soluble_volume(Accumulation),
251                "kappa": self.kappa(
252                    mass_fractions=Accumulation, water_molar_volume=water_molar_volume
253                ),
254                "nu_org": self.nu_org(Accumulation),
255                "spectrum": spectra.Lognormal(
256                    norm_factor=Acc_N2 / si.cm**3, m_mode=100 * si.nm, s_geom=1.703
257                ),
258            },
259        )
260
261    color = "orangered"
10@strict
11class AerosolMarine(DryAerosolMixture):
12    # cd MAV
13    # MODAL_PARS.CONC         = [223  137];   %[number/cm3]
14    # MODAL_PARS.GSD          = [1.68 1.68];
15    # MODAL_PARS.GEOMEAN_DIAM = [0.0390  0.139];     %[um]
16    # DENSITY(4:5)            = 0.852;  %Set organic density. Palmitic acid 256.4 [gmol-1]
17    # MASS_FRAC               = [0 0.8 0 0.2 0 0 0 0.0;...
18    #                            0 0.0 0 0.2 0 0 0 0.8];
19    # NAT                     = 2;
20    # NMODE                   = [1 1];
21    # DENSITY                 = [1.841, 1.78, 1.77, 0.852, 1.5, 2., 2.65, 2.165]; %[gcm-3]
22
23    def __init__(
24        self, water_molar_volume: float, Forg: float = 0.2, Acc_N2: float = 137
25    ):
26        Aitken = {
27            "palmitic": Forg,
28            "(NH4)2SO4": (1 - Forg),
29            "NaCl": 0,
30        }
31        Accumulation = {
32            "palmitic": Forg,
33            "(NH4)2SO4": 0,
34            "NaCl": (1 - Forg),
35        }
36
37        super().__init__(
38            ionic_dissociation_phi={
39                "palmitic": 1,
40                "(NH4)2SO4": 3,
41                "NaCl": 2,
42            },
43            is_soluble={
44                "palmitic": False,
45                "(NH4)2SO4": True,
46                "NaCl": True,
47            },
48            densities={
49                "palmitic": 0.852 * si.g / si.cm**3,
50                "(NH4)2SO4": 1.78 * si.g / si.cm**3,
51                "NaCl": 2.165 * si.g / si.cm**3,
52            },
53            compounds=("palmitic", "(NH4)2SO4", "NaCl"),
54            molar_masses={
55                "palmitic": 256.4 * si.g / si.mole,
56                "(NH4)2SO4": Substance.from_formula("(NH4)2SO4").mass
57                * si.gram
58                / si.mole,
59                "NaCl": Substance.from_formula("NaCl").mass * si.gram / si.mole,
60            },
61        )
62        self.modes = (
63            {
64                "f_org": 1 - self.f_soluble_volume(Aitken),
65                "kappa": self.kappa(
66                    mass_fractions=Aitken, water_molar_volume=water_molar_volume
67                ),
68                "nu_org": self.nu_org(Aitken),
69                "spectrum": spectra.Lognormal(
70                    norm_factor=223 / si.cm**3, m_mode=19.6 * si.nm, s_geom=1.68
71                ),
72            },
73            {
74                "f_org": 1 - self.f_soluble_volume(Accumulation),
75                "kappa": self.kappa(
76                    mass_fractions=Accumulation, water_molar_volume=water_molar_volume
77                ),
78                "nu_org": self.nu_org(Accumulation),
79                "spectrum": spectra.Lognormal(
80                    norm_factor=Acc_N2 / si.cm**3, m_mode=69.5 * si.nm, s_geom=1.68
81                ),
82            },
83        )
84
85    color = "dodgerblue"
AerosolMarine(water_molar_volume: float, Forg: float = 0.2, Acc_N2: float = 137)
23    def __init__(
24        self, water_molar_volume: float, Forg: float = 0.2, Acc_N2: float = 137
25    ):
26        Aitken = {
27            "palmitic": Forg,
28            "(NH4)2SO4": (1 - Forg),
29            "NaCl": 0,
30        }
31        Accumulation = {
32            "palmitic": Forg,
33            "(NH4)2SO4": 0,
34            "NaCl": (1 - Forg),
35        }
36
37        super().__init__(
38            ionic_dissociation_phi={
39                "palmitic": 1,
40                "(NH4)2SO4": 3,
41                "NaCl": 2,
42            },
43            is_soluble={
44                "palmitic": False,
45                "(NH4)2SO4": True,
46                "NaCl": True,
47            },
48            densities={
49                "palmitic": 0.852 * si.g / si.cm**3,
50                "(NH4)2SO4": 1.78 * si.g / si.cm**3,
51                "NaCl": 2.165 * si.g / si.cm**3,
52            },
53            compounds=("palmitic", "(NH4)2SO4", "NaCl"),
54            molar_masses={
55                "palmitic": 256.4 * si.g / si.mole,
56                "(NH4)2SO4": Substance.from_formula("(NH4)2SO4").mass
57                * si.gram
58                / si.mole,
59                "NaCl": Substance.from_formula("NaCl").mass * si.gram / si.mole,
60            },
61        )
62        self.modes = (
63            {
64                "f_org": 1 - self.f_soluble_volume(Aitken),
65                "kappa": self.kappa(
66                    mass_fractions=Aitken, water_molar_volume=water_molar_volume
67                ),
68                "nu_org": self.nu_org(Aitken),
69                "spectrum": spectra.Lognormal(
70                    norm_factor=223 / si.cm**3, m_mode=19.6 * si.nm, s_geom=1.68
71                ),
72            },
73            {
74                "f_org": 1 - self.f_soluble_volume(Accumulation),
75                "kappa": self.kappa(
76                    mass_fractions=Accumulation, water_molar_volume=water_molar_volume
77                ),
78                "nu_org": self.nu_org(Accumulation),
79                "spectrum": spectra.Lognormal(
80                    norm_factor=Acc_N2 / si.cm**3, m_mode=69.5 * si.nm, s_geom=1.68
81                ),
82            },
83        )
modes
39    @property
40    def modes(self):
41        return self._modes
color = 'dodgerblue'
 88@strict
 89class AerosolBoreal(DryAerosolMixture):
 90    #     cd HYY
 91    #     MODAL_PARS.CONC         = [1110   540];
 92    #     MODAL_PARS.GSD          = [1.75   1.62];
 93    #     MODAL_PARS.GEOMEAN_DIAM = [0.0453 0.1644];
 94    #     DENSITY(4:5)            = [1.2 1.4];                  %Set organic density
 95    #     DENSITY(1)              = 1.72;
 96    #     INORG_MASS_RATIO        = 0.1515/0.1559;  %ammonium sulfate:ammonium nitrate  mass
 97    #     FORG                    = 0.60;
 98    #     MASS_FRAC               = [(1-FORG)/(1+INORG_MASS_RATIO) 0 ...
 99    #                               INORG_MASS_RATIO*(1-FORG)/(1+INORG_MASS_RATIO) FORG...
100    #                               0 0 0 0;...
101    #                               (1-FORG)/(1+INORG_MASS_RATIO) 0 ...
102    #                               INORG_MASS_RATIO*(1-FORG)/(1+INORG_MASS_RATIO) 0 ...
103    #                               FORG 0 0 0];
104    #     NAT                     = 2;
105    #     NMODE                   = [1 1];
106
107    # DENSITY                     = [1.841, 1.78, 1.77, 1.5, 1.5, 2., 2.65, 2.165]; %[gcm-3]
108    # DENSITY                     = [1.72, 1.78, 1.77, 1.2, 1.4, 2., 2.65, 2.165]; %[gcm-3]
109
110    def __init__(
111        self, water_molar_volume: float, Forg: float = 0.668, Acc_N2: float = 540
112    ):
113        # TODO #1247: SOA1 or SOA2 unclear from the paper
114        # TODO #1247: CAN'T FIND WHERE NH4NO3 PROPERTIES ARE DEFINED IN ICPM
115        INORG_MASS_RATIO = 0.1515 / 0.1559
116        Aitken = {
117            "SOA1": Forg,
118            "SOA2": 0,
119            "(NH4)2SO4": INORG_MASS_RATIO * (1 - Forg) / (1 + INORG_MASS_RATIO),
120            "NH4NO3": (1 - Forg) / (1 + INORG_MASS_RATIO),
121        }
122        Accumulation = {
123            "SOA1": 0,
124            "SOA2": Forg,
125            "(NH4)2SO4": INORG_MASS_RATIO * (1 - Forg) / (1 + INORG_MASS_RATIO),
126            "NH4NO3": (1 - Forg) / (1 + INORG_MASS_RATIO),
127        }
128
129        super().__init__(
130            ionic_dissociation_phi={
131                "SOA1": 1,
132                "SOA2": 1,
133                "(NH4)2SO4": 3,
134                "NH4NO3": 2,
135            },
136            molar_masses={
137                "(NH4)2SO4": Substance.from_formula("(NH4)2SO4").mass
138                * si.gram
139                / si.mole,
140                "NH4NO3": Substance.from_formula("NH4NO3").mass * si.gram / si.mole,
141                "SOA1": 190 * si.g / si.mole,  # TODO #1247: 190 OR 200?
142                "SOA2": 368.4 * si.g / si.mole,  # TODO #1247: 368.4 OR 200?
143            },
144            densities={
145                "SOA1": 1.2 * si.g / si.cm**3,
146                "SOA2": 1.4 * si.g / si.cm**3,
147                "(NH4)2SO4": 1.77 * si.g / si.cm**3,
148                "NH4NO3": 1.72 * si.g / si.cm**3,
149            },
150            compounds=("SOA1", "SOA2", "(NH4)2SO4", "NH4NO3"),
151            is_soluble={
152                "SOA1": False,
153                "SOA2": False,
154                "(NH4)2SO4": True,
155                "NH4NO3": True,
156            },
157        )
158        self.modes = (
159            {
160                "f_org": 1 - self.f_soluble_volume(Aitken),
161                "kappa": self.kappa(
162                    mass_fractions=Aitken, water_molar_volume=water_molar_volume
163                ),
164                "nu_org": self.nu_org(Aitken),
165                "spectrum": spectra.Lognormal(
166                    norm_factor=1110 / si.cm**3, m_mode=22.65 * si.nm, s_geom=1.75
167                ),
168            },
169            {
170                "f_org": 1 - self.f_soluble_volume(Accumulation),
171                "kappa": self.kappa(
172                    mass_fractions=Accumulation, water_molar_volume=water_molar_volume
173                ),
174                "nu_org": self.nu_org(Accumulation),
175                "spectrum": spectra.Lognormal(
176                    norm_factor=Acc_N2 / si.cm**3,
177                    m_mode=82.2 * si.nm,
178                    s_geom=1.62,
179                ),
180            },
181        )
182
183    color = "yellowgreen"
AerosolBoreal(water_molar_volume: float, Forg: float = 0.668, Acc_N2: float = 540)
110    def __init__(
111        self, water_molar_volume: float, Forg: float = 0.668, Acc_N2: float = 540
112    ):
113        # TODO #1247: SOA1 or SOA2 unclear from the paper
114        # TODO #1247: CAN'T FIND WHERE NH4NO3 PROPERTIES ARE DEFINED IN ICPM
115        INORG_MASS_RATIO = 0.1515 / 0.1559
116        Aitken = {
117            "SOA1": Forg,
118            "SOA2": 0,
119            "(NH4)2SO4": INORG_MASS_RATIO * (1 - Forg) / (1 + INORG_MASS_RATIO),
120            "NH4NO3": (1 - Forg) / (1 + INORG_MASS_RATIO),
121        }
122        Accumulation = {
123            "SOA1": 0,
124            "SOA2": Forg,
125            "(NH4)2SO4": INORG_MASS_RATIO * (1 - Forg) / (1 + INORG_MASS_RATIO),
126            "NH4NO3": (1 - Forg) / (1 + INORG_MASS_RATIO),
127        }
128
129        super().__init__(
130            ionic_dissociation_phi={
131                "SOA1": 1,
132                "SOA2": 1,
133                "(NH4)2SO4": 3,
134                "NH4NO3": 2,
135            },
136            molar_masses={
137                "(NH4)2SO4": Substance.from_formula("(NH4)2SO4").mass
138                * si.gram
139                / si.mole,
140                "NH4NO3": Substance.from_formula("NH4NO3").mass * si.gram / si.mole,
141                "SOA1": 190 * si.g / si.mole,  # TODO #1247: 190 OR 200?
142                "SOA2": 368.4 * si.g / si.mole,  # TODO #1247: 368.4 OR 200?
143            },
144            densities={
145                "SOA1": 1.2 * si.g / si.cm**3,
146                "SOA2": 1.4 * si.g / si.cm**3,
147                "(NH4)2SO4": 1.77 * si.g / si.cm**3,
148                "NH4NO3": 1.72 * si.g / si.cm**3,
149            },
150            compounds=("SOA1", "SOA2", "(NH4)2SO4", "NH4NO3"),
151            is_soluble={
152                "SOA1": False,
153                "SOA2": False,
154                "(NH4)2SO4": True,
155                "NH4NO3": True,
156            },
157        )
158        self.modes = (
159            {
160                "f_org": 1 - self.f_soluble_volume(Aitken),
161                "kappa": self.kappa(
162                    mass_fractions=Aitken, water_molar_volume=water_molar_volume
163                ),
164                "nu_org": self.nu_org(Aitken),
165                "spectrum": spectra.Lognormal(
166                    norm_factor=1110 / si.cm**3, m_mode=22.65 * si.nm, s_geom=1.75
167                ),
168            },
169            {
170                "f_org": 1 - self.f_soluble_volume(Accumulation),
171                "kappa": self.kappa(
172                    mass_fractions=Accumulation, water_molar_volume=water_molar_volume
173                ),
174                "nu_org": self.nu_org(Accumulation),
175                "spectrum": spectra.Lognormal(
176                    norm_factor=Acc_N2 / si.cm**3,
177                    m_mode=82.2 * si.nm,
178                    s_geom=1.62,
179                ),
180            },
181        )
modes
39    @property
40    def modes(self):
41        return self._modes
color = 'yellowgreen'
186@strict
187class AerosolNascent(DryAerosolMixture):
188    # cd NUM
189    # MODAL_PARS.CONC         = [2000  30];
190    # MODAL_PARS.GSD          = [1.71  1.703];
191    # MODAL_PARS.GEOMEAN_DIAM = [0.023 0.200];
192    # DENSITY(4:5)            = [1.2 1.24];                  %Set organic density
193    # MASS_FRAC               = [0 0 0.48 0.52 0 0 0 0;...
194    #                            0 0 0.70 0.0 0.3 0 0 0];
195    # NAT                     = 2;
196    # NMODE                   = [1 1];
197
198    # DENSITY                 = [1.841, 1.78, 1.77, 1.2, 1.24, 2., 2.65, 2.165]; %[gcm-3]
199
200    def __init__(
201        self, water_molar_volume: float, Acc_Forg: float = 0.3, Acc_N2: float = 30
202    ):
203        # TODO #1247: CAN'T FIND WHEN PHI IS MULTIPLIED FOR KÖHLER B IN ICPM CODE
204        Ultrafine = {
205            "SOA1": 0.52,
206            "SOA2": 0,
207            "(NH4)2SO4": 0.48,
208        }
209        Accumulation = {
210            "SOA1": 0,
211            "SOA2": Acc_Forg,
212            "(NH4)2SO4": (1 - Acc_Forg),
213        }
214        super().__init__(
215            ionic_dissociation_phi={
216                "SOA1": 1,
217                "SOA2": 1,
218                "(NH4)2SO4": 3,
219            },
220            molar_masses={
221                "SOA1": 190 * si.g / si.mole,  # TODO #1247: 190 OR 200?
222                "SOA2": 368.4 * si.g / si.mole,  # TODO #1247: 368.4 OR 200?
223                "(NH4)2SO4": Substance.from_formula("(NH4)2SO4").mass
224                * si.gram
225                / si.mole,
226            },
227            densities={
228                "SOA1": 1.2 * si.g / si.cm**3,
229                "SOA2": 1.24 * si.g / si.cm**3,
230                "(NH4)2SO4": 1.77 * si.g / si.cm**3,
231            },
232            compounds=("SOA1", "SOA2", "(NH4)2SO4"),
233            is_soluble={
234                "SOA1": False,
235                "SOA2": False,
236                "(NH4)2SO4": True,
237            },
238        )
239        self.modes = (
240            {
241                "f_org": 1 - self.f_soluble_volume(Ultrafine),
242                "kappa": self.kappa(
243                    mass_fractions=Ultrafine, water_molar_volume=water_molar_volume
244                ),
245                "nu_org": self.nu_org(Ultrafine),
246                "spectrum": spectra.Lognormal(
247                    norm_factor=2000 / si.cm**3, m_mode=11.5 * si.nm, s_geom=1.71
248                ),
249            },
250            {
251                "f_org": 1 - self.f_soluble_volume(Accumulation),
252                "kappa": self.kappa(
253                    mass_fractions=Accumulation, water_molar_volume=water_molar_volume
254                ),
255                "nu_org": self.nu_org(Accumulation),
256                "spectrum": spectra.Lognormal(
257                    norm_factor=Acc_N2 / si.cm**3, m_mode=100 * si.nm, s_geom=1.703
258                ),
259            },
260        )
261
262    color = "orangered"
AerosolNascent(water_molar_volume: float, Acc_Forg: float = 0.3, Acc_N2: float = 30)
200    def __init__(
201        self, water_molar_volume: float, Acc_Forg: float = 0.3, Acc_N2: float = 30
202    ):
203        # TODO #1247: CAN'T FIND WHEN PHI IS MULTIPLIED FOR KÖHLER B IN ICPM CODE
204        Ultrafine = {
205            "SOA1": 0.52,
206            "SOA2": 0,
207            "(NH4)2SO4": 0.48,
208        }
209        Accumulation = {
210            "SOA1": 0,
211            "SOA2": Acc_Forg,
212            "(NH4)2SO4": (1 - Acc_Forg),
213        }
214        super().__init__(
215            ionic_dissociation_phi={
216                "SOA1": 1,
217                "SOA2": 1,
218                "(NH4)2SO4": 3,
219            },
220            molar_masses={
221                "SOA1": 190 * si.g / si.mole,  # TODO #1247: 190 OR 200?
222                "SOA2": 368.4 * si.g / si.mole,  # TODO #1247: 368.4 OR 200?
223                "(NH4)2SO4": Substance.from_formula("(NH4)2SO4").mass
224                * si.gram
225                / si.mole,
226            },
227            densities={
228                "SOA1": 1.2 * si.g / si.cm**3,
229                "SOA2": 1.24 * si.g / si.cm**3,
230                "(NH4)2SO4": 1.77 * si.g / si.cm**3,
231            },
232            compounds=("SOA1", "SOA2", "(NH4)2SO4"),
233            is_soluble={
234                "SOA1": False,
235                "SOA2": False,
236                "(NH4)2SO4": True,
237            },
238        )
239        self.modes = (
240            {
241                "f_org": 1 - self.f_soluble_volume(Ultrafine),
242                "kappa": self.kappa(
243                    mass_fractions=Ultrafine, water_molar_volume=water_molar_volume
244                ),
245                "nu_org": self.nu_org(Ultrafine),
246                "spectrum": spectra.Lognormal(
247                    norm_factor=2000 / si.cm**3, m_mode=11.5 * si.nm, s_geom=1.71
248                ),
249            },
250            {
251                "f_org": 1 - self.f_soluble_volume(Accumulation),
252                "kappa": self.kappa(
253                    mass_fractions=Accumulation, water_molar_volume=water_molar_volume
254                ),
255                "nu_org": self.nu_org(Accumulation),
256                "spectrum": spectra.Lognormal(
257                    norm_factor=Acc_N2 / si.cm**3, m_mode=100 * si.nm, s_geom=1.703
258                ),
259            },
260        )
modes
39    @property
40    def modes(self):
41        return self._modes
color = 'orangered'