rizer.cantera_ext
C++ Cantera 1-D plasma extension (custom Domain1D models and solvers)
Loading...
Searching...
No Matches
Plasma0DReactor.h
Go to the documentation of this file.
1
15
16#ifndef RIZER_PLASMA_0D_REACTOR_H
17#define RIZER_PLASMA_0D_REACTOR_H
18
19#ifndef NOMINMAX
20#define NOMINMAX
21#endif
23#include "ReactorRHS.h"
24#include "CollisionModel.h"
25
26#include <memory>
27#include <string>
28#include <vector>
29
30namespace rizer {
31
33public:
34 struct Config {
35 std::string mech, phase;
37 bool reacting = true;
40 std::vector<CollisionModel::SpeciesSpec> specs;
42 double Te_min = 300.0;
44 double Te_max = 1.0e5;
46 std::size_t Te_n = 400;
48 bool spitzer = true;
49 double gap = 0.0;
50 };
51
56 explicit Plasma0DReactor(const Config& cfg);
57
58 std::size_t nSpecies() const { return m_rhs->nSpecies(); }
59 std::vector<std::string> speciesNames() const;
60
67 double conductivity(double Tg, double Te, const double* Y, double rho) const {
68 return m_rhs->conductivity(Tg, Te, Y, rho);
69 }
70
75 double electronDensity(double Tg, double Te, const double* Y, double rho) const {
76 return m_rhs->electronDensity(Tg, Te, Y, rho);
77 }
78
98 void rhs(double Tg, double Te, double V, const double* Y, double E, double mass,
99 double p_ext, double polytropic_index, double* dydt) const;
100
105 const ReactorRHS::Diagnostics& diagnostics() const { return m_diag; }
106
107private:
109 std::shared_ptr<Cantera::Solution> m_sol;
112 std::unique_ptr<ReactorRHS> m_rhs;
115 std::size_t m_ie;
118 double m_gap;
122 mutable ReactorRHS::Diagnostics m_diag;
123};
124
125} // namespace rizer
126
127#endif
std::size_t nSpecies() const
double electronDensity(double Tg, double Te, const double *Y, double rho) const
Electron number density [1/m^3].
std::vector< std::string > speciesNames() 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.
const ReactorRHS::Diagnostics & diagnostics() const
Power / Maxwellian-condition breakdown from the most recent rhs() call (see ReactorRHS::Diagnostics) ...
Plasma0DReactor(const Config &cfg)
Construct from a mechanism/phase and collision-model configuration.
double conductivity(double Tg, double Te, const double *Y, double rho) const
Electrical conductivity [S/m] at state .
bool spitzer
Use Spitzer (Coulomb) conductivity contribution when true.
double gap
[m], for the polytropic volume equation (optional)
std::size_t Te_n
Number of points in the tabulated Te grid [-].
double Te_max
Upper bound of the tabulated electron-temperature grid [K].
bool reacting
If false, disables chemistry source terms in the RHS.
std::vector< CollisionModel::SpeciesSpec > specs
Per-species cross-section model (cross-section data / radius / ion Z).
std::string phase
Mechanism file/URI, and phase name within it.
double Te_min
Lower bound of the tabulated electron-temperature grid [K].
Optional power / Maxwellian-condition breakdown filled by rates() when a non-null pointer is passed.
Definition ReactorRHS.h:43