|
ASCOT5
|
Module for performing guiding center transformations. More...
#include "offload.h"#include <stdlib.h>#include <stdio.h>#include <math.h>#include "ascot5.h"#include "consts.h"#include "physlib.h"#include "gctransform.h"Go to the source code of this file.
Functions | |
| void | gctransform_setorder (int order) |
| Set the order of the transformation. | |
| void | gctransform_particle2guidingcenter (real mass, real charge, real *B_dB, real r, real phi, real z, real pr, real pphi, real pz, real *R, real *Phi, real *Z, real *ppar, real *mu, real *zeta) |
| Transform particle to guiding center phase space. | |
| void | gctransform_guidingcenter2particle (real mass, real charge, real *B_dB, real R, real Phi, real Z, real ppar, real mu, real zeta, real *r, real *phi, real *z, real *pparprt, real *muprt, real *zetaprt) |
| Transform guiding center to particle phase space. | |
| void | gctransform_pparmuzeta2prpphipz (real mass, real charge, real *B_dB, real phi, real ppar, real mu, real zeta, real *pr, real *pphi, real *pz) |
| Transform particle ppar, mu, and zeta to momentum vector. | |
Variables | |
| static int | GCTRANSFORM_ORDER = 1 |
Module for performing guiding center transformations.
The guiding center transformation is done both ways between particle phase-space [r, phi, z, pr, pphi, pz] and guiding center phase-space [R, Phi, Z, ppar, mu, zeta] to first order (both in spatial and momentum space coordinates).
The guiding genter motion is defined from a basis {bhat, e1, e2}, where bhat is magnetic field unit vector. e1 and e2 are chosen so that e1 = (bhat x z) / |bhat x z| and bhat x e1 = e2. Thus we are assuming that magnetic field is never parallel to z axis.
This module works as follows:
The transformation is relativistic.
Reference: "Guiding-center transformation of the radiation-reaction force in a nonuniform magnetic field", E. Hirvijoki et. al. https://arxiv.org/pdf/1412.1966.pdf
Definition in file gctransform.c.
| void gctransform_setorder | ( | int | order | ) |
Set the order of the transformation.
| order | order which is either zero or one |
Definition at line 62 of file gctransform.c.
| void gctransform_particle2guidingcenter | ( | real | mass, |
| real | charge, | ||
| real * | B_dB, | ||
| real | r, | ||
| real | phi, | ||
| real | z, | ||
| real | pr, | ||
| real | pphi, | ||
| real | pz, | ||
| real * | R, | ||
| real * | Phi, | ||
| real * | Z, | ||
| real * | ppar, | ||
| real * | mu, | ||
| real * | zeta ) |
Transform particle to guiding center phase space.
The transformation is done from coordinates [r, phi, z, pr, pphi, pz] to [R, Phi, Z, ppar, mu, zeta]. If particle is neutral, the transformation will be in zeroth order both in real and momentum space as that transformation is valid when q = 0.
| mass | mass [kg] |
| charge | charge [C] |
| B_dB | gradient of magnetic field vector at particle position |
| r | particle R coordinate [m] |
| phi | particle phi coordinate [rad] |
| z | particle z coordinate [m] |
| pr | particle momentum R component [kg m/s] |
| pphi | particle momentum phi component [kg m/s] |
| pz | particle momentum z component [kg m/s] |
| R | pointer to guiding center R coordinate [m] |
| Phi | pointer to guiding center phi coordinate [rad] |
| Z | pointer to guiding center z coordinate [m] |
| ppar | pointer to guiding center parallel momentum [kg m/s] |
| mu | pointer to guiding center magnetic moment [J/T] |
| zeta | pointer to guiding center gyroangle [rad] |
Definition at line 90 of file gctransform.c.
| void gctransform_guidingcenter2particle | ( | real | mass, |
| real | charge, | ||
| real * | B_dB, | ||
| real | R, | ||
| real | Phi, | ||
| real | Z, | ||
| real | ppar, | ||
| real | mu, | ||
| real | zeta, | ||
| real * | r, | ||
| real * | phi, | ||
| real * | z, | ||
| real * | pparprt, | ||
| real * | muprt, | ||
| real * | zetaprt ) |
Transform guiding center to particle phase space.
The transformation is done from coordinates [R, Phi, Z, ppar, mu] to [r, phi, z, ppar_prt, mu_prt, zeta_prt]. If particle is neutral, the transformation will be in zeroth order both in real and momentum space as that transformation is valid when q = 0.
| mass | mass [kg] |
| charge | charge [C] |
| B_dB | gradient of magnetic field vector at guiding center position |
| R | guiding center R coordinate [m] |
| Phi | guiding center phi coordinate [rad] |
| Z | guiding center z coordinate [m] |
| ppar | guiding center parallel momentum [kg m/s] |
| mu | guiding center magnetic moment [J/T] |
| zeta | guiding center gyroangle [rad] |
| r | pointer to particle R coordinate [m] |
| phi | pointer to particle phi coordinate [rad] |
| z | pointer to particle z coordinate [m] |
| pparprt | pointer to particle parallel momentum [kg m/s] |
| muprt | pointer to particle magnetic moment [J/T] |
| zetaprt | pointer to particle gyroangle [rad] |
Definition at line 329 of file gctransform.c.
| void gctransform_pparmuzeta2prpphipz | ( | real | mass, |
| real | charge, | ||
| real * | B_dB, | ||
| real | phi, | ||
| real | ppar, | ||
| real | mu, | ||
| real | zeta, | ||
| real * | pr, | ||
| real * | pphi, | ||
| real * | pz ) |
Transform particle ppar, mu, and zeta to momentum vector.
The transformation is done from coordinates [R, Phi, Z, ppar, mu] to [r, phi, z, pr, pphi, pz]. The transformation is done to first order.
| mass | mass [kg] |
| charge | charge [C] |
| B_dB | gradient of magnetic field vector at particle position |
| phi | particle phi coordinate [rad] |
| ppar | particle parallel momentum [kg m/s] |
| mu | particle magnetic moment [J/T] |
| zeta | particle gyroangle [rad] |
| pr | pointer to particle momentum R-component [kg m/s] |
| pphi | pointer to particle momentum phi-component [kg m/s] |
| pz | pointer to particle momentum z-component [kg m/s] |
Definition at line 554 of file gctransform.c.
|
static |
Order to which guiding center transformation is done in momentum space.
Definition at line 53 of file gctransform.c.