Native parametric tokamak source#3999
Conversation
paulromano
left a comment
There was a problem hiding this comment.
Great work on this new source class @eepeterson! I know there are a lot of people in the fusion world who will be excited to use this. See my comment below about the radial distribution sampling; once we resolve that, this should be good to merge.
paulromano
left a comment
There was a problem hiding this comment.
@eepeterson I've just made my updated. I've implemented a grid refinement on the radial sampling as proposed. I've also refactored how the radial and poloidal distributions are stored so that we can take advantage of the Tabular class. One other thing that needed fixing (outside the scope of your changes) to make it work well was that Tabular used a linear search over CDF points, which I've changed to use a binary search.
It may be worth re-running some of the test cases from your manuscript just to make sure my changes haven't messed anything up, but I'll leave it up to you! As far as I'm concerned, this PR is good to go.
Description
This PR implements a new type of source based on a common parametric description of a tokamak plasma. A schematic of the tokamak shaping parameters can be seen in the image below where$R_0$ is the major radius, $a$ is the minor radius, $\delta$ is the triangularity, $\kappa$ is the elongation, $\Delta$ is the Shafranov shift, $\tilde{r}$ is the normalized minor radial coordinate $r/a$ , and $\alpha$ is the poloidal angle measured counterclockwise from the outboard midplane.
The parameterization defines the flux surfaces with the following equations:
The total source emission rate,$S_0$ in neutrons / second is given by the integral over the plasma volume of the source emission density $S(R,Z)$ as shown in the equation below.
To sample the plasma conformally and continuously without rejection we want to transform coordinates from$R, Z$ to $r, \alpha$ because the plasma is defined to be on $r \in [0,a] \times \alpha \in [0, 2\pi]$ and the source emission density is a flux function and therefore only a function of $r$ . This means the spatial probability distribution we need to sample from is (assuming axisymmetry so that $\phi$ can be sampled uniformly):
where$R(\tilde{r}, \alpha)$ and $\mathcal{J}(\tilde{r}, \alpha)$ are the major radius and jacobian of the transformation respectively. I won't work through the remainder of the math here, but the algorithm to sample the neutron source site proceeds as follows
Fixes # (issue)
Checklist