Comments (15)
I pushed a fix for the bending issue and implemented the divergence. Also BBNBI is now part of the automatic testing which checks that both the beam divergence is correct and the ionization rate based on how the ionized markers are distributed.
The code needs some polishing but you can already try it out in branch https://github.com/ascot4fusion/ascot5/tree/hotfix/48-bbnbi-beam-divergence-and-verification
The divergence angle is exactly as it is defined in the equation I posted, which is the same as in the figure Pietro posted. So if I understood correctly, it should be called "the half-divergence angle"? I can put that graph from the BBNBI paper to the documentation to make it clear.
from ascot5.
Based on the model in the old BBNBI (in ASCOT4), the beam divergence and halo fraction will be implemented as
Here
from ascot5.
Speaking with our DTT NBI design team colleagues, they define halo and core beamlet fractions as in the picture below (numbers are for DTT, obsolete now):
We checked, and this is in agreement with BBNBI definition.
It is important to leave this user-defined parameters:
- halo and core divergences (separately)
- horizontal and vertical divergences
- f, i.e. the power fraction carried by halo
So in total (up to) 5 parameters. For divergences, it would be easy to use the angles corresponding to half of the cones (as it should already be), e.g.:
from ascot5.
Great! We already have all those 5 parameters in the input so this is just a matter of implementing that in the code. Shouldn't be an issue. I will write an algorithm that:
- Draws a random number between [0,1]. If it is smaller than
$f$ (the halo fraction) it will be part of the halo. - Depending on whether the marker is in halo or not, choose the correct values for the divergences.
- Samples the Gaussian distributions to get values for
$\omega_x$ and$\omega_y$ . This is easy since these variables are not correlated.
from ascot5.
@rui-coelho I think I found the reason why the beam bends. The momentum in cylindrical basis was not updated. My bad but luckily this issue is not present in the 5.4 release. And it won't be in 5.5.
from ascot5.
Is it possible to have it fixed in the main ?
from ascot5.
And regarding the definition of the beam divergence, what the Japanese provide as half-divergence angle is the same as in Pietro's figure labeled as "divergence angle" (misleading...). In ASCOT4/old-BBNBI formulae, i'm not so sure if the "divergence" is rather the half divergence angle multiplied by sqrt(2). Dr. Google sent me to some sites on optics and lasers and in all of them it is widely accepted that :
tan(half-divergence angle) = (difference in radii of two beam cross sections along propagating path) / (distance of the two cross sections along propagating path)
And the "radius" of the beam is usually defined as the width at 1/e^2 of the beam intensity. In your definition of the "probability"/power the "radius" of the beam will get 1/e^2 if we use and angle of half-divergence * sqrt(2).
It is thus very important to clarify if:
- For bbnbi5 what we put in the Injector class object is the half-divergence angle or the full one
- For bbnbi5 that "angle" implemented results in a beam "radius" that increases with tan(angle) or tan(angle*sqrt(2))
from ascot5.
and why the factor 1/2 in the gaussian ? In Eq.1 from the paper of Otto it is absent....
from ascot5.
first test with new version shows that the bending is no longer present BUT.....to get the same deposition pattern as the ASCOT4/BBNBI4 run i need to divide the half-divergence by a further sqrt(2) see pictures below
from ascot5.
I had a typo in the equation I posted: it shouldn't be
but
As for the factor of
However, if my reasoning was incorrect and the factor of
from ascot5.
So we just have to define what the exponential should look like and that defines our
from ascot5.
the point is really making sure the definition of half-divergence angle is consistent with the values we are given by the engineers. We need to ensure that they provide is:
- Related to the variation over distance along beam path of the beam "radius"
- This "radius" understood as the 1/e^2 folding of the intensity......or the power. This is a crucial point since if it is power then you square the expression and the exponential gets a factor 2 in the exponent....cancelling the 1/2 you have there...
Your probability gives intensity or power equivalent ?
from ascot5.
Now we have tests for the BBNBI and now I can say with confidence what the divergence is right now.
The top two plots show the vertical and horizontal divergencies. The blue curve is the fraction of particles at each angle, i.e. power (not intensity), and the black curve (and red) is the bi-Gaussian (halo+core) where both have the form:
This means that the divergence that BBNBI5 uses:
- Corresponds to
$1/e$ folding in power. - It is therefore the "half-divergence angle" in engineering language.
Do you guys agree with me? If you want to verify it yourself, just run the BBNBI in this branch (I rebased this on the main so all the other fixes are now here as well).
from ascot5.
so, in theory i should only use the half-divergence angle and NOT apply an additional sqrt(2) ? I just raise this since it is a tricky point when we compare our NBI beams to usual laser beams. In laser beam optics the electric field goes like
E(x,y,z)~e^( - (x^2+y^2)/w(z)^2 ) w=beam "radius", easier to define once we define beam Intensity
Beam "intensity" is defined in W/m^2 and relates to the power in the electric field so
I(x,y,z)~e^( - 2*(x^2+y^2)/w(z)^2 )
So, the beam width (w) at any point of the propagation path (z) is defined as the radius at width the intensity reduces to 1/e^2 of the on-axis value. So, i am tempted to believe we need the 1/sqrt(2) in the divergence if we want to explain the matching curves you provided but please someone prove me wrong otherwise.....
@pietrovincenzi what do you think ?
from ascot5.
Yes right now as the code currently is, you shouldn't apply sqrt(2). Just give the half-divergence as is. Note that this was not the case earlier as I adjusted the definition in the code.
from ascot5.
Related Issues (20)
- BBNBI5 resulting markers and distribution weights don't match HOT 1
- Bug in atomic model HOT 1
- Distributions not properly updated when using adaptive timestep HOT 1
- Alternative definition for Coulomb logarithm
- Stellarator test case and tutorial
- Improve input error detection HOT 2
- ICRH operator
- Serpent-AFSI interface
- Segfault in markergen rhoto5d HOT 1
- Bug in afsi.thermal HOT 9
- Some features to analyse 2D wall loads HOT 4
- No n_phi dependence in afsi_get_volume HOT 3
- Major cleanup of a5py (and some plans for ASCOT5's future) HOT 2
- Restart option for very time consuming jobs HOT 3
- Upgrade to numpy 2.0
- Check convergence of heat load on specific wall flag HOT 3
- Improved hybrid mode
- a5editoptions rejects float values for the distribution charge bin edges
- Recording GO results as GCs (RECORD_MODE=1) results in 1e4 times more particles in the fast ion distribution HOT 1
- Scale markergen to represent all particles
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ascot5.