chombo-discharge
CD_ItoKMCBackgroundSpecies.H
Go to the documentation of this file.
1 /* chombo-discharge
2  * Copyright © 2023 SINTEF Energy Research.
3  * Please refer to Copyright.txt and LICENSE in the chombo-discharge root directory.
4  */
5 
12 #ifndef CD_ItoKMCBackgroundSpecies_H
13 #define CD_ItoKMCBackgroundSpecies_H
14 
15 // Std includes
16 #include <string>
17 
18 // Chombo includes
19 #include <RealVect.H>
20 
21 // Our includes
22 #include <CD_NamespaceHeader.H>
23 
24 namespace Physics {
25  namespace ItoKMC {
26 
31  {
32  public:
36  using MolarFraction = std::function<Real(const RealVect a_pos)>;
37 
41  ItoKMCBackgroundSpecies() noexcept;
42 
48  ItoKMCBackgroundSpecies(const std::string& a_name, const MolarFraction& a_molarFraction) noexcept;
49 
53  virtual ~ItoKMCBackgroundSpecies() noexcept;
54 
60  void
61  define(const std::string& a_name, const MolarFraction& a_molarFraction) noexcept;
62 
67  Real
68  molarFraction(const RealVect a_pos) const noexcept;
69 
74  std::string
75  getName() const noexcept;
76 
77  protected:
82 
86  std::string m_name;
87 
92  };
93  } // namespace ItoKMC
94 } // namespace Physics
95 
96 #include <CD_NamespaceFooter.H>
97 
98 #endif
Encapsulation of a background species for usage with ItoKMCJSON.
Definition: CD_ItoKMCBackgroundSpecies.H:31
std::string getName() const noexcept
Get the species name.
Definition: CD_ItoKMCBackgroundSpecies.cpp:49
void define(const std::string &a_name, const MolarFraction &a_molarFraction) noexcept
Define function. Puts object in usable state.
Definition: CD_ItoKMCBackgroundSpecies.cpp:33
ItoKMCBackgroundSpecies() noexcept
Default constructor. Must subsequently call the define function.
Definition: CD_ItoKMCBackgroundSpecies.cpp:18
MolarFraction m_molarFraction
Initial data function.
Definition: CD_ItoKMCBackgroundSpecies.H:91
Real molarFraction(const RealVect a_pos) const noexcept
Get molar fraction at the physical coordinates.
Definition: CD_ItoKMCBackgroundSpecies.cpp:41
std::string m_name
Neutral species name.
Definition: CD_ItoKMCBackgroundSpecies.H:86
std::function< Real(const RealVect a_pos)> MolarFraction
Alias for position-dependent molar fraction.
Definition: CD_ItoKMCBackgroundSpecies.H:36
bool m_isDefined
Make sure model has initial data.
Definition: CD_ItoKMCBackgroundSpecies.H:81
Name containing various physics models for running chombo-discharge code.
Definition: CD_AdvectionDiffusion.H:15