100#ifndef RIZER_PLASMA_CHANNEL_1D_H
101#define RIZER_PLASMA_CHANNEL_1D_H
232 std::vector<CollisionModel::SpeciesSpec>
specs;
284 std::string
domainType()
const override {
return "plasma-channel-1d"; }
308 bool checkAlias =
true)
const override;
312 bool hasComponent(
const std::string &name,
bool checkAlias =
true)
const override;
319 void getValues(
const std::string &component,
326 double initialValue(std::size_t n, std::size_t j)
override;
332 std::size_t
nSpecies()
const {
return m_n_species; }
346 return m_cell->molecularWeights();
354 const std::vector<double> &
speciesCp()
const {
return m_cell->speciesCp(); }
363 m_cell->updateSpeciesCp(Tg, Te, Y, rho);
382 const std::vector<double> &
density()
const {
return m_rho; }
385 const std::vector<double> &
velocity()
const {
return m_u_r; }
398 const std::vector<double> &u_r);
413 void nodeDiagnostics(
double Tg,
double Te,
const double *Y, std::size_t j,
414 double &pressure,
double &electron_density)
const;
431 void nodeRates(std::size_t j,
double Tg,
double Te,
const double *Y,
432 double electric_field,
double *ydot)
const;
443 std::size_t j)
const;
457 double &diffusion_out,
458 std::vector<double> &species_mass_out)
const;
522 std::shared_ptr<Cantera::Solution>
m_solution;
526 std::unique_ptr<PlasmaCell> m_cell;
530 std::vector<std::unique_ptr<PlasmaCell>> m_extra_rhs;
534 std::string m_mech, m_phase;
535 std::size_t m_n_species;
536 std::size_t m_electron_index;
538 double m_outer_radius;
539 std::vector<double> m_rho;
545 std::vector<double> m_u_r;
549 bool m_hydrodynamics;
552 double m_wall_ghost_density;
559 double m_electric_field;
561 double m_species_diffusivity;
564 double m_ambient_temperature;
565 std::vector<double> m_Y_amb;
577 std::vector<PropertyTable> m_initY;
579 bool m_has_transport;
Outer-boundary vocabulary for the 1D radial channel: which treatment is applied, the primitive state ...
One cell of two-temperature reacting plasma: the source terms the 0-D reactor and the 1-D channel bot...
The parabolic half of PlasmaChannel1D::eval(): conduction in both pools, Fickian species diffusion,...
shared_ptr< Solution > m_solution
vector< double > values(const string &component) const
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 ...
const PropertyTable & electronConductivity() const
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 th...
OuterBc outerBcMode() const
Outer boundary treatment for the hydro sub-step [-].
void setEvaluatorPoolSize(std::size_t slots)
Give nodeRates() slots independent evaluators so that many threads can call it at once.
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 compone...
std::size_t nSpecies() const
Number of species K [-] in this domain's mechanism.
void setHydroState(const std::vector< double > &rho, const std::vector< double > &u_r)
Replace the fields the hydro sub-step owns.
void nodeDiagnostics(double Tg, double Te, const double *Y, std::size_t j, double &pressure, double &electron_density) const
Total pressure [Pa] and electron number density [1/m^3] for a node state, both from the two-temperatu...
std::size_t electronIndex() const
Species index of the electron [-]; the constructor rejects a mechanism without one,...
bool hasComponent(const std::string &name, bool checkAlias=true) const override
Whether name is "Tg", "Te", or a species of this domain's mechanism.
std::string componentName(std::size_t n) const override
Component n -> name ("Tg", "Te", or a species name).
void nodeRates(std::size_t j, double Tg, double Te, const double *Y, double electric_field, double *ydot) const
One node's time derivatives with no transport stencil: exactly what eval() computes for node j when h...
bool hydrodynamics() const
Whether the radial hydrodynamic sub-step is active [-].
void setElectricField(double electricField)
Applied electric field E [V/m] used by the next eval() call.
const std::vector< double > & molecularWeights() const
const PropertyTable & heavyConductivity() const
The transport tables and per-species properties the diffusion operator reads.
void updateSpeciesCp(double Tg, double Te, const double *Y, double rho) const
Refresh speciesCp() at one node's state.
const std::vector< double > & density() const
Per-node mass density [kg/m^3], length nPoints().
const std::vector< double > & velocity() const
Per-node radial velocity [m/s], length nPoints().
std::string domainType() const override
double nodeElectricalConductivity(double Tg, double Te, const double *Y, std::size_t j) const
Electrical conductivity [S/m] at one node's state, from the same composition-resolved closure the sou...
double faceRadius(std::size_t j) const
Radius of face j, the single definition of where a cell boundary sits (NUMERICS.md section 2).
std::size_t evaluatorPoolSize() const
Number of independent evaluators nodeRates() can be called on at once [-]; 1 unless setEvaluatorPoolS...
PlasmaChannel1D(const PlasmaChannelConfig &cfg)
Build the domain (mesh, thermo/kinetics, property tables) from cfg.
double faceSpacing(std::size_t j) const
Node-to-node spacing across face j [m], the distance a gradient at that face is taken over.
bool hasTransport() const
Whether any conduction or diffusion term is enabled [-].
std::size_t componentIndex(const std::string &name, bool checkAlias=true) const override
Component name -> index (inverse of componentName()); throws if unknown.
const std::vector< double > & speciesCp() const
Per-species [J/kg/K], length nSpecies(), at the state the cell was last evaluated at.
const std::vector< double > & ambientMassFractions() const
Ambient mass fractions [-], length nSpecies(): the composition outside the domain,...
OuterBc
Outer-boundary treatment (NUMERICS.md section 7).
WallEnergyOutflow wallEnergyOutflow(const PlasmaChannel1D &domain, Cantera::span< const double > x, const RadialDiffusionCoefficients &c, const double *species_enthalpy)
What conduction and species diffusion move through the wall face at the state x.
Everything PlasmaChannel1D needs to build itself.
std::vector< double > initTe_v
std::vector< double > kappa_e_T
Electron thermal conductivity table kappa_e(Te) [K], [W/m/K].
std::vector< double > init_rho_v
std::vector< double > initY_v
double electric_field
Applied electric field E [V/m], held at every node until the driver changes it through setElectricFie...
std::string mech
Cantera mechanism (YAML) file path.
double T_amb
Wall/ambient temperature T_amb [K], and the outer-wall Dirichlet ghost value for Tg.
std::vector< double > init_ur_v
std::vector< double > init_ur_r
u_r(r) at t=0 [m], [m/s].
bool hydrodynamics
Radial hydrodynamics (NUMERICS.md section 4.2's Strang split).
std::vector< double > sigma_v
double nu_m
Electron momentum-transfer frequency nu_m [1/s].
std::vector< double > species_h0k
Per-species standard enthalpy of formation at 0 K [J/kmol], forwarded to PlasmaCellConfig::species_h0...
std::vector< double > initTg_r
Tg(r) at t=0: _r is the radius axis [m], _v the temperature at that radius [K].
std::vector< double > kappa_e_v
double p_amb
Ambient pressure [Pa] handed to the hydro sub-step.
std::vector< double > kappa_H_v
std::vector< double > Y_amb
Ambient mass fractions [-], length K, summing to 1: the composition of the gas OUTSIDE the domain.
std::vector< double > init_rho_r
rho(r) at t=0 [m], [kg/m^3]; every value must be > 0.
double hydro_substep
Pinned hydro sub-step [s]; 0 lets the CFL bound choose it.
std::size_t n_points
Number of radial grid points [-]. Ignored when grid is given.
double nu_E
Elastic electron-heavy energy-exchange frequency nu_E [1/s].
std::vector< double > kappa_H_T
Heavy-pool thermal conductivity table kappa_H(Tg) [K], [W/m/K].
std::size_t Te_n
Collision-model Te grid point count [-]. Read only with specs.
std::string outer_bc_mode
Outer boundary treatment: "ambient_ghost" (the default, and the accurate choice while R_max sits beyo...
std::vector< double > initTg_v
double R_max
Outer (wall) radius R [m]. Ignored when grid is given.
double D_species
Constant scalar species mass diffusivity D [m^2/s].
double Te_min
Collision-model Te grid lower bound [K].
std::vector< double > sigma_T
Electrical conductivity table sigma(Te) [K], [S/m].
bool reacting
Include finite-rate chemistry source terms [-].
std::vector< double > initTe_r
Te(r) at t=0 [m], [K]. Python: Te0 (uniform) or Te_profile.
double cfl
Courant number for the hydro sub-step's own CFL sub-cycling [-].
std::vector< double > initY_r
Y(r) at t=0.
std::vector< double > nu_m_T
Te-dependent nu_m(Te) table [K], [1/s].
double Te_max
Collision-model Te grid upper bound [K].
std::vector< CollisionModel::SpeciesSpec > specs
Composition-resolved collision model, preferred over the legacy sigma/nu_m/nu_E closures above and mu...
double rho
Mass density rho [kg/m^3] held at every node, unless init_rho_r/init_rho_v give a radial profile.
std::vector< double > nu_m_v
std::vector< double > grid
Explicit radial grid [m], increasing from 0.
std::string phase
Phase name within mech; must be a PlasmaPhase carrying "e-".
Everything the diffusion block needs that the grid and the state do not carry: the transport coeffici...