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__(
11        self,
12        *,
13        n_sd: int,
14        timestep: float,
15        enable_immersion_freezing: bool = True,
16        enable_vapour_deposition_on_ice: bool = True,
17    ):
18        self.n_sd = n_sd
19        self.timestep = timestep
20        self.enable_immersion_freezing = enable_immersion_freezing
21        self.enable_vapour_deposition_on_ice = enable_vapour_deposition_on_ice
22
23        self.initial_total_pressure = 1000 * si.hPa  # note: not given in the paper
24
25        # parameters from the paper
26        self.formulae = Formulae(
27            constants={"bulk_phase_partitioning_exponent": 0.1},
28            bulk_phase_partitioning="KaulEtAl2015",
29            particle_shape_and_density="MixedPhaseSpheres",
30            diffusion_coordinate="WaterMassLogarithm",
31        )
32        self.initial_water_vapour_mixing_ratio = 1.5 * si.g / si.kg
33        self.parcel_linear_extent = 100 * si.m
34        self.updraft = 0.5 * si.m / si.s
35
36        thd_0 = self.formulae.state_variable_triplet.th_dry(
37            th_std=269 * si.K,
38            water_vapour_mixing_ratio=self.initial_water_vapour_mixing_ratio,
39        )
40        rhod_0 = self.formulae.state_variable_triplet.rho_d(
41            p=self.initial_total_pressure,
42            water_vapour_mixing_ratio=self.initial_water_vapour_mixing_ratio,
43            theta_std=thd_0,
44        )
45
46        self.mass_of_dry_air = rhod_0 * self.formulae.trivia.volume(
47            radius=self.parcel_linear_extent
48        )
49        self.soluble_aerosol = Lognormal(
50            norm_factor=200
51            / si.mg
52            * self.mass_of_dry_air,  # note: assuming per mg of dry air
53            m_mode=75 * si.nm,
54            s_geom=1.6,
55        )
56        self.kappa = 0.6
57        self.initial_temperature = self.formulae.state_variable_triplet.T(
58            rhod=rhod_0, thd=thd_0
59        )
@strict
class Settings:
 9@strict
10class Settings:
11    def __init__(
12        self,
13        *,
14        n_sd: int,
15        timestep: float,
16        enable_immersion_freezing: bool = True,
17        enable_vapour_deposition_on_ice: bool = True,
18    ):
19        self.n_sd = n_sd
20        self.timestep = timestep
21        self.enable_immersion_freezing = enable_immersion_freezing
22        self.enable_vapour_deposition_on_ice = enable_vapour_deposition_on_ice
23
24        self.initial_total_pressure = 1000 * si.hPa  # note: not given in the paper
25
26        # parameters from the paper
27        self.formulae = Formulae(
28            constants={"bulk_phase_partitioning_exponent": 0.1},
29            bulk_phase_partitioning="KaulEtAl2015",
30            particle_shape_and_density="MixedPhaseSpheres",
31            diffusion_coordinate="WaterMassLogarithm",
32        )
33        self.initial_water_vapour_mixing_ratio = 1.5 * si.g / si.kg
34        self.parcel_linear_extent = 100 * si.m
35        self.updraft = 0.5 * si.m / si.s
36
37        thd_0 = self.formulae.state_variable_triplet.th_dry(
38            th_std=269 * si.K,
39            water_vapour_mixing_ratio=self.initial_water_vapour_mixing_ratio,
40        )
41        rhod_0 = self.formulae.state_variable_triplet.rho_d(
42            p=self.initial_total_pressure,
43            water_vapour_mixing_ratio=self.initial_water_vapour_mixing_ratio,
44            theta_std=thd_0,
45        )
46
47        self.mass_of_dry_air = rhod_0 * self.formulae.trivia.volume(
48            radius=self.parcel_linear_extent
49        )
50        self.soluble_aerosol = Lognormal(
51            norm_factor=200
52            / si.mg
53            * self.mass_of_dry_air,  # note: assuming per mg of dry air
54            m_mode=75 * si.nm,
55            s_geom=1.6,
56        )
57        self.kappa = 0.6
58        self.initial_temperature = self.formulae.state_variable_triplet.T(
59            rhod=rhod_0, thd=thd_0
60        )
Settings( *, n_sd: int, timestep: float, enable_immersion_freezing: bool = True, enable_vapour_deposition_on_ice: bool = True)
11    def __init__(
12        self,
13        *,
14        n_sd: int,
15        timestep: float,
16        enable_immersion_freezing: bool = True,
17        enable_vapour_deposition_on_ice: bool = True,
18    ):
19        self.n_sd = n_sd
20        self.timestep = timestep
21        self.enable_immersion_freezing = enable_immersion_freezing
22        self.enable_vapour_deposition_on_ice = enable_vapour_deposition_on_ice
23
24        self.initial_total_pressure = 1000 * si.hPa  # note: not given in the paper
25
26        # parameters from the paper
27        self.formulae = Formulae(
28            constants={"bulk_phase_partitioning_exponent": 0.1},
29            bulk_phase_partitioning="KaulEtAl2015",
30            particle_shape_and_density="MixedPhaseSpheres",
31            diffusion_coordinate="WaterMassLogarithm",
32        )
33        self.initial_water_vapour_mixing_ratio = 1.5 * si.g / si.kg
34        self.parcel_linear_extent = 100 * si.m
35        self.updraft = 0.5 * si.m / si.s
36
37        thd_0 = self.formulae.state_variable_triplet.th_dry(
38            th_std=269 * si.K,
39            water_vapour_mixing_ratio=self.initial_water_vapour_mixing_ratio,
40        )
41        rhod_0 = self.formulae.state_variable_triplet.rho_d(
42            p=self.initial_total_pressure,
43            water_vapour_mixing_ratio=self.initial_water_vapour_mixing_ratio,
44            theta_std=thd_0,
45        )
46
47        self.mass_of_dry_air = rhod_0 * self.formulae.trivia.volume(
48            radius=self.parcel_linear_extent
49        )
50        self.soluble_aerosol = Lognormal(
51            norm_factor=200
52            / si.mg
53            * self.mass_of_dry_air,  # note: assuming per mg of dry air
54            m_mode=75 * si.nm,
55            s_geom=1.6,
56        )
57        self.kappa = 0.6
58        self.initial_temperature = self.formulae.state_variable_triplet.T(
59            rhod=rhod_0, thd=thd_0
60        )
n_sd
timestep
enable_immersion_freezing
enable_vapour_deposition_on_ice
initial_total_pressure
formulae
initial_water_vapour_mixing_ratio
parcel_linear_extent
updraft
mass_of_dry_air
soluble_aerosol
kappa
initial_temperature