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 
14 class Diffusion : public Source{
17 
18  public:
19 
21 
23  nlr.use_namelist("diff_param");
24  inner_psi_bound = nlr.get<double>("diff_bd_in",magnetic_field.inpsi);
25  outer_psi_bound = nlr.get<double>("diff_bd_out",magnetic_field.outpsi);
26 
27  // Normalize by xpt
28  // Default values are already normalized, so only normalize if not default
29  if(nlr.present("diff_bd_in")) inner_psi_bound *= magnetic_field.equil.xpt_psi;
30  if(nlr.present("diff_bd_out")) outer_psi_bound *= magnetic_field.equil.xpt_psi;
31  }
32 
33 
35  ElectricField<DeviceType>& electric_field,
36  const DomainDecomposition<DeviceType>& pol_decomp, const VelocityGrid& vgrid, Plasma& plasma,
37  const Moments& moments,
40  double dt);
41 };
42 
43 #endif
double inpsi
Boundary condition used in a few spots.
Definition: magnetic_field.hpp:25
T get(const string &param, const T default_val, int val_ind=0)
Definition: NamelistReader.hpp:373
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:1237
Definition: NamelistReader.hpp:193
Definition: magnetic_field.hpp:12
Definition: moments.hpp:13
Definition: electric_field.hpp:39
Equilibrium equil
The object containing information about the magnetic equilibrium.
Definition: magnetic_field.hpp:32
Definition: source.hpp:7
Definition: diffusion.hpp:14
Diffusion(NLReader::NamelistReader &nlr, const MagneticField< DeviceType > &magnetic_field)
Definition: diffusion.hpp:22
double outpsi
Boundary condition used in a few spots.
Definition: magnetic_field.hpp:26
void use_namelist(const string &namelist)
Definition: NamelistReader.hpp:355
double inner_psi_bound
Definition: diffusion.hpp:15
Definition: magnetic_field.F90:1
Definition: plasma.hpp:14
double outer_psi_bound
Definition: diffusion.hpp:16
Diffusion()
Definition: diffusion.hpp:20
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, const Moments &moments, VGridDistribution< HostType > &f0_f, VGridDistribution< HostType > &f0_df0g, VGridDistribution< HostType > &df0g_tmp, double dt)
Definition: diffusion.cpp:615
double xpt_psi
Psi coordinate of 1st X-point.
Definition: equil.hpp:79