XGC1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
thermal_bath.cpp File Reference

Functions related to thermal bath computations. More...

#include "coarse_graining.hpp"
#include "flux_surface_average.hpp"
#include "toroidal_average.hpp"
#include "thermal_bath.hpp"
Include dependency graph for thermal_bath.cpp:

Functions

template<class Device >
KOKKOS_INLINE_FUNCTION void prepare_bin_information (const Grid< Device > &grid, const MagneticField< Device > &magnetic_field, const Species< Device > &species, const DomainDecomposition< Device > &pol_decomp, const View< double **, CLayout, DeviceType > &bin_f0, const View< double **, CLayout, DeviceType > &bin_df, int i_item, int n_energy, double vmax)
 Computes bin information for particles to be binned on velocity grid. More...
 
template<class Device >
KOKKOS_INLINE_FUNCTION void thermal_bath_for_the_weights (const Grid< Device > &grid, const MagneticField< Device > &magnetic_field, const Species< Device > &species, const DomainDecomposition< Device > &pol_decomp, const ThermalBath &thermal_bath, const View< double **, CLayout, DeviceType > &bin_f0, const View< double **, CLayout, DeviceType > &bin_df, const View< double **, CLayout, DeviceType > &bin_df_den, const View< double **, CLayout, DeviceType > &bin_df_flow, const View< double **, CLayout, DeviceType > &bin_df_energy, const View< double **, CLayout, DeviceType > &bin_df_count, const View< double *, CLayout, DeviceType > &bin_df_countout, int i_item, double rate)
 Updates weights based on heating to maintain a fixed background. More...
 
void normalize_by_volume (const Grid< DeviceType > &grid, const Species< DeviceType > &species, const MagneticField< DeviceType > &magnetic_field, View< double **, CLayout, DeviceType > &density, View< double **, CLayout, DeviceType > &flow, View< double **, CLayout, DeviceType > &energy, View< double **, CLayout, DeviceType > &count)
 Normalizes values by volume. More...
 
void thermal_bath_for_one_species (const Grid< DeviceType > &grid, const MagneticField< DeviceType > &magnetic_field, Plasma &plasma, Species< DeviceType > &species, const DomainDecomposition< DeviceType > &pol_decomp, const ThermalBath &thermal_bath, View< double **, CLayout, DeviceType > &bin_f0, View< double **, CLayout, DeviceType > &bin_df, View< double **, CLayout, DeviceType > &bin_df_den, View< double **, CLayout, DeviceType > &bin_df_flow, View< double **, CLayout, DeviceType > &bin_df_energy, View< double **, CLayout, DeviceType > &bin_df_count, View< double *, CLayout, DeviceType > &bin_df_countout, const double rate)
 Computes thermal bath for one species. More...
 
void thermal_bath_for_all_species (const Grid< DeviceType > &grid, const MagneticField< DeviceType > &magnetic_field, Plasma &plasma, const DomainDecomposition< DeviceType > &pol_decomp, const ThermalBath &thermal_bath, double rate)
 Computes thermal bath for all species. Heat the weights of all non-adiabatic species by [df = df - gamma_k f0 dn/n0. More...
 

Detailed Description

Functions related to thermal bath computations.

Function Documentation

void normalize_by_volume ( const Grid< DeviceType > &  grid,
const Species< DeviceType > &  species,
const MagneticField< DeviceType > &  magnetic_field,
View< double **, CLayout, DeviceType > &  density,
View< double **, CLayout, DeviceType > &  flow,
View< double **, CLayout, DeviceType > &  energy,
View< double **, CLayout, DeviceType > &  count 
)

Normalizes values by volume.

Parameters
gridGrid object.
speciesSpecies object.
magnetic_fieldMagnetic field object.
densityView of density values.
flowView of flow values.
energyView of energy values.
countView of count values.

Here is the caller graph for this function:

template<class Device >
KOKKOS_INLINE_FUNCTION void prepare_bin_information ( const Grid< Device > &  grid,
const MagneticField< Device > &  magnetic_field,
const Species< Device > &  species,
const DomainDecomposition< Device > &  pol_decomp,
const View< double **, CLayout, DeviceType > &  bin_f0,
const View< double **, CLayout, DeviceType > &  bin_df,
int  i_item,
int  n_energy,
double  vmax 
)

Computes bin information for particles to be binned on velocity grid.

Template Parameters
DeviceDevice type.
Parameters
gridGrid object.
magnetic_fieldMagnetic field object.
speciesSpecies object.
pol_decompDomain decomposition object.
bin_f0View of bin f0 values.
bin_dfView of bin df values.
i_itemIndex of particle/vector.
n_energyNumber of energy bins.
vmax_nMaximum normalized velocity.

Here is the call graph for this function:

Here is the caller graph for this function:

void thermal_bath_for_all_species ( const Grid< DeviceType > &  grid,
const MagneticField< DeviceType > &  magnetic_field,
Plasma plasma,
const DomainDecomposition< DeviceType > &  pol_decomp,
const ThermalBath thermal_bath,
double  rate 
)

Computes thermal bath for all species. Heat the weights of all non-adiabatic species by [df = df - gamma_k f0 dn/n0.

Parameters
gridGrid object.
magnetic_fieldMagnetic field object.
plasmaPlasma object.
pol_decompDomain decomposition object.
thermal_bathThermal bath parameters.
rateHeating rate.

Here is the call graph for this function:

Here is the caller graph for this function:

void thermal_bath_for_one_species ( const Grid< DeviceType > &  grid,
const MagneticField< DeviceType > &  magnetic_field,
Plasma plasma,
Species< DeviceType > &  species,
const DomainDecomposition< DeviceType > &  pol_decomp,
const ThermalBath thermal_bath,
View< double **, CLayout, DeviceType > &  bin_f0,
View< double **, CLayout, DeviceType > &  bin_df,
View< double **, CLayout, DeviceType > &  bin_df_den,
View< double **, CLayout, DeviceType > &  bin_df_flow,
View< double **, CLayout, DeviceType > &  bin_df_energy,
View< double **, CLayout, DeviceType > &  bin_df_count,
View< double *, CLayout, DeviceType > &  bin_df_countout,
const double  rate 
)

Computes thermal bath for one species.

Parameters
gridGrid object.
magnetic_fieldMagnetic field object.
plasmaPlasma object.
speciesSpecies object.
pol_decompDomain decomposition object.
thermal_bathThermal bath parameters.
bin_f0View of bin f0 values.
bin_dfView of bin df values.
bin_df_denView of bin df density values.
bin_df_flowView of bin df flow values.
bin_df_energyView of bin df energy values.
bin_df_countView of bin df count values.
bin_df_countoutView of bin df countout values.
rateHeating rate.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class Device >
KOKKOS_INLINE_FUNCTION void thermal_bath_for_the_weights ( const Grid< Device > &  grid,
const MagneticField< Device > &  magnetic_field,
const Species< Device > &  species,
const DomainDecomposition< Device > &  pol_decomp,
const ThermalBath thermal_bath,
const View< double **, CLayout, DeviceType > &  bin_f0,
const View< double **, CLayout, DeviceType > &  bin_df,
const View< double **, CLayout, DeviceType > &  bin_df_den,
const View< double **, CLayout, DeviceType > &  bin_df_flow,
const View< double **, CLayout, DeviceType > &  bin_df_energy,
const View< double **, CLayout, DeviceType > &  bin_df_count,
const View< double *, CLayout, DeviceType > &  bin_df_countout,
int  i_item,
double  rate 
)

Updates weights based on heating to maintain a fixed background.

Template Parameters
DeviceDevice type.
Parameters
gridGrid object.
magnetic_fieldMagnetic field object.
speciesSpecies object.
pol_decompDomain decomposition object.
thermal_bathThermal bath parameters.
bin_f0View of bin f0 values.
bin_dfView of bin df values.
bin_df_denView of bin df density values.
bin_df_flowView of bin df flow values.
bin_df_energyView of bin df energy values.
bin_df_countView of bin df count values.
bin_df_countoutView of bin df countout values.
i_itemIndex of particle/vector.
rateHeating rate.

Here is the call graph for this function:

Here is the caller graph for this function: