File adas_reaction.hxx#

Defines

ADAS_REACTION_H#

Functions

template<std::size_t N>
constexpr std::string_view to_string_view(const char (&char_array)[N])#

Variables

template<template<int> typename species_name, int level>
constexpr auto izn_component_name_v = izn_component_name<species_name, level>::value#
template<template<int> typename species_name, int level>
constexpr auto rec_component_name_v = rec_component_name<species_name, level>::value#
template<template<int> typename species_name, int level, char isotope>
constexpr auto cx_component_name_v = cx_component_name<species_name, level, isotope>::value#
struct OpenADASRateCoefficient#
#include <adas_reaction.hxx>

Represent a 2D rate coefficient table (T,n) Reads data from a file, then interpolates at required values.

Public Functions

OpenADASRateCoefficient(const std::string &filename, std::size_t level)#

Read the file, extracting data for the given ionisation level

Read and interpolate

OpenADAS rate coefficients

Parts of this code are based on atomic++ by Thomas Body (2017) TBody/atomicpp Copyright (c) 2017 Tom Body That was based on the TBody/atomic1D code, TBody/atomicpp which is in turn based on the cfe316/atomic code cfe316/atomic Copyright (c) 2016 David Wagner wagdav@gmail.com Copyright (c) 2016 Jacob Schwartz jschwart@pppl.gov

Parameters:
  • filename – The file to read. Path relative to run working directory

  • level – The first index in the log coefficient array (ionisation level)

BoutReal evaluate(BoutReal T, BoutReal n)#

Inputs:

Parameters:
  • n – Electron density in m^-3

  • T – Electron temperature in eV

Returns:

rate in units of m^3/s or eV m^3/s

Public Members

std::vector<std::vector<BoutReal>> log_coeff#
std::vector<BoutReal> log_temperature#
std::vector<BoutReal> log_density#
BoutReal Tmin#
BoutReal Tmax#

Range of T [eV].

BoutReal nmin#
BoutReal nmax#

Range of density [m^-3].

struct OpenADAS : public hermes::ReactionBase#
#include <adas_reaction.hxx>

Read in and perform calculations with OpenADAS data https://open.adas.ac.uk/

Uses the JSON files produced by: TBody/OpenADAS_to_JSON

Subclassed by ADASCarbonIonisation< level >, ADASCarbonRecombination< level >, ADASLithiumIonisation< level >, ADASLithiumRecombination< level >, ADASNeonIonisation< level >, ADASNeonRecombination< level >, NamedOpenADAS< T >

Public Functions

inline OpenADAS(std::string name, const Options &units, const std::string &rate_file, const std::string &radiation_file, std::string from_ion, std::string to_ion, std::size_t level, BoutReal electron_heating)#

Inputs

Notes

  • The rate and radiation file names have “json_database/” prepended

Parameters:
  • units – Options tree containing normalisation constants

  • rate_file – A JSON file containing reaction rate <σv> rates (e.g. SCD, ACD)

  • radiation_file – A JSON file containing radiation loss rates (e.g. PLT, PRB)

  • level – The lower ionisation state in the transition e.g. 0 for neutral -> 1st ionisation and 1st -> neutral recombination

  • electron_heating – The heating of the electrons per reaction [eV] This is the ionisation energy, positive for recombination and negative for ionisation

void calculate_rates(GuardedOptions &&electron, GuardedOptions &&from_ion, GuardedOptions &&to_ion)#

Perform the calculation of rates, and transfer of particles/momentum/energy

Parameters:
  • electron – The electron species e.g. state[“species”][“e”]

  • from_ion – The ion on the left of the reaction

  • to_ion – The ion on the right of the reaction

Private Members

OpenADASRateCoefficient rate_coef#

Reaction rate coefficient.

OpenADASRateCoefficient radiation_coef#

Energy loss (radiation) coefficient.

BoutReal electron_heating#

Heating per reaction [eV].

BoutReal Tnorm#
BoutReal Nnorm#
BoutReal FreqNorm#

Normalisations.

struct OpenADASChargeExchange : public hermes::ReactionBase#
#include <adas_reaction.hxx>

Subclassed by ADASCarbonCX< level, Hisotope >, ADASLithiumCX< level, Hisotope >, ADASNeonCX< level, Hisotope >, NamedOpenADASChargeExchange< T >

Public Functions

inline OpenADASChargeExchange(std::string name, const Options &units, const std::string &rate_file, std::string from_A, std::string from_B, std::string to_A, std::string to_B, std::size_t level)#
void calculate_rates(GuardedOptions &&electron, GuardedOptions &&from_A, GuardedOptions &&from_B, GuardedOptions &&to_A, GuardedOptions &&to_B)#

Perform charge exchange

from_A + from_B -> to_A + to_B

from_A and to_A must have the same atomic mass from_B and to_B must have the same atomic mass The charge of from_A + from_B must equal the charge of to_A + to_B

Private Members

OpenADASRateCoefficient rate_coef#

Reaction rate coefficient.

BoutReal Tnorm#
BoutReal Nnorm#
BoutReal FreqNorm#

Normalisations.

template<typename T>
struct NamedOpenADAS : public OpenADAS#
#include <adas_reaction.hxx>

Subclasses of OpenADAS clsses that implements the typeName method via CRTP.

Public Functions

inline virtual std::string typeName() const final#
inline OpenADAS(std::string name, const Options &units, const std::string &rate_file, const std::string &radiation_file, std::string from_ion, std::string to_ion, std::size_t level, BoutReal electron_heating)#

Inputs

Notes

  • The rate and radiation file names have “json_database/” prepended

Parameters:
  • units – Options tree containing normalisation constants

  • rate_file – A JSON file containing reaction rate <σv> rates (e.g. SCD, ACD)

  • radiation_file – A JSON file containing radiation loss rates (e.g. PLT, PRB)

  • level – The lower ionisation state in the transition e.g. 0 for neutral -> 1st ionisation and 1st -> neutral recombination

  • electron_heating – The heating of the electrons per reaction [eV] This is the ionisation energy, positive for recombination and negative for ionisation

template<typename T>
struct NamedOpenADASChargeExchange : public OpenADASChargeExchange#
#include <adas_reaction.hxx>

Public Functions

inline virtual std::string typeName() const final#
inline OpenADASChargeExchange(std::string name, const Options &units, const std::string &rate_file, std::string from_A, std::string from_B, std::string to_A, std::string to_B, std::size_t level)#
template<template<int> typename species_name, int level>
struct izn_component_name#
#include <adas_reaction.hxx>

Public Static Attributes

static constexpr std::string_view reactant = std::string_view(species_name<level>::value)#
static constexpr std::string_view product = std::string_view(species_name<level + 1>::value)#
static constexpr char other_reactants_arr[] = " + e -> "#
static constexpr char other_products_arr[] = " + 2e"#
static constexpr std::string_view other_reactants = to_string_view(other_reactants_arr)#
static constexpr std::string_view other_products = to_string_view(other_products_arr)#
static constexpr std::string_view value = join_v<reactant, other_reactants, product, other_products>#
template<template<int> typename species_name, int level>
struct rec_component_name#
#include <adas_reaction.hxx>

Public Static Attributes

static constexpr std::string_view reactant = std::string_view(species_name<level + 1>::value)#
static constexpr std::string_view product = std::string_view(species_name<level>::value)#
static constexpr char other_reactants_arr[] = " + e -> "#
static constexpr std::string_view other_reactants = to_string_view(other_reactants_arr)#
static constexpr std::string_view value = join_v<reactant, other_reactants, product>#
template<template<int> typename species_name, int level, char isotope>
struct cx_component_name#
#include <adas_reaction.hxx>

Public Static Attributes

static constexpr std::string_view reactant = std::string_view(species_name<level + 1>::value)#
static constexpr std::string_view product = std::string_view(species_name<level>::value)#
static constexpr char other_reactants_arr[] = {' ', '+', ' ', isotope, ' ', '-', '>', ' '}#
static constexpr char other_products_arr[] = {' ', '+', ' ', isotope, '+'}#
static constexpr std::string_view other_reactants = to_string_view(other_reactants_arr)#
static constexpr std::string_view other_products = to_string_view(other_products_arr)#
static constexpr std::string_view value = join_v<reactant, other_reactants, product, other_products>#