beam-tracing / Scotty

Beam tracing code for diagnostics
https://scotty.readthedocs.io/en/latest/
GNU General Public License v3.0
7 stars 4 forks source link

Fix `poloidal_flux` for `CircularCrossSection` #68

Closed ZedThree closed 1 year ago

ZedThree commented 2 years ago

For find_B_method = "analytical", circular cross-section geometry, $\psi(R, 0)$ is linear, but so is $B_R(R, 0) \simeq \frac{d\psi}{dR}$.

Instead we need $\psi \simeq \rho^2$ so that the magnetic field components come out linear.

@valerian-chen $\psi$ is the normalised flux, right? So we don't need an extra B_p_a / 2 in there to make B_R etc correct?

Unfortunately, this does change the results a bit, so the golden answer test needs updating.

ZedThree commented 2 years ago

I don't think this is actually the correct fix, and instead we should have $BR = B{pa} Z / (R a \rho)$ which is the derivative of the existing $\psi$ times a scaling factor

valerian-chen commented 2 years ago

The first fix was the one I had in mind. \psi is indeed normalised, so no need for the factor of two.

However, the default density fit needs to be changed such that it's linear in rho (that is, linear in distance in meters from the magnetic axis).

This week has been madly busy, I'll be able to chat next week if you like.

ZedThree commented 1 year ago

Closing this; #74 adds ConstantCurrentDensityField which has the original behaviour, and CircularCrossSectionField has $\psi = \rho / a$ and consistent field components from that.