ASCOT5
|
MHD module for stationary amplitudes (eigenmodes). More...
#include <stdlib.h>
#include "../ascot5.h"
#include "../print.h"
#include "../error.h"
#include "../boozer.h"
#include "../spline/interp.h"
#include "../B_field.h"
#include "../math.h"
#include "../mhd.h"
#include "mhd_stat.h"
Go to the source code of this file.
Functions | |
int | mhd_stat_init (mhd_stat_data *data, int nmode, int nrho, real rhomin, real rhomax, int *moden, int *modem, real *amplitude_nm, real *omega_nm, real *phase_nm, real *alpha, real *phi) |
Load MHD data. | |
void | mhd_stat_free (mhd_stat_data *data) |
Free allocated resources. | |
void | mhd_stat_offload (mhd_stat_data *data) |
Offload data to the accelerator. | |
a5err | mhd_stat_eval (real mhd_dmhd[10], real r, real phi, real z, real t, int includemode, boozer_data *boozerdata, mhd_stat_data *mhddata, B_field_data *Bdata) |
Evaluate the needed quantities from MHD mode for orbit following. | |
a5err | mhd_stat_perturbations (real pert_field[7], real r, real phi, real z, real t, int pertonly, int includemode, boozer_data *boozerdata, mhd_stat_data *mhddata, B_field_data *Bdata) |
Evaluate perturbed fields Btilde, Etilde and potential Phi explicitly. | |
MHD module for stationary amplitudes (eigenmodes).
Definition in file mhd_stat.c.
int mhd_stat_init | ( | mhd_stat_data * | data, |
int | nmode, | ||
int | nrho, | ||
real | rhomin, | ||
real | rhomax, | ||
int * | moden, | ||
int * | modem, | ||
real * | amplitude_nm, | ||
real * | omega_nm, | ||
real * | phase_nm, | ||
real * | alpha, | ||
real * | phi ) |
Load MHD data.
offload_data | pointer to the data struct |
Definition at line 23 of file mhd_stat.c.
void mhd_stat_free | ( | mhd_stat_data * | data | ) |
Free allocated resources.
data | pointer to the data struct |
Definition at line 82 of file mhd_stat.c.
void mhd_stat_offload | ( | mhd_stat_data * | data | ) |
Offload data to the accelerator.
data | pointer to the data struct |
Definition at line 99 of file mhd_stat.c.
a5err mhd_stat_eval | ( | real | mhd_dmhd[10], |
real | r, | ||
real | phi, | ||
real | z, | ||
real | t, | ||
int | includemode, | ||
boozer_data * | boozerdata, | ||
mhd_stat_data * | mhddata, | ||
B_field_data * | Bdata ) |
Evaluate the needed quantities from MHD mode for orbit following.
The quantities to be evaluated are alpha, phi, grad alpha, grad phi, partial t alpha, partial t phi
The values are stored in the given array as:
mhd_dmhd | |
r | R coordinate [m] |
phi | phi coordinate [rad] |
z | z coordinate [m] |
t | time coordinate [s] |
includemode | mode number to include or MHD_INCLUDE_ALL |
boozerdata | pointer to boozer data |
mhddata | pointer to mhd data |
Bdata | pointer to magnetic field data |
Definition at line 133 of file mhd_stat.c.
a5err mhd_stat_perturbations | ( | real | pert_field[7], |
real | r, | ||
real | phi, | ||
real | z, | ||
real | t, | ||
int | pertonly, | ||
int | includemode, | ||
boozer_data * | boozerdata, | ||
mhd_stat_data * | mhddata, | ||
B_field_data * | Bdata ) |
Evaluate perturbed fields Btilde, Etilde and potential Phi explicitly.
The values are stored in the given array as
Only the perturbation values for the magnetic field are returned if pertonly=1, otherwise, the total perturbed field is returned. This is done to avoid double evaluation of the magnetic field e.g. in field line tracing. For electric field only the perturbation component is returned always.
pert_field | perturbation field components |
r | R coordinate [m] |
phi | phi coordinate [rad] |
z | z coordinate [m] |
t | time coordinate [s] |
pertonly | flag whether to return the whole field or only perturbation |
includemode | mode number to include or MHD_INCLUDE_ALL |
boozerdata | pointer to boozer data |
mhddata | pointer to mhd data |
Bdata | pointer to magnetic field data |
Definition at line 258 of file mhd_stat.c.