PySDM_examples.Bieli_et_al_2022.settings

 1from pystrict import strict
 2
 3from PySDM.dynamics.collisions.breakup_efficiencies import ConstEb
 4from PySDM.dynamics.collisions.breakup_fragmentations import Feingold1988
 5from PySDM.dynamics.collisions.coalescence_efficiencies import ConstEc
 6from PySDM.dynamics.collisions.collision_kernels import Golovin
 7from PySDM.formulae import Formulae
 8from PySDM.initialisation.spectra import Gamma
 9from PySDM.physics import si
10from PySDM.physics.constants_defaults import rho_w
11
12
13@strict
14class Settings:
15    def __init__(self, formulae: Formulae = None):
16        self.n_sd = 2**12
17        self.n_part = 1e4 / si.cm**3
18        self.theta = 0.33e-9 * si.g / rho_w
19        self.k = 1
20        self.dv = 0.1 * si.m**3
21        self.norm_factor = self.n_part * self.dv
22        self.dt = 1 * si.seconds
23        self.adaptive = False
24        self.seed = 44
25        self._steps = list(range(60))
26        self.kernel = Golovin(b=2000 * si.cm**3 / si.g / si.s * rho_w)
27        self.coal_effs = [ConstEc(Ec=0.8), ConstEc(Ec=0.9), ConstEc(Ec=1.0)]
28        self.vmin = 1.0 * si.um**3
29        self.nfmax = 10
30        self.fragtol = 1e-3
31        self.fragmentation = Feingold1988(
32            scale=self.k * self.theta,
33            fragtol=self.fragtol,
34            vmin=self.vmin,
35            nfmax=self.nfmax,
36        )
37        self.break_eff = ConstEb(1.0)
38        self.spectrum = Gamma(norm_factor=self.norm_factor, k=self.k, theta=self.theta)
39        self.rho = rho_w
40        self.formulae = formulae or Formulae(
41            fragmentation_function=self.fragmentation.__class__.__name__
42        )
43
44    @property
45    def output_steps(self):
46        return [int(step / self.dt) for step in self._steps]
@strict
class Settings:
14@strict
15class Settings:
16    def __init__(self, formulae: Formulae = None):
17        self.n_sd = 2**12
18        self.n_part = 1e4 / si.cm**3
19        self.theta = 0.33e-9 * si.g / rho_w
20        self.k = 1
21        self.dv = 0.1 * si.m**3
22        self.norm_factor = self.n_part * self.dv
23        self.dt = 1 * si.seconds
24        self.adaptive = False
25        self.seed = 44
26        self._steps = list(range(60))
27        self.kernel = Golovin(b=2000 * si.cm**3 / si.g / si.s * rho_w)
28        self.coal_effs = [ConstEc(Ec=0.8), ConstEc(Ec=0.9), ConstEc(Ec=1.0)]
29        self.vmin = 1.0 * si.um**3
30        self.nfmax = 10
31        self.fragtol = 1e-3
32        self.fragmentation = Feingold1988(
33            scale=self.k * self.theta,
34            fragtol=self.fragtol,
35            vmin=self.vmin,
36            nfmax=self.nfmax,
37        )
38        self.break_eff = ConstEb(1.0)
39        self.spectrum = Gamma(norm_factor=self.norm_factor, k=self.k, theta=self.theta)
40        self.rho = rho_w
41        self.formulae = formulae or Formulae(
42            fragmentation_function=self.fragmentation.__class__.__name__
43        )
44
45    @property
46    def output_steps(self):
47        return [int(step / self.dt) for step in self._steps]
Settings(formulae: PySDM.formulae.Formulae = None)
16    def __init__(self, formulae: Formulae = None):
17        self.n_sd = 2**12
18        self.n_part = 1e4 / si.cm**3
19        self.theta = 0.33e-9 * si.g / rho_w
20        self.k = 1
21        self.dv = 0.1 * si.m**3
22        self.norm_factor = self.n_part * self.dv
23        self.dt = 1 * si.seconds
24        self.adaptive = False
25        self.seed = 44
26        self._steps = list(range(60))
27        self.kernel = Golovin(b=2000 * si.cm**3 / si.g / si.s * rho_w)
28        self.coal_effs = [ConstEc(Ec=0.8), ConstEc(Ec=0.9), ConstEc(Ec=1.0)]
29        self.vmin = 1.0 * si.um**3
30        self.nfmax = 10
31        self.fragtol = 1e-3
32        self.fragmentation = Feingold1988(
33            scale=self.k * self.theta,
34            fragtol=self.fragtol,
35            vmin=self.vmin,
36            nfmax=self.nfmax,
37        )
38        self.break_eff = ConstEb(1.0)
39        self.spectrum = Gamma(norm_factor=self.norm_factor, k=self.k, theta=self.theta)
40        self.rho = rho_w
41        self.formulae = formulae or Formulae(
42            fragmentation_function=self.fragmentation.__class__.__name__
43        )
n_sd
n_part
theta
k
dv
norm_factor
dt
adaptive
seed
kernel
coal_effs
vmin
nfmax
fragtol
fragmentation
break_eff
spectrum
rho
formulae
output_steps
45    @property
46    def output_steps(self):
47        return [int(step / self.dt) for step in self._steps]