A quasi-optical beam-tracing code for electron cyclotron waves absorption and current drive in tokamaks
Go to file
Michele Guerini Rocco 26976a31dd
src/equilibrium.f90: give the poloidal flux a definition domain
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.
2024-02-09 11:16:17 +01:00
doc Improve documentation build 2022-11-17 19:31:58 +01:00
input rework the analytical model 2023-12-12 23:37:43 +01:00
scripts Add first draft of Python plotting script 2022-11-13 01:57:09 +01:00
src src/equilibrium.f90: give the poloidal flux a definition domain 2024-02-09 11:16:17 +01:00
srcjetto fixed incompatibilities with allocatable arrays (pgf90 compiler, JETTO); fixed input/output scaling (gray/jetto interface); fixed error in read_beams2 for small beam tables 2016-06-01 13:49:35 +00:00
tests add tests 2024-02-09 11:16:17 +01:00
.gitignore add option to set parameters from the command-line 2022-05-11 01:15:07 +02:00
configure fix static compilation on macOS 2024-01-24 14:37:21 +01:00
default.nix add tests 2024-02-09 11:16:17 +01:00
depend depend: fix typo 2023-03-30 11:06:33 +02:00
LICENSE.md Update license 2022-11-18 19:47:50 +01:00
Makefile add tests 2024-02-09 11:16:17 +01:00
minpack-LICENSE.txt Add License files 2022-11-17 19:42:44 +01:00