ASCOT5
Loading...
Searching...
No Matches
Functions
bbnbi5.c File Reference

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.
 

Detailed Description

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.

Function Documentation

◆ bbnbi_trace_markers()

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.

Parameters
pqpointer to the marker queue containing the initial neutrals
simpointer to the simu struct with initialized data

Definition at line 227 of file bbnbi5.c.

◆ bbnbi_inject_markers()

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.

Parameters
ppointer where generated markers are stored
nprtnumber of markers to be injected or generated
ngeneratednumber of markers that have already been generated
t0time when the injector is turned on
t1time when the injector is turned off
injpointer to injector data
simpointer to the sim struct with initialized data

Definition at line 157 of file bbnbi5.c.

◆ bbnbi_simulate()

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.

Parameters
simpointer to the simulation offload data structure
nprtnumber of markers to be injected
t1time instant when the injector is turned on
t2time instant when the injector is turned off
B_offload_arraypointer to the magnetic field data
plasma_offload_arraypointer to the plasma data
neutral_offload_arraypointer to the neutral data
wall_offload_arraypointer to the wall data
wall_int_offload_arraypointer to the wall int data
asigma_offload_arraypointer to the atomic sigma data
nbi_offload_arraypointer to the nbi data
ppointer to the marker array which is allocated here
diag_offload_arraypointer to the diagnostics data

Definition at line 64 of file bbnbi5.c.