29#pragma omp declare target
30DECLARE_TARGET_SIMD_UNIFORM(asigma)
33 real* rate_eff_ion,
real* rate_eff_rec,
int z_1,
int a_1,
real m_1,
35 int q,
real E,
int N_pls_spec,
int N_ntl_spec,
real* T,
real* T_0,
38#pragma omp end declare target
72 for(
int i = 0; i <
NSIMD; i++) {
78 p_comps[0] = p->
p_r[i];
79 p_comps[1] = p->
p_phi[i];
80 p_comps[2] = p->
p_z[i];
88 p->
r[i], p->
phi[i], p->
z[i],
96 p->
r[i], p->
phi[i], p->
z[i],
101 p->
r[i], p->
phi[i], p->
z[i],
108 real rate_eff_ion, rate_eff_rec;
111 &rate_eff_ion, &rate_eff_rec, p->
znum[i], p->
anum[i],
112 p->
mass[i], z_2, a_2, m_2, asigmadata,
113 q, E, N_pls_spec, N_ntl_spec, T_2, T_0, n_2, n_0);
120 &q, h[i], rate_eff_ion, rate_eff_rec, p->
znum[i], rnd[i]);
165 real* rate_eff_ion,
real* rate_eff_rec,
int z_1,
int a_1,
real m_1,
166 const int* z_2,
const int* a_2,
const real* m_2,
asigma_data* asigmadata,
167 int q,
real E,
int N_pls_spec,
int N_ntl_spec,
real* T,
real* T_0,
182 &coeff, z_1, a_1, E, m_1, N_ntl_spec, z_2, a_2,
183 T_0[0], n_0, asigmadata);
184 *rate_eff_rec += coeff;
188 &coeff, z_1, a_1, E, m_1, (N_pls_spec-1),
189 z_2, a_2, T[0], &n[1], asigmadata);
190 *rate_eff_ion += coeff * n[0];
224 if(rate_eff_ion == 0.0) {
227 prob_eff_ion = rate_eff_ion/(rate_eff_ion+rate_eff_rec)
228 *(1.0-exp(-(rate_eff_ion+rate_eff_rec)*dt));
230 if(rate_eff_rec == 0.0) {
233 prob_eff_rec = rate_eff_rec/(rate_eff_ion+rate_eff_rec)
234 *(1.0-exp(-(rate_eff_ion+rate_eff_rec)*dt));
238 if(*q < z_1 && rnd < prob_eff_ion) {
240 }
else if(*q > 0 && rnd < (prob_eff_ion+prob_eff_rec)) {
Main header file for ASCOT5.
#define NSIMD
Number of particles simulated simultaneously in a particle group operations.
#define MAX_SPECIES
Maximum number of plasma species.
a5err asigma_eval_cx(real *ratecoeff, int z_1, int a_1, real E, real mass, int nspec, const int *znum, const int *anum, real T_0, real *n_0, asigma_data *asigma_data)
Evaluate charge exchange rate coefficient.
a5err asigma_eval_bms(real *ratecoeff, int z_1, int a_1, real E, real mass, int nion, const int *znum, const int *anum, real T_e, real *n_i, asigma_data *asigma_data)
Evaluate beam stopping rate coefficient.
Header file for asigma.c.
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 *asigma, 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.
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.
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.
Header file for atomic.c.
Header file containing physical and mathematical constants.
#define CONST_E
Elementary charge [C]
unsigned long int a5err
Simulation error flag.
static DECLARE_TARGET_SIMD a5err error_raise(error_type type, int line, error_file file)
Raise a new error.
#define math_norm(a)
Calculate norm of 3D vector a.
int neutral_get_n_species(neutral_data *ndata)
Get the number of neutral species.
a5err neutral_eval_n0(real *n0, real rho, real r, real phi, real z, real t, neutral_data *ndata)
Evaluate neutral density.
a5err neutral_eval_t0(real *t0, real rho, real r, real phi, real z, real t, neutral_data *ndata)
Evaluate neutral temperature.
Header file for particle.c.
Methods to evaluate elementary physical quantities.
#define physlib_Ekin_pnorm(m, p)
Evaluate kinetic energy [J] from momentum norm.
const real * plasma_get_species_mass(plasma_data *pls_data)
Get mass of all plasma species.
const int * plasma_get_species_znum(plasma_data *pls_data)
Get charge number of ion species.
int plasma_get_n_species(plasma_data *pls_data)
Get the number of plasma species.
a5err plasma_eval_densandtemp(real *dens, real *temp, real rho, real r, real phi, real z, real t, plasma_data *pls_data)
Evaluate plasma density and temperature for all species.
const int * plasma_get_species_anum(plasma_data *pls_data)
Get atomic mass number of ion species.
Header file for plasma.c.
Macros for printing console output.
Header file for random.c.
#define random_uniform_simd(data, n, r)
Atomic reaction simulation data.
Struct representing NSIMD particle markers.