rizer.cantera_ext
C++ Cantera 1-D plasma extension (custom Domain1D models and solvers)
Loading...
Searching...
No Matches
rizer::PlasmaChannel1D Class Reference

Transient, two-temperature (Te != Tg), finite-rate reacting 1-D radial plasma channel (custom Cantera Domain1D). More...

#include <PlasmaChannel1D.h>

Inheritance diagram for rizer::PlasmaChannel1D:
Cantera::Domain1D

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 OneDimcontainer () 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)
Refinerrefiner ()
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< SolutionArraytoArray (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< Solutionphase () 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)
Domain1Dleft () const
Domain1Dright () 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
OneDimm_container
size_t m_index
size_t m_iloc
size_t m_jstart
Domain1Dm_left
Domain1Dm_right
string m_id
unique_ptr< Refinerm_refiner
vector< stringm_name
int m_bw
bool m_force_full_update
shared_ptr< Solutionm_solution

Detailed Description

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):

  • Fixed mass density rho (CONSTANT VOLUME): no continuity/momentum equation, rho is a parameter not a state. Pressure is NOT held constant (hot core at fixed rho => elevated local P, a constant-volume artefact). Valid for conduction/diffusion + chemistry driven evolution; NOT for pressure-driven (shock / Braginskii) gas-dynamic expansion (needs a compressible flow solve).
  • Prescribed field \(E(t)\); NO self-consistent field: Poisson is not solved and the plasma is treated quasi-neutral (no dielectric-relaxation timescale). NOT valid for self-consistent sheath/streamer dynamics (use drift-diffusion-Poisson for those).
  • Two-temperature (Te != Tg), Maxwellian EEDF at Te.
  • Heat conduction: two-temperature Fourier ( \(\kappa(T_g)\), \(\kappa_e(T_e)\)), each active only if its table is supplied.
  • Species transport: FICKIAN, single constant scalar D_species. NO thermal diffusion (Soret)/Dufour; NOT mixture-averaged/multicomponent (one D for all species); NO ambipolar diffusion (electrons & ions share D). Frozen when D_species == 0. Species diffusion also feeds BOTH energy equations (compressibility + enthalpy-diffusion terms above), not just Y_k.
  • Joule heating \(\sigma E^2\). Two mutually exclusive closures for sigma (and, for the electron energy equation, the elastic exchange frequency nu_E): (a) a composition-resolved CollisionModel (cfg.specs), evaluated live from the evolving composition every eval() – the same model the 0D Plasma0DReactor uses; or (b) the legacy closure: sigma from a \(\sigma(T_e)\) table, or \(n_e e^2/(m_e \nu_m)\) from the local n_e if nu_m > 0, with a separately-injected constant nu_E. Supplying both is an error (see the .cpp) – pick one.
  • Numerics: fixed-step implicit Backward-Euler (BDF1) on a FIXED grid, monolithic damped-Newton per step. First order in time; Newton convergence is the practical limit – very stiff chemistry can fail at fixed dt (reduce dt, or operator-split/CVODE; see ARCHITECTURE.md).

Definition at line 199 of file PlasmaChannel1D.h.

Constructor & Destructor Documentation

◆ PlasmaChannel1D()

rizer::PlasmaChannel1D::PlasmaChannel1D ( const PlasmaChannelConfig & cfg)
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.

Member Function Documentation

◆ componentIndex()

std::size_t rizer::PlasmaChannel1D::componentIndex ( const std::string & name,
bool checkAlias = true ) const
override

Component name -> index (inverse of componentName()); throws if unknown.

Parameters
nameComponent name: "Tg", "Te", or a species name
checkAliasUnused (this domain has no aliases)

Definition at line 186 of file PlasmaChannel1D.cpp.

◆ componentName()

std::string rizer::PlasmaChannel1D::componentName ( std::size_t n) const
override

Component n -> name ("Tg", "Te", or a species name).

Definition at line 176 of file PlasmaChannel1D.cpp.

◆ domainType()

std::string rizer::PlasmaChannel1D::domainType ( ) const
inlineoverridevirtual

Reimplemented from Cantera::Domain1D.

Definition at line 205 of file PlasmaChannel1D.h.

◆ electricField()

double rizer::PlasmaChannel1D::electricField ( ) const
inline

Currently-set electric field E [V/m].

Definition at line 256 of file PlasmaChannel1D.h.

◆ electronDensity()

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).

Parameters
TgGas (heavy-species) temperature [K]
TeElectron temperature [K]
YSpecies mass fractions [-] (length nSpecies())

Definition at line 256 of file PlasmaChannel1D.cpp.

◆ eval()

void rizer::PlasmaChannel1D::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.

Parameters
jgGlobal point to (re)evaluate, or Cantera::npos for a full residual pass [-]
xgFull global state vector (all domains), this domain's slice at loc() [K]/[K]/[-] (Tg/Te/Y_k)
[out]rgFull global residual vector to write into, same layout as xg
[out]maskgFull global transient/algebraic mask (1 = transient unknown, 0 = algebraic row) [-]
rdtPseudo-transient reciprocal time step 1/dt [1/s] (0 for steady/method-of-lines)

Definition at line 269 of file PlasmaChannel1D.cpp.

◆ getValues()

void rizer::PlasmaChannel1D::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).

Parameters
componentComponent name: "Tg", "Te", or a species name
[out]valuesOne value per radial node, in that component's unit [K] or [-]

Definition at line 206 of file PlasmaChannel1D.cpp.

◆ hasComponent()

bool rizer::PlasmaChannel1D::hasComponent ( const std::string & name,
bool checkAlias = true ) const
override

Whether name is "Tg", "Te", or a species of this domain's mechanism.

Parameters
nameComponent name to test: "Tg", "Te", or a species name
checkAliasUnused (this domain has no aliases)

Definition at line 195 of file PlasmaChannel1D.cpp.

◆ initialValue()

double rizer::PlasmaChannel1D::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.

Parameters
nComponent index: 0=Tg, 1=Te, 2+k=species k [-]
jRadial grid point index [-]

Definition at line 224 of file PlasmaChannel1D.cpp.

◆ nSpecies()

std::size_t rizer::PlasmaChannel1D::nSpecies ( ) const
inline

Number of species K [-] in this domain's mechanism.

Definition at line 258 of file PlasmaChannel1D.h.

◆ resetBadValues()

void rizer::PlasmaChannel1D::resetBadValues ( Cantera::span< double > xg)
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.

Parameters
[out]xgFull 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.

◆ setElectricField()

void rizer::PlasmaChannel1D::setElectricField ( double electricField)
inline

Applied electric field E [V/m] used by the next eval() call.

Parameters
electricFieldApplied electric field E [V/m]

Definition at line 254 of file PlasmaChannel1D.h.


The documentation for this class was generated from the following files: