1 #ifndef LOOP_VOLTAGE_HPP
2 #define LOOP_VOLTAGE_HPP
21 template<
class Device,PhiInterpType PIT>
22 KOKKOS_INLINE_FUNCTION
void add_loop_voltage(
const PushControls& push_controls,
const Grid<Device>& grid,
const MagneticField<Device>&
magnetic_field,
const GridFieldPack<Device,PIT>& gfpack,
const Species<Device>& species,
const SimdParticles& part,
const Simd<double>& B_mag,
const Simd<double>& psi,
SimdVector& efield,
SimdGridWeights<Order::One, PIT>& grid_wts){
35 for (
int i_simd = 0; i_simd<SIMD_SIZE; i_simd++){
36 double cmrhoB = species.
c_m*part.
ph.
rho[i_simd]*B_mag[i_simd];
37 double f0_T_ev = species.
eq_temp.value(magnetic_field, psi[i_simd],part.
ph.
r[i_simd],part.
ph.
z[i_simd]);
40 constexpr
double LOOP_VOLTAGE_HIGH_E_LIMIT_FACTOR = 16.0;
43 ((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));
45 if(loop_voltage_on) efield.
phi[i_simd] += loop_voltage[i_simd]/(
TWOPI*part.
ph.
r[i_simd]);
GridField< Device, VarType::Scalar, PIT, TorType::OnePlane, KinType::DriftKin > loop_voltage
Definition: grid_field_pack.hpp:91
KOKKOS_INLINE_FUNCTION void add_loop_voltage(const PushControls &push_controls, const Grid< Device > &grid, const MagneticField< Device > &magnetic_field, const GridFieldPack< Device, PIT > &gfpack, const Species< Device > &species, const SimdParticles &part, const Simd< double > &B_mag, const Simd< double > &psi, SimdVector &efield, SimdGridWeights< Order::One, PIT > &grid_wts)
Definition: loop_voltage.hpp:22
double c_m
c/m
Definition: species.hpp:86
Definition: grid_weights.hpp:73
Definition: push_controls.hpp:9
Definition: magnetic_field.hpp:12
double loop_voltage_psimax
Definition: push_controls.hpp:24
Definition: grid_field_pack.hpp:21
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:83
Simd< double > r
Definition: particles.hpp:18
SimdPhase ph
Definition: particles.hpp:62
Simd< double > phi
Definition: simd.hpp:152
Definition: particles.hpp:61
Simd< double > z
Definition: particles.hpp:19
Simd< double > phi
Definition: particles.hpp:20
Definition: magnetic_field.F90:1
SimdConstants ct
Definition: particles.hpp:63
Definition: species.hpp:75
KOKKOS_INLINE_FUNCTION bool is_in_region_1_or_2(double r, double z, double psi) const
Definition: magnetic_field.tpp:9
Eq::Profile< Device > eq_temp
Definition: species.hpp:132
Simd< double > mu
Definition: particles.hpp:52
constexpr double TWOPI
Definition: constants.hpp:9