PySDM_examples.Abade_and_Albuquerque_2024.settings

 1from pystrict import strict
 2
 3from PySDM import Formulae
 4from PySDM.physics import si
 5from PySDM.initialisation.spectra import Lognormal
 6
 7
 8@strict
 9class Settings:
10    def __init__(self, *, n_sd: int, timestep: float):
11        self.n_sd = n_sd
12        self.timestep = timestep
13
14        self.initial_total_pressure = 1000 * si.hPa  # note: not given in the paper
15
16        # parameters from the paper
17        self.formulae = Formulae(
18            constants={"bulk_phase_partitioning_exponent": 0.1},
19            bulk_phase_partitioning="KaulEtAl2015",
20        )
21        self.initial_water_vapour_mixing_ratio = 1.5 * si.g / si.kg
22        self.parcel_linear_extent = 100 * si.m
23        self.updraft = 0.5 * si.m / si.s
24
25        thd_0 = self.formulae.state_variable_triplet.th_dry(
26            th_std=269 * si.K,
27            water_vapour_mixing_ratio=self.initial_water_vapour_mixing_ratio,
28        )
29        rhod_0 = self.formulae.state_variable_triplet.rho_d(
30            p=self.initial_total_pressure,
31            water_vapour_mixing_ratio=self.initial_water_vapour_mixing_ratio,
32            theta_std=thd_0,
33        )
34
35        self.mass_of_dry_air = rhod_0 * self.formulae.trivia.volume(
36            radius=self.parcel_linear_extent
37        )
38        self.soluble_aerosol = Lognormal(
39            norm_factor=200
40            / si.mg
41            * self.mass_of_dry_air,  # note: assuming per mg of dry air
42            m_mode=75 * si.nm,
43            s_geom=1.6,
44        )
45        self.kappa = 0.6
46        self.initial_temperature = self.formulae.state_variable_triplet.T(
47            rhod=rhod_0, thd=thd_0
48        )
@strict
class Settings:
 9@strict
10class Settings:
11    def __init__(self, *, n_sd: int, timestep: float):
12        self.n_sd = n_sd
13        self.timestep = timestep
14
15        self.initial_total_pressure = 1000 * si.hPa  # note: not given in the paper
16
17        # parameters from the paper
18        self.formulae = Formulae(
19            constants={"bulk_phase_partitioning_exponent": 0.1},
20            bulk_phase_partitioning="KaulEtAl2015",
21        )
22        self.initial_water_vapour_mixing_ratio = 1.5 * si.g / si.kg
23        self.parcel_linear_extent = 100 * si.m
24        self.updraft = 0.5 * si.m / si.s
25
26        thd_0 = self.formulae.state_variable_triplet.th_dry(
27            th_std=269 * si.K,
28            water_vapour_mixing_ratio=self.initial_water_vapour_mixing_ratio,
29        )
30        rhod_0 = self.formulae.state_variable_triplet.rho_d(
31            p=self.initial_total_pressure,
32            water_vapour_mixing_ratio=self.initial_water_vapour_mixing_ratio,
33            theta_std=thd_0,
34        )
35
36        self.mass_of_dry_air = rhod_0 * self.formulae.trivia.volume(
37            radius=self.parcel_linear_extent
38        )
39        self.soluble_aerosol = Lognormal(
40            norm_factor=200
41            / si.mg
42            * self.mass_of_dry_air,  # note: assuming per mg of dry air
43            m_mode=75 * si.nm,
44            s_geom=1.6,
45        )
46        self.kappa = 0.6
47        self.initial_temperature = self.formulae.state_variable_triplet.T(
48            rhod=rhod_0, thd=thd_0
49        )
Settings(*, n_sd: int, timestep: float)
11    def __init__(self, *, n_sd: int, timestep: float):
12        self.n_sd = n_sd
13        self.timestep = timestep
14
15        self.initial_total_pressure = 1000 * si.hPa  # note: not given in the paper
16
17        # parameters from the paper
18        self.formulae = Formulae(
19            constants={"bulk_phase_partitioning_exponent": 0.1},
20            bulk_phase_partitioning="KaulEtAl2015",
21        )
22        self.initial_water_vapour_mixing_ratio = 1.5 * si.g / si.kg
23        self.parcel_linear_extent = 100 * si.m
24        self.updraft = 0.5 * si.m / si.s
25
26        thd_0 = self.formulae.state_variable_triplet.th_dry(
27            th_std=269 * si.K,
28            water_vapour_mixing_ratio=self.initial_water_vapour_mixing_ratio,
29        )
30        rhod_0 = self.formulae.state_variable_triplet.rho_d(
31            p=self.initial_total_pressure,
32            water_vapour_mixing_ratio=self.initial_water_vapour_mixing_ratio,
33            theta_std=thd_0,
34        )
35
36        self.mass_of_dry_air = rhod_0 * self.formulae.trivia.volume(
37            radius=self.parcel_linear_extent
38        )
39        self.soluble_aerosol = Lognormal(
40            norm_factor=200
41            / si.mg
42            * self.mass_of_dry_air,  # note: assuming per mg of dry air
43            m_mode=75 * si.nm,
44            s_geom=1.6,
45        )
46        self.kappa = 0.6
47        self.initial_temperature = self.formulae.state_variable_triplet.T(
48            rhod=rhod_0, thd=thd_0
49        )
n_sd
timestep
initial_total_pressure
formulae
initial_water_vapour_mixing_ratio
parcel_linear_extent
updraft
mass_of_dry_air
soluble_aerosol
kappa
initial_temperature