XGCa
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
sheath.hpp
Go to the documentation of this file.
1 #ifndef SHEATH_HPP
2 #define SHEATH_HPP
3 #include "species.hpp"
4 #include "neutrals.hpp"
5 #include "heat_diagnostics.hpp"
6 #include "charge.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(int nphi, int nwall, int nthreads);
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 sheath_calculation1(const Simulation<Device> &sml, const Species<Device> &species, const Grid<Device> &grid, const MagneticField<Device> &magnetic_field, const Charge<Device> &charge, const Neutrals<Device> &neutrals, const HeatDiagnostics<Device> &heat_diag, const SimdParticles &old_part,const Simd<bool>& not_in_triangle,SimdParticles &part,Simd<int>& itrout,SimdGridVec &pout) const;
57 
58  KOKKOS_INLINE_FUNCTION void sheath_calculation2(const Simulation<Device> &sml, const Species<Device> &species, const Grid<Device> &grid, const MagneticField<Device> &magnetic_field, const Charge<Device> &charge, const SheathParticles<Device> &sheath_particles, int i_item, const SimdParticles &old_part,const Simd<bool>& not_in_triangle,SimdParticles &part,Simd<int>& itrout,SimdGridVec &pout) const;
59 
60 };
61 
62 #include "sheath.tpp"
63 #endif
Definition: sheath.hpp:8
Definition: heat_diagnostics.hpp:7
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: magnetic_field.hpp:9
KOKKOS_INLINE_FUNCTION void sheath_calculation2(const Simulation< Device > &sml, const Species< Device > &species, const Grid< Device > &grid, const MagneticField< Device > &magnetic_field, const Charge< Device > &charge, const SheathParticles< Device > &sheath_particles, int i_item, const SimdParticles &old_part, const Simd< bool > &not_in_triangle, SimdParticles &part, Simd< int > &itrout, SimdGridVec &pout) const
Definition: sheath.tpp:210
Definition: grid.hpp:10
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 sheath_calculation1(const Simulation< Device > &sml, const Species< Device > &species, const Grid< Device > &grid, const MagneticField< Device > &magnetic_field, const Charge< Device > &charge, const Neutrals< Device > &neutrals, const HeatDiagnostics< Device > &heat_diag, const SimdParticles &old_part, const Simd< bool > &not_in_triangle, SimdParticles &part, Simd< int > &itrout, SimdGridVec &pout) const
Definition: sheath.tpp:54
Kokkos::View< double ***, Kokkos::LayoutRight, Device > ilost
Tracker of ions lost to the sheath.
Definition: sheath.hpp:54
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:31
Definition: grid_structs.hpp:7
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: simd.hpp:18
Kokkos::View< SheathVec *, Kokkos::LayoutRight, Device > ph_out
Track location outside the grid.
Definition: sheath.hpp:36
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:13
Definition: charge.hpp:9
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