forked from ascot4fusion/ascot5
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnbi.h
More file actions
51 lines (46 loc) · 2.13 KB
/
Copy pathnbi.h
File metadata and controls
51 lines (46 loc) · 2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/**
* @file nbi.h
* @brief Header file for nbi.c
*/
#ifndef NBI_H
#define NBI_H
#include "ascot5.h"
#include "B_field.h"
#include "particle.h"
#include "plasma.h"
#include "random.h"
#include "wall.h"
#define NBI_MAX_DISTANCE 100
/**
* @brief Structure for describing an NBI injector
*/
typedef struct {
int id; /**< Integer identifier for this injector */
int n_beamlet; /**< Number of beamlets in this injector */
real* beamlet_x; /**< X coordinates of beamlets [m] */
real* beamlet_y; /**< Y coordinates of beamlets [m] */
real* beamlet_z; /**< Z coordinates of beamlets [m] */
real* beamlet_dx; /**< X components of beamlet unit direction vectors */
real* beamlet_dy; /**< Y components of beamlet unit direction vectors */
real* beamlet_dz; /**< Z components of beamlet unit direction vectors */
real power; /**< Total power injected [W] */
real energy; /**< Full energy of injected particles [J] */
real efrac[3]; /**< Fractions of full, half and one-third energy */
real div_h; /**< Vertical divergence [radians] */
real div_v; /**< Horizontal divergence [radians] */
real div_halo_frac; /**< Fraction of power in the halo */
real div_halo_h; /**< Horizontal divergence of the halo [radians] */
real div_halo_v; /**< Vertical divergence of the halo [radians] */
int anum; /**< Mass number of injected species */
int znum; /**< Charge number of injected species */
real mass; /**< Mass of injected species */
} nbi_injector;
void nbi_inject(nbi_injector* n, real* x, real* y, real* z, real* vx, real* vy,
real* vz, int* anum, int* znum, real* mass, random_data* rng);
void nbi_ionize(real* xyz, real* vxyz, real time, int* shinethrough, int anum, int znum,
B_field_data* Bdata, plasma_data* plsdata, wall_data* walldata,
random_data* rng);
void nbi_generate(int nprt, real t0, real t1, particle* p, nbi_injector* n,
B_field_data* Bdata, plasma_data* plsdata,
wall_data* walldata, random_data* rng);
#endif