PySDM-examples 2.109__py3-none-any.whl → 2.111__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- PySDM_examples/Abade_and_Albuquerque_2024/settings.py +12 -1
- PySDM_examples/Abade_and_Albuquerque_2024/simulation.py +36 -4
- PySDM_examples/Arabas_and_Shima_2017/settings.py +1 -1
- PySDM_examples/Bolin_1958/__init__.py +8 -0
- PySDM_examples/Lowe_et_al_2019/settings.py +1 -1
- PySDM_examples/Morrison_and_Grabowski_2007/cumulus.py +1 -1
- PySDM_examples/Shipway_and_Hill_2012/settings.py +1 -1
- PySDM_examples/Yang_et_al_2018/simulation.py +1 -1
- {pysdm_examples-2.109.dist-info → pysdm_examples-2.111.dist-info}/METADATA +1 -1
- {pysdm_examples-2.109.dist-info → pysdm_examples-2.111.dist-info}/RECORD +12 -12
- {pysdm_examples-2.109.dist-info → pysdm_examples-2.111.dist-info}/WHEEL +0 -0
- {pysdm_examples-2.109.dist-info → pysdm_examples-2.111.dist-info}/top_level.txt +0 -0
|
@@ -7,9 +7,18 @@ from PySDM.initialisation.spectra import Lognormal
|
|
|
7
7
|
|
|
8
8
|
@strict
|
|
9
9
|
class Settings:
|
|
10
|
-
def __init__(
|
|
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
|
+
):
|
|
11
18
|
self.n_sd = n_sd
|
|
12
19
|
self.timestep = timestep
|
|
20
|
+
self.enable_immersion_freezing = enable_immersion_freezing
|
|
21
|
+
self.enable_vapour_deposition_on_ice = enable_vapour_deposition_on_ice
|
|
13
22
|
|
|
14
23
|
self.initial_total_pressure = 1000 * si.hPa # note: not given in the paper
|
|
15
24
|
|
|
@@ -17,6 +26,8 @@ class Settings:
|
|
|
17
26
|
self.formulae = Formulae(
|
|
18
27
|
constants={"bulk_phase_partitioning_exponent": 0.1},
|
|
19
28
|
bulk_phase_partitioning="KaulEtAl2015",
|
|
29
|
+
particle_shape_and_density="MixedPhaseSpheres",
|
|
30
|
+
diffusion_coordinate="WaterMassLogarithm",
|
|
20
31
|
)
|
|
21
32
|
self.initial_water_vapour_mixing_ratio = 1.5 * si.g / si.kg
|
|
22
33
|
self.parcel_linear_extent = 100 * si.m
|
|
@@ -4,9 +4,20 @@ from PySDM_examples.utils import BasicSimulation
|
|
|
4
4
|
|
|
5
5
|
from PySDM import Builder
|
|
6
6
|
from PySDM.backends import CPU
|
|
7
|
-
from PySDM.dynamics import
|
|
7
|
+
from PySDM.dynamics import (
|
|
8
|
+
Condensation,
|
|
9
|
+
AmbientThermodynamics,
|
|
10
|
+
VapourDepositionOnIce,
|
|
11
|
+
Freezing,
|
|
12
|
+
)
|
|
8
13
|
from PySDM.initialisation.sampling.spectral_sampling import ConstantMultiplicity
|
|
9
|
-
from PySDM.products import
|
|
14
|
+
from PySDM.products import (
|
|
15
|
+
AmbientTemperature,
|
|
16
|
+
AmbientWaterVapourMixingRatio,
|
|
17
|
+
ParcelDisplacement,
|
|
18
|
+
WaterMixingRatio,
|
|
19
|
+
SpecificIceWaterContent,
|
|
20
|
+
)
|
|
10
21
|
from PySDM.environments import Parcel
|
|
11
22
|
|
|
12
23
|
|
|
@@ -22,23 +33,44 @@ class Simulation(BasicSimulation):
|
|
|
22
33
|
initial_water_vapour_mixing_ratio=settings.initial_water_vapour_mixing_ratio,
|
|
23
34
|
T0=settings.initial_temperature,
|
|
24
35
|
w=settings.updraft,
|
|
36
|
+
mixed_phase=True,
|
|
25
37
|
),
|
|
26
38
|
)
|
|
27
39
|
builder.add_dynamic(AmbientThermodynamics())
|
|
28
40
|
builder.add_dynamic(Condensation())
|
|
29
41
|
|
|
42
|
+
if settings.enable_immersion_freezing:
|
|
43
|
+
builder.add_dynamic(Freezing())
|
|
44
|
+
if settings.enable_vapour_deposition_on_ice:
|
|
45
|
+
builder.add_dynamic(VapourDepositionOnIce())
|
|
46
|
+
|
|
30
47
|
r_dry, n_in_dv = ConstantMultiplicity(settings.soluble_aerosol).sample(
|
|
31
48
|
n_sd=settings.n_sd
|
|
32
49
|
)
|
|
33
50
|
attributes = builder.particulator.environment.init_attributes(
|
|
34
51
|
n_in_dv=n_in_dv, kappa=settings.kappa, r_dry=r_dry
|
|
35
52
|
)
|
|
53
|
+
attributes["signed water mass"] = (
|
|
54
|
+
builder.particulator.formulae.particle_shape_and_density.volume_to_mass(
|
|
55
|
+
attributes["volume"]
|
|
56
|
+
)
|
|
57
|
+
)
|
|
58
|
+
del attributes["volume"]
|
|
59
|
+
|
|
60
|
+
# TODO #1524
|
|
61
|
+
if settings.enable_immersion_freezing:
|
|
62
|
+
attributes["freezing temperature"] = np.full(
|
|
63
|
+
shape=(settings.n_sd,), fill_value=250
|
|
64
|
+
)
|
|
65
|
+
|
|
36
66
|
self.products = (
|
|
37
67
|
WaterMixingRatio(name="water", radius_range=(0, np.inf)),
|
|
38
|
-
|
|
39
|
-
WaterMixingRatio(name="total", radius_range=(-np.inf, np.inf)),
|
|
68
|
+
SpecificIceWaterContent(name="ice"),
|
|
40
69
|
ParcelDisplacement(name="height"),
|
|
41
70
|
AmbientTemperature(name="T"),
|
|
71
|
+
AmbientWaterVapourMixingRatio(
|
|
72
|
+
name="vapour", var="water_vapour_mixing_ratio"
|
|
73
|
+
),
|
|
42
74
|
)
|
|
43
75
|
super().__init__(
|
|
44
76
|
particulator=builder.build(attributes=attributes, products=self.products)
|
|
@@ -27,7 +27,7 @@ class Settings:
|
|
|
27
27
|
constants=LOWE_CONSTS,
|
|
28
28
|
diffusion_kinetics="LoweEtAl2019",
|
|
29
29
|
diffusion_thermics="LoweEtAl2019",
|
|
30
|
-
|
|
30
|
+
latent_heat_vapourisation="Lowe2019",
|
|
31
31
|
saturation_vapour_pressure="Lowe1977",
|
|
32
32
|
optical_albedo="Bohren1987",
|
|
33
33
|
optical_depth="Stephens1978",
|
|
@@ -48,7 +48,7 @@ class Cumulus(Common):
|
|
|
48
48
|
|
|
49
49
|
def __rhod_of_z(self, T_of_z, p_of_z, q_of_z, z_of_p, z_points):
|
|
50
50
|
def drhod_dz(z, _):
|
|
51
|
-
lv = self.formulae.
|
|
51
|
+
lv = self.formulae.latent_heat_vapourisation.lv(T_of_z(z))
|
|
52
52
|
return self.formulae.hydrostatics.drho_dz(
|
|
53
53
|
p_of_z(z), T_of_z(z), q_of_z(z), lv
|
|
54
54
|
)
|
|
@@ -120,7 +120,7 @@ class Settings:
|
|
|
120
120
|
p = self.formulae.state_variable_triplet.p(
|
|
121
121
|
rhod[0], T, water_vapour_mixing_ratio
|
|
122
122
|
)
|
|
123
|
-
lv = self.formulae.
|
|
123
|
+
lv = self.formulae.latent_heat_vapourisation.lv(T)
|
|
124
124
|
return self.formulae.hydrostatics.drho_dz(
|
|
125
125
|
p, T, water_vapour_mixing_ratio, lv
|
|
126
126
|
) / (
|
|
@@ -17,7 +17,7 @@ class Simulation:
|
|
|
17
17
|
while dt_output / self.n_substeps >= settings.dt_max:
|
|
18
18
|
self.n_substeps += 1
|
|
19
19
|
self.formulae = Formulae(
|
|
20
|
-
|
|
20
|
+
diffusion_coordinate=settings.coord,
|
|
21
21
|
saturation_vapour_pressure="AugustRocheMagnus",
|
|
22
22
|
)
|
|
23
23
|
self.bins_edges = self.formulae.trivia.volume(settings.r_bins_edges)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: pysdm-examples
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.111
|
|
4
4
|
Summary: PySDM usage examples reproducing results from literature and depicting how to use PySDM from Python Jupyter notebooks
|
|
5
5
|
Home-page: https://github.com/open-atmos/PySDM
|
|
6
6
|
Author: https://github.com/open-atmos/PySDM/graphs/contributors
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PySDM_examples/__init__.py,sha256=TnieTsOWPG-6J5Z9S_LgBRil-kbBWmsl3q2dlA4equk,228
|
|
2
2
|
PySDM_examples/Abade_and_Albuquerque_2024/__init__.py,sha256=JlXdzgcWzQEj87r0IatZAHx4j3hgDsyxP8LisaJvP_U,279
|
|
3
|
-
PySDM_examples/Abade_and_Albuquerque_2024/settings.py,sha256=
|
|
4
|
-
PySDM_examples/Abade_and_Albuquerque_2024/simulation.py,sha256=
|
|
3
|
+
PySDM_examples/Abade_and_Albuquerque_2024/settings.py,sha256=KVll9MY-EEYbxCrDs8PDasHg1YLMhLVIO634WXeb9sQ,2015
|
|
4
|
+
PySDM_examples/Abade_and_Albuquerque_2024/simulation.py,sha256=mbUH6mr76TnXDsjhc20-8dBpD1uGuW0IuD7WSW7OUHM,2771
|
|
5
5
|
PySDM_examples/Abdul_Razzak_Ghan_2000/__init__.py,sha256=2M2S0Qff2PJhxzEiV7eIGhJHCVkUywM0moIBT_BXJIg,311
|
|
6
6
|
PySDM_examples/Abdul_Razzak_Ghan_2000/aerosol.py,sha256=BHZL7DILM2WGK5v251N0pHd_bdk8V1PnhSpItkPh1HI,3405
|
|
7
7
|
PySDM_examples/Abdul_Razzak_Ghan_2000/data_from_ARG2000_paper.py,sha256=MRyurAnXq5ESE8gA5rzMsVx1ZhwcOz76o2xPRAcTPMQ,11585
|
|
@@ -14,7 +14,7 @@ PySDM_examples/Alpert_and_Knopf_2016/table_1.py,sha256=edJfFNqOYwZvOL4nKM5Ir5kFp
|
|
|
14
14
|
PySDM_examples/Alpert_and_Knopf_2016/table_2.py,sha256=oxeB_UNLWzrSHKoWOot-kAe5X_i9n18SKDOh7fF9KkQ,1857
|
|
15
15
|
PySDM_examples/Arabas_and_Shima_2017/__init__.py,sha256=A8GENIPgHqt8kSni21gxo8_kSKSTex0atCquQ9_qlc8,237
|
|
16
16
|
PySDM_examples/Arabas_and_Shima_2017/example.py,sha256=dWzGbRCkdwjWethxtdEjn6IjEssFrmW37sEK8y36Q3I,253
|
|
17
|
-
PySDM_examples/Arabas_and_Shima_2017/settings.py,sha256=
|
|
17
|
+
PySDM_examples/Arabas_and_Shima_2017/settings.py,sha256=HuikQrqhpg0tBU0lX_DpOCXMGI9nf7DmlkYt92EiG7c,2370
|
|
18
18
|
PySDM_examples/Arabas_and_Shima_2017/simulation.py,sha256=mCrf-GQLL-so4cZs2w6hdjQnDvYiNnctLpgfDfoxFF8,4164
|
|
19
19
|
PySDM_examples/Arabas_et_al_2015/__init__.py,sha256=fo2jbv-pNNiLOvdWBfFVeHzbudi6xx57nkWJ8cm7TU0,291
|
|
20
20
|
PySDM_examples/Arabas_et_al_2015/example.py,sha256=YB-ABtUByHQnv0jTGJvROhxNX_aQnM_PgoilG7mSEmQ,828
|
|
@@ -41,7 +41,7 @@ PySDM_examples/Berry_1967/spectrum_plotter.py,sha256=uwSZJQ2G3zuxml3on9IMCiWIldv
|
|
|
41
41
|
PySDM_examples/Bieli_et_al_2022/__init__.py,sha256=23wE81iNNkeNmr3PRTs0WC29gEfTDAZCNv7x0BuI2IU,205
|
|
42
42
|
PySDM_examples/Bieli_et_al_2022/settings.py,sha256=qJxoGChzqta-c_O2yv4E3wEM4yoECa2dyhKmE8AGrtI,1679
|
|
43
43
|
PySDM_examples/Bieli_et_al_2022/simulation.py,sha256=4L0AxnpGjfWqIUgVdZdH1PgXzrx4yXEeJ8_WaWsksy8,1324
|
|
44
|
-
PySDM_examples/Bolin_1958/__init__.py,sha256=
|
|
44
|
+
PySDM_examples/Bolin_1958/__init__.py,sha256=lCYe6sgW5AG1rn05QSqtoWIoqFL9cWSeDd9UOqVQYgw,175
|
|
45
45
|
PySDM_examples/Bolot_et_al_2013/__init__.py,sha256=wFQIlJaBVXaB5ji97EYjoFIv8fQFBXcPQYp2UDW0uEA,187
|
|
46
46
|
PySDM_examples/Bulenok_2023_MasterThesis/__init__.py,sha256=GPHWvxMGulWIaSH7CQlESd2jNTRJeMcXRqjzzJ-AAf8,164
|
|
47
47
|
PySDM_examples/Bulenok_2023_MasterThesis/performance_comparison_Srivastava_Setup.py,sha256=uPWdzK-9gYIr3LxMj-AIFB7PP4-zru3VnfJX2iSA4uo,7272
|
|
@@ -70,13 +70,13 @@ PySDM_examples/Lowe_et_al_2019/aerosol.py,sha256=8h0e1QAo4CQyyKokYScfuiWbKVJuLHf
|
|
|
70
70
|
PySDM_examples/Lowe_et_al_2019/aerosol_code.py,sha256=HqjEfWwsdKFnrCvRNpyUrfX4JGJLdS53AbHTJ0NgyzQ,9667
|
|
71
71
|
PySDM_examples/Lowe_et_al_2019/constants_def.py,sha256=dgNxLpBwXiyrefuW4t87uNIxIV3wySx5PXW3QqQZ7f0,480
|
|
72
72
|
PySDM_examples/Lowe_et_al_2019/plot_helper.py,sha256=5h7zo0Aonm2pzUPFNNTqxLhShWcJZaNgG-Bwa9EwY9E,6427
|
|
73
|
-
PySDM_examples/Lowe_et_al_2019/settings.py,sha256
|
|
73
|
+
PySDM_examples/Lowe_et_al_2019/settings.py,sha256=p6xSlPJIyDPE4OZ6VX0GxPUTqJdkU9posreOGFLbbO4,2599
|
|
74
74
|
PySDM_examples/Lowe_et_al_2019/simulation.py,sha256=Cg4Sd7_We-VEM0RuMCH-r9WmWseuqes2PFhlACvlLRI,5862
|
|
75
75
|
PySDM_examples/Merlivat_and_Nief_1967/__init__.py,sha256=ng7qsws-A87JR1X5DSewG2ABFdSVrnsUbczc3sKgfME,178
|
|
76
76
|
PySDM_examples/Miyake_et_al_1968/__init__.py,sha256=6uWg29ppJfgyvgwuuBPJdX9immnAly-gkFF_fjTZ9hE,202
|
|
77
77
|
PySDM_examples/Morrison_and_Grabowski_2007/__init__.py,sha256=C8SGK7hJSZmigurj720OGVOO1lCSayznPszwd8siVEw,283
|
|
78
78
|
PySDM_examples/Morrison_and_Grabowski_2007/common.py,sha256=aOSCsXSCRPLEgV2LThpmAdF_gGANPAypUDxwGe5C2Do,5221
|
|
79
|
-
PySDM_examples/Morrison_and_Grabowski_2007/cumulus.py,sha256=
|
|
79
|
+
PySDM_examples/Morrison_and_Grabowski_2007/cumulus.py,sha256=oyfntiPshPzBJa8qEP00npLRLVke-A94l1JMSed6joc,4473
|
|
80
80
|
PySDM_examples/Morrison_and_Grabowski_2007/strato_cumulus.py,sha256=2tLh5p2ruFtfuPFr96wGWgZC-jYYrdmzDtF_rglQ6hk,1096
|
|
81
81
|
PySDM_examples/Niedermeier_et_al_2014/__init__.py,sha256=onCrRnKNGSVExQkYDjxtrLF94CnsjEwqF4TZ5lUbySs,199
|
|
82
82
|
PySDM_examples/Niedermeier_et_al_2014/settings.py,sha256=wO9NwcgOhzIDmmyVDHVYuGSlbnJUq7FjRL1kfCekS8M,1556
|
|
@@ -103,7 +103,7 @@ PySDM_examples/Shima_et_al_2009/tutorial_settings.py,sha256=nTe_rKAIPpXwnh52mDBr
|
|
|
103
103
|
PySDM_examples/Shipway_and_Hill_2012/__init__.py,sha256=_yZNTXhicir6Q1PaX_ThYx_z_gwTVdKV8P86oTM-Ycw,298
|
|
104
104
|
PySDM_examples/Shipway_and_Hill_2012/mpdata_1d.py,sha256=8l7Zcv2PluBXYZO0qQ4j4_otLcLPtPWSGJJgzRfxEKs,2341
|
|
105
105
|
PySDM_examples/Shipway_and_Hill_2012/plot.py,sha256=Q6lnGWE3oSDKV_F1qKUIihhbYABQ3S1A1qg7Q2rXwn4,3606
|
|
106
|
-
PySDM_examples/Shipway_and_Hill_2012/settings.py,sha256=
|
|
106
|
+
PySDM_examples/Shipway_and_Hill_2012/settings.py,sha256=FZnUeCoJHenbBHMHiqZ8AZxNQn-ubYRm7ktS4AgZerg,6427
|
|
107
107
|
PySDM_examples/Shipway_and_Hill_2012/simulation.py,sha256=5uG7Nq80jQ8TTfypwnFIThOF9ndTL_hseUcXPfMKbOg,10351
|
|
108
108
|
PySDM_examples/Singer_Ward/__init__.py,sha256=2nKsepqAvYfHeiGAF1qca6DRzPQvUMosxhoCQKM7iiQ,161
|
|
109
109
|
PySDM_examples/Singer_Ward/aerosol.py,sha256=H7TcvI94Wc-IvhTMFshFaJRJY3eUjihAlSdNxVKZzL0,5805
|
|
@@ -128,7 +128,7 @@ PySDM_examples/Toon_et_al_1980/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5
|
|
|
128
128
|
PySDM_examples/Van_Hook_1968/__init__.py,sha256=rTmp4AjFBnNJP61rn7Scui5G_AwQruqjz50tF04EmsY,170
|
|
129
129
|
PySDM_examples/Yang_et_al_2018/__init__.py,sha256=w7eRDdbBJKvp-iRqgTJDEGlX2o1vqubjjuqc0YECodc,278
|
|
130
130
|
PySDM_examples/Yang_et_al_2018/settings.py,sha256=FkK46ZhgRIwPRAZKWBFcf1NYquvMtyQmoX3z7_eMwQs,2330
|
|
131
|
-
PySDM_examples/Yang_et_al_2018/simulation.py,sha256=
|
|
131
|
+
PySDM_examples/Yang_et_al_2018/simulation.py,sha256=vLmevPahaEaCoxx6H8wKKk8lq0n8yxNywI150NzUnwA,4286
|
|
132
132
|
PySDM_examples/Zaba_et_al_2025/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
133
133
|
PySDM_examples/_HOWTOs/__init__.py,sha256=1k3BtizvAoImB2DMfeafabeMmdT0NeaqI5zwNOwEvuQ,169
|
|
134
134
|
PySDM_examples/deJong_Azimi/__init__.py,sha256=HEv69Ke02s732IjcQ5expjDT2uPCKpfaYe6L8gP9AKU,376
|
|
@@ -154,7 +154,7 @@ PySDM_examples/utils/read_vtk_1d.py,sha256=7_3sagEbX_FxqFuGkFWdwQapd1-9echFghU8T
|
|
|
154
154
|
PySDM_examples/utils/widgets/__init__.py,sha256=U67WZ2YDcXSocMraI7pzcMxCfcxzXNqehDzoG6ogsh4,519
|
|
155
155
|
PySDM_examples/utils/widgets/freezer.py,sha256=tFlZWShXUzA2X0cxgeE44N1g9kD33q3KQWZBqkgBP0A,407
|
|
156
156
|
PySDM_examples/utils/widgets/progbar_updater.py,sha256=3uhG32QkAiSM3dTV7DoROJl7fAUNA6ZsJEIKSg3tdmk,267
|
|
157
|
-
pysdm_examples-2.
|
|
158
|
-
pysdm_examples-2.
|
|
159
|
-
pysdm_examples-2.
|
|
160
|
-
pysdm_examples-2.
|
|
157
|
+
pysdm_examples-2.111.dist-info/METADATA,sha256=8bQKT4_PSHYbZy-vQgzPCF_MLYv8JEE8xqHve3kvR3g,12686
|
|
158
|
+
pysdm_examples-2.111.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
|
|
159
|
+
pysdm_examples-2.111.dist-info/top_level.txt,sha256=axw2inuuYKPWkQhzBYtkZJTPDlo5LrpGLOA0iSAf9v0,15
|
|
160
|
+
pysdm_examples-2.111.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|