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

Atomic reactions model. More...

#include <stdlib.h>
#include <stdio.h>
#include "../ascot5.h"
#include "../math.h"
#include "../physlib.h"
#include "../consts.h"
#include "../error.h"
#include "../print.h"
#include "../particle.h"
#include "../plasma.h"
#include "../random.h"
#include "../asigma.h"
#include "atomic.h"

Go to the source code of this file.

Functions

a5err atomic_rates (real *rate_eff_ion, real *rate_eff_rec, int z_1, int a_1, real m_1, const int *z_2, const int *a_2, const real *m_2, asigma_data *asigmadata, int q, real E, int N_pls_spec, int N_ntl_spec, real *T, real *T_0, real *n, real *n_0)
 Determines atomic reaction rates.
 
DECLARE_TARGET_SIMD a5err atomic_react (int *q, real dt, real rate_eff_ion, real rate_eff_rec, int z_1, real rnd)
 Determines if an atomic reaction occurs during one time step.
 
void atomic_fo (particle_simd_fo *p, real *h, plasma_data *p_data, neutral_data *n_data, random_data *r_data, asigma_data *asigmadata)
 Determine if atomic reactions occur during time-step and change charge.
 

Detailed Description

Atomic reactions model.

The atomic module models atomic reactions for the simulated test particles. Using atomic reaction data supplied by the asigma (atomicsigma) helper module, reaction probabilities are calculated and tested against a random number. If a reaction occurs, the particle charge state is changed.

The terms ionization and recombination are used loosely in variable names. Ionization (ion) stands for all charge-increasing reactions, and recombination (rec) for all charge-decreasing reactions.

Definition in file atomic.c.

Function Documentation

◆ atomic_rates()

a5err atomic_rates ( real * rate_eff_ion,
real * rate_eff_rec,
int z_1,
int a_1,
real m_1,
const int * z_2,
const int * a_2,
const real * m_2,
asigma_data * asigmadata,
int q,
real E,
int N_pls_spec,
int N_ntl_spec,
real * T,
real * T_0,
real * n,
real * n_0 )

Determines atomic reaction rates.

The reaction rates are determined based on the charge state. The terms "ionization" and "recombination" are used loosely, where "ionization" refers to all charge-increasing reactions, and "recombination" to all charge-decreasing reactions.

Parameters
rate_eff_ionpointer to evaluated reaction rate for ionization
rate_eff_recpointer to evaluated reaction rate for recombination
z_1atomic number of fast particle
a_1atomic mass number of fast particle
m_1mass of fast particle
z_2atomic numbers of bulk particle species
a_2atomic mass numbers of bulk particle species
m_2masses of bulk particle species
asigmadatapointer to atomic data struct
qcharge of fast particle
Eenergy of fast particle
N_pls_specnumber of species in bulk plasma
N_ntl_specnumber of species in bulk neutrals
Ttemperature of bulk plasma species
T_0temperature of bulk neutral species
ndensity of bulk plasma species
n_0density of bulk neutral species
Returns
zero if evaluation succeeded

Definition at line 164 of file atomic.c.

◆ atomic_react()

a5err atomic_react ( int * q,
real dt,
real rate_eff_ion,
real rate_eff_rec,
int z_1,
real rnd )

Determines if an atomic reaction occurs during one time step.

The terms ionization and recombination are used loosely in variable names. Ionization (ion) stands for all charge-increasing reactions, and recombination (rec) for all charge-decreasing reactions.

Parameters
qcharge of fast particle
dttime-step
rate_eff_ionreaction rate for ionization
rate_eff_recreaction rate for recombination
z_1atomic number of fast particle
rndrandom number
Returns
zero if evaluation succeeded

Definition at line 215 of file atomic.c.

◆ atomic_fo()

void atomic_fo ( particle_simd_fo * p,
real * h,
plasma_data * p_data,
neutral_data * n_data,
random_data * r_data,
asigma_data * asigmadata )

Determine if atomic reactions occur during time-step and change charge.

Parameters
pfo struct
htime-steps from NSIMD markers
p_datapointer to plasma data
n_datapointer to neutral data
r_datapointer to random-generator data
asigmadatapointer to atomic reaction data

Definition at line 56 of file atomic.c.