-
Notifications
You must be signed in to change notification settings - Fork 217
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
Particle Manipulators: Init Multi Ion Species #1018
Particle Manipulators: Init Multi Ion Species #1018
Conversation
Great job! ✨ Will you also add a Wiki entry for this subject? |
👍 great. I will have a look if you say its ready. |
@ax3l What is the current status of this pull request? |
as written in the PR description and still without a tick: I did not do a run or compile time test for this PR, but the only thing I changed from my local branch are some namings. |
Btw, I just noticed that the title of the PR seems a bit misleading: |
pls merge me |
2db958b
to
79fbfd2
Compare
@ax3l I will review this pull request. But since you unassigned me 3 month ago: are you OK with that? |
Yes thanks, I think it was just not finished at this point in time.
|
|
||
/* Re-scale the weighting of a cloned species by numberOfProtons | ||
* | ||
* When cloning species from each other, the new |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, you are speaking about a general species
but this manipulator is only useful for electrons. Could you specify species
by saying electron species
here (as in the description of the pull request) in order to clarify the comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I will describe it as an example use case that this is useful for electrons.
@ax3l If I understand your
Is this, what you intended? Or did you wanted to use a
|
Great pull request 👍 @ax3l have you decided what you will do with the following points:
|
I tried to write an actual I think all manipulators have a .def file now. |
I need a some more days to finish the changes and to answer your last question, thx for the review already! |
This commit adds new manipulators that can be used during the species init-pipeline. - `RatioWeightingImpl`: Useful to clone one ion species from an other ion species by still satisfying the densityRatio of the new created species. - `ProtonTimesWeightingImpl`: Useful to clone electron species from an ion species for pre-ionized plasmas. The weighting of the electrons is simply multiplied by the proton number of the initial ion species.
I don't normalize to something like a "total density" since such a quantity is not known to PIConGPU. The only thing known is a reference density defined in /*! alias for particle density ratio
*
* density ratio between default density @see `gasConfig.param` SI::GAS_DENSITY_SI
* and a user defined species
*
* densityRatio is an *optional* flag of a species
*/
alias(densityRatio); If a species defines a Here is an example for PMMA / , having
// [...]
/* ratio relative to GAS_DENSITY for this species */
// electron density ratio is the same as fallback,
// we just like to define reference densities in electron densities
value_identifier(float_X, DensityRatioElectrons, 1.0);
// ions
value_identifier(float_X, DensityRatioCarbon, 5./54.);
value_identifier(float_X, DensityRatioOxygen, 2./54.);
value_identifier(float_X, DensityRatioProton, 8./54.);
typedef bmpl::vector<
// [...]
densityRatio<DensityRatioOxygen>
> ParticleFlagsOxygen;
// [...] Now the situation occurs that one wants to initialize a 2 (or more) ion species. One can now initialize both ions from a gas profile ( While cloning one keeps the number of macro particles per cell constant for both species. To get the new species' weighting, simply calculate back to particleDesSpecies[weighting_] *= densityRatioDes / densityRatioSrc; |
79fbfd2
to
ef47335
Compare
@ax3l Thank you for introducing your intended workflow. The fact that you can initialize based on a gas profile and I missed this line of code, that explained the rescaling to |
ef47335
to
aae709a
Compare
@ax3l Please update the license header of:
|
|
||
/* Adjust the weighting of particleDes by densityRatio of own & Src particle | ||
* | ||
* While cloning a particle (particleDes) from an other (T_SrcParticle), one |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: an other
-> another
see here
thx! |
... and remove unused parameters.
aae709a
to
57cb32a
Compare
Particle Manipulators: Init Multi Ion Species
This commit adds new manipulators that can be used during the species init-pipeline.
RatioWeightingImpl
: Useful to clone one ion species from an other ion species by still satisfying thedensityRatio
of the new created species.ProtonTimesWeightingImpl
: Useful to clone electron species from an ion species for pre-ionized plasmas. The weighting of the electrons is simply multiplied by the proton number of the initial ion species.Example Usage
in
particleConfig.param
:in
speciesInitialization.param
:Alternatively, if
CreateGas
is using a quick/unexpensive functor and one does not care thatMIN_WEIGHTING
might create cells in low-density areas with only some of the three ion species:Note
I did only add the second part of the documentation for the new work-flow in
speciesInitialization.param
(docs init pipeline) yet.Missing part: the
particleConfig.param
(will probably be renamed) does include and select (viatypedef
) theparticles/manipulators/
that are used inspeciesInitialization.param
and is not yet documented (will contain a list + short description of all manipulators before the next release, see #1020).To do
.def
file to each manipulator's.hpp
file -> follow-up PR?