PySDM-examples 2.39__tar.gz → 2.41__tar.gz

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 (140) hide show
  1. {PySDM-examples-2.39 → PySDM-examples-2.41}/PKG-INFO +1 -1
  2. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Abdul_Razzak_Ghan_2000/aerosol.py +19 -6
  3. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Abdul_Razzak_Ghan_2000/run_ARG_parcel.py +4 -4
  4. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Alpert_and_Knopf_2016/__init__.py +1 -0
  5. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Arabas_and_Shima_2017/__init__.py +1 -0
  6. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Arabas_et_al_2015/settings.py +1 -4
  7. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Arabas_et_al_2023/__init__.py +1 -0
  8. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Arabas_et_al_2023/plots.py +5 -3
  9. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Bartman_et_al_2021/label.py +5 -5
  10. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Berry_1967/__init__.py +1 -0
  11. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Bieli_et_al_2022/__init__.py +1 -0
  12. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Bolot_et_al_2013/__init__.py +1 -0
  13. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Ervens_and_Feingold_2012/__init__.py +1 -0
  14. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Ervens_and_Feingold_2012/settings.py +1 -3
  15. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Kreidenweis_et_al_2003/settings.py +7 -5
  16. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Lowe_et_al_2019/aerosol.py +21 -9
  17. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Lowe_et_al_2019/aerosol_code.py +34 -16
  18. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Merlivat_and_Nief_1967/__init__.py +1 -0
  19. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Niedermeier_et_al_2014/__init__.py +1 -0
  20. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Niedermeier_et_al_2014/simulation.py +5 -3
  21. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Pierchala_et_al_2022/__init__.py +1 -0
  22. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Pyrcel/profile_plotter.py +5 -5
  23. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Shipway_and_Hill_2012/settings.py +6 -6
  24. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Singer_Ward/aerosol.py +16 -8
  25. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Srivastava_1982/__init__.py +1 -0
  26. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Srivastava_1982/example.py +4 -4
  27. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Srivastava_1982/simulation.py +3 -3
  28. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Szumowski_et_al_1998/gui_viewer.py +9 -7
  29. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Szumowski_et_al_1998/simulation.py +5 -5
  30. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Van_Hook_1968/__init__.py +1 -0
  31. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/__init__.py +1 -0
  32. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/deJong_Mackay_et_al_2023/__init__.py +1 -0
  33. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/utils/__init__.py +1 -0
  34. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/utils/notebook_vars.py +1 -0
  35. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples.egg-info/PKG-INFO +1 -1
  36. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples.egg-info/requires.txt +3 -1
  37. {PySDM-examples-2.39 → PySDM-examples-2.41}/setup.py +3 -3
  38. {PySDM-examples-2.39 → PySDM-examples-2.41}/MANIFEST.in +0 -0
  39. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Abdul_Razzak_Ghan_2000/__init__.py +0 -0
  40. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Abdul_Razzak_Ghan_2000/data_from_ARG2000_paper.py +0 -0
  41. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Abdul_Razzak_Ghan_2000/data_from_CloudMicrophysics_ARG.py +0 -0
  42. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Alpert_and_Knopf_2016/simulation.py +0 -0
  43. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Alpert_and_Knopf_2016/table.py +0 -0
  44. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Alpert_and_Knopf_2016/table_1.py +0 -0
  45. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Alpert_and_Knopf_2016/table_2.py +0 -0
  46. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Arabas_and_Shima_2017/example.py +0 -0
  47. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Arabas_and_Shima_2017/settings.py +0 -0
  48. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Arabas_and_Shima_2017/simulation.py +0 -0
  49. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Arabas_et_al_2015/__init__.py +0 -0
  50. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Arabas_et_al_2015/example.py +0 -0
  51. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Arabas_et_al_2015/example_benchmark.py +0 -0
  52. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Arabas_et_al_2015/spin_up.py +0 -0
  53. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Arabas_et_al_2023/commons.py +0 -0
  54. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Arabas_et_al_2023/curved_text.py +0 -0
  55. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Arabas_et_al_2023/frozen_fraction.py +0 -0
  56. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Arabas_et_al_2023/make_particulator.py +0 -0
  57. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Arabas_et_al_2023/run_simulation.py +0 -0
  58. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Bartman_2020_MasterThesis/__init__.py +0 -0
  59. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Bartman_2020_MasterThesis/fig_4_adaptive_sdm.py +0 -0
  60. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Bartman_2020_MasterThesis/fig_5_SCIPY_VS_ADAPTIVE.py +0 -0
  61. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Bartman_et_al_2021/__init__.py +0 -0
  62. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Berry_1967/example.py +0 -0
  63. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Berry_1967/example_fig_6.py +0 -0
  64. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Berry_1967/settings.py +0 -0
  65. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Berry_1967/spectrum_plotter.py +0 -0
  66. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Bieli_et_al_2022/settings.py +0 -0
  67. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Bieli_et_al_2022/simulation.py +0 -0
  68. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Bulenok_2023_MasterThesis/__init__.py +0 -0
  69. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Bulenok_2023_MasterThesis/setups.py +0 -0
  70. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Bulenok_2023_MasterThesis/utils.py +0 -0
  71. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Grabowski_and_Pawlowska_2023/__init__.py +0 -0
  72. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Grabowski_and_Pawlowska_2023/settings.py +0 -0
  73. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Grabowski_and_Pawlowska_2023/simulation.py +0 -0
  74. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Graf_et_al_2019/__init__.py +0 -0
  75. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Jaruga_and_Pawlowska_2018/__init__.py +0 -0
  76. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Kreidenweis_et_al_2003/__init__.py +0 -0
  77. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Kreidenweis_et_al_2003/simulation.py +0 -0
  78. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Lowe_et_al_2019/__init__.py +0 -0
  79. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Lowe_et_al_2019/plot_helper.py +0 -0
  80. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Lowe_et_al_2019/settings.py +0 -0
  81. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Lowe_et_al_2019/simulation.py +0 -0
  82. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Morrison_and_Grabowski_2007/__init__.py +0 -0
  83. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Morrison_and_Grabowski_2007/common.py +0 -0
  84. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Morrison_and_Grabowski_2007/cumulus.py +0 -0
  85. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Morrison_and_Grabowski_2007/strato_cumulus.py +0 -0
  86. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Niedermeier_et_al_2014/settings.py +0 -0
  87. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Pierchala_et_al_2022/commons.py +0 -0
  88. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Pyrcel/__init__.py +0 -0
  89. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Pyrcel/settings.py +0 -0
  90. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Pyrcel/simulation.py +0 -0
  91. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Pyrcel/tutorial_settings.py +0 -0
  92. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Pyrcel/tutorial_simulation.py +0 -0
  93. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Shima_et_al_2009/__init__.py +0 -0
  94. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Shima_et_al_2009/error_measure.py +0 -0
  95. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Shima_et_al_2009/example.py +0 -0
  96. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Shima_et_al_2009/example_timing.py +0 -0
  97. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Shima_et_al_2009/settings.py +0 -0
  98. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Shima_et_al_2009/spectrum_plotter.py +0 -0
  99. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Shima_et_al_2009/tutorial_example.py +0 -0
  100. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Shima_et_al_2009/tutorial_plotter.py +0 -0
  101. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Shima_et_al_2009/tutorial_settings.py +0 -0
  102. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Shipway_and_Hill_2012/__init__.py +0 -0
  103. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Shipway_and_Hill_2012/mpdata_1d.py +0 -0
  104. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Shipway_and_Hill_2012/plot.py +0 -0
  105. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Shipway_and_Hill_2012/simulation.py +0 -0
  106. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Singer_Ward/__init__.py +0 -0
  107. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Srivastava_1982/equations.py +0 -0
  108. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Srivastava_1982/settings.py +0 -0
  109. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Szumowski_et_al_1998/__init__.py +0 -0
  110. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Szumowski_et_al_1998/fields.py +0 -0
  111. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Szumowski_et_al_1998/gui.py +0 -0
  112. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Szumowski_et_al_1998/gui_controller.py +0 -0
  113. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Szumowski_et_al_1998/gui_settings.py +0 -0
  114. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Szumowski_et_al_1998/make_default_product_collection.py +0 -0
  115. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Szumowski_et_al_1998/mpdata_2d.py +0 -0
  116. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Szumowski_et_al_1998/plots.py +0 -0
  117. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Szumowski_et_al_1998/sounding.py +0 -0
  118. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Szumowski_et_al_1998/storage.py +0 -0
  119. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Yang_et_al_2018/__init__.py +0 -0
  120. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Yang_et_al_2018/settings.py +0 -0
  121. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/Yang_et_al_2018/simulation.py +0 -0
  122. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/deJong_Mackay_et_al_2023/plot_rates.py +0 -0
  123. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/deJong_Mackay_et_al_2023/settings1D.py +0 -0
  124. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/deJong_Mackay_et_al_2023/settings_0D.py +0 -0
  125. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/deJong_Mackay_et_al_2023/simulation1D.py +0 -0
  126. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/deJong_Mackay_et_al_2023/simulation_0D.py +0 -0
  127. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/deJong_Mackay_et_al_2023/simulation_ss.py +0 -0
  128. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/utils/basic_simulation.py +0 -0
  129. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/utils/dummy_controller.py +0 -0
  130. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/utils/progbar_controller.py +0 -0
  131. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/utils/read_vtk_1d.py +0 -0
  132. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/utils/widgets/__init__.py +0 -0
  133. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/utils/widgets/freezer.py +0 -0
  134. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples/utils/widgets/progbar_updater.py +0 -0
  135. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples.egg-info/SOURCES.txt +0 -0
  136. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples.egg-info/dependency_links.txt +0 -0
  137. {PySDM-examples-2.39 → PySDM-examples-2.41}/PySDM_examples.egg-info/top_level.txt +0 -0
  138. {PySDM-examples-2.39 → PySDM-examples-2.41}/README.md +0 -0
  139. {PySDM-examples-2.39 → PySDM-examples-2.41}/pyproject.toml +0 -0
  140. {PySDM-examples-2.39 → PySDM-examples-2.41}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PySDM-examples
3
- Version: 2.39
3
+ Version: 2.41
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
@@ -16,6 +16,7 @@ CONSTANTS_ARG = {
16
16
  class AerosolARG(DryAerosolMixture):
17
17
  def __init__(
18
18
  self,
19
+ water_molar_volume: float,
19
20
  M2_sol: float = 0,
20
21
  M2_N: float = 100 / si.cm**3,
21
22
  M2_rad: float = 50 * si.nm,
@@ -35,13 +36,19 @@ class AerosolARG(DryAerosolMixture):
35
36
  )
36
37
  self.modes = (
37
38
  {
38
- "kappa": self.kappa({"(NH4)2SO4": 1.0, "insoluble": 0.0}),
39
+ "kappa": self.kappa(
40
+ mass_fractions={"(NH4)2SO4": 1.0, "insoluble": 0.0},
41
+ water_molar_volume=water_molar_volume,
42
+ ),
39
43
  "spectrum": spectra.Lognormal(
40
44
  norm_factor=100.0 / si.cm**3, m_mode=50.0 * si.nm, s_geom=2.0
41
45
  ),
42
46
  },
43
47
  {
44
- "kappa": self.kappa({"(NH4)2SO4": M2_sol, "insoluble": (1 - M2_sol)}),
48
+ "kappa": self.kappa(
49
+ mass_fractions={"(NH4)2SO4": M2_sol, "insoluble": (1 - M2_sol)},
50
+ water_molar_volume=water_molar_volume,
51
+ ),
45
52
  "spectrum": spectra.Lognormal(
46
53
  norm_factor=M2_N, m_mode=M2_rad, s_geom=2.0
47
54
  ),
@@ -51,7 +58,7 @@ class AerosolARG(DryAerosolMixture):
51
58
 
52
59
  @strict
53
60
  class AerosolWhitby(DryAerosolMixture):
54
- def __init__(self):
61
+ def __init__(self, water_molar_volume: float):
55
62
  nuclei = {"(NH4)2SO4": 1.0}
56
63
  accum = {"(NH4)2SO4": 1.0}
57
64
  coarse = {"(NH4)2SO4": 1.0}
@@ -69,19 +76,25 @@ class AerosolWhitby(DryAerosolMixture):
69
76
  )
70
77
  self.modes = (
71
78
  {
72
- "kappa": self.kappa(nuclei),
79
+ "kappa": self.kappa(
80
+ mass_fractions=nuclei, water_molar_volume=water_molar_volume
81
+ ),
73
82
  "spectrum": spectra.Lognormal(
74
83
  norm_factor=1000.0 / si.cm**3, m_mode=0.008 * si.um, s_geom=1.6
75
84
  ),
76
85
  },
77
86
  {
78
- "kappa": self.kappa(accum),
87
+ "kappa": self.kappa(
88
+ mass_fractions=accum, water_molar_volume=water_molar_volume
89
+ ),
79
90
  "spectrum": spectra.Lognormal(
80
91
  norm_factor=800 / si.cm**3, m_mode=0.034 * si.um, s_geom=2.1
81
92
  ),
82
93
  },
83
94
  {
84
- "kappa": self.kappa(coarse),
95
+ "kappa": self.kappa(
96
+ mass_fractions=coarse, water_molar_volume=water_molar_volume
97
+ ),
85
98
  "spectrum": spectra.Lognormal(
86
99
  norm_factor=0.72 / si.cm**3, m_mode=0.46 * si.um, s_geom=2.2
87
100
  ),
@@ -6,7 +6,6 @@ from PySDM_examples.Abdul_Razzak_Ghan_2000.aerosol import CONSTANTS_ARG, Aerosol
6
6
  from PySDM import Builder, Formulae
7
7
  from PySDM import products as PySDM_products
8
8
  from PySDM.backends import CPU
9
- from PySDM.backends.impl_numba.test_helpers import scipy_ode_condensation_solver
10
9
  from PySDM.dynamics import AmbientThermodynamics, Condensation
11
10
  from PySDM.environments import Parcel
12
11
  from PySDM.initialisation import equilibrate_wet_radii
@@ -47,10 +46,12 @@ def run_parcel(
47
46
  T0=T0,
48
47
  )
49
48
 
50
- aerosol = AerosolARG(M2_sol=sol2, M2_N=N2, M2_rad=rad2)
49
+ aerosol = AerosolARG(
50
+ M2_sol=sol2, M2_N=N2, M2_rad=rad2, water_molar_volume=const.Mv / const.rho_w
51
+ )
51
52
  n_sd = n_sd_per_mode * len(aerosol.modes)
52
53
 
53
- builder = Builder(backend=CPU(), n_sd=n_sd, environment=env)
54
+ builder = Builder(backend=CPU(formulae), n_sd=n_sd, environment=env)
54
55
  builder.add_dynamic(AmbientThermodynamics())
55
56
  builder.add_dynamic(Condensation())
56
57
  builder.request_attribute("critical supersaturation")
@@ -79,7 +80,6 @@ def run_parcel(
79
80
  attributes["volume"] = builder.formulae.trivia.volume(radius=r_wet)
80
81
 
81
82
  particulator = builder.build(attributes, products=products)
82
- scipy_ode_condensation_solver.patch_particulator(particulator)
83
83
 
84
84
  output = {product.name: [] for product in particulator.products.values()}
85
85
  output_attributes = {
@@ -2,6 +2,7 @@
2
2
  box-environment example based on
3
3
  [Alpert & Knopf 2016 (Atmos. Chem. Phys. 16)](https://doi.org/10.5194/acp-16-2083-2016)
4
4
  """
5
+
5
6
  # pylint: disable=invalid-name
6
7
  from .simulation import Simulation, simulation
7
8
  from .table_1 import Table1
@@ -2,4 +2,5 @@
2
2
  condensation-evaportaion parcel example based on
3
3
  [Arabas and Shima 2017 (Nonlin. Processes Geophys. 24)](https://doi.org/10.5194/npg-24-535-2017)
4
4
  """
5
+
5
6
  # pylint: disable=invalid-name
@@ -28,10 +28,7 @@ class Settings(StratoCumulus):
28
28
  def __init__(
29
29
  self,
30
30
  formulae=None,
31
- rhod_w_max: float = 0.6
32
- * si.metres
33
- / si.seconds
34
- * (si.kilogram / si.metre**3),
31
+ rhod_w_max: float = 0.6 * si.metres / si.seconds * (si.kilogram / si.metre**3),
35
32
  ):
36
33
  super().__init__(formulae or Formulae(), rhod_w_max=rhod_w_max)
37
34
 
@@ -2,6 +2,7 @@
2
2
  box-model and 2D prescribed-flow immersion-freezing examples based on
3
3
  [Arabas et al. 2023](https://arxiv.org/abs/2308.05015)
4
4
  """
5
+
5
6
  from .make_particulator import make_particulator
6
7
  from .plots import make_freezing_spec_plot, make_pdf_plot, make_temperature_plot
7
8
  from .run_simulation import run_simulation
@@ -28,9 +28,11 @@ def make_temperature_plot(data):
28
28
  xy2.plot(
29
29
  datum["t"],
30
30
  np.asarray(datum["qi"]) / qi_unit, # marker='.',
31
- label=f"Monte-Carlo ({labels[v['singular']]})"
32
- if not plotted[v["singular"]]
33
- else "",
31
+ label=(
32
+ f"Monte-Carlo ({labels[v['singular']]})"
33
+ if not plotted[v["singular"]]
34
+ else ""
35
+ ),
34
36
  color=colors[v["singular"]],
35
37
  )
36
38
  plotted[v["singular"]] = True
@@ -1,11 +1,11 @@
1
1
  def label(settings):
2
2
  lbl = str(
3
3
  {
4
- k.replace("condensation_", ""): f"{v:.1e}"
5
- if isinstance(v, float)
6
- else str(v).zfill(2)
7
- if isinstance(v, int)
8
- else v
4
+ k.replace("condensation_", ""): (
5
+ f"{v:.1e}"
6
+ if isinstance(v, float)
7
+ else str(v).zfill(2) if isinstance(v, int) else v
8
+ )
9
9
  for k, v in settings.items()
10
10
  }
11
11
  )
@@ -2,4 +2,5 @@
2
2
  box-model coalescence-only example based on
3
3
  [Berry 1967 (J. Atmos. Sci. 24)](https://doi.org/10.1175/1520-0469(1967)024%3C0688:CDGBC%3E2.0.CO;2)
4
4
  """
5
+
5
6
  # pylint: disable=invalid-name
@@ -1,4 +1,5 @@
1
1
  """
2
2
  collision-only box-model example from [Bieli et al. 2022](https://doi.org/10.1029/2022MS002994)
3
3
  """
4
+
4
5
  # pylint: disable=invalid-name
@@ -2,4 +2,5 @@
2
2
  figures from Bolot et al. 2013 (Atmos. Chem. Phys. 13)
3
3
  https://doi.org/10.5194/acp-13-7903-2013
4
4
  """
5
+
5
6
  # pylint: disable=invalid-name
@@ -2,4 +2,5 @@
2
2
  aerosol distribution from
3
3
  [Ervens and Feingold 2012 (Atmos. Chem. Phys. 12)](https://doi.org/10.5194/acp-12-5807-2012)
4
4
  """
5
+
5
6
  # pylint: disable=invalid-name
@@ -7,8 +7,6 @@ def sampled_ccn_diameter_number_concentration_spectrum(
7
7
  n_sd: int = 11, size_range: tuple = (0.02 * si.um, 2 * si.um)
8
8
  ):
9
9
  return Logarithmic(
10
- spectrum=Lognormal(
11
- s_geom=1.4, m_mode=0.04 * si.um, norm_factor=100 / si.cm**3
12
- ),
10
+ spectrum=Lognormal(s_geom=1.4, m_mode=0.04 * si.um, norm_factor=100 / si.cm**3),
13
11
  size_range=size_range,
14
12
  ).sample(n_sd)
@@ -70,11 +70,13 @@ class Settings:
70
70
 
71
71
  self.starting_amounts = {
72
72
  "moles_"
73
- + k: self.formulae.trivia.volume(self.r_dry)
74
- * self.DRY_RHO
75
- / self.dry_molar_mass
76
- if k in ("N_mIII", "S_VI")
77
- else np.zeros(self.n_sd)
73
+ + k: (
74
+ self.formulae.trivia.volume(self.r_dry)
75
+ * self.DRY_RHO
76
+ / self.dry_molar_mass
77
+ if k in ("N_mIII", "S_VI")
78
+ else np.zeros(self.n_sd)
79
+ )
78
80
  for k in AQUEOUS_COMPOUNDS
79
81
  }
80
82
 
@@ -8,7 +8,9 @@ from PySDM.physics import si
8
8
 
9
9
  @strict
10
10
  class AerosolMarine(DryAerosolMixture):
11
- def __init__(self, Forg: float = 0.2, Acc_N2: float = 134):
11
+ def __init__(
12
+ self, water_molar_volume: float, Forg: float = 0.2, Acc_N2: float = 134
13
+ ):
12
14
  Aitken = {
13
15
  "palmitic": Forg,
14
16
  "(NH4)2SO4": (1 - Forg),
@@ -48,7 +50,7 @@ class AerosolMarine(DryAerosolMixture):
48
50
  self.modes = (
49
51
  {
50
52
  "f_org": 1 - self.f_soluble_volume(Aitken),
51
- "kappa": self.kappa(Aitken),
53
+ "kappa": self.kappa(Aitken, water_molar_volume=water_molar_volume),
52
54
  "nu_org": self.nu_org(Aitken),
53
55
  "spectrum": spectra.Lognormal(
54
56
  norm_factor=226 / si.cm**3, m_mode=19.6 * si.nm, s_geom=1.71
@@ -56,7 +58,9 @@ class AerosolMarine(DryAerosolMixture):
56
58
  },
57
59
  {
58
60
  "f_org": 1 - self.f_soluble_volume(Accumulation),
59
- "kappa": self.kappa(Accumulation),
61
+ "kappa": self.kappa(
62
+ Accumulation, water_molar_volume=water_molar_volume
63
+ ),
60
64
  "nu_org": self.nu_org(Accumulation),
61
65
  "spectrum": spectra.Lognormal(
62
66
  norm_factor=Acc_N2 / si.cm**3, m_mode=69.5 * si.nm, s_geom=1.7
@@ -69,7 +73,9 @@ class AerosolMarine(DryAerosolMixture):
69
73
 
70
74
  @strict
71
75
  class AerosolBoreal(DryAerosolMixture):
72
- def __init__(self, Forg: float = 0.668, Acc_N2: float = 540):
76
+ def __init__(
77
+ self, water_molar_volume: float, Forg: float = 0.668, Acc_N2: float = 540
78
+ ):
73
79
  # note: SOA1 or SOA2 unclear from the paper
74
80
  Aitken = {
75
81
  "SOA1": Forg,
@@ -116,7 +122,7 @@ class AerosolBoreal(DryAerosolMixture):
116
122
  self.modes = (
117
123
  {
118
124
  "f_org": 1 - self.f_soluble_volume(Aitken),
119
- "kappa": self.kappa(Aitken),
125
+ "kappa": self.kappa(Aitken, water_molar_volume=water_molar_volume),
120
126
  "nu_org": self.nu_org(Aitken),
121
127
  "spectrum": spectra.Lognormal(
122
128
  norm_factor=1110 / si.cm**3, m_mode=22.7 * si.nm, s_geom=1.75
@@ -124,7 +130,9 @@ class AerosolBoreal(DryAerosolMixture):
124
130
  },
125
131
  {
126
132
  "f_org": 1 - self.f_soluble_volume(Accumulation),
127
- "kappa": self.kappa(Accumulation),
133
+ "kappa": self.kappa(
134
+ Accumulation, water_molar_volume=water_molar_volume
135
+ ),
128
136
  "nu_org": self.nu_org(Accumulation),
129
137
  "spectrum": spectra.Lognormal(
130
138
  norm_factor=Acc_N2 / si.cm**3,
@@ -139,7 +147,9 @@ class AerosolBoreal(DryAerosolMixture):
139
147
 
140
148
  @strict
141
149
  class AerosolNascent(DryAerosolMixture):
142
- def __init__(self, Acc_Forg: float = 0.3, Acc_N2: float = 30):
150
+ def __init__(
151
+ self, water_molar_volume: float, Acc_Forg: float = 0.3, Acc_N2: float = 30
152
+ ):
143
153
  Ultrafine = {
144
154
  "SOA1": 0.52,
145
155
  "SOA2": 0,
@@ -178,7 +188,7 @@ class AerosolNascent(DryAerosolMixture):
178
188
  self.modes = (
179
189
  {
180
190
  "f_org": 1 - self.f_soluble_volume(Ultrafine),
181
- "kappa": self.kappa(Ultrafine),
191
+ "kappa": self.kappa(Ultrafine, water_molar_volume=water_molar_volume),
182
192
  "nu_org": self.nu_org(Ultrafine),
183
193
  "spectrum": spectra.Lognormal(
184
194
  norm_factor=2000 / si.cm**3, m_mode=11.5 * si.nm, s_geom=1.71
@@ -186,7 +196,9 @@ class AerosolNascent(DryAerosolMixture):
186
196
  },
187
197
  {
188
198
  "f_org": 1 - self.f_soluble_volume(Accumulation),
189
- "kappa": self.kappa(Accumulation),
199
+ "kappa": self.kappa(
200
+ Accumulation, water_molar_volume=water_molar_volume
201
+ ),
190
202
  "nu_org": self.nu_org(Accumulation),
191
203
  "spectrum": spectra.Lognormal(
192
204
  norm_factor=Acc_N2 / si.cm**3, m_mode=100 * si.nm, s_geom=1.70
@@ -19,7 +19,9 @@ class AerosolMarine(DryAerosolMixture):
19
19
  # NMODE = [1 1];
20
20
  # DENSITY = [1.841, 1.78, 1.77, 0.852, 1.5, 2., 2.65, 2.165]; %[gcm-3]
21
21
 
22
- def __init__(self, Forg: float = 0.2, Acc_N2: float = 137):
22
+ def __init__(
23
+ self, water_molar_volume: float, Forg: float = 0.2, Acc_N2: float = 137
24
+ ):
23
25
  Aitken = {
24
26
  "palmitic": Forg,
25
27
  "(NH4)2SO4": (1 - Forg),
@@ -59,7 +61,9 @@ class AerosolMarine(DryAerosolMixture):
59
61
  self.modes = (
60
62
  {
61
63
  "f_org": 1 - self.f_soluble_volume(Aitken),
62
- "kappa": self.kappa(Aitken),
64
+ "kappa": self.kappa(
65
+ mass_fractions=Aitken, water_molar_volume=water_molar_volume
66
+ ),
63
67
  "nu_org": self.nu_org(Aitken),
64
68
  "spectrum": spectra.Lognormal(
65
69
  norm_factor=223 / si.cm**3, m_mode=19.6 * si.nm, s_geom=1.68
@@ -67,7 +71,9 @@ class AerosolMarine(DryAerosolMixture):
67
71
  },
68
72
  {
69
73
  "f_org": 1 - self.f_soluble_volume(Accumulation),
70
- "kappa": self.kappa(Accumulation),
74
+ "kappa": self.kappa(
75
+ mass_fractions=Accumulation, water_molar_volume=water_molar_volume
76
+ ),
71
77
  "nu_org": self.nu_org(Accumulation),
72
78
  "spectrum": spectra.Lognormal(
73
79
  norm_factor=Acc_N2 / si.cm**3, m_mode=69.5 * si.nm, s_geom=1.68
@@ -100,9 +106,11 @@ class AerosolBoreal(DryAerosolMixture):
100
106
  # DENSITY = [1.841, 1.78, 1.77, 1.5, 1.5, 2., 2.65, 2.165]; %[gcm-3]
101
107
  # DENSITY = [1.72, 1.78, 1.77, 1.2, 1.4, 2., 2.65, 2.165]; %[gcm-3]
102
108
 
103
- def __init__(self, Forg: float = 0.668, Acc_N2: float = 540):
104
- # TODO #604: SOA1 or SOA2 unclear from the paper
105
- # TODO #604: CAN'T FIND WHERE NH4NO3 PROPERTIES ARE DEFINED IN ICPM
109
+ def __init__(
110
+ self, water_molar_volume: float, Forg: float = 0.668, Acc_N2: float = 540
111
+ ):
112
+ # TODO #1247: SOA1 or SOA2 unclear from the paper
113
+ # TODO #1247: CAN'T FIND WHERE NH4NO3 PROPERTIES ARE DEFINED IN ICPM
106
114
  INORG_MASS_RATIO = 0.1515 / 0.1559
107
115
  Aitken = {
108
116
  "SOA1": Forg,
@@ -129,8 +137,8 @@ class AerosolBoreal(DryAerosolMixture):
129
137
  * si.gram
130
138
  / si.mole,
131
139
  "NH4NO3": Substance.from_formula("NH4NO3").mass * si.gram / si.mole,
132
- "SOA1": 190 * si.g / si.mole, # TODO #604: 190 OR 200?
133
- "SOA2": 368.4 * si.g / si.mole, # TODO #604: 368.4 OR 200?
140
+ "SOA1": 190 * si.g / si.mole, # TODO #1247: 190 OR 200?
141
+ "SOA2": 368.4 * si.g / si.mole, # TODO #1247: 368.4 OR 200?
134
142
  },
135
143
  densities={
136
144
  "SOA1": 1.2 * si.g / si.cm**3,
@@ -149,7 +157,9 @@ class AerosolBoreal(DryAerosolMixture):
149
157
  self.modes = (
150
158
  {
151
159
  "f_org": 1 - self.f_soluble_volume(Aitken),
152
- "kappa": self.kappa(Aitken),
160
+ "kappa": self.kappa(
161
+ mass_fractions=Aitken, water_molar_volume=water_molar_volume
162
+ ),
153
163
  "nu_org": self.nu_org(Aitken),
154
164
  "spectrum": spectra.Lognormal(
155
165
  norm_factor=1110 / si.cm**3, m_mode=22.65 * si.nm, s_geom=1.75
@@ -157,7 +167,9 @@ class AerosolBoreal(DryAerosolMixture):
157
167
  },
158
168
  {
159
169
  "f_org": 1 - self.f_soluble_volume(Accumulation),
160
- "kappa": self.kappa(Accumulation),
170
+ "kappa": self.kappa(
171
+ mass_fractions=Accumulation, water_molar_volume=water_molar_volume
172
+ ),
161
173
  "nu_org": self.nu_org(Accumulation),
162
174
  "spectrum": spectra.Lognormal(
163
175
  norm_factor=Acc_N2 / si.cm**3,
@@ -184,8 +196,10 @@ class AerosolNascent(DryAerosolMixture):
184
196
 
185
197
  # DENSITY = [1.841, 1.78, 1.77, 1.2, 1.24, 2., 2.65, 2.165]; %[gcm-3]
186
198
 
187
- def __init__(self, Acc_Forg: float = 0.3, Acc_N2: float = 30):
188
- # TODO #604: CAN'T FIND WHEN PHI IS MULTIPLIED FOR KÖHLER B IN ICPM CODE
199
+ def __init__(
200
+ self, water_molar_volume: float, Acc_Forg: float = 0.3, Acc_N2: float = 30
201
+ ):
202
+ # TODO #1247: CAN'T FIND WHEN PHI IS MULTIPLIED FOR KÖHLER B IN ICPM CODE
189
203
  Ultrafine = {
190
204
  "SOA1": 0.52,
191
205
  "SOA2": 0,
@@ -203,8 +217,8 @@ class AerosolNascent(DryAerosolMixture):
203
217
  "(NH4)2SO4": 3,
204
218
  },
205
219
  molar_masses={
206
- "SOA1": 190 * si.g / si.mole, # TODO #604: 190 OR 200?
207
- "SOA2": 368.4 * si.g / si.mole, # TODO #604: 368.4 OR 200?
220
+ "SOA1": 190 * si.g / si.mole, # TODO #1247: 190 OR 200?
221
+ "SOA2": 368.4 * si.g / si.mole, # TODO #1247: 368.4 OR 200?
208
222
  "(NH4)2SO4": Substance.from_formula("(NH4)2SO4").mass
209
223
  * si.gram
210
224
  / si.mole,
@@ -224,7 +238,9 @@ class AerosolNascent(DryAerosolMixture):
224
238
  self.modes = (
225
239
  {
226
240
  "f_org": 1 - self.f_soluble_volume(Ultrafine),
227
- "kappa": self.kappa(Ultrafine),
241
+ "kappa": self.kappa(
242
+ mass_fractions=Ultrafine, water_molar_volume=water_molar_volume
243
+ ),
228
244
  "nu_org": self.nu_org(Ultrafine),
229
245
  "spectrum": spectra.Lognormal(
230
246
  norm_factor=2000 / si.cm**3, m_mode=11.5 * si.nm, s_geom=1.71
@@ -232,7 +248,9 @@ class AerosolNascent(DryAerosolMixture):
232
248
  },
233
249
  {
234
250
  "f_org": 1 - self.f_soluble_volume(Accumulation),
235
- "kappa": self.kappa(Accumulation),
251
+ "kappa": self.kappa(
252
+ mass_fractions=Accumulation, water_molar_volume=water_molar_volume
253
+ ),
236
254
  "nu_org": self.nu_org(Accumulation),
237
255
  "spectrum": spectra.Lognormal(
238
256
  norm_factor=Acc_N2 / si.cm**3, m_mode=100 * si.nm, s_geom=1.703
@@ -2,4 +2,5 @@
2
2
  figure from Merlivat and Nief 1967 (Tellus)
3
3
  https://doi.org/10.3402/tellusa.v19i1.9756
4
4
  """
5
+
5
6
  # pylint: disable=invalid-name
@@ -1,3 +1,4 @@
1
1
  """ based on [Niedermeier et al. 2014](https://doi.org/10.1002/2013GL058684) """
2
+
2
3
  from .settings import Settings
3
4
  from .simulation import Simulation
@@ -68,9 +68,11 @@ class Simulation(BasicSimulation):
68
68
  data[:-1],
69
69
  np.full(
70
70
  settings.in_sampling_n,
71
- data[-1]
72
- if attribute != "multiplicity"
73
- else data[-1] / settings.in_sampling_n,
71
+ (
72
+ data[-1]
73
+ if attribute != "multiplicity"
74
+ else data[-1] / settings.in_sampling_n
75
+ ),
74
76
  ),
75
77
  )
76
78
  )
@@ -2,4 +2,5 @@
2
2
  based on Pierchala et al. 2022 (Geochim. Cosmochim. Acta)
3
3
  https://doi.org/10.1016/j.gca.2022.01.020
4
4
  """
5
+
5
6
  # pylint: disable=invalid-name
@@ -57,11 +57,11 @@ class ProfilePlotter:
57
57
  settings.formulae.trivia.radius(volume=np.asarray(volume)) / si.um,
58
58
  output["products"]["z"],
59
59
  color="magenta" if drop_id < settings.n_sd_per_mode[0] else "blue",
60
- label="mode 1"
61
- if drop_id == 0
62
- else "mode 2"
63
- if drop_id == settings.n_sd_per_mode[0]
64
- else "",
60
+ label=(
61
+ "mode 1"
62
+ if drop_id == 0
63
+ else "mode 2" if drop_id == settings.n_sd_per_mode[0] else ""
64
+ ),
65
65
  )
66
66
  axR.legend(loc="upper right")
67
67
  axR.set_xlabel("Droplet radius [μm]")
@@ -1,9 +1,9 @@
1
1
  from typing import Iterable
2
2
 
3
3
  import numpy as np
4
+ from numdifftools import Derivative
4
5
  from scipy.integrate import solve_ivp
5
6
  from scipy.interpolate import interp1d
6
- from scipy.misc import derivative
7
7
 
8
8
  from PySDM import Formulae
9
9
  from PySDM.dynamics import condensation
@@ -60,8 +60,8 @@ class Settings:
60
60
  self.t_max = t_max
61
61
 
62
62
  t_1 = 600 * si.s
63
- self.rho_times_w = (
64
- lambda t: rho_times_w_1 * np.sin(np.pi * t / t_1) if t < t_1 else 0
63
+ self.rho_times_w = lambda t: (
64
+ rho_times_w_1 * np.sin(np.pi * t / t_1) if t < t_1 else 0
65
65
  )
66
66
  apprx_w1 = rho_times_w_1 / self.formulae.constants.rho_STP
67
67
  self.particle_reservoir_depth = (
@@ -106,9 +106,9 @@ class Settings:
106
106
  water_vapour_mixing_ratio = self.water_vapour_mixing_ratio(
107
107
  z_above_reservoir
108
108
  )
109
- d_water_vapour_mixing_ratio__dz = derivative(
110
- self.water_vapour_mixing_ratio, z_above_reservoir
111
- )
109
+ d_water_vapour_mixing_ratio__dz = Derivative(
110
+ self.water_vapour_mixing_ratio
111
+ )(z_above_reservoir)
112
112
  T = self.formulae.state_variable_triplet.T(
113
113
  rhod[0], self.thd(z_above_reservoir)
114
114
  )
@@ -8,7 +8,7 @@ from PySDM.physics import si
8
8
 
9
9
  @strict
10
10
  class AerosolBetaCaryophylleneDark(DryAerosolMixture):
11
- def __init__(self, Forg: float = 0.8, N: float = 400):
11
+ def __init__(self, water_molar_volume: float, Forg: float = 0.8, N: float = 400):
12
12
  mode = {
13
13
  "(NH4)2SO4": (1 - Forg),
14
14
  "bcary_dark": Forg,
@@ -38,7 +38,9 @@ class AerosolBetaCaryophylleneDark(DryAerosolMixture):
38
38
  self.modes = (
39
39
  {
40
40
  "f_org": 1 - self.f_soluble_volume(mode),
41
- "kappa": self.kappa(mode),
41
+ "kappa": self.kappa(
42
+ mass_fractions=mode, water_molar_volume=water_molar_volume
43
+ ),
42
44
  "nu_org": self.nu_org(mode),
43
45
  "spectrum": spectra.Lognormal(
44
46
  norm_factor=N / si.cm**3, m_mode=50.0 * si.nm, s_geom=1.75
@@ -50,7 +52,7 @@ class AerosolBetaCaryophylleneDark(DryAerosolMixture):
50
52
 
51
53
 
52
54
  class AerosolBetaCaryophylleneLight(DryAerosolMixture):
53
- def __init__(self, Forg: float = 0.8, N: float = 400):
55
+ def __init__(self, water_molar_volume: float, Forg: float = 0.8, N: float = 400):
54
56
  mode = {
55
57
  "(NH4)2SO4": (1 - Forg),
56
58
  "bcary_light": Forg,
@@ -80,7 +82,9 @@ class AerosolBetaCaryophylleneLight(DryAerosolMixture):
80
82
  self.modes = (
81
83
  {
82
84
  "f_org": 1 - self.f_soluble_volume(mode),
83
- "kappa": self.kappa(mode),
85
+ "kappa": self.kappa(
86
+ mass_fractions=mode, water_molar_volume=water_molar_volume
87
+ ),
84
88
  "nu_org": self.nu_org(mode),
85
89
  "spectrum": spectra.Lognormal(
86
90
  norm_factor=N / si.cm**3, m_mode=50.0 * si.nm, s_geom=1.75
@@ -93,7 +97,7 @@ class AerosolBetaCaryophylleneLight(DryAerosolMixture):
93
97
 
94
98
  @strict
95
99
  class AerosolAlphaPineneDark(DryAerosolMixture):
96
- def __init__(self, Forg: float = 0.8, N: float = 400):
100
+ def __init__(self, water_molar_volume: float, Forg: float = 0.8, N: float = 400):
97
101
  mode = {
98
102
  "(NH4)2SO4": (1 - Forg),
99
103
  "apinene_dark": Forg,
@@ -123,7 +127,9 @@ class AerosolAlphaPineneDark(DryAerosolMixture):
123
127
  self.modes = (
124
128
  {
125
129
  "f_org": 1 - self.f_soluble_volume(mode),
126
- "kappa": self.kappa(mode),
130
+ "kappa": self.kappa(
131
+ mass_fractions=mode, water_molar_volume=water_molar_volume
132
+ ),
127
133
  "nu_org": self.nu_org(mode),
128
134
  "spectrum": spectra.Lognormal(
129
135
  norm_factor=N / si.cm**3, m_mode=50.0 * si.nm, s_geom=1.75
@@ -136,7 +142,7 @@ class AerosolAlphaPineneDark(DryAerosolMixture):
136
142
 
137
143
  @strict
138
144
  class AerosolAlphaPineneLight(DryAerosolMixture):
139
- def __init__(self, Forg: float = 0.8, N: float = 400):
145
+ def __init__(self, water_molar_volume: float, Forg: float = 0.8, N: float = 400):
140
146
  mode = {
141
147
  "(NH4)2SO4": (1 - Forg),
142
148
  "apinene_light": Forg,
@@ -166,7 +172,9 @@ class AerosolAlphaPineneLight(DryAerosolMixture):
166
172
  self.modes = (
167
173
  {
168
174
  "f_org": 1 - self.f_soluble_volume(mode),
169
- "kappa": self.kappa(mode),
175
+ "kappa": self.kappa(
176
+ mass_fractions=mode, water_molar_volume=water_molar_volume
177
+ ),
170
178
  "nu_org": self.nu_org(mode),
171
179
  "spectrum": spectra.Lognormal(
172
180
  norm_factor=N / si.cm**3, m_mode=50.0 * si.nm, s_geom=1.75
@@ -2,6 +2,7 @@
2
2
  box-model examples feat. analytic solution for breakup from
3
3
  [Srivastava 1982 (JAS)](https://doi.org/10.1175/1520-0469(1982)039%3C1317:ASMOPC%3E2.0.CO;2)
4
4
  """
5
+
5
6
  from .equations import Equations, EquationsHelpers
6
7
  from .example import (
7
8
  add_to_plot_simulation_results,
@@ -137,10 +137,10 @@ def get_breakup_coalescence_analytic_results(equations, settings, m0, x, x_log):
137
137
 
138
138
  def get_analytic_results(equations, settings, mean_mass, mean_mass_ratio):
139
139
  res = {}
140
- res[
141
- SimProducts.Computed.mean_drop_volume_total_volume_ratio.name
142
- ] = compute_drop_volume_total_volume_ratio(
143
- mean_volume=mean_mass / settings.rho, total_volume=settings.total_volume
140
+ res[SimProducts.Computed.mean_drop_volume_total_volume_ratio.name] = (
141
+ compute_drop_volume_total_volume_ratio(
142
+ mean_volume=mean_mass / settings.rho, total_volume=settings.total_volume
143
+ )
144
144
  )
145
145
  res[SimProducts.PySDM.total_numer.name] = equations.M / mean_mass_ratio
146
146
  return res