25#define mccc_coefs_cab(qa, qb, nb, clogab) ( \
26 nb * qa*qa * qb*qb * clogab / ( 4 * CONST_PI * CONST_E0*CONST_E0 ) )
43#define mccc_coefs_Q(ma, qa, mb, qb, nb, vb, clogab, mu0) ( \
44 -mccc_coefs_cab(qa, qb, nb, clogab) * mu0 / ( ma * mb * vb*vb ) )
61#define mccc_coefs_dQ(ma, qa, mb, qb, nb, vb, clogab, dmu0) ( \
62 -mccc_coefs_cab(qa, qb, nb, clogab) * dmu0 / ( ma * mb * vb*vb*vb ) )
80#define mccc_coefs_F(ma, qa, mb, qb, nb, vb, clogab, mu0) ( \
81 -( 1/mb + 1/ma ) * mccc_coefs_cab(qa, qb, nb, clogab) * mu0 \
103#define mccc_coefs_Dpara(ma, qa, va, qb, nb, vb, clogab, mu0) ( \
105 mccc_coefs_cab(qa, qb, nb, clogab) * mu0 / ( 2 * ma*ma * va ) : \
106 mccc_coefs_cab(qa, qb, nb, clogab) * 4 \
107 / ( 6 * CONST_SQRTPI * ma*ma * vb ) )
126#define mccc_coefs_dDpara(ma, qa, va, qb, nb, vb, clogab, mu0, dmu0) ( \
127 mccc_coefs_cab(qa, qb, nb, clogab) * ( dmu0/vb - mu0/va ) \
128 / ( 2 * ma*ma * va ) )
150#define mccc_coefs_Dperp(ma, qa, va, qb, nb, vb, clogab, mu1) ( \
152 mccc_coefs_cab(qa, qb, nb, clogab) * mu1 / ( 2 * ma*ma * va ) : \
153 mccc_coefs_cab(qa, qb, nb, clogab) * 4 \
154 / ( 6 * CONST_SQRTPI * ma*ma * vb ) )
167#define mccc_coefs_K(va, Dpara, dDpara, Q) ( \
168 Q + dDpara + 2*Dpara / va )
180 #define mccc_coefs_nu(va, Dperp) ( \
181 2 * Dperp / ( va * va ) )
195#define mccc_coefs_DX(xi, Dpara, Dperp, gyrofreq) ( \
196 ( 0.5 * ( Dpara - Dperp ) * ( 1 - xi*xi ) + Dperp ) \
197 / (gyrofreq*gyrofreq) )
199GPU_DECLARE_TARGET_SIMD_UNIFORM(mdata)
203GPU_DECLARE_TARGET_SIMD_UNIFORM(nspec, mb, qb, nb, Tb)
235 for(
int i = 0; i < nspec; i++){
236 sum += nb[i] * qb[i] * qb[i] / Tb[i];
243 for(
int i=0; i < nspec; i++){
244 real vbar = va * va + 2 * Tb[i] / mb[i];
245 real mr = ma * mb[i] / ( ma + mb[i] );
250 clogab[i] = log( debyeLength / bcl );
253 clogab[i] = log( debyeLength / bqm );
278 real expm2x = exp(-x*x);
281 mufun[0] = ( erfx - 2 * x * expm2x /
CONST_SQRTPI ) / (x*x);
282 mufun[1] = erfx - 0.5 * mufun[0];
283 mufun[2] = 4 * expm2x /
CONST_SQRTPI - 2 * mufun[0] / x;
Main header file for ASCOT5.
Header file containing physical and mathematical constants.
#define CONST_E0
Electric constant [m^-3*kg^-1*s^4*A^2]
#define CONST_HBAR
Reduced Planck constant [m^2*kg/s]
#define CONST_SQRTPI
sqrt(pi)
Header file for mccc package.
static void mccc_coefs_mufun(real mufun[3], real x, mccc_data *mdata)
Evaluate special functions needed by collision coefficients.
static DECLARE_TARGET_END void mccc_coefs_clog(real *clogab, real ma, real qa, real va, int nspec, const real *mb, const real *qb, const real *nb, const real *Tb)
Evaluate Coulomb logarithm.
Parameters and data required to evaluate Coulomb collisions.