XGC1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
diffusion.hpp
Go to the documentation of this file.
1 #ifndef DIFFUSION_HPP
2 #define DIFFUSION_HPP
3 
4 #include "sml.hpp"
5 #include "grid.hpp"
6 #include "magnetic_field.hpp"
7 #include "electric_field.hpp"
9 #include "velocity_grid.hpp"
10 #include "plasma.hpp"
11 #include "vgrid_distribution.hpp"
12 #include "source.hpp"
13 #include "diag_f0_df.hpp"
14 
15 class Diffusion : public Source{
18 
19  public:
20 
22 
24  nlr.use_namelist("diff_param");
25  inner_psi_bound = nlr.get<double>("diff_bd_in",magnetic_field.inpsi);
26  outer_psi_bound = nlr.get<double>("diff_bd_out",magnetic_field.outpsi);
27 
28  // Normalize by xpt
29  // Default values are already normalized, so only normalize if not default
30  if(nlr.present("diff_bd_in")) inner_psi_bound *= magnetic_field.psi_norm();
31  if(nlr.present("diff_bd_out")) outer_psi_bound *= magnetic_field.psi_norm();
32  }
33 
34 
36  ElectricField<DeviceType>& electric_field,
37  const DomainDecomposition<DeviceType>& pol_decomp, const VelocityGrid& vgrid, Plasma& plasma,
38  DiagF0DF& diag_f0_df, const Moments& moments,
41  double dt);
42 };
43 
44 #endif
double inpsi
Boundary condition used in a few spots.
Definition: magnetic_field.hpp:42
T get(const string &param, const T default_val, int val_ind=0)
Definition: NamelistReader.hpp:373
Definition: diag_f0_df.hpp:9
Definition: velocity_grid.hpp:8
Definition: sml.hpp:8
bool present(const string &param)
Definition: NamelistReader.hpp:363
subroutine plasma(grid, itr, p, dene_out, deni_out, Te_out, Ti_out, Vparai_out)
Calculate the plasma density, temperature, and parallel velocity for a point in triangle itr using pl...
Definition: neutral_totalf.F90:1224
Definition: NamelistReader.hpp:193
Definition: magnetic_field.hpp:12
Definition: moments.hpp:13
Definition: electric_field.hpp:42
Definition: source.hpp:7
Definition: diffusion.hpp:15
KOKKOS_INLINE_FUNCTION double psi_norm() const
Definition: magnetic_field.tpp:3
Diffusion(NLReader::NamelistReader &nlr, const MagneticField< DeviceType > &magnetic_field)
Definition: diffusion.hpp:23
double outpsi
Boundary condition used in a few spots.
Definition: magnetic_field.hpp:43
void use_namelist(const string &namelist)
Definition: NamelistReader.hpp:355
double inner_psi_bound
Definition: diffusion.hpp:16
Definition: magnetic_field.F90:1
Definition: plasma.hpp:13
double outer_psi_bound
Definition: diffusion.hpp:17
Diffusion()
Definition: diffusion.hpp:21
void apply(const Simulation< DeviceType > &sml, const Grid< DeviceType > &grid, const MagneticField< DeviceType > &magnetic_field, ElectricField< DeviceType > &electric_field, const DomainDecomposition< DeviceType > &pol_decomp, const VelocityGrid &vgrid, Plasma &plasma, DiagF0DF &diag_f0_df, const Moments &moments, VGridDistribution< HostType > &f0_f, VGridDistribution< HostType > &f0_df0g, VGridDistribution< HostType > &df0g_tmp, double dt)
Definition: diffusion.cpp:565