chombo-discharge
Loading...
Searching...
No Matches
CD_ItoKMCSurfaceReactionSetImplem.H
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2021-2026 SINTEF Energy Research
3 *
4 * SPDX-License-Identifier: GPL-3.0-or-later
5 */
6
12
13#ifndef CD_ITOKMCSURFACEREACTIONSETIMPLEM_H
14#define CD_ITOKMCSURFACEREACTIONSETIMPLEM_H
15
16// Our includes
18#include <CD_NamespaceHeader.H>
19
20using namespace Physics::ItoKMC;
21
24
25inline void
26ItoKMCSurfaceReactionSet::add(const size_t a_speciesIndex,
27 const ItoKMCSurfaceReaction& a_reaction,
29 const ItoKMCSurfaceReactionSet::Species a_speciesType) noexcept
30{
31 if (a_surface == Surface::Dielectric) {
32 if (a_speciesType == Species::Plasma) {
33 m_dielectricPlasmaReactions[a_speciesIndex].add(a_reaction);
34 }
35 else if (a_speciesType == Species::Photon) {
36 m_dielectricPhotonReactions[a_speciesIndex].add(a_reaction);
37 }
38 else {
39 MayDay::Error("ItoKMCSurfaceReaction::add - logic bust 1");
40 }
41 }
42 else if (a_surface == Surface::Electrode) {
43 if (a_speciesType == Species::Plasma) {
44 m_electrodePlasmaReactions[a_speciesIndex].add(a_reaction);
45 }
46 else if (a_speciesType == Species::Photon) {
47 m_electrodePhotonReactions[a_speciesIndex].add(a_reaction);
48 }
49 else {
50 MayDay::Error("ItoKMCSurfaceReaction::add - logic bust 2");
51 }
52 }
53 else {
54 MayDay::Error("ItoKMCSurfaceReaction::add - logic bust 3");
55 }
56}
57
58inline void
59ItoKMCSurfaceReactionSet::addDomain(const size_t a_speciesIndex,
60 const ItoKMCSurfaceReaction& a_reaction,
61 const int a_dir,
62 const Side::LoHiSide a_side,
63 const ItoKMCSurfaceReactionSet::Species a_speciesType) noexcept
64{
65 CH_assert(a_dir >= 0 && a_dir < SpaceDim);
66
67 const int face = domainFaceIndex(a_dir, a_side);
68
69 if (a_speciesType == Species::Plasma) {
70 m_domainPlasmaReactions[face][a_speciesIndex].add(a_reaction);
71 }
72 else if (a_speciesType == Species::Photon) {
73 m_domainPhotonReactions[face][a_speciesIndex].add(a_reaction);
74 }
75 else {
76 MayDay::Error("ItoKMCSurfaceReaction::addDomain - logic bust");
77 }
78}
79
80inline const std::map<size_t, ItoKMCSurfaceReactions>&
85
86inline const std::map<size_t, ItoKMCSurfaceReactions>&
91
92inline const std::map<size_t, ItoKMCSurfaceReactions>&
97
98inline const std::map<size_t, ItoKMCSurfaceReactions>&
103
104inline const std::map<size_t, ItoKMCSurfaceReactions>&
105ItoKMCSurfaceReactionSet::getDomainPlasmaReactions(const int a_dir, const Side::LoHiSide a_side) const noexcept
106{
107 CH_assert(a_dir >= 0 && a_dir < SpaceDim);
108
109 return m_domainPlasmaReactions[domainFaceIndex(a_dir, a_side)];
110}
111
112inline const std::map<size_t, ItoKMCSurfaceReactions>&
113ItoKMCSurfaceReactionSet::getDomainPhotonReactions(const int a_dir, const Side::LoHiSide a_side) const noexcept
114{
115 CH_assert(a_dir >= 0 && a_dir < SpaceDim);
116
117 return m_domainPhotonReactions[domainFaceIndex(a_dir, a_side)];
118}
119
120inline int
121ItoKMCSurfaceReactionSet::domainFaceIndex(const int a_dir, const Side::LoHiSide a_side) noexcept
122{
123 return 2 * a_dir + ((a_side == Side::Lo) ? 0 : 1);
124}
125
126#include <CD_NamespaceFooter.H>
127
128#endif
Declaration of a class that encapsulates a set of secondary emission reactions.
std::map< size_t, ItoKMCSurfaceReactions > m_dielectricPlasmaReactions
Dielectric reaction set where outgoing species is a plasma species.
Definition CD_ItoKMCSurfaceReactionSet.H:141
std::array< std::map< size_t, ItoKMCSurfaceReactions >, 2 *SpaceDim > m_domainPlasmaReactions
Domain reaction sets where outgoing species is a plasma species, one per domain face.
Definition CD_ItoKMCSurfaceReactionSet.H:162
Species
Local enum for specifying species type.
Definition CD_ItoKMCSurfaceReactionSet.H:49
virtual ~ItoKMCSurfaceReactionSet() noexcept
Destructor.
Definition CD_ItoKMCSurfaceReactionSetImplem.H:22
static int domainFaceIndex(const int a_dir, const Side::LoHiSide a_side) noexcept
Index of a domain face in m_domainPlasmaReactions and m_domainPhotonReactions.
Definition CD_ItoKMCSurfaceReactionSetImplem.H:121
std::map< size_t, ItoKMCSurfaceReactions > m_dielectricPhotonReactions
Dielectric reaction set where outgoing species is a photon species.
Definition CD_ItoKMCSurfaceReactionSet.H:146
void add(const size_t a_speciesIndex, const ItoKMCSurfaceReaction &a_reaction, const ItoKMCSurfaceReactionSet::Surface a_surface, const ItoKMCSurfaceReactionSet::Species a_speciesType) noexcept
Add a surface reaction to the set.
Definition CD_ItoKMCSurfaceReactionSetImplem.H:26
std::map< size_t, ItoKMCSurfaceReactions > m_electrodePlasmaReactions
Electrode reaction set where outgoing species is a plasma species.
Definition CD_ItoKMCSurfaceReactionSet.H:151
Surface
Local enum for specifying surface type.
Definition CD_ItoKMCSurfaceReactionSet.H:40
const std::map< size_t, ItoKMCSurfaceReactions > & getElectrodePhotonReactions() const noexcept
Get the electrode surface reactions where the outgoing species is a photon species.
Definition CD_ItoKMCSurfaceReactionSetImplem.H:99
const std::map< size_t, ItoKMCSurfaceReactions > & getDielectricPlasmaReactions() const noexcept
Get the dielectric surface reactions where the outgoing species is a plasma species.
Definition CD_ItoKMCSurfaceReactionSetImplem.H:81
const std::map< size_t, ItoKMCSurfaceReactions > & getDomainPhotonReactions(const int a_dir, const Side::LoHiSide a_side) const noexcept
Get the reactions on one domain face where the outgoing species is a photon species.
Definition CD_ItoKMCSurfaceReactionSetImplem.H:113
std::map< size_t, ItoKMCSurfaceReactions > m_electrodePhotonReactions
Electrode reaction set where outgoing species is a photon species.
Definition CD_ItoKMCSurfaceReactionSet.H:156
const std::map< size_t, ItoKMCSurfaceReactions > & getDielectricPhotonReactions() const noexcept
Get the dielectric surface reactions where the outgoing species is a photon species.
Definition CD_ItoKMCSurfaceReactionSetImplem.H:87
std::array< std::map< size_t, ItoKMCSurfaceReactions >, 2 *SpaceDim > m_domainPhotonReactions
Domain reaction sets where outgoing species is a photon species, one per domain face.
Definition CD_ItoKMCSurfaceReactionSet.H:168
const std::map< size_t, ItoKMCSurfaceReactions > & getElectrodePlasmaReactions() const noexcept
Get the electrode surface reactions where the outgoing species is a plasma species.
Definition CD_ItoKMCSurfaceReactionSetImplem.H:93
const std::map< size_t, ItoKMCSurfaceReactions > & getDomainPlasmaReactions(const int a_dir, const Side::LoHiSide a_side) const noexcept
Get the reactions on one domain face where the outgoing species is a plasma species.
Definition CD_ItoKMCSurfaceReactionSetImplem.H:105
void addDomain(const size_t a_speciesIndex, const ItoKMCSurfaceReaction &a_reaction, const int a_dir, const Side::LoHiSide a_side, const ItoKMCSurfaceReactionSet::Species a_speciesType) noexcept
Add a surface reaction on one face of the computational domain.
Definition CD_ItoKMCSurfaceReactionSetImplem.H:59
Reaction class for describing secondary emissions due to a single outgoing particle in ItoKMCPhysics.
Definition CD_ItoKMCSurfaceReaction.H:34