Skip to content
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

DSMC: Add impact ionization #5654

Open
wants to merge 43 commits into
base: development
Choose a base branch
from

Conversation

roelof-groenewald
Copy link
Member

@roelof-groenewald roelof-groenewald commented Feb 11, 2025

This PR extends the work already done by @RemiLehe and @oshapoval in #5524.

Some changes were made to how the ionization process is initialized, for example, the user must now specify the target_species (i.e., the species which undergoes ionization) as well as the product_species. The product species can include the colliding species (for example electron + neutral -> 2 x electron + ion), but does not have to (for example H$^+$ + D -> H$^+$ + D$^+$ + electron).

The test created by @archermarx is now passing (at least early on):
image

Todo:

  • test implementation
  • fix scattering process to conserve momentum
  • clean up code

RemiLehe and others added 30 commits October 10, 2024 16:51
@roelof-groenewald
Copy link
Member Author

At this point the existing DSMC test (as part of the capactive discharge test) succeeds, indicating that the existing DSMC functionality is not broken.

@roelof-groenewald
Copy link
Member Author

roelof-groenewald commented Feb 11, 2025

At present running the capacitive discharge problem while using DSMC for electron-impact ionization, results in a slightly higher average plasma density than the Turner result:
image

@archermarx
Copy link
Contributor

The results on the comparison to the global model look about as good as we were able to get with MCC, so that's good. I'm still curious why we're off from the theory. I can't think of any missing physics that we're not accounting for. Also, it's a bit strange that we get higher densities in DSMC vs MCC, as MCC doesn't permit neutrals to be depleted and should have an overall higher ionization rate.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we extract the max process count into a compile-time constant that the user could specify (i.e. -DWARPX_MAX_SCATTERING_PROCS=10 or the like?) Or set the number much larger than five? While we're doing this PR it would also be good to actually address this in the constructor like the comment says we should.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like a change to template the max number of processes was partly overwritten in this PR. I fixed that now.

Copy link
Contributor

@archermarx archermarx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for getting this close to the finish line! I think this looks pretty good. In the spirit of cleanliness I think it would be good to go ahead and move the process count check to the constructor. I also think it would be worth exploring increasing the max process count (see prev comment), but I don't have a good enough understanding of what the performance implications would be to say. That could perhaps wait for a second PR, however.

@roelof-groenewald
Copy link
Member Author

roelof-groenewald commented Feb 12, 2025

The results on the comparison to the global model look about as good as we were able to get with MCC, so that's good. I'm still curious why we're off from the theory. I can't think of any missing physics that we're not accounting for. Also, it's a bit strange that we get higher densities in DSMC vs MCC, as MCC doesn't permit neutrals to be depleted and should have an overall higher ionization rate.

I'm guessing the reason must be that the electron energy distribution function starts to deviate substantially from a Maxwellian. The theory and simulation seem to match up pretty nicely until the plasma density has increased by ~20%, at that point a sizeable fraction of electrons have been involved in a collision, and therefore likely do not follow a Maxwellian disrtibution anymore. I guess we could check this since we output the electron velocities in during the test. An alternative approach could be to use the electron distribution function at every output to predict the ionization rate over the next diagnostic interval.
In terms of why the DSMC density is higher than the MCC density, I'm not sure either. One possibility is that the binary ion-elastic scattering is causing the neutral gas to heat up a bit leading to a higher ionization rate. I can check this by switching the ion collisions back to MCC.

Update: It does seem like the ion-neutral collisions causes a drift in the ionization rate. Here is what I get if I only use DSMC for the ionization collisions:
image

@roelof-groenewald roelof-groenewald changed the title [WIP] DSMC: Add impact ionization DSMC: Add impact ionization Feb 12, 2025
@archermarx
Copy link
Contributor

archermarx commented Feb 12, 2025

The results on the comparison to the global model look about as good as we were able to get with MCC, so that's good. I'm still curious why we're off from the theory. I can't think of any missing physics that we're not accounting for. Also, it's a bit strange that we get higher densities in DSMC vs MCC, as MCC doesn't permit neutrals to be depleted and should have an overall higher ionization rate.

I'm guessing the reason must be that the electron energy distribution function starts to deviate substantially from a Maxwellian. The theory and simulation seem to match up pretty nicely until the plasma density has increased by ~20%, at that point a sizeable fraction of electrons have been involved in a collision, and therefore likely do not follow a Maxwellian disrtibution anymore. I guess we could check this since we output the electron velocities in during the test. An alternative approach could be to use the electron distribution function at every output to predict the ionization rate over the next diagnostic interval.

That's a nice idea. In that approach, we'd run the simulation to completion, saving electron information at each output step. In the analysis, we'd then compute the empirical ionization rate coefficient (instead of pre-computing it for a Maxwellian over a range of temperatures).

Alternatively, we could add binary e-e collisions to try and thermalize the electrons a bit more (though at ne = 1e14 they'd be pretty infrequent)

In terms of why the DSMC density is higher than the MCC density, I'm not sure either. One possibility is that the binary ion-elastic scattering is causing the neutral gas to heat up a bit leading to a higher ionization rate. I can check this by switching the ion collisions back to MCC.

Update: It does seem like the ion-neutral collisions causes a drift in the ionization rate. Here is what I get if I only use DSMC for the ionization collisions: image

That's interesting, and I'm surprised that the result is so noticeable, but good to see that we can match MCC well if we neglect them.

Copy link
Contributor

@archermarx archermarx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this looks good for now. We agree with the model in early times before any potential deviations from Maxwellian occur. A better test which accounts for that deviation could be added in a followup PR

// TODO: Add a check that the first species is the electron species
// (This should be done for impact ionization with MCC too)
// And add a check that the ionization species has the same mass
// (and a positive charge), compared to the target species
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to handle this in a follow-up PR @roelof-groenewald ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We actually don't need the first part of this anymore (for DSMC at least), but yes, I think we can leave the second part to a follow-up PR.

uy_p2 -= uCOM_y;
uz_p2 -= uCOM_z;

if (mask[i] == int(ScatteringProcessType::IONIZATION)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems redundant: we are already in an else if condition for (mask[i] == int(ScatteringProcessType::IONIZATION))

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added it in as a forward-looking thing since we could add excitation events (or other product producing events). I know we will need to change the higher if condition for this as well in that case, but it would still clearly show where the logic should split.

Copy link
Member

@RemiLehe RemiLehe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR!
Could you modify the documentation in parameters.rst to add ionization to the list of possible dsmc processes, and to add ionization_target_species in the parameters?

Signed-off-by: roelof-groenewald <[email protected]>
@ax3l ax3l self-requested a review February 19, 2025 00:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: collisions Anything related to particle collisions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants