XGCa
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
sheath.hpp
Go to the documentation of this file.
1 #ifndef SHEATH_HPP
2 #define SHEATH_HPP
3 #include "push_controls.hpp"
4 #include "species.hpp"
5 #include "neutrals.hpp"
6 #include "heat_diagnostics.hpp"
7 
8 struct SheathVec {
9  double r;
10  double z;
11  double phi;
12 };
13 
14 // Sheath particle class to store particle info if using sheath mode 2
15 template<class Device>
17  public:
18 
19  // Constructor
20  SheathParticles(int n_threads, int sheath_nphi_in, int grid_nwall_in, double *en_max_initial, int n_ptl_in);
21 
22  // Null constructor
24 
25  // Sheath variables
26  int n_ptl;
27 
28  // Sheath mode 2 array
29  Kokkos::View<double***,Kokkos::LayoutRight,Device> en_max;
30  // Arrays of particle properties to track
31  Kokkos::View<int*,Kokkos::LayoutRight,Device> widx;
32  Kokkos::View<int*,Kokkos::LayoutRight,Device> iphi;
33  Kokkos::View<double*,Kokkos::LayoutRight,Device> en_para;
34  Kokkos::View<double*,Kokkos::LayoutRight,Device> en_perp;
35  Kokkos::View<SheathVec*,Kokkos::LayoutRight,Device> ph_back;
36  Kokkos::View<SheathVec*,Kokkos::LayoutRight,Device> ph_out;
37 };
38 
39 
40 // Sheath class
41 template<class Device>
42 class Sheath {
43  public:
44 
45  // Constructor
46  Sheath(const Grid<Device>& grid, const Simulation<Device>& sml);
47 
48  // Null constructor
49  Sheath(){}
50 
51  // Sheath variables
52  Kokkos::View<double**,Kokkos::LayoutRight,Device> pot;
53  Kokkos::View<double***,Kokkos::LayoutRight,Device> lost;
54  Kokkos::View<double***,Kokkos::LayoutRight,Device> ilost;
55 
56  KOKKOS_INLINE_FUNCTION void deposition_diagnostics_and_w1(const Species<Device> &species, const Grid<Device> &grid, const MagneticField<Device> &magnetic_field, const Neutrals<Device> &neutrals, const HeatDiagnostics<Device> &heat_diag, const SimdParticles &old_part,SimdParticles &part, const SimdVector2D& xff, const Simd<int>& iphi, const Simd<double>& en_para, const Simd<double>& en_perp, SimdPhase& new_phase, const Simd<int>& widx, const Simd<bool>& just_left_the_grid, bool update_lost, bool update_ilost, bool update_neutrals, bool update_heat_diag, Simd<double>& dw) const;
57 
58  KOKKOS_INLINE_FUNCTION void save_sheath_ptl_info(const PushControls &push_controls, const Species<Device> &species, const Grid<Device> &grid, const SheathParticles<Device> &sheath_particles, int i_item, const SimdParticles &old_part,SimdParticles &part, const Simd<int>& iphi, const Simd<double>& en_para, const Simd<double>& en_perp, const SimdPhase& new_phase, const Simd<int>& widx, const Simd<bool>& just_left_the_grid) const;
59 
60  KOKKOS_INLINE_FUNCTION void sheath_calculation(const PushControls &push_controls, const Species<Device> &species, const Grid<Device> &grid, const MagneticField<Device> &magnetic_field, const Neutrals<Device> &neutrals, const HeatDiagnostics<Device> &heat_diag, const SheathParticles<Device> &sheath_particles, int i_item, const SimdParticles &old_part,const Simd<bool>& not_in_triangle,SimdParticles &part,SimdGridWeights<Order::One, PIT_GLOBAL>& grid_wts_new, Simd<double>& dw) const;
61 
62 };
63 
64 #include "sheath.tpp"
65 #endif
Definition: sheath.hpp:8
Definition: heat_diagnostics.hpp:14
Sheath()
Definition: sheath.hpp:49
Kokkos::View< double ***, Kokkos::LayoutRight, Device > lost
Tracker of particles lost to the sheath.
Definition: sheath.hpp:53
Definition: sml.hpp:8
Kokkos::View< double ***, Kokkos::LayoutRight, Device > en_max
The most energetic particle that hit the wall in a given section.
Definition: sheath.hpp:29
int n_ptl
Number of particles.
Definition: sheath.hpp:26
Definition: grid_weights.hpp:51
Definition: push_controls.hpp:9
Definition: magnetic_field.hpp:12
Definition: grid.hpp:67
double z
Definition: sheath.hpp:10
Kokkos::View< SheathVec *, Kokkos::LayoutRight, Device > ph_back
Track location where particle was returned to.
Definition: sheath.hpp:35
KOKKOS_INLINE_FUNCTION void deposition_diagnostics_and_w1(const Species< Device > &species, const Grid< Device > &grid, const MagneticField< Device > &magnetic_field, const Neutrals< Device > &neutrals, const HeatDiagnostics< Device > &heat_diag, const SimdParticles &old_part, SimdParticles &part, const SimdVector2D &xff, const Simd< int > &iphi, const Simd< double > &en_para, const Simd< double > &en_perp, SimdPhase &new_phase, const Simd< int > &widx, const Simd< bool > &just_left_the_grid, bool update_lost, bool update_ilost, bool update_neutrals, bool update_heat_diag, Simd< double > &dw) const
Definition: sheath.tpp:53
Kokkos::View< double ***, Kokkos::LayoutRight, Device > ilost
Tracker of ions lost to the sheath.
Definition: sheath.hpp:54
KOKKOS_INLINE_FUNCTION void save_sheath_ptl_info(const PushControls &push_controls, const Species< Device > &species, const Grid< Device > &grid, const SheathParticles< Device > &sheath_particles, int i_item, const SimdParticles &old_part, SimdParticles &part, const Simd< int > &iphi, const Simd< double > &en_para, const Simd< double > &en_perp, const SimdPhase &new_phase, const Simd< int > &widx, const Simd< bool > &just_left_the_grid) const
Definition: sheath.tpp:109
KOKKOS_INLINE_FUNCTION void sheath_calculation(const PushControls &push_controls, const Species< Device > &species, const Grid< Device > &grid, const MagneticField< Device > &magnetic_field, const Neutrals< Device > &neutrals, const HeatDiagnostics< Device > &heat_diag, const SheathParticles< Device > &sheath_particles, int i_item, const SimdParticles &old_part, const Simd< bool > &not_in_triangle, SimdParticles &part, SimdGridWeights< Order::One, PIT_GLOBAL > &grid_wts_new, Simd< double > &dw) const
Definition: sheath.tpp:154
Kokkos::View< int *, Kokkos::LayoutRight, Device > iphi
Track which phi segment the particle hit.
Definition: sheath.hpp:32
Definition: sheath.hpp:16
Definition: neutrals.hpp:6
Definition: particles.hpp:58
double phi
Definition: sheath.hpp:11
Kokkos::View< double *, Kokkos::LayoutRight, Device > en_perp
Track perpendicular energy of sheath hit.
Definition: sheath.hpp:34
Definition: magnetic_field.F90:1
Definition: particles.hpp:17
Kokkos::View< SheathVec *, Kokkos::LayoutRight, Device > ph_out
Track location outside the grid.
Definition: sheath.hpp:36
Definition: simd.hpp:139
Kokkos::View< int *, Kokkos::LayoutRight, Device > widx
Track which wall index the particle hit.
Definition: sheath.hpp:31
Definition: sheath.hpp:42
Definition: species.hpp:75
double r
Definition: sheath.hpp:9
SheathParticles()
Definition: sheath.hpp:23
Kokkos::View< double *, Kokkos::LayoutRight, Device > en_para
Track parallel energy of sheath hit.
Definition: sheath.hpp:33
Kokkos::View< double **, Kokkos::LayoutRight, Device > pot
Sheath potential.
Definition: sheath.hpp:52