|
| 1 | +#pragma once |
| 2 | +#ifndef ADAS_LITHIUM_H |
| 3 | +#define ADAS_LITHIUM_H |
| 4 | + |
| 5 | +#include "adas_reaction.hxx" |
| 6 | + |
| 7 | +#include <array> |
| 8 | +#include <initializer_list> |
| 9 | + |
| 10 | +/// Ionisation energies in eV |
| 11 | +/// from https://www.webelements.com/lithium/atoms.html |
| 12 | +/// Conversion 1 kJ mol‑1 = 1.0364e-2 eV |
| 13 | +/// These are added (removed) from the electron energy during recombination (ionisation) |
| 14 | +constexpr std::array<BoutReal, 3> lithium_ionisation_energy{ |
| 15 | + 5.39, 75.64, 122.45}; |
| 16 | + |
| 17 | +/// The name of the species. This initializer list can be passed to a string |
| 18 | +/// constructor, or used to index into an Options tree. |
| 19 | +/// |
| 20 | +/// li, li+, li+2, ... |
| 21 | +/// |
| 22 | +/// Special cases for level=0, 1 and 3 |
| 23 | +/// |
| 24 | +/// @tparam level The ionisation level: 0 is neutral, 3 is fully stripped. |
| 25 | +template <int level> |
| 26 | +constexpr std::initializer_list<char> lithium_species_name{'l', 'i', '+', '0' + level}; |
| 27 | + |
| 28 | +template <> |
| 29 | +constexpr std::initializer_list<char> lithium_species_name<3>{'l', 'i', '+', '3'}; |
| 30 | + |
| 31 | +template <> |
| 32 | +constexpr std::initializer_list<char> lithium_species_name<1>{'l', 'i', '+'}; |
| 33 | + |
| 34 | +template <> |
| 35 | +constexpr std::initializer_list<char> lithium_species_name<0>{'l', 'i'}; |
| 36 | + |
| 37 | +/// ADAS effective ionisation (ADF11) |
| 38 | +/// |
| 39 | +/// @tparam level The ionisation level of the ion on the left of the reaction |
| 40 | +template <int level> |
| 41 | +struct ADASLithiumIonisation : public OpenADAS { |
| 42 | + ADASLithiumIonisation(std::string, Options& alloptions, Solver*) |
| 43 | + : OpenADAS(alloptions["units"], "scd96_li.json", "plt96_li.json", level, |
| 44 | + -lithium_ionisation_energy[level]) {} |
| 45 | + |
| 46 | + void transform(Options& state) override { |
| 47 | + calculate_rates( |
| 48 | + state["species"]["e"], // Electrons |
| 49 | + state["species"][lithium_species_name<level>], // From this ionisation state |
| 50 | + state["species"][lithium_species_name<level + 1>] // To this state |
| 51 | + ); |
| 52 | + } |
| 53 | +}; |
| 54 | + |
| 55 | +///////////////////////////////////////////////// |
| 56 | + |
| 57 | +/// ADAS effective recombination coefficients (ADF11) |
| 58 | +/// |
| 59 | +/// @tparam level The ionisation level of the ion on the right of the reaction |
| 60 | +template <int level> |
| 61 | +struct ADASLithiumRecombination : public OpenADAS { |
| 62 | + /// @param alloptions The top-level options. Only uses the ["units"] subsection. |
| 63 | + ADASLithiumRecombination(std::string, Options& alloptions, Solver*) |
| 64 | + : OpenADAS(alloptions["units"], "acd96_li.json", "prb96_li.json", level, |
| 65 | + lithium_ionisation_energy[level]) {} |
| 66 | + |
| 67 | + void transform(Options& state) override { |
| 68 | + calculate_rates( |
| 69 | + state["species"]["e"], // Electrons |
| 70 | + state["species"][lithium_species_name<level + 1>], // From this ionisation state |
| 71 | + state["species"][lithium_species_name<level>] // To this state |
| 72 | + ); |
| 73 | + } |
| 74 | +}; |
| 75 | + |
| 76 | +/// @tparam level The ionisation level of the ion on the right of the reaction |
| 77 | +/// @tparam Hisotope The hydrogen isotope ('h', 'd' or 't') |
| 78 | +template <int level, char Hisotope> |
| 79 | +struct ADASLithiumCX : public OpenADASChargeExchange { |
| 80 | + /// @param alloptions The top-level options. Only uses the ["units"] subsection. |
| 81 | + ADASLithiumCX(std::string, Options& alloptions, Solver*) |
| 82 | + : OpenADASChargeExchange(alloptions["units"], "ccd89_li.json", level) {} |
| 83 | + |
| 84 | + void transform(Options& state) override { |
| 85 | + Options& species = state["species"]; |
| 86 | + calculate_rates( |
| 87 | + species["e"], // Electrons |
| 88 | + species[lithium_species_name<level + 1>], // From this ionisation state |
| 89 | + species[{Hisotope}], // and this neutral hydrogen atom |
| 90 | + species[lithium_species_name<level>], // To this state |
| 91 | + species[{Hisotope, '+'}] // and this hydrogen ion |
| 92 | + ); |
| 93 | + } |
| 94 | +}; |
| 95 | + |
| 96 | +namespace { |
| 97 | +// Ionisation by electron-impact |
| 98 | +RegisterComponent<ADASLithiumIonisation<0>> register_ionisation_li0("li + e -> li+ + 2e"); |
| 99 | +RegisterComponent<ADASLithiumIonisation<1>> register_ionisation_li1("li+ + e -> li+2 + 2e"); |
| 100 | +RegisterComponent<ADASLithiumIonisation<2>> register_ionisation_li2("li+2 + e -> li+3 + 2e"); |
| 101 | + |
| 102 | +// Recombination |
| 103 | +RegisterComponent<ADASLithiumRecombination<0>> register_recombination_li0("li+ + e -> li"); |
| 104 | +RegisterComponent<ADASLithiumRecombination<1>> register_recombination_li1("li+2 + e -> li+"); |
| 105 | +RegisterComponent<ADASLithiumRecombination<2>> register_recombination_li2("li+3 + e -> li+2"); |
| 106 | + |
| 107 | +// Charge exchange |
| 108 | +RegisterComponent<ADASLithiumCX<0, 'h'>> register_cx_li0h("li+ + h -> li + h+"); |
| 109 | +RegisterComponent<ADASLithiumCX<1, 'h'>> register_cx_li1h("li+2 + h -> li+ + h+"); |
| 110 | +RegisterComponent<ADASLithiumCX<2, 'h'>> register_cx_li2h("li+3 + h -> li+2 + h+"); |
| 111 | + |
| 112 | +RegisterComponent<ADASLithiumCX<0, 'd'>> register_cx_li0d("li+ + d -> li + d+"); |
| 113 | +RegisterComponent<ADASLithiumCX<1, 'd'>> register_cx_li1d("li+2 + d -> li+ + d+"); |
| 114 | +RegisterComponent<ADASLithiumCX<2, 'd'>> register_cx_li2d("li+3 + d -> li+2 + d+"); |
| 115 | + |
| 116 | +RegisterComponent<ADASLithiumCX<0, 't'>> register_cx_li0t("li+ + t -> li + t+"); |
| 117 | +RegisterComponent<ADASLithiumCX<1, 't'>> register_cx_li1t("li+2 + t -> li+ + t+"); |
| 118 | +RegisterComponent<ADASLithiumCX<2, 't'>> register_cx_li2t("li+3 + t -> li+2 + t+"); |
| 119 | +} // namespace |
| 120 | + |
| 121 | +#endif // ADAS_LITHIUM_H |
0 commit comments