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
34
35#ifndef RIZER_THERMAL_PLASMA_COLUMN_1D_H
36#define RIZER_THERMAL_PLASMA_COLUMN_1D_H
37
38#ifndef NOMINMAX
39#define NOMINMAX
40#endif
42#include "PropertyTable.h"
43
44#include <string>
45
46namespace rizer {
47
49public:
67 ThermalPlasmaColumn1D(double R, std::size_t npoints,
68 double electric_field, double T_wall,
69 PropertyTable sigma, PropertyTable kappa,
70 PropertyTable p_rad, double T_center_guess,
71 double rho_cp,
72 PropertyTable init_profile = PropertyTable());
73
74 std::string domainType() const override { return "thermal-plasma-column"; }
75
76 // Residual of the cylindrical heat equation. span-based signature per
77 // Cantera main (>3.2). xg/rg are GLOBAL spans; the local part is
78 // xg.subspan(loc(), size()).
92 void eval(std::size_t jg, Cantera::span<const double> xg, Cantera::span<double> rg,
93 Cantera::span<int> maskg, double rdt) override;
94
95 std::string componentName(std::size_t n) const override { return "T"; }
96
100 std::size_t componentIndex(const std::string& name,
101 bool checkAlias = true) const override;
102
106 bool hasComponent(const std::string& name, bool checkAlias = true) const override;
107
112 void getValues(const std::string& component,
113 Cantera::span<double> values) const override;
114
122 double initialValue(std::size_t n, std::size_t j) override;
123
128 void resetBadValues(Cantera::span<double> xg) override;
129
133 void setElectricField(double E) { m_E = E; }
134 double electricField() const { return m_E; }
135 double radius() const { return m_R; }
136
139 double sigmaAt(double T) const { return m_sigma.eval(T); }
141 double kappaAt(double T) const { return m_kappa.eval(T); }
143 double pRadAt(double T) const { return m_prad.eval(T); }
144
145private:
146 double m_R;
147 double m_E;
148 double m_Twall;
149 double m_Tcenter;
150 double m_rho_cp;
151 PropertyTable m_sigma;
152 PropertyTable m_kappa;
153 PropertyTable m_prad;
154 PropertyTable m_init;
155};
156
157} // namespace rizer
158
159#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
Return the index of the named solution component.
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
Test whether a component name exists in this domain.
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())
Construct a radial LTE arc-column domain with tabulated property closures.
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 ...