-
Notifications
You must be signed in to change notification settings - Fork 24
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
Draft: New beam architecture #383
base: development
Are you sure you want to change the base?
Conversation
BeamDistribution Added BeamDistribution class, with DistributionFunction as baseclass. BeamDistribution handles spatial properties of beam, e.g. geometry, density distribution etc. (these were removed from Beam node). BeamDistribution will allow BeamModels to adress arbitrary level of complexity, from the most complicated 6D integration during observation. Simpler realisation of BeamModels (the currently available ones) can use mehods of the class providing the moments of the distribution: bulk_velocity, temperature, density. SingleRayAttenuator Was made more stand-alone. It now has _transform and _transform_inv attributes which are transforms from and to beam frame. This is to allow simple re-using of SingleRayAttenuator for also "MultiRayAttenuator" BeamDistribuions ThinBeam is a replacement of the current beam model. BeamModels and BeamMaterial changed to work with the ThinBeam model and changes brought by the introduction of the BeamDistribution
removing errors should make the ThinBeam initialisation more user-friendly Adjust beam demos to make them work with the new architecture
Hi @Mateasek, I looked at the output of the FEDASIM code, there neutral density is resolved over excited states. I believe other codes that calculate beam attenuation also output state-resolved neutral density. If only a state-unresolved distribution is supported in Cherab, we run into a data inconsistency problem when the beam attenuation is calculated by the external code with one collisional radiative model (CRM) and the radiation is calculated in Cherab with another CRM. I'm still thinking how the state-resolved distribution of neutrals can be implemented in the |
Hi @vsnever , thanks for the feedback. At the beginning I thought that the beam would have only a single particle species needed for the models to work. You are right, that more advanced models would probably need more beam species. In this case I think we should adopt something similar to the plasma composition and apply it to the beam. We should also implement state resolved model into the atomic model of cherab. Sorting this out only within the beam would be I think a bit dirty. |
For the plasma composition, I think we could restrict ourselves to level resolution for hydrogen and H-like ions, and metastable resolution for other species. This would allow to use metastable-resolved PECs and Einstein coefficients for H and H-like ions, when the population density is calculated by an external code, e.g. EIRENE. That would be a huge step forward, but given the amount of change, do we have enough manpower? |
I was thinking about how to add this new beam architecture in 1.5 without breaking user code and I came up with a possible solution. I think, we should keep the beam properties, now associated with the @property
def divergence_x(self):
if isinstance(self._distribution, ThinBeam):
return self._distribution.divergence_x
raise TypeError("Unable to get 'divergence_x', not a 'ThinBeam'.")
@divergence_x.setter
def divergence_x(self, double value):
if isinstance(self._distribution, ThinBeam):
warnings.warn("Setting beam distribution properties directly through a 'Beam' instance is deprecated and will be removed in the next release. Instead, use the 'BeamDistribution' instance properties.", DeprecationWarning)
self._distribution.divergence_x = value
else:
raise TypeError("Unable to set 'divergence_x', not a 'ThinBeam'.")
@property
def element(self):
return self._distribution.element
@element.setter
def element(self, Element value not None):
warnings.warn("Setting beam distribution properties directly through a 'Beam' instance is deprecated and will be removed in the next release. Instead, use the 'BeamDistribution' instance properties.", DeprecationWarning)
self._distribution.element = value The deprecated The line |
Hi @vsnever , at the end, we will add the new architecture along the old one. The new one will be sitting in I'm not in favour of the name "focal length" in this case . It is something the ion lense in the beam source has, but when you look at the generated beam profile the actual beam waist can be in some distance from the focal point of the lense. The difference depends largely on the source properties as beamlet divergences, focal length, etc. In case of a model which is based on the description of the beam itself I would like to use terms "beam waist" and "beam divergence" which is taken from the Gaussian model. My plan is to add also a model of a beam based on individual bealmlets which will have a focal point into which all the beamlets aim. |
Hi @Mateasek,
I agree it's better, considering that there is also a laser beam in Cherab.
Yes, "beam waist" is better, we should avoid ambiguity. |
This is the work in progress of the new beam architecture (mentioned in #292). There still can be major changes, please use the branch with caution. I wanted to publish it to get it out there so it can be used by pioneers and tested to collect suggestions.
Changes Summary
BeamDistribution
Added BeamDistribution class, with DistributionFunction as baseclass. BeamDistribution handles spatial properties of beam, e.g. geometry, density distribution etc. (these were removed from Beam node). BeamDistribution will allow BeamModels to adress arbitrary level of complexity, from the most complicated 6D integration during observation. Simpler realisation of BeamModels (the currently available ones) can use mehods of the class providing the moments of the distribution: bulk_velocity, temperature, density.
SingleRayAttenuator
Was made more stand-alone. It now has _transform and _transform_inv attributes which are transforms from and to beam frame. This is to allow simple re-using of SingleRayAttenuator for also "MultiRayAttenuator" BeamDistribuions
ThinBeam
is a replacement of the current beam model.
BeamModels and BeamMaterial changed to work with the ThinBeam model and changes brought by the introduction of the BeamDistribution