|
rizer.cantera_ext
C++ Cantera 1-D plasma extension (custom Domain1D models and solvers)
|
Transient, two-temperature (Te != Tg), finite-rate reacting 1-D radial plasma channel (custom Cantera Domain1D). More...
#include <PlasmaChannel1D.h>
Public Member Functions | |
| PlasmaChannel1D (const PlasmaChannelConfig &cfg) | |
| Build the domain (mesh, thermo/kinetics, property tables) from cfg. | |
| std::string | domainType () const override |
| void | eval (std::size_t jg, Cantera::span< const double > xg, Cantera::span< double > rg, Cantera::span< int > maskg, double rdt) override |
| Residual + transient-mask assembly at global point jg (or every point if jg == Cantera::npos); see the .cpp for the finite-volume stencil. | |
| std::string | componentName (std::size_t n) const override |
| Component n -> name ("Tg", "Te", or a species name). | |
| std::size_t | componentIndex (const std::string &name, bool checkAlias=true) const override |
| Component name -> index (inverse of componentName()); throws if unknown. | |
| bool | hasComponent (const std::string &name, bool checkAlias=true) const override |
| Whether name is "Tg", "Te", or a species of this domain's mechanism. | |
| void | getValues (const std::string &component, Cantera::span< double > values) const override |
| Radial profile of one component, read from the domain's own solution buffer (units match that component: [K] for Tg/Te, [-] for a species). | |
| double | initialValue (std::size_t n, std::size_t j) override |
| Initial value of component n at grid point j ([K] for Tg/Te, [-] for a species mass fraction); seeds the first solve. | |
| void | resetBadValues (Cantera::span< double > xg) override |
| Clamp a trial state back onto a physically evaluable range (Tg, Te >= 200 K; every Y_k in [0, 1]) after repeated Newton failures. | |
| void | setElectricField (double electricField) |
| Applied electric field E [V/m] used by the next eval() call. | |
| double | electricField () const |
| Currently-set electric field E [V/m]. | |
| std::size_t | nSpecies () const |
| Number of species K [-] in this domain's mechanism. | |
| double | electronDensity (double Tg, double Te, const double *Y) const |
| Electron number density [1/m^3] for a node state (X_e * P / (k_B * Tmean)), matching the n_e used internally in reactorRates(). | |
| Public Member Functions inherited from Cantera::Domain1D | |
| size_t | domainIndex () |
| virtual bool | isConnector () |
| virtual void | setTransportModel (const string &model) |
| const OneDim & | container () const |
| void | setContainer (OneDim *c, size_t index) |
| void | setBandwidth (int bw=-1) |
| size_t | bandwidth () |
| virtual void | init () |
| virtual void | resize (size_t nv, size_t np) |
| Refiner & | refiner () |
| size_t | nComponents () const |
| size_t | nPoints () const |
| virtual string | componentName (size_t n) const |
| void | setComponentName (size_t n, const string &name) |
| virtual size_t | componentIndex (const string &name, bool checkAlias=true) const |
| virtual bool | hasComponent (const string &name, bool checkAlias=true) const |
| virtual void | updateState (size_t loc) |
| void | setBounds (size_t n, double lower, double upper) |
| void | setTransientTolerances (double rtol, double atol, size_t n=npos) |
| void | setSteadyTolerances (double rtol, double atol, size_t n=npos) |
| double | rtol (size_t n) |
| double | atol (size_t n) |
| double | steady_rtol (size_t n) |
| double | steady_atol (size_t n) |
| double | transient_rtol (size_t n) |
| double | transient_atol (size_t n) |
| double | upperBound (size_t n) const |
| double | lowerBound (size_t n) const |
| void | setRefineCriteria (double ratio=10.0, double slope=0.8, double curve=0.8, double prune=-0.1) |
| vector< double > | getRefineCriteria () |
| void | initTimeInteg (double dt, span< const double > x0) |
| void | setSteadyMode () |
| bool | steady () |
| bool | transient () |
| void | needJacUpdate () |
| virtual void | eval (size_t j, span< const double > x, span< double > r, span< int > mask, double rdt=0.0) |
| size_t | index (size_t n, size_t j) const |
| virtual double | value (const string &component) const |
| virtual void | setValue (const string &component, double value) |
| vector< double > | values (const string &component) const |
| virtual void | getValues (const string &component, span< double > values) const |
| virtual void | setValues (const string &component, span< const double > values) |
| vector< double > | residuals (const string &component) const |
| virtual void | getResiduals (const string &component, span< double > values) const |
| virtual void | setProfile (const string &component, span< const double > pos, span< const double > values) |
| virtual void | setFlatProfile (const string &component, double value) |
| virtual shared_ptr< SolutionArray > | toArray (bool normalize=false) |
| virtual void | fromArray (const shared_ptr< SolutionArray > &arr) |
| string | info (const vector< string > &keys, int rows=10, int width=80) |
| string | _info (int rows=10, int width=80) |
| shared_ptr< Solution > | phase () const |
| size_t | size () const |
| void | locate () |
| virtual size_t | loc (size_t j=0) const |
| size_t | firstPoint () const |
| size_t | lastPoint () const |
| void | linkLeft (Domain1D *left) |
| void | linkRight (Domain1D *right) |
| void | append (Domain1D *right) |
| Domain1D * | left () const |
| Domain1D * | right () const |
| double | prevSoln (size_t n, size_t j) const |
| void | setID (const string &s) |
| string | id () const |
| virtual void | show (span< const double > x) |
| double | z (size_t jlocal) const |
| double | zmin () const |
| double | zmax () const |
| span< double > | grid () |
| span< const double > | grid () const |
| virtual void | setupGrid (span< const double > z) |
| void | setupUniformGrid (size_t points, double length, double start=0.) |
| virtual void | _getInitialSoln (span< double > x) |
| virtual double | initialValue (size_t n, size_t j) |
| virtual void | _finalize (span< const double > x) |
| void | forceFullUpdate (bool update) |
| void | setData (shared_ptr< vector< double > > &data) |
Additional Inherited Members | |
| Protected Member Functions inherited from Cantera::Domain1D | |
| Domain1D (size_t nv=1, size_t points=1, double time=0.0) | |
| virtual void | _setKinetics (shared_ptr< Kinetics > kin) |
| virtual void | _setTransport (shared_ptr< Transport > trans) |
| virtual AnyMap | getMeta () const |
| virtual void | setMeta (const AnyMap &meta) |
| Protected Attributes inherited from Cantera::Domain1D | |
| double | m_press |
| shared_ptr< vector< double > > | m_state |
| double | m_rdt |
| size_t | m_nv |
| size_t | m_points |
| vector< double > | m_slast |
| vector< double > | m_max |
| vector< double > | m_min |
| vector< double > | m_rtol_ss |
| vector< double > | m_rtol_ts |
| vector< double > | m_atol_ss |
| vector< double > | m_atol_ts |
| vector< double > | m_z |
| OneDim * | m_container |
| size_t | m_index |
| size_t | m_iloc |
| size_t | m_jstart |
| Domain1D * | m_left |
| Domain1D * | m_right |
| string | m_id |
| unique_ptr< Refiner > | m_refiner |
| vector< string > | m_name |
| int | m_bw |
| bool | m_force_full_update |
| shared_ptr< Solution > | m_solution |
Transient, two-temperature (Te != Tg), finite-rate reacting 1-D radial plasma channel (custom Cantera Domain1D).
PlasmaChannel1D: a transient, two-temperature (Te != Tg), finite-rate reacting plasma channel as a custom Cantera Domain1D on a radial grid.
Thermo/kinetics-backed (holds a Cantera Solution whose ThermoPhase is a PlasmaPhase). Per radial node it evaluates finite-rate chemistry + two two-temperature energy balances + radial transport (conduction/diffusion), mirroring rizer's 0D ConstantMassPlasmaReactorOde generalised to 1D radial.
Components per radial node (nv = 2 + K): 0 : Tg gas/heavy temperature [K] 1 : Te electron temperature [K] 2 .. 2+K-1 : Y_k species mass fractions
Equations (finite-volume, cylindrical; see ARCHITECTURE.md):
Species mass fraction:
\[ \rho \frac{dY_k}{dt} = \frac{1}{r} \frac{d}{dr}\!\left(r \rho D \frac{dY_k}{dr}\right) + W_k \dot\omega_k \]
Gas (heavy-species) energy:
\[ \rho \bar{c}_{v,h} \frac{dT_g}{dt} = \frac{1}{r} \frac{d}{dr}\!\left(r \kappa \frac{dT_g}{dr}\right) - P_\text{chem} + Q_\text{el} + Q_\text{inel} + \rho D R T_g \sum_{k \neq e} \frac{1}{W_k} \frac{1}{r} \frac{d}{dr}\!\left(r \frac{dY_k}{dr}\right) + \rho D \frac{dT_g}{dr} \sum_{k \neq e} c_{p,k} \frac{dY_k}{dr} \]
Electron energy:
\[ \frac{3}{2} n_e k_B \frac{dT_e}{dt} = \frac{1}{r} \frac{d}{dr}\!\left(r \kappa_e \frac{dT_e}{dr}\right) + \sigma E^2 - P_{\text{chem},e} - Q_\text{el} - Q_\text{inel} + \rho D \frac{R T_e}{W_e} \frac{1}{r} \frac{d}{dr}\!\left(r \frac{dY_e}{dr}\right) + \rho D c_{p,e} \frac{dY_e}{dr} \frac{dT_e}{dr} \]
The last two terms in each equation are the species-diffusion COMPRESSIBILITY term (from expanding \(DP/Dt\) for the two-temperature ideal-gas EOS under Fick's law) and the ENTHALPY-DIFFUSION (species heat transport) term (the Fickian reduction of the full multicomponent energy equation's \(-\nabla\!\cdot\!\left(\sum_k h_k \vec\jmath_k\right)\) term); both vanish when D_species == 0 or the composition is uniform. See the species-diffusion block in eval() and ARCHITECTURE.md.
BCs: r=0 symmetry (zero-area axis face); r=R wall Dirichlet to ambient. Transport is OFF when all conductivities/diffusivity are zero (P0 limit: each node is an independent 0D reactor).
ASSUMPTIONS AND DOMAIN OF VALIDITY (mirrored in the Python wrapper PlasmaChannel, which is what Sphinx renders – keep the two in sync):
Definition at line 199 of file PlasmaChannel1D.h.
|
explicit |
Build the domain (mesh, thermo/kinetics, property tables) from cfg.
Throws std::invalid_argument if cfg is inconsistent (see the .cpp).
Definition at line 35 of file PlasmaChannel1D.cpp.
|
override |
Component name -> index (inverse of componentName()); throws if unknown.
| name | Component name: "Tg", "Te", or a species name |
| checkAlias | Unused (this domain has no aliases) |
Definition at line 186 of file PlasmaChannel1D.cpp.
|
override |
Component n -> name ("Tg", "Te", or a species name).
Definition at line 176 of file PlasmaChannel1D.cpp.
|
inlineoverridevirtual |
Reimplemented from Cantera::Domain1D.
Definition at line 205 of file PlasmaChannel1D.h.
|
inline |
Currently-set electric field E [V/m].
Definition at line 256 of file PlasmaChannel1D.h.
| double rizer::PlasmaChannel1D::electronDensity | ( | double | Tg, |
| double | Te, | ||
| const double * | Y ) const |
Electron number density [1/m^3] for a node state (X_e * P / (k_B * Tmean)), matching the n_e used internally in reactorRates().
Used to record n_e(r,t).
| Tg | Gas (heavy-species) temperature [K] |
| Te | Electron temperature [K] |
| Y | Species mass fractions [-] (length nSpecies()) |
Definition at line 256 of file PlasmaChannel1D.cpp.
|
override |
Residual + transient-mask assembly at global point jg (or every point if jg == Cantera::npos); see the .cpp for the finite-volume stencil.
| jg | Global point to (re)evaluate, or Cantera::npos for a full residual pass [-] | |
| xg | Full global state vector (all domains), this domain's slice at loc() [K]/[K]/[-] (Tg/Te/Y_k) | |
| [out] | rg | Full global residual vector to write into, same layout as xg |
| [out] | maskg | Full global transient/algebraic mask (1 = transient unknown, 0 = algebraic row) [-] |
| rdt | Pseudo-transient reciprocal time step 1/dt [1/s] (0 for steady/method-of-lines) |
Definition at line 269 of file PlasmaChannel1D.cpp.
|
override |
Radial profile of one component, read from the domain's own solution buffer (units match that component: [K] for Tg/Te, [-] for a species).
| component | Component name: "Tg", "Te", or a species name | |
| [out] | values | One value per radial node, in that component's unit [K] or [-] |
Definition at line 206 of file PlasmaChannel1D.cpp.
|
override |
Whether name is "Tg", "Te", or a species of this domain's mechanism.
| name | Component name to test: "Tg", "Te", or a species name |
| checkAlias | Unused (this domain has no aliases) |
Definition at line 195 of file PlasmaChannel1D.cpp.
|
override |
Initial value of component n at grid point j ([K] for Tg/Te, [-] for a species mass fraction); seeds the first solve.
| n | Component index: 0=Tg, 1=Te, 2+k=species k [-] |
| j | Radial grid point index [-] |
Definition at line 224 of file PlasmaChannel1D.cpp.
|
inline |
Number of species K [-] in this domain's mechanism.
Definition at line 258 of file PlasmaChannel1D.h.
|
overridevirtual |
Clamp a trial state back onto a physically evaluable range (Tg, Te >= 200 K; every Y_k in [0, 1]) after repeated Newton failures.
| [out] | xg | Full global state vector (all domains); this domain's slice at loc() is clamped in place |
Reimplemented from Cantera::Domain1D.
Definition at line 241 of file PlasmaChannel1D.cpp.
|
inline |
Applied electric field E [V/m] used by the next eval() call.
| electricField | Applied electric field E [V/m] |
Definition at line 254 of file PlasmaChannel1D.h.