PySDM-examples 2.121__py3-none-any.whl → 2.122__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.
Files changed (21) hide show
  1. PySDM_examples/Arabas_et_al_2015/example.py +1 -1
  2. PySDM_examples/Arabas_et_al_2015/example_benchmark.py +1 -1
  3. PySDM_examples/Morrison_and_Grabowski_2007/__init__.py +2 -6
  4. PySDM_examples/utils/kinematic_2d/__init__.py +19 -0
  5. PySDM_examples/{Szumowski_et_al_1998 → utils/kinematic_2d}/gui.py +4 -2
  6. PySDM_examples/{Szumowski_et_al_1998 → utils/kinematic_2d}/gui_viewer.py +1 -1
  7. PySDM_examples/{Szumowski_et_al_1998 → utils/kinematic_2d}/mpdata_2d.py +1 -1
  8. PySDM_examples/{Szumowski_et_al_1998 → utils/kinematic_2d}/simulation.py +2 -2
  9. {pysdm_examples-2.121.dist-info → pysdm_examples-2.122.dist-info}/METADATA +7 -7
  10. {pysdm_examples-2.121.dist-info → pysdm_examples-2.122.dist-info}/RECORD +18 -20
  11. {pysdm_examples-2.121.dist-info → pysdm_examples-2.122.dist-info}/WHEEL +1 -1
  12. PySDM_examples/Morrison_and_Grabowski_2007/cumulus.py +0 -136
  13. PySDM_examples/Szumowski_et_al_1998/__init__.py +0 -9
  14. PySDM_examples/Szumowski_et_al_1998/sounding.py +0 -93
  15. /PySDM_examples/{Szumowski_et_al_1998 → utils/kinematic_2d}/fields.py +0 -0
  16. /PySDM_examples/{Szumowski_et_al_1998 → utils/kinematic_2d}/gui_controller.py +0 -0
  17. /PySDM_examples/{Szumowski_et_al_1998 → utils/kinematic_2d}/gui_settings.py +0 -0
  18. /PySDM_examples/{Szumowski_et_al_1998 → utils/kinematic_2d}/make_default_product_collection.py +0 -0
  19. /PySDM_examples/{Szumowski_et_al_1998 → utils/kinematic_2d}/plots.py +0 -0
  20. /PySDM_examples/{Szumowski_et_al_1998 → utils/kinematic_2d}/storage.py +0 -0
  21. {pysdm_examples-2.121.dist-info → pysdm_examples-2.122.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  from open_atmos_jupyter_utils import TemporaryFile
2
2
  from PySDM_examples.Arabas_et_al_2015 import Settings, SpinUp
3
- from PySDM_examples.Szumowski_et_al_1998 import Simulation, Storage
3
+ from PySDM_examples.utils.kinematic_2d import Simulation, Storage
4
4
  from PySDM_examples.utils import DummyController
5
5
 
6
6
  from PySDM import Formulae
@@ -2,7 +2,7 @@ import importlib
2
2
 
3
3
  from matplotlib import pyplot as plt
4
4
  from PySDM_examples.Arabas_et_al_2015 import Settings
5
- from PySDM_examples.Szumowski_et_al_1998 import Simulation, Storage
5
+ from PySDM_examples.utils.kinematic_2d import Simulation, Storage
6
6
 
7
7
  import PySDM.backends.impl_numba.conf
8
8
  from PySDM import Formulae
@@ -3,10 +3,6 @@
3
3
  prescribed-flow simulation settings data from
4
4
  [Morrison & Grabowski 2007 (JAS)](https://doi.org/10.1175/JAS3980)
5
5
 
6
- fig_2.ipynb:
7
- .. include:: ./fig_2.ipynb.badges.md
8
-
9
- fig_3.ipynb:
10
- .. include:: ./fig_3.ipynb.badges.md
6
+ fig_1.ipynb:
7
+ .. include:: ./fig_1.ipynb.badges.md
11
8
  """
12
- from .cumulus import Cumulus
@@ -0,0 +1,19 @@
1
+ # pylint: disable=invalid-name
2
+ """
3
+ The 2D prescribed-flow framework used here can be traced back to the work
4
+ of [Kessler 1969 (section 3C)](https://doi.org/10.1007/978-1-935704-36-2_1), can be found also in
5
+ [Szumowski et al. 1998 (Atmos. Res.)](https://doi.org/10.1016/S0169-8095(97)00082-3).
6
+
7
+ The setup mimics a stratiform cloud deck and features periodic horizontal boundary condition
8
+ and vanishing flow at vertical boundaries.
9
+ It was introduced in [Morrison & Grabowski 2007](https://doi.org/10.1175/JAS3980) and later adopted
10
+ for particle-based simulations in [Arabas et al. 2015](https://doi.org/10.5194/gmd-8-1677-2015)
11
+ It uses a non-devergent single-eddy flow field resulting in an updraft-downdraft pair in the domain.
12
+ The flow field advects two scalar fields in an Eulerian way: water vapour mixing ratio
13
+ and dry-air potential temperature.
14
+ """
15
+
16
+ from .gui_settings import GUISettings
17
+ from .mpdata_2d import MPDATA_2D
18
+ from .simulation import Simulation
19
+ from .storage import Storage
@@ -2,8 +2,10 @@ import os
2
2
  import sys
3
3
 
4
4
  from open_atmos_jupyter_utils import TemporaryFile
5
- from PySDM_examples.Szumowski_et_al_1998.gui_controller import GUIController
6
- from PySDM_examples.Szumowski_et_al_1998.gui_viewer import GUIViewer
5
+ from PySDM_examples.utils.kinematic_2d.gui_controller import (
6
+ GUIController,
7
+ )
8
+ from PySDM_examples.utils.kinematic_2d.gui_viewer import GUIViewer
7
9
  from PySDM_examples.utils.widgets import HTML, Tab, VBox, display
8
10
 
9
11
  from PySDM.exporters import NetCDFExporter
@@ -3,7 +3,7 @@ import warnings
3
3
  import numpy as np
4
4
  from matplotlib import pyplot, rcParams
5
5
  from open_atmos_jupyter_utils import save_and_make_link
6
- from PySDM_examples.Szumowski_et_al_1998.plots import (
6
+ from PySDM_examples.utils.kinematic_2d.plots import (
7
7
  _ImagePlot,
8
8
  _SpectrumPlot,
9
9
  _TemperaturePlot,
@@ -5,7 +5,7 @@ from threading import Thread
5
5
  import numpy as np
6
6
  from PyMPDATA import Options, ScalarField, Solver, Stepper, VectorField
7
7
  from PyMPDATA.boundary_conditions import Periodic
8
- from PySDM_examples.Szumowski_et_al_1998.fields import (
8
+ from PySDM_examples.utils.kinematic_2d.fields import (
9
9
  nondivergent_vector_field_2d,
10
10
  x_vec_coord,
11
11
  z_vec_coord,
@@ -1,8 +1,8 @@
1
1
  import numpy as np
2
- from PySDM_examples.Szumowski_et_al_1998.make_default_product_collection import (
2
+ from PySDM_examples.utils.kinematic_2d.make_default_product_collection import (
3
3
  make_default_product_collection,
4
4
  )
5
- from PySDM_examples.Szumowski_et_al_1998.mpdata_2d import MPDATA_2D
5
+ from PySDM_examples.utils.kinematic_2d.mpdata_2d import MPDATA_2D
6
6
  from PySDM_examples.utils import DummyController
7
7
 
8
8
  from PySDM.backends import CPU
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pysdm-examples
3
- Version: 2.121
3
+ Version: 2.122
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
@@ -75,12 +75,12 @@ The 2D prescribed-flow framework used here can be traced back to the work of
75
75
  and dry-air potential temperature.
76
76
  In PySDM-examples, the Eulerian advection is handled using the <a href="https://doi.org/10.21105/joss.03896">PyMPDATA</a> Numba-based
77
77
  implementation of the <a href="https://doi.org/10.1002/fld.1071">MPDATA numerical scheme of Smolarkiewicz (e.g., 2006)</a>.
78
- An animation depicting PySDM simulation capturing <mark>aerosol collisional processing</mark> by warm rain is shown below:
79
-
80
- <video controls style="width:100%">
81
- <source src="https://github.com/open-atmos/PySDM/releases/download/tip/docs_intro_animation_ubuntu-24.04.mp4" type="video/mp4">
82
- Your browser does not support the video tag.
83
- </video>
78
+ An animation depicting PySDM simulation capturing <mark>aerosol collisional processing</mark> by warm rain is shown below
79
+ (<a href="https://github.com/open-atmos/PySDM/blob/main/examples/PySDM_examples/_HOWTOs/paraview_hello_world.ipynb">see
80
+ the Paraview hello-world HOWTO Jupyter notbook for code generating the simulation and visualisation</a>):
81
+ <center>
82
+ <img src="https://github.com/open-atmos/PySDM/releases/download/tip/docs_intro_animation_ubuntu-24.04.gif" style="width:80%" />
83
+ </center>
84
84
 
85
85
  Example notebooks:
86
86
  - <a href="https://open-atmos.github.io/PySDM/PySDM_examples/Arabas_et_al_2015.html">Arabas_et_al_2015</a>
@@ -17,8 +17,8 @@ PySDM_examples/Arabas_and_Shima_2017/example.py,sha256=dWzGbRCkdwjWethxtdEjn6IjE
17
17
  PySDM_examples/Arabas_and_Shima_2017/settings.py,sha256=HuikQrqhpg0tBU0lX_DpOCXMGI9nf7DmlkYt92EiG7c,2370
18
18
  PySDM_examples/Arabas_and_Shima_2017/simulation.py,sha256=ZA7vdFHNNaD4pu3iCWHYVJ5oCEr6llD6K8GJOtZ81FU,4165
19
19
  PySDM_examples/Arabas_et_al_2015/__init__.py,sha256=fo2jbv-pNNiLOvdWBfFVeHzbudi6xx57nkWJ8cm7TU0,291
20
- PySDM_examples/Arabas_et_al_2015/example.py,sha256=YB-ABtUByHQnv0jTGJvROhxNX_aQnM_PgoilG7mSEmQ,828
21
- PySDM_examples/Arabas_et_al_2015/example_benchmark.py,sha256=iUn5qGO0dB_s0DcYlOtllFURbRa6X9H9HW9AkaiHFoc,2343
20
+ PySDM_examples/Arabas_et_al_2015/example.py,sha256=5na1kSsR95wGIniGZ6J9f2qKvnRZ1th03hs65bPP5jI,826
21
+ PySDM_examples/Arabas_et_al_2015/example_benchmark.py,sha256=btZxgmuaUT-cYEZkOkPIsibvHikxyaboJupoDvLBjyc,2341
22
22
  PySDM_examples/Arabas_et_al_2015/settings.py,sha256=suLNA8trdy4UV27yiG4S_SWlkYc9c9yzn2ropDek-S4,1028
23
23
  PySDM_examples/Arabas_et_al_2015/spin_up.py,sha256=fGh8MOle-g0sXCxZ_hjomLeFs-8KsOGnZUNf3eWRWVY,736
24
24
  PySDM_examples/Arabas_et_al_2025/__init__.py,sha256=lE1vr24BrQcr_9GurxtW6N2vSLreR6VnJlwBKL5OgSc,770
@@ -79,9 +79,8 @@ PySDM_examples/Lowe_et_al_2019/settings.py,sha256=p6xSlPJIyDPE4OZ6VX0GxPUTqJdkU9
79
79
  PySDM_examples/Lowe_et_al_2019/simulation.py,sha256=Cg4Sd7_We-VEM0RuMCH-r9WmWseuqes2PFhlACvlLRI,5862
80
80
  PySDM_examples/Merlivat_and_Nief_1967/__init__.py,sha256=ng7qsws-A87JR1X5DSewG2ABFdSVrnsUbczc3sKgfME,178
81
81
  PySDM_examples/Miyake_et_al_1968/__init__.py,sha256=6uWg29ppJfgyvgwuuBPJdX9immnAly-gkFF_fjTZ9hE,202
82
- PySDM_examples/Morrison_and_Grabowski_2007/__init__.py,sha256=C8SGK7hJSZmigurj720OGVOO1lCSayznPszwd8siVEw,283
82
+ PySDM_examples/Morrison_and_Grabowski_2007/__init__.py,sha256=EB1uqfjyflCw4U-rwlV3dpvCMtUpBuJizSWrxO46FeE,203
83
83
  PySDM_examples/Morrison_and_Grabowski_2007/common.py,sha256=aOSCsXSCRPLEgV2LThpmAdF_gGANPAypUDxwGe5C2Do,5221
84
- PySDM_examples/Morrison_and_Grabowski_2007/cumulus.py,sha256=oyfntiPshPzBJa8qEP00npLRLVke-A94l1JMSed6joc,4473
85
84
  PySDM_examples/Morrison_and_Grabowski_2007/strato_cumulus.py,sha256=2tLh5p2ruFtfuPFr96wGWgZC-jYYrdmzDtF_rglQ6hk,1096
86
85
  PySDM_examples/Niedermeier_et_al_2014/__init__.py,sha256=onCrRnKNGSVExQkYDjxtrLF94CnsjEwqF4TZ5lUbySs,199
87
86
  PySDM_examples/Niedermeier_et_al_2014/settings.py,sha256=pkOP8SLbaaJXDHBNTInQfYQJQVTrwNQUgIQZg47OZ30,1557
@@ -117,18 +116,6 @@ PySDM_examples/Srivastava_1982/example.py,sha256=fGaLDvqz4BBLLG8NqHB2D2aAYFPOJhE
117
116
  PySDM_examples/Srivastava_1982/settings.py,sha256=f5R-MyEKEw4Lbfix_4eyjiP9o_SqabM4IOH1fvQ3jjA,2275
118
117
  PySDM_examples/Srivastava_1982/simulation.py,sha256=m24_z-awxSmkGxma8XJoFpqzXDWmvvKvkgpihKuF-VM,3039
119
118
  PySDM_examples/Stewart_1975/__init__.py,sha256=wPLEtji2ufVD_oJtvJC6-dkPm85-5dJRAelorELiS3Q,140
120
- PySDM_examples/Szumowski_et_al_1998/__init__.py,sha256=L9UucV9lyb08Hkzs1zYI9cxmN7mcogIFNsYgmnUpfY8,315
121
- PySDM_examples/Szumowski_et_al_1998/fields.py,sha256=tcR2MAB7azOLF955-ACHJU6v7aJxxpDXVdSIMQTbHEg,1584
122
- PySDM_examples/Szumowski_et_al_1998/gui.py,sha256=Vjt_ahdSl74NEjbZ-WxhK9eU3H2bqifjibPp6hy2DME,1309
123
- PySDM_examples/Szumowski_et_al_1998/gui_controller.py,sha256=AsP78e9bcGSP81kfDet_5fxpthlHsjDyJxHknvN2EgI,4283
124
- PySDM_examples/Szumowski_et_al_1998/gui_settings.py,sha256=eGYd6nf6RNuZqkbRKetmjVddbA3l0iohH8s0KQu7FsM,14457
125
- PySDM_examples/Szumowski_et_al_1998/gui_viewer.py,sha256=JZFAfD9FXHS5msVYAzccoF5rhHlb6hdwY28Q6lAdJD4,13164
126
- PySDM_examples/Szumowski_et_al_1998/make_default_product_collection.py,sha256=m8qiUHsCaGSBo_b8MqhHtO4a-MBuhG42XHBn42Vy6Cw,4682
127
- PySDM_examples/Szumowski_et_al_1998/mpdata_2d.py,sha256=5iv-G7Gfea-7LfiSMtehapBCrmTE5CNt7gLtTX92jJM,4443
128
- PySDM_examples/Szumowski_et_al_1998/plots.py,sha256=fzeluxlLF9VbSMmcu2wvd9WPl3ApIuA0jouwOh6rJHA,7001
129
- PySDM_examples/Szumowski_et_al_1998/simulation.py,sha256=H0tDBLSh8xhCq3aYtFlgBcnun-PX3sg8_R_ZfMPE7VI,10363
130
- PySDM_examples/Szumowski_et_al_1998/sounding.py,sha256=vk3KHRPrBbZpz6QCqj2RtWyEpl_N7jSMR-zoDWM_ZVQ,1440
131
- PySDM_examples/Szumowski_et_al_1998/storage.py,sha256=NaGoujCRLubSEbhLA0QZDaSkATpJuF09HCnGdWQzcxQ,2579
132
119
  PySDM_examples/Toon_et_al_1980/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
133
120
  PySDM_examples/Van_Hook_1968/__init__.py,sha256=rTmp4AjFBnNJP61rn7Scui5G_AwQruqjz50tF04EmsY,170
134
121
  PySDM_examples/Yang_et_al_2018/__init__.py,sha256=w7eRDdbBJKvp-iRqgTJDEGlX2o1vqubjjuqc0YECodc,278
@@ -157,10 +144,21 @@ PySDM_examples/utils/dummy_controller.py,sha256=f1AjVNXPnDhhD15GkBFtJthDf7jZivDr
157
144
  PySDM_examples/utils/progbar_controller.py,sha256=IXk7rkXUOBKP7EQe6zLHUpnCPwtE2LuEeho5lxdsewA,470
158
145
  PySDM_examples/utils/pvanim.py,sha256=ZkYuwCAsvsS4zqX4DMcPH124rzGR-LNvU60iOBMeWfE,9615
159
146
  PySDM_examples/utils/read_vtk_1d.py,sha256=7_3sagEbX_FxqFuGkFWdwQapd1-9echFghU8TSNvGuw,966
147
+ PySDM_examples/utils/kinematic_2d/__init__.py,sha256=lvH0Ait3kGUBF_Zi-1K3w3U_6sLoqcZuQbxY-iEIX5A,989
148
+ PySDM_examples/utils/kinematic_2d/fields.py,sha256=tcR2MAB7azOLF955-ACHJU6v7aJxxpDXVdSIMQTbHEg,1584
149
+ PySDM_examples/utils/kinematic_2d/gui.py,sha256=w1Bd0nVqGqMGqUE8b321mmIHDwQIdnSn2mTGDQ83nNY,1314
150
+ PySDM_examples/utils/kinematic_2d/gui_controller.py,sha256=AsP78e9bcGSP81kfDet_5fxpthlHsjDyJxHknvN2EgI,4283
151
+ PySDM_examples/utils/kinematic_2d/gui_settings.py,sha256=eGYd6nf6RNuZqkbRKetmjVddbA3l0iohH8s0KQu7FsM,14457
152
+ PySDM_examples/utils/kinematic_2d/gui_viewer.py,sha256=i1dAK811XBzGKPvch-07wCOL8eoQNWbYOEczg3lrj2M,13162
153
+ PySDM_examples/utils/kinematic_2d/make_default_product_collection.py,sha256=m8qiUHsCaGSBo_b8MqhHtO4a-MBuhG42XHBn42Vy6Cw,4682
154
+ PySDM_examples/utils/kinematic_2d/mpdata_2d.py,sha256=jFhRg71H0PmSQ33s4eGfrgDRw3UFqnAgmuHDDTXaVv0,4441
155
+ PySDM_examples/utils/kinematic_2d/plots.py,sha256=fzeluxlLF9VbSMmcu2wvd9WPl3ApIuA0jouwOh6rJHA,7001
156
+ PySDM_examples/utils/kinematic_2d/simulation.py,sha256=cuOE_W8teA4o2_PUvyJGVPzFswcZWjCNbR3CVBA5sn8,10359
157
+ PySDM_examples/utils/kinematic_2d/storage.py,sha256=NaGoujCRLubSEbhLA0QZDaSkATpJuF09HCnGdWQzcxQ,2579
160
158
  PySDM_examples/utils/widgets/__init__.py,sha256=U67WZ2YDcXSocMraI7pzcMxCfcxzXNqehDzoG6ogsh4,519
161
159
  PySDM_examples/utils/widgets/freezer.py,sha256=tFlZWShXUzA2X0cxgeE44N1g9kD33q3KQWZBqkgBP0A,407
162
160
  PySDM_examples/utils/widgets/progbar_updater.py,sha256=3uhG32QkAiSM3dTV7DoROJl7fAUNA6ZsJEIKSg3tdmk,267
163
- pysdm_examples-2.121.dist-info/METADATA,sha256=w9u-T02Ew43i2q07WPNWLY2lpyRRC0d2qzl_3ssfpjU,12822
164
- pysdm_examples-2.121.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
165
- pysdm_examples-2.121.dist-info/top_level.txt,sha256=axw2inuuYKPWkQhzBYtkZJTPDlo5LrpGLOA0iSAf9v0,15
166
- pysdm_examples-2.121.dist-info/RECORD,,
161
+ pysdm_examples-2.122.dist-info/METADATA,sha256=G-S89BUwHODw60TBAYVn13Pwk74OWhHPBrhUWBaRSks,12977
162
+ pysdm_examples-2.122.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
163
+ pysdm_examples-2.122.dist-info/top_level.txt,sha256=axw2inuuYKPWkQhzBYtkZJTPDlo5LrpGLOA0iSAf9v0,15
164
+ pysdm_examples-2.122.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.7.1)
2
+ Generator: setuptools (80.8.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,136 +0,0 @@
1
- import numpy as np
2
- from PySDM_examples.Morrison_and_Grabowski_2007.common import Common
3
- from PySDM_examples.Szumowski_et_al_1998 import sounding
4
- from scipy.integrate import solve_ivp
5
- from scipy.interpolate import interp1d
6
-
7
- from PySDM.physics import si
8
-
9
-
10
- class Cumulus(Common):
11
- def __init__(self, formulae):
12
- super().__init__(formulae)
13
- self.size = (9 * si.km, 2.7 * si.km)
14
- self.hx = 1.8 * si.km
15
- self.x0 = 3.6 * si.km
16
- self.xc = self.size[0] / 2
17
- self.dz = 50 * si.m
18
- self.grid = tuple(s / self.dz for s in self.size)
19
- for g in self.grid:
20
- assert int(g) == g
21
- self.grid = tuple(int(g) for g in self.grid)
22
- self.dt = 1 * si.s
23
- self.simulation_time = 60 * si.min
24
-
25
- self.__init_profiles()
26
-
27
- def __init_profiles(self):
28
- z_of_p = self.__z_of_p()
29
- T_of_z = interp1d(z_of_p, sounding.temperature)
30
- p_of_z = interp1d(z_of_p, sounding.pressure)
31
- q_of_z = interp1d(z_of_p, sounding.mixing_ratio)
32
-
33
- z_points_scalar = np.linspace(
34
- self.dz / 2, self.size[-1] - self.dz / 2, num=self.grid[-1], endpoint=True
35
- )
36
- z_points_both = np.linspace(
37
- 0, self.size[-1], num=2 * self.grid[-1] + 1, endpoint=True
38
- )
39
- rhod_of_z = self.__rhod_of_z(T_of_z, p_of_z, q_of_z, z_of_p, z_points_both)
40
- self.rhod = interp1d(z_points_both / self.size[-1], rhod_of_z)
41
- self.initial_water_vapour_mixing_ratio = q_of_z(z_points_scalar)
42
- self.th_std0 = self.formulae.trivia.th_std(
43
- p_of_z(z_points_scalar), T_of_z(z_points_scalar)
44
- )
45
-
46
- def rhod_of_zZ(self, zZ):
47
- return self.rhod(zZ)
48
-
49
- def __rhod_of_z(self, T_of_z, p_of_z, q_of_z, z_of_p, z_points):
50
- def drhod_dz(z, _):
51
- lv = self.formulae.latent_heat_vapourisation.lv(T_of_z(z))
52
- return self.formulae.hydrostatics.drho_dz(
53
- p_of_z(z), T_of_z(z), q_of_z(z), lv
54
- )
55
-
56
- theta_std0 = self.formulae.trivia.th_std(
57
- sounding.pressure[0], sounding.temperature[0]
58
- )
59
- rhod0 = self.formulae.state_variable_triplet.rho_d(
60
- sounding.pressure[0], sounding.mixing_ratio[0], theta_std0
61
- )
62
- rhod_solution = solve_ivp(
63
- fun=drhod_dz,
64
- t_span=(0, np.amax(z_of_p)),
65
- y0=np.asarray((rhod0,)),
66
- t_eval=z_points,
67
- )
68
- assert rhod_solution.success
69
- return rhod_solution.y[0]
70
-
71
- def __z_of_p(self):
72
- T_virt_of_p = interp1d(
73
- sounding.pressure,
74
- sounding.temperature
75
- * (1 + sounding.mixing_ratio / self.formulae.constants.eps)
76
- / (1 + sounding.mixing_ratio),
77
- )
78
-
79
- def dz_dp(p, _):
80
- return (
81
- -self.formulae.constants.Rd
82
- * T_virt_of_p(p)
83
- / self.formulae.constants.g_std
84
- / p
85
- )
86
-
87
- z_of_p = solve_ivp(
88
- fun=dz_dp,
89
- t_span=(max(sounding.pressure), min(sounding.pressure)),
90
- y0=np.asarray((0,)),
91
- t_eval=sounding.pressure,
92
- )
93
- assert z_of_p.success
94
- return z_of_p.y[0]
95
-
96
- @staticmethod
97
- def z0(z):
98
- return np.where(z <= 1.7 * si.km, 0, 0.7 * si.km)
99
-
100
- @staticmethod
101
- def hz(z):
102
- return np.where(z <= 1.7 * si.km, 3.4 * si.km, 2.0 * si.km)
103
-
104
- def alpha(self, x):
105
- return np.where(abs(x - self.xc) <= 0.9 * si.km, 1, 0)
106
-
107
- @staticmethod
108
- def beta(x):
109
- return np.where(x <= 5.4 * si.km, 1, -1)
110
-
111
- @staticmethod
112
- def A1(t):
113
- if t <= 900 * si.s:
114
- return 5.73e2
115
- if t <= 1500 * si.s:
116
- return 5.73e2 + 2.02e3 * (1 + np.cos(np.pi * ((t - 900) / 600 + 1)))
117
- return 1.15e3 + 1.72e3 * (1 + np.cos(np.pi * ((min(t, 2400) - 1500) / 900 + 1)))
118
-
119
- @staticmethod
120
- def A2(t):
121
- if t <= 300 * si.s:
122
- return 0
123
- if t <= 1500 * si.s:
124
- return 6e2 * (1 + np.cos(np.pi * ((t - 300) / 600 - 1)))
125
- return 5e2 * (1 + np.cos(np.pi * ((min(2400, t) - 1500) / 900 - 1)))
126
-
127
- # see Appendix (page 2859)
128
- def stream_function(self, xX, zZ, t):
129
- x = xX * self.size[0]
130
- z = zZ * self.size[-1]
131
- return (
132
- -self.A1(t)
133
- * np.cos(self.alpha(x) * np.pi * (x - self.x0) / self.hx)
134
- * np.sin(self.beta(x) * np.pi * (z - self.z0(z)) / self.hz(z))
135
- + self.A2(t) / 2 * zZ**2
136
- )
@@ -1,9 +0,0 @@
1
- # pylint: disable=invalid-name
2
- """
3
- 2D GUI-equipped prescribed-flow warm-rain case based on
4
- [Szumowski et al. 1998 (Atmos. Res.)](https://doi.org/10.1016/S0169-8095(97)00082-3)
5
- """
6
- from .gui_settings import GUISettings
7
- from .mpdata_2d import MPDATA_2D
8
- from .simulation import Simulation
9
- from .storage import Storage
@@ -1,93 +0,0 @@
1
- import numpy as np
2
-
3
- from PySDM.physics import constants as const
4
- from PySDM.physics import si
5
-
6
- pressure = (
7
- np.array(
8
- (
9
- 1014,
10
- 1010,
11
- 1000,
12
- 990,
13
- 975,
14
- 960,
15
- 950,
16
- 925,
17
- 900,
18
- 875,
19
- 850,
20
- 825,
21
- 800,
22
- 790,
23
- 775,
24
- 765,
25
- 755,
26
- 745,
27
- 730,
28
- 715,
29
- 700,
30
- )
31
- )
32
- * si.hPa
33
- )
34
-
35
- temperature = (
36
- np.array(
37
- (
38
- 25.2,
39
- 24.8,
40
- 23.6,
41
- 22.5,
42
- 21.8,
43
- 20.5,
44
- 19.9,
45
- 18.2,
46
- 16.8,
47
- 14.8,
48
- 13.3,
49
- 11.9,
50
- 11.0,
51
- 11.3,
52
- 10.9,
53
- 11.2,
54
- 10.2,
55
- 11.0,
56
- 11.2,
57
- 10.0,
58
- 8.8,
59
- )
60
- )
61
- * si.kelvin
62
- + const.T0
63
- )
64
-
65
- mixing_ratio = (
66
- np.array(
67
- (
68
- 14.5,
69
- 14.5,
70
- 14.5,
71
- 14.0,
72
- 13.7,
73
- 13.9,
74
- 13.9,
75
- 10.3,
76
- 10.3,
77
- 10.0,
78
- 9.9,
79
- 8.9,
80
- 7.9,
81
- 4.0,
82
- 2.3,
83
- 1.2,
84
- 1.2,
85
- 0.9,
86
- 0.6,
87
- 2.0,
88
- 1.6,
89
- )
90
- )
91
- * si.g
92
- / si.kg
93
- )