XGCa
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
basic_physics.hpp
Go to the documentation of this file.
1 #ifndef BASIC_PHYSICS_HPP
2 #define BASIC_PHYSICS_HPP
3 
4 // Kinetic energy
5 // E = (1/2) m v^2
6 KOKKOS_INLINE_FUNCTION double kinetic_energy(double mass, double v){
7  return 0.5*mass*v*v;
8 }
9 
10 // Return equilibrium distribution function
11 // f = (n / sqrt(T^3)) * exp(-E/T)
12 KOKKOS_INLINE_FUNCTION double maxwellian_dist(double den, double temp, double energy){
13  const double EXP_LIM = 64.0;
14  return den/(temp*sqrt(temp))*exp(-min(EXP_LIM,energy/temp));
15 }
16 
17 #endif
KOKKOS_INLINE_FUNCTION double maxwellian_dist(double den, double temp, double energy)
Definition: basic_physics.hpp:12
KOKKOS_INLINE_FUNCTION double kinetic_energy(double mass, double v)
Definition: basic_physics.hpp:6