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"
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;
54 std::vector<double> species_h0k;
55 };
56
61 explicit Plasma0DReactor(const Config& cfg);
62
63 std::size_t nSpecies() const { return m_rhs->nSpecies(); }
64 std::vector<std::string> speciesNames() const;
65
72 double conductivity(double Tg, double Te, const double* Y, double rho) const {
73 return m_rhs->conductivity(Tg, Te, Y, rho);
74 }
75
80 double electronDensity(double Tg, double Te, const double* Y, double rho) const {
81 return m_rhs->electronDensity(Tg, Te, Y, rho);
82 }
83
103 void rhs(double Tg, double Te, double V, const double* Y, double E, double mass,
104 double p_ext, double polytropic_index, double* dydt) const;
105
110 const ReactorRHS::Diagnostics& diagnostics() const { return m_diag; }
111
112private:
114 std::shared_ptr<Cantera::Solution> m_sol;
117 std::unique_ptr<ReactorRHS> m_rhs;
120 std::size_t m_ie;
123 double m_gap;
127 mutable ReactorRHS::Diagnostics m_diag;
128};
129
130} // namespace rizer
131
132#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.
std::vector< double > species_h0k
Per-species standard enthalpy of formation at 0 K [J/kmol]; forwarded to ReactorRHS::Config::species_...
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