A quasi-optical beam-tracing code for electron cyclotron waves absorption and current drive in tokamaks
Go to file
Michele Guerini Rocco f82f91bc8d
fix coupling for subsequent beams
In situations when multiple beams are traced, either when allowing
multiple plasma crossings (raytracing.ipass > 0) or the initial polarisation
is mixed (raytracing.ipol == .true.), the couplings of all but the first
beam (with least index_rt) were invalid.

The bug is due to the re-use of the psipol,chipol variables as the beams
are traced sequentially over the beam_loop. For the first beam being
traced the psipol,chipol are correctly initialised to the user-defined
value and the resulting coupling is correct.
However, in each subsequent beam the values were not set to those of the
parent beam (or to the user-defined value in the case of the first X
mode beam), but to those of the previous beams (current index_rt - 1).

This change repurposes the psipv,chipv arrays to store the polarisation
of the parent beams, including the initial user-defined value and makes
plasma_in always use these to compute the coupling.

In addition, in the case the polarisation is not immediately known (i.e.
if raytracing.ipol == .false.), this change postpones the computation of
the Jones vector (ext, eyt) from the launch point, if the magnetic
equilibrium is available, to when the ray actually crosses the
plasma boundary.
The original code, besides being strictly incorrect, can lead to
non-negligible alterations to the coupling. This change also mean:

1. most of the functionality of `set_pol` has been merged with
   `plasma_in`
2. the polarisation is undefined and the Jones vector is set to the
   placeholder value [1, 0] till `plasma_im` is called

Finally, `polarcold` is removed because it's unused.
2024-04-11 18:06:46 +02:00
doc doc: reorganize example input files 2024-02-16 00:38:43 +01:00
scripts Add first draft of Python plotting script 2022-11-13 01:57:09 +01:00
src fix coupling for subsequent beams 2024-04-11 18:06:46 +02: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 tests: replace all gray_params.data with gray.ini 2024-02-09 11:16:21 +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 doc: reorganize example input files 2024-02-16 00:38:43 +01:00
minpack-LICENSE.txt Add License files 2022-11-17 19:42:44 +01:00