Particle injector for boundary inflow#363
Merged
JamesMcClung merged 59 commits intopsc-code:mainfrom Oct 24, 2025
Merged
Conversation
Closed
Collaborator
Author
|
I'm now thinking |
germasch
approved these changes
Oct 23, 2025
Contributor
germasch
left a comment
There was a problem hiding this comment.
LGTM -- I did go through it commit by commit (and, as usual, nice job breaking it up). Still couldn't say that I followed 100% of it, but I only have two minor concerns:
- The .999 to keep it away from the right boundary. I hit similar issues before in the particle boundary -- I think I used (1 - 1e-6) at that point. I guess neither is likely to cause any noticeable issues, though.
- You templated some injected particle generator class by the number of particles -- I don't think I saw why that's a template arg rather than just a regular argument.
Collaborator
Author
|
What kind of issue, noticeable or not, would you anticipate from the .999? It does have to be in that cell, so 1.0 doesn't work. As for the templated count... yeah, that was just me doing the first thing that came to mind. I already have a note to fix that in the next PR I'll submit. |
the functionality of `Inflow` will be superseded by `InjectorBoundaryInflow`, which will be tested in test_injector_boundary_inflow
redoing inflow
so it "works" in debug mode
edfec0b to
cfd512c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
InjectorBoundaryInflow, an injector (to be passed as theinject_particlesargument ofmakePscIntegrator) that injects particles at a boundary as if from a population of particles just beyond the edge. The injector has the following features:The injector currently has a few limitations, however:
Also note that the injector is not responsible for removing particles that exit the domain. This injector should be paired with a boundary condition of
BND_PRT_OPENthat removes exiting particles, although this functionality does not currently exist.See
test_injector_boundary_inflowfor example uses.