rizer.cantera_ext
C++ Cantera 1-D plasma extension (custom Domain1D models and solvers)
Loading...
Searching...
No Matches
PlasmaReactor0D.h
Go to the documentation of this file.
1
20
21#ifndef RIZER_PLASMA_REACTOR_0D_H
22#define RIZER_PLASMA_REACTOR_0D_H
23
24#ifndef NOMINMAX
25#define NOMINMAX
26#endif
28#include "PlasmaCell.h"
30
32
33#include <memory>
34#include <string>
35#include <vector>
36
37namespace rizer
38{
39
41 {
42 std::string mech, phase;
44 bool reacting = true;
48 std::vector<CollisionModel::SpeciesSpec> specs;
51 double Te_min = 200.0;
54 double Te_max = 1.0e5;
56 std::size_t Te_n = 400;
60 double gap = 0.0;
65 std::vector<double> species_h0k;
66 };
67
69 {
70 public:
77 explicit PlasmaReactor0D(const PlasmaReactor0DConfig &cfg);
78
81 std::size_t nSpecies() const { return m_rhs->nSpecies(); }
82
86 std::vector<std::string> speciesNames() const;
87
94 double electricalConductivity(double Tg, double Te, const double *Y,
95 double rho) const
96 {
97 return m_rhs->electricalConductivity(Tg, Te, Y, rho);
98 }
99
104 double electronDensity(double Tg, double Te, const double *Y, double rho) const
105 {
106 return m_rhs->electronDensity(Tg, Te, Y, rho);
107 }
108
136 void rhs(double Tg, double Te, double V, const double *Y, double E, double mass,
137 double p_ext, double polytropic_index, double *dydt) const;
138
148 const PlasmaCell::Diagnostics &diagnostics() const { return m_diag; }
149
150 private:
153 Cantera::PlasmaPhase *m_plasma = nullptr;
154
156 std::shared_ptr<Cantera::Solution> m_sol;
159 std::unique_ptr<PlasmaCell> m_rhs;
162 std::size_t m_ie;
165 double m_gap;
169 mutable PlasmaCell::Diagnostics m_diag;
170 };
171
172} // namespace rizer
173
174#endif
One cell of two-temperature reacting plasma: the source terms the 0-D reactor and the 1-D channel bot...
double electronDensity(double Tg, double Te, const double *Y, double rho) const
Electron number density [1/m^3].
std::size_t nSpecies() const
void rhs(double Tg, double Te, double V, const double *Y, double E, double mass, double p_ext, double polytropic_index, double *dydt) const
Full 0D RHS.
PlasmaReactor0D(const PlasmaReactor0DConfig &cfg)
Construct from a mechanism/phase and collision-model configuration.
std::vector< std::string > speciesNames() const
Species names in mechanism index order, so a caller passing plain numbers across the Python boundary ...
const PlasmaCell::Diagnostics & diagnostics() const
Power / Maxwellian-condition breakdown from the most recent rhs() call (see PlasmaCell::Diagnostics) ...
double electricalConductivity(double Tg, double Te, const double *Y, double rho) const
Electrical conductivity [S/m] at state .
Optional power / Maxwellian-condition breakdown filled by rates() when a non-null pointer is passed.
Definition PlasmaCell.h:98
double Te_max
Upper bound of the tabulated electron-temperature grid [K].
double Te_min
Lower bound of the tabulated electron-temperature grid [K].
std::string phase
Mechanism file/URI, and phase name within it.
double gap
Inter-electrode gap [m], for the polytropic volume equation.
std::vector< CollisionModel::SpeciesSpec > specs
Per-species cross-section model (cross-section data / radius / ion Z), exactly one entry per mechanis...
std::size_t Te_n
Number of points in the tabulated Te grid [-].
std::vector< double > species_h0k
Per-species standard enthalpy of formation at 0 K [J/kmol]; forwarded to PlasmaCellConfig::species_h0...
bool reacting
If false, disables chemistry source terms in the RHS.