Skip to content

Seeding examples for 1D environment of S&H 2012 as well as 2D environment of M&G2007 #1396

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 55 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
d5ef600
updated with sampling for X direction
jtbuch Apr 19, 2024
7c30823
updated pre-commit hook
jtbuch Apr 19, 2024
49f7d18
pruned branches following pylint
jtbuch Apr 22, 2024
9015069
Merge branch 'open-atmos:main' into main
jtbuch May 13, 2024
5e6fdca
spatial sampling for 2D flows
jtbuch May 20, 2024
0a33e15
seeding example for 1D
jtbuch Oct 3, 2024
da5bb28
added new files for 1D seeding example
jtbuch Oct 3, 2024
6524516
renamed file
jtbuch Oct 3, 2024
8c7da10
merging latest version
jtbuch Oct 8, 2024
abac174
Merge branch 'open-atmos:main' into main
jtbuch Oct 8, 2024
363debf
Merge branch 'main' of https://github.com/jtbuch/PySDM
jtbuch Oct 8, 2024
c3994cb
couple of minor fixes based on Clares comments
jtbuch Oct 8, 2024
c0ec55e
made seeding dynamic compatible with both Parcel and KinematicXD envi…
jtbuch Jan 6, 2025
a421ca8
Merge branch 'open-atmos:main' into main
jtbuch Jan 6, 2025
f274579
removed stray variables in seeding dynamic
jtbuch Jan 6, 2025
d115df9
Merge branch 'open-atmos:main' into main
jtbuch Jan 7, 2025
79c823e
Update bibliography.json
jtbuch Jan 8, 2025
57fde0f
modified seeding routine to account for environment dimensionality
jtbuch Jan 10, 2025
736435a
Merge branch 'main' into main
jtbuch Jan 12, 2025
487cd38
Merge branch 'main' into main
jtbuch Jan 13, 2025
9ac7c1c
Merge branch 'main' into main
jtbuch Jan 16, 2025
b19f0e0
Merge branch 'main' into main
jtbuch Jan 17, 2025
8322e5e
Merge branch 'open-atmos:main' into main
jtbuch May 5, 2025
8f4968d
made 1D seeding compatible with latest PySDM version
May 5, 2025
e16f59d
testing linting fix
May 5, 2025
a78e508
Merge branch 'main' of https://github.com/jtbuch/PySDM
jtbuch May 12, 2025
ffc2fef
Merge branch 'open-atmos:main' into main
jtbuch May 12, 2025
5a8dd9a
Merge branch 'main' of https://github.com/jtbuch/PySDM
jtbuch May 12, 2025
c6453dd
updated precipitation units
jtbuch May 12, 2025
04f4376
linting fix attempt 2
jtbuch May 5, 2025
9757a17
updated description of hello world notebook example for seeding initi…
jtbuch May 13, 2025
080fdd1
initial commit for seeding routine example in 2d environment
jtbuch May 13, 2025
630a252
updated description for seeding_no_collisions.ipynb
jtbuch May 13, 2025
ac1f6e9
Merge branch 'main' of https://github.com/jtbuch/PySDM
jtbuch May 14, 2025
2e7fde1
modified description for SH2012 example to maintain consistency acros…
jtbuch May 14, 2025
c84f844
initialized notebook for piloting seeding dynamic in 2D environments
jtbuch May 14, 2025
02a9c22
set up benchmark case for seeding in 2D environments
jtbuch May 14, 2025
0cf8992
updated bibliography.json for MG2007_seeding.ipynb
jtbuch May 14, 2025
6633a6c
modified description for seeding_no_collisions.ipynb
jtbuch May 14, 2025
206488d
Merge branch 'seeding_2d' of https://github.com/jtbuch/PySDM into see…
jtbuch May 14, 2025
7668e89
fixed version mismatch for SH2012_seeding.ipynb
jtbuch May 14, 2025
6c2674e
updated 1D and 2D seeding scripts
jtbuch Jun 3, 2025
45f54f6
Merge branch 'seeding_2d' of https://github.com/jtbuch/PySDM into see…
jtbuch Jun 3, 2025
1089381
Merge branch 'open-atmos:main' into main
jtbuch Jun 3, 2025
9eb1cfc
successful implementation of seeding dynamic in 2D environment
jtbuch Jun 3, 2025
5bceccf
finished minimal working example of 2D seeding
jtbuch Jun 4, 2025
eb061e9
Merge branch 'main' into seeding_2d
jtbuch Jun 4, 2025
d36c065
Merge pull request #7 from jtbuch/seeding_2d
jtbuch Jun 4, 2025
9582c87
updated references of Szumowski_et_al_1998 to utils/kinematic_2d
jtbuch Jun 4, 2025
fbcec0d
Merge branch 'open-atmos:main' into main
jtbuch Jun 5, 2025
fb95201
Merge branch 'open-atmos:main' into main
jtbuch Jun 19, 2025
5862e33
modified common_seeding.py to remove redundant numpy call
jtbuch Jun 19, 2025
f3b2d24
removed old setter function from particulator.py
jtbuch Jun 19, 2025
220a4ea
removed cell id, cell origin, position in cell, volume attribute updates
jtbuch Jun 19, 2025
8df53d6
Merge branch 'open-atmos:main' into main
jtbuch Jul 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions PySDM/dynamics/seeding.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ def __init__(
seeded_particle_extensive_attributes: dict,
seeded_particle_multiplicity: Sized,
):
for attr in seeded_particle_extensive_attributes.values():
assert len(seeded_particle_multiplicity) == len(attr)
# for attr in seeded_particle_extensive_attributes.values():
# assert len(seeded_particle_multiplicity) == len(attr)
self.particulator = None
self.super_droplet_injection_rate = super_droplet_injection_rate
self.seeded_particle_extensive_attributes = seeded_particle_extensive_attributes
Expand Down
31 changes: 22 additions & 9 deletions PySDM/particulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,15 +469,28 @@ def seeding(
Instead increase multiplicity of injected particles."
)

self.backend.seeding(
idx=self.attributes._ParticleAttributes__idx,
multiplicity=self.attributes["multiplicity"],
extensive_attributes=self.attributes.get_extensive_attribute_storage(),
seeded_particle_index=seeded_particle_index,
seeded_particle_multiplicity=seeded_particle_multiplicity,
seeded_particle_extensive_attributes=seeded_particle_extensive_attributes,
number_of_super_particles_to_inject=number_of_super_particles_to_inject,
)
if self.environment.mesh.n_dims == 0:
self.backend.seeding(
idx=self.attributes._ParticleAttributes__idx,
multiplicity=self.attributes["multiplicity"],
extensive_attributes=self.attributes.get_extensive_attribute_storage(),
seeded_particle_index=seeded_particle_index,
seeded_particle_multiplicity=seeded_particle_multiplicity,
seeded_particle_extensive_attributes=seeded_particle_extensive_attributes,
number_of_super_particles_to_inject=number_of_super_particles_to_inject,
)

else:
self.backend.seeding(
idx=self.attributes._ParticleAttributes__idx,
multiplicity=self.attributes["multiplicity"],
extensive_attributes=self.attributes.get_extensive_attribute_storage(),
seeded_particle_index=seeded_particle_index,
seeded_particle_multiplicity=seeded_particle_multiplicity,
seeded_particle_extensive_attributes=seeded_particle_extensive_attributes,
number_of_super_particles_to_inject=number_of_super_particles_to_inject,
)

self.attributes.reset_idx()
self.attributes.sanitize()

Expand Down
14 changes: 10 additions & 4 deletions docs/bibliography.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@
"examples/docs/pysdm_examples_landing.md",
"examples/PySDM_examples/utils/kinematic_2d/__init__.py",
"examples/PySDM_examples/Morrison_and_Grabowski_2007/__init__.py",
"examples/PySDM_examples/Morrison_and_Grabowski_2007/fig_1.ipynb"
"examples/PySDM_examples/Morrison_and_Grabowski_2007/fig_1.ipynb",
"examples/PySDM_examples/seeding/MG2007_seeding.ipynb"
],
"label": "Morrison & Grabowski 2007 (J. Atmos. Sci. 64)",
"title": "Comparison of Bulk and Bin Warm-Rain Microphysics Models Using a Kinematic Framework"
Expand Down Expand Up @@ -260,7 +261,9 @@
"examples/PySDM_examples/Arabas_et_al_2015/gui.ipynb",
"PySDM/dynamics/displacement.py",
"PySDM/physics/particle_advection/implicit_in_space.py",
"examples/PySDM_examples/utils/kinematic_2d/__init__.py"
"examples/PySDM_examples/seeding/MG2007_seeding.ipynb"
"examples/PySDM_examples/utils/kinematic_2d/__init__.py",
"examples/PySDM_examples/seeding/MG2007_seeding.ipynb"
],
"label": "Arabas et al. 2015 (Geosci. Model Dev. 2015)",
"title": "libcloudph++ 1.0: a single-moment bulk, double-moment bulk, and particle-based warm-rain microphysics library in C++"
Expand Down Expand Up @@ -513,7 +516,8 @@
"examples/docs/pysdm_examples_landing.md",
"examples/PySDM_examples/deJong_Mackay_et_al_2023/figs_10_11_12_13.ipynb",
"examples/PySDM_examples/Shipway_and_Hill_2012/fig_1.ipynb",
"examples/PySDM_examples/Shipway_and_Hill_2012/__init__.py"
"examples/PySDM_examples/Shipway_and_Hill_2012/__init__.py",
"examples/PySDM_examples/seeding/SH2012_seeding.ipynb"
],
"label": "Shipway & Hill 2012 (Q. J. R. Meteorol. Soc. 138)",
"title": "Diagnosis of systematic differences between multiple parametrizations of warm rain microphysics using a kinematic framework"
Expand Down Expand Up @@ -610,7 +614,9 @@
},
"https://doi.org/10.1016/S0169-8095(97)00082-3": {
"usages": [
"examples/PySDM_examples/utils/kinematic_2d/__init__.py"
"examples/PySDM_examples/Szumowski_et_al_1998/__init__.py",
"examples/PySDM_examples/utils/kinematic_2d/__init__.py",
"examples/PySDM_examples/seeding/MG2007_seeding.ipynb"
],
"label": "Szumowski et al. 1998 (Atmos. Res. 45)",
"title": "Simple two-dimensional kinematic framework designed to test warm rain microphysical models"
Expand Down
Loading
Loading