ASCOT5
|
Interface to BBNBI5. More...
#include <getopt.h>
#include <math.h>
#include <omp.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "ascot5.h"
#include "consts.h"
#include "gitver.h"
#include "physlib.h"
#include "print.h"
#include "simulate.h"
#include "endcond.h"
#include "random.h"
#include "particle.h"
#include "suzuki.h"
#include "B_field.h"
#include "plasma.h"
#include "neutral.h"
#include "wall.h"
#include "asigma.h"
#include "nbi.h"
#include "diag.h"
#include "bbnbi5.h"
Go to the source code of this file.
Functions | |
void | bbnbi_trace_markers (particle_queue *pq, sim_data *sim) |
Trace a neutral marker until it has ionized or hit wall. | |
void | bbnbi_inject_markers (particle_state *p, int nprt, int ngenerated, real t0, real t1, nbi_injector *inj, sim_data *sim) |
Inject neutrals from an injector. | |
void | bbnbi_simulate (sim_offload_data *sim, int nprt, real t1, real t2, real *B_offload_array, real *plasma_offload_array, real *neutral_offload_array, real *wall_offload_array, int *wall_int_offload_array, real *asigma_offload_array, real *nbi_offload_array, particle_state **p, real *diag_offload_array) |
Simulate NBI injection. | |
Interface to BBNBI5.
BBNBI5 models neutral beam injectors and is used to evaluate shine-through and beam birth-profile. Neutral markers are generated from injector geometry and traced until they ionize or hit the wall. Several injectors can be modelled simultaneously keeping in mind that in this case the output the injector from which a particle originated is lost.
Definition in file bbnbi5.c.
void bbnbi_trace_markers | ( | particle_queue * | pq, |
sim_data * | sim ) |
Trace a neutral marker until it has ionized or hit wall.
This function is for the most part identical to simulate_fo with few exceptions relevant for BBNBI.
pq | pointer to the marker queue containing the initial neutrals |
sim | pointer to the simu struct with initialized data |
void bbnbi_inject_markers | ( | particle_state * | p, |
int | nprt, | ||
int | ngenerated, | ||
real | t0, | ||
real | t1, | ||
nbi_injector * | inj, | ||
sim_data * | sim ) |
Inject neutrals from an injector.
This function initializes neutral markers at the beamlet positions and launches them in a (random) direction based on the injector specs. The marker is traced until it enters the magnetic field, at which point the particle struct is filled with only the particle data, and the struct is returned.
p | pointer where generated markers are stored |
nprt | number of markers to be injected or generated |
ngenerated | number of markers that have already been generated |
t0 | time when the injector is turned on |
t1 | time when the injector is turned off |
inj | pointer to injector data |
sim | pointer to the sim struct with initialized data |
void bbnbi_simulate | ( | sim_offload_data * | sim, |
int | nprt, | ||
real | t1, | ||
real | t2, | ||
real * | B_offload_array, | ||
real * | plasma_offload_array, | ||
real * | neutral_offload_array, | ||
real * | wall_offload_array, | ||
int * | wall_int_offload_array, | ||
real * | asigma_offload_array, | ||
real * | nbi_offload_array, | ||
particle_state ** | p, | ||
real * | diag_offload_array ) |
Simulate NBI injection.
This function initializes neutrals and traces them until they have ionized or hit the wall.
sim | pointer to the simulation offload data structure |
nprt | number of markers to be injected |
t1 | time instant when the injector is turned on |
t2 | time instant when the injector is turned off |
B_offload_array | pointer to the magnetic field data |
plasma_offload_array | pointer to the plasma data |
neutral_offload_array | pointer to the neutral data |
wall_offload_array | pointer to the wall data |
wall_int_offload_array | pointer to the wall int data |
asigma_offload_array | pointer to the atomic sigma data |
nbi_offload_array | pointer to the nbi data |
p | pointer to the marker array which is allocated here |
diag_offload_array | pointer to the diagnostics data |