XGC1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
maxwellian.hpp
Go to the documentation of this file.
1 #ifndef MAXWELLIAN_HPP
2 #define MAXWELLIAN_HPP
3 
4 class Maxwellian{
5  double density;
6  double temperature;
8 
9  // Store inverse square root for efficient calculation
10  double anisotropy_inv_sqrt; // Defined such that T = T_para*sqrt(1.0 + T_aniso*T_aniso);
11 
12  public:
13 
14  // Normal Maxwellian
15  Maxwellian(double density_in, double temperature_in)
16  : density(density_in),
17  temperature(temperature_in),
18  parallel_velocity(0.0),
19  anisotropy_inv_sqrt(1.0){}
20 
21  // Maxwellian with a parallel velocity and temperature anisotropy
22  Maxwellian(double density_in, double temperature_in, double parallel_velocity_in, double anisotropy_in)
23  : density(density_in),
24  temperature(temperature_in),
25  parallel_velocity(parallel_velocity_in),
26  anisotropy_inv_sqrt(1.0/sqrt(anisotropy_in)){}
27 
28  // Get distribution function at (vpara, vperp) coordinate
29  KOKKOS_INLINE_FUNCTION double get_f(double vpara, double vperp) const{
30  double vpara_adj = (vpara - parallel_velocity)*anisotropy_inv_sqrt;
31  double energy = 0.5*(vpara_adj*vpara_adj + vperp*vperp);
32  double dist = vperp*density*anisotropy_inv_sqrt/temperature*exp(-energy);
33  return dist;
34  }
35 };
36 
37 #endif
double anisotropy_inv_sqrt
Definition: maxwellian.hpp:10
double temperature
Definition: maxwellian.hpp:6
Definition: maxwellian.hpp:4
double parallel_velocity
Definition: maxwellian.hpp:7
Maxwellian(double density_in, double temperature_in)
Definition: maxwellian.hpp:15
double density
Definition: maxwellian.hpp:5
Maxwellian(double density_in, double temperature_in, double parallel_velocity_in, double anisotropy_in)
Definition: maxwellian.hpp:22
KOKKOS_INLINE_FUNCTION double get_f(double vpara, double vperp) const
Definition: maxwellian.hpp:29