Seeding examples for 1D environment of S&H 2012 as well as 2D environment of M&G2007
Update toward solving a subset of goals raised in #1387.
Specifically, I included functionality for selecting cell id, cell origin, and position in cell of the seeded super-droplets (SDs) in Shipway and Hill's (SH2012) kinematic driver environment. For this I had to modify seeding.py, particulator.py, as well as the backend seeding_methods.py files in a way that does not seem to be straightforwardly backward compatible with the parcel model example that @slayoo introduced earlier.
I also made another major assumption: rather than simply using a default value of water mass for the seeded SDs, I update it using the volume attribute derived from the wet, rather than dry, radius of seed SDs at the time of injection. If I use the dry radius, the resulting precipitation is significantly lower. This might be a subtle point that is worth discussing in some detail, even if it is for my own personal clarification.
Here's the .ipynb file containing the full example.
Something looks odd to me in the plot of superdroplet count over time for the seeding vs. no seeding case. Why in the seeding case is the sd count constant at 32 during the seeding interval?
That is due to the int type casting while plotting the mean SD count. I have fixed it now and it looks better here
However, this made me wonder: why are the number of SDs decreasing with time initially even in the no seeding case?
However, this made me wonder: why are the number of SDs decreasing with time initially even in the no seeding case?
This is a good question... I thought it was just precip, but the sd_count is decreasing even before precip onset (and actually faster in the initial time than during the precip period). Is there some spin-up that's happening? I don't know why that wouldn't conserve SDs though.
However, this made me wonder: why are the number of SDs decreasing with time initially even in the no seeding case?
This is a good question... I thought it was just precip, but the sd_count is decreasing even before precip onset (and actually faster in the initial time than during the precip period). Is there some spin-up that's happening? I don't know why that wouldn't conserve SDs though.
I expect it to be caused by the updraft which is only present during the first settings.t_1 seconds (10 minutes). It pushes super droplets beyond the top of the domain.
I expect it to be caused by the updraft which is only present during the first
settings.t_1seconds (10 minutes). It pushes super droplets beyond the top of the domain.
Oh, this totally makes sense. Thanks, Sylwester!
Hi @slayoo and @claresinger, I have committed examples for seeding in both 1D and 2D environments that are compatible with the latest PySDM version. Any comments or criticisms would be much appreciated!
Hi @slayoo , @claresinger and I were discussing a potential issue with the Seeding dynamic as implemented. As you see in this attached plot for 1D seeding ~(it's also the case in the parcel model)~ below, the number of super-droplets does not change as expected. Specifically, when the seeding dynamic is called, instead of adding the seed super-droplets to the existing super-droplet buffer, it adds it to the initial buffer state. When it's done, the number of super-droplets returns to the (decreased) number of super-droplets with the additional seed ones.
I think this is due to the way attributes are initialized in the __call()__ method here: https://github.com/open-atmos/PySDM/blob/07512fe176fd566d0c577d7a0e4324ce2df63991/PySDM/dynamics/seeding.py#L72
Unclear, how tricky the fix might be.
I see your point, @slayoo . I have now removed the update step for cell id etc. but still continue to see the same issue of the whole buffer getting updated when seeding.
I see your point, @slayoo . I have now removed the update step for
cell idetc. but still continue to see the same issue of the whole buffer getting updated when seeding.
I must say, I don't yet understand what you described. How does it show up in the parcel model? In the "hello-world" seeding example (https://github.com/open-atmos/PySDM/blob/main/examples/PySDM_examples/seeding/hello_world.ipynb) we clearly see an increase in SD count.
I must say, I don't yet understand what you described. How does it show up in the parcel model? In the "hello-world" seeding example (https://github.com/open-atmos/PySDM/blob/main/examples/PySDM_examples/seeding/hello_world.ipynb) we clearly see an increase in SD count.
Yes, sorry, this is not an issue in the parcel model (I incorrectly wrote that earlier) since the number of super-droplets does not change between the start of the simulation and the seeding timestep. This assumption does not translate to 1D and 2D where the number of super-droplets decreases as they are pushed outside the domain.
@slayoo I verified the increase in super-droplet count by calculating the total number of super-droplets for each simulation timestep in the 1D example. The count starts at 2336, reduces to 2059 before increasing to 2337 after adding 1 super-droplet. It keeps increasing to 2395 till the end of the seeding period before sharply reverting to 1881.
@slayoo I verified the increase in super-droplet count by calculating the total number of super-droplets for each simulation timestep in the 1D example. The count starts at 2336, reduces to 2059 before increasing to 2337 after adding 1 super-droplet. It keeps increasing to 2395 till the end of the seeding period before sharply reverting to 1881.
@jtbuch Just confirming I've reproduced it locally and I'm trying to figure out what is the origin of these super-droplet-count jumps
@jtbuch, not necessarily related to the sd-count-per-cell issue, but it seems that as of now:
- position attributes of seed droplets are initialised to zeros
- the
Displacementdynamic still advects these particles - as a result these are seeded to the sixth cell (because the first 5 minutes are enough to move them up by six cells)
Likely not intentional. We should probably modify the displacement dynamic to ignore particles with zero multiplicity, and then to set different than zero position attributes to spawn the seed particles where intended.
as for the SD-count jumps, I'm inclined to blame the incompatibility of seeding with the cell_start-computing logic here:
https://github.com/open-atmos/PySDM/blob/36811d9629559f9e990317196130b63de0fd792d/PySDM/backends/impl_numba/methods/collisions_methods.py#L685-L697
We need to start with writing a unit test for multi-cell seeding to isolate the problem within a single step and a simplest possible setup (e.g., two cells, two super droplets, etc) - contributions welcome
Thank you, @claresinger and @slayoo for your helpful review! I will address these now and then respond to some of the major comments that @slayoo raised.
Bumping this thread up for my own reference since I finally have time to start wrapping this project.
