rizer.cantera_ext
C++ Cantera 1-D plasma extension (custom Domain1D models and solvers)
Loading...
Searching...
No Matches
ThermalPlasmaColumn1D.h
Go to the documentation of this file.
1
29
30#ifndef RIZER_THERMAL_PLASMA_COLUMN_1D_H
31#define RIZER_THERMAL_PLASMA_COLUMN_1D_H
32
33#ifndef NOMINMAX
34#define NOMINMAX
35#endif
37#include "PropertyTable.h"
38
39#include <string>
40
41namespace rizer {
42
44public:
45 ThermalPlasmaColumn1D(double R, std::size_t npoints,
46 double electric_field, double T_wall,
47 PropertyTable sigma, PropertyTable kappa,
48 PropertyTable p_rad,
49 double T_center_guess,
50 double rho_cp,
51 PropertyTable init_profile = PropertyTable());
52
53 std::string domainType() const override { return "thermal-plasma-column"; }
54
55 // Residual of the cylindrical heat equation. span-based signature per
56 // Cantera main (>3.2). xg/rg are GLOBAL spans; the local part is
57 // xg.subspan(loc(), size()).
60
71 void eval(std::size_t jg, Cantera::span<const double> xg,
73 double rdt) override;
74
75 std::string componentName(std::size_t n) const override { return "T"; }
76 std::size_t componentIndex(const std::string& name,
77 bool checkAlias = true) const override;
78 bool hasComponent(const std::string& name,
79 bool checkAlias = true) const override;
80
83 void getValues(const std::string& component,
84 Cantera::span<double> values) const override;
85
89 double initialValue(std::size_t n, std::size_t j) override;
90
93 void resetBadValues(Cantera::span<double> xg) override;
94
97 void setElectricField(double E) { m_E = E; }
98 double electricField() const { return m_E; }
99 double radius() const { return m_R; }
100
102 double sigmaAt(double T) const { return m_sigma.eval(T); }
103 double kappaAt(double T) const { return m_kappa.eval(T); }
104 double pRadAt(double T) const { return m_prad.eval(T); }
105
106private:
107 double m_R;
108 double m_E;
109 double m_Twall;
110 double m_Tcenter;
111 double m_rho_cp;
112 PropertyTable m_sigma;
113 PropertyTable m_kappa;
114 PropertyTable m_prad;
115 PropertyTable m_init;
116};
117
118} // namespace rizer
119
120#endif
vector< double > values(const string &component) const
std::string componentName(std::size_t n) const override
std::size_t componentIndex(const std::string &name, bool checkAlias=true) const override
double initialValue(std::size_t n, std::size_t j) override
Initial guess for component n at grid point j.
std::string domainType() const override
void getValues(const std::string &component, Cantera::span< double > values) const override
Copy converged temperatures from the shared global solution vector.
double sigmaAt(double T) const
Property look-ups at a given temperature, for post-processing.
bool hasComponent(const std::string &name, bool checkAlias=true) const override
void setElectricField(double E)
Change the electric field without rebuilding the domain (used by the Python-side secant iteration for...
void eval(std::size_t jg, Cantera::span< const double > xg, Cantera::span< double > rg, Cantera::span< int > maskg, double rdt) override
Evaluate the residual function at point jg.
ThermalPlasmaColumn1D(double R, std::size_t npoints, double electric_field, double T_wall, PropertyTable sigma, PropertyTable kappa, PropertyTable p_rad, double T_center_guess, double rho_cp, PropertyTable init_profile=PropertyTable())
void resetBadValues(Cantera::span< double > xg) override
Clamp any out-of-bound temperatures after a failed Newton step to keep the solve from wandering into ...