All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Go to the documentation of this file.
17 KOKKOS_INLINE_FUNCTION void add_loop_voltage(const PushControls& push_controls, const MagneticField<DeviceType>& magnetic_field, const Species<DeviceType>& species, const SimdParticles& part, const Simd<double>& B_mag, const Simd<double>& psi, SimdVector& efield){
18  for (int i_simd = 0; i_simd<SIMD_SIZE; i_simd++){
19  double cmrhoB = species.c_m*part.ph.rho[i_simd]*B_mag[i_simd];
20  double f0_T_ev = species.eq_temp.value(magnetic_field, psi[i_simd],part.ph.r[i_simd],part.ph.z[i_simd]);
22  // Add loop voltage if particle is within specified psi range and isn't beyond the energy threshold
23  constexpr double LOOP_VOLTAGE_HIGH_E_LIMIT_FACTOR = 16.0;
24  bool loop_voltage_on = (psi[i_simd]<push_controls.loop_voltage_psimax) &&
25  ((part.ct.mu[i_simd]*2.0*B_mag[i_simd] + cmrhoB*cmrhoB*species.mass)*J_2_EV<(LOOP_VOLTAGE_HIGH_E_LIMIT_FACTOR*f0_T_ev));
26  if(loop_voltage_on) efield.phi[i_simd] += push_controls.loop_voltage/(TWOPI*part.ph.r[i_simd]);
27  }
28 }
30 #endif
Definition: simd.hpp:149
double c_m
Definition: species.hpp:85
KOKKOS_INLINE_FUNCTION void add_loop_voltage(const PushControls &push_controls, const MagneticField< DeviceType > &magnetic_field, const Species< DeviceType > &species, const SimdParticles &part, const Simd< double > &B_mag, const Simd< double > &psi, SimdVector &efield)
Definition: loop_voltage.hpp:17
Definition: push_controls.hpp:8
Definition: magnetic_field.hpp:12
double loop_voltage_psimax
Definition: push_controls.hpp:22
Simd< double > rho
Definition: particles.hpp:21
constexpr double J_2_EV
Conversion rate J to ev.
Definition: constants.hpp:6
double mass
Particle mass.
Definition: species.hpp:82
Simd< double > r
Definition: particles.hpp:18
SimdPhase ph
Definition: particles.hpp:59
Simd< double > phi
Definition: simd.hpp:152
Definition: particles.hpp:58
Simd< double > z
Definition: particles.hpp:19
Definition: magnetic_field.F90:1
SimdConstants ct
Definition: particles.hpp:60
Definition: species.hpp:74
Eq::Profile< Device > eq_temp
Definition: species.hpp:123
Simd< double > mu
Definition: particles.hpp:52
double loop_voltage
Definition: push_controls.hpp:21
constexpr double TWOPI
Definition: constants.hpp:9