Skip to content

Commit 5be1525

Browse files
authoredFeb 9, 2024··
Merge pull request #205 from bshanahan/lithium
Add support for Lithium
2 parents 46719f5 + b7902f6 commit 5be1525

11 files changed

+19646
-0
lines changed
 

‎docs/sphinx/components.rst

+51
Original file line numberDiff line numberDiff line change
@@ -1655,6 +1655,57 @@ and `AmjuelHeRecombination10` classes:
16551655
.. doxygenstruct:: AmjuelHeRecombination10
16561656
:members:
16571657

1658+
Lithium
1659+
~~~~~~~
1660+
1661+
These rates are taken from ADAS ('96 and '89)
1662+
1663+
+-----------------------+---------------------------------------+
1664+
| Reaction | Description |
1665+
+=======================+=======================================+
1666+
| li + e -> li+ + 2e | Lithium ionisation |
1667+
+-----------------------+---------------------------------------+
1668+
| li+ + e -> li+2 + 2e | |
1669+
+-----------------------+---------------------------------------+
1670+
| li+2 + e -> li+3 + 2e | |
1671+
+-----------------------+---------------------------------------+
1672+
| li+ + e -> li | Lithium recombination |
1673+
+-----------------------+---------------------------------------+
1674+
| li+2 + e -> li+ | |
1675+
+-----------------------+---------------------------------------+
1676+
| li+3 + e -> li+2 | |
1677+
+-----------------------+---------------------------------------+
1678+
| li+ + h -> li + h+ | Charge exchange with hydrogen |
1679+
+-----------------------+---------------------------------------+
1680+
| li+2 + h -> li+ + h+ | |
1681+
+-----------------------+---------------------------------------+
1682+
| li+3 + h -> li+2 + h+ | |
1683+
+-----------------------+---------------------------------------+
1684+
| li+ + d -> li + d+ | Charge exchange with deuterium |
1685+
+-----------------------+---------------------------------------+
1686+
| li+2 + d -> li+ + d+ | |
1687+
+-----------------------+---------------------------------------+
1688+
| li+3 + d -> li+2 + d+ | |
1689+
+-----------------------+---------------------------------------+
1690+
| li+ + t -> li + t+ | Charge exchange with tritium |
1691+
+-----------------------+---------------------------------------+
1692+
| li+2 + t -> li+ + t+ | |
1693+
+-----------------------+---------------------------------------+
1694+
| li+3 + t -> li+2 + t+ | |
1695+
+-----------------------+---------------------------------------+
1696+
1697+
The implementation of these rates is in `ADASLithiumIonisation`,
1698+
`ADASLithiumRecombination` and `ADASLithiumCX` template classes:
1699+
1700+
.. doxygenstruct:: ADASLithiumIonisation
1701+
:members:
1702+
1703+
.. doxygenstruct:: ADASLithiumRecombination
1704+
:members:
1705+
1706+
.. doxygenstruct:: ADASLithiumCX
1707+
:members:
1708+
16581709
Neon
16591710
~~~~
16601711

‎hermes-3.cxx

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
#include "include/adas_carbon.hxx"
2727
#include "include/adas_neon.hxx"
28+
#include "include/adas_lithium.hxx"
2829
#include "include/amjuel_helium.hxx"
2930
#include "include/amjuel_hyd_ionisation.hxx"
3031
#include "include/amjuel_hyd_recombination.hxx"

‎include/adas_lithium.hxx

+121
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
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

‎json_database/acd96_li.json

+1,416
Large diffs are not rendered by default.

‎json_database/ccd89_li.json

+4,131
Large diffs are not rendered by default.

‎json_database/ecd89_li.json

+4,131
Large diffs are not rendered by default.

‎json_database/ecd96_li.json

+1,416
Large diffs are not rendered by default.

‎json_database/plt96_li.json

+1,416
Large diffs are not rendered by default.

‎json_database/prb96_li.json

+1,416
Large diffs are not rendered by default.

‎json_database/prc89_li.json

+4,131
Large diffs are not rendered by default.

‎json_database/scd96_li.json

+1,416
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
Please sign in to comment.