A quasi-optical beam-tracing code for electron cyclotron waves absorption and current drive in tokamaks
26976a31dd
This change limits the evaluation of the poloidal flux spline ψ(R,z) to a particular domain where ψ(R,z) is strictly monotonic. This choice ensures that ψ_n < 1 only inside the plasma boundary; so plasma parameters like q(ψ), Te(ψ), etc. can be mapped to the physical space without ambiguities. Before this change, anywhere ψ_n happened to decrease below 1 (either as a result of a physical current or simply from the spline extrapolation), Gray would effectively create a spurious plasma region. This behavior is seriously problematic because it completely invalidates the simulation: it can alter the ray directions, the power disribution and total power if the beam enters one such region. The domain is computed by applying a transformation to the contour of the plasma boundary: for each contour point we cast a ray from the magnetic axis to that point and extend the ray until the restriction of ψ(R,z) on the ray starts decreasing or reach a maximum scaling factor. The endpoint of the ray is then taken as the new point. If ψ(R,z) is globally monotonic, the transformation is a homotety wrt the magnetic axis, so the domain will be an enlarged boundary; otherwise the shape will be more irregular (an intersection of the enlarged boundary and several level curves of ψ). Finally, each `pol_flux(r, z)` call is now guarded behind a check `inside(psi_domain, r, z)`. For points outside the domain the subroutine returns, as usual, -1 for ψ and 0 for derivatives. |
||
---|---|---|
doc | ||
input | ||
scripts | ||
src | ||
srcjetto | ||
tests | ||
.gitignore | ||
configure | ||
default.nix | ||
depend | ||
LICENSE.md | ||
Makefile | ||
minpack-LICENSE.txt |