rizer.cantera_ext
C++ Cantera 1-D plasma extension (custom Domain1D models and solvers)
Loading...
Searching...
No Matches
PlasmaColumnSolver.h
Go to the documentation of this file.
1// PlasmaColumnSolver: assembles [Empty1D, ThermalPlasmaColumn1D, Empty1D] into
2// a Cantera Sim1D, drives the steady solve with adaptive grid refinement, and
3// returns the converged radial profile as plain numeric vectors.
4//
5// The three-domain layout [Empty1D | ThermalPlasmaColumn1D | Empty1D] is the
6// standard Cantera pattern for a BVP that does not need inlet/outlet domains.
7// The Empty1D terminators satisfy the Sim1D API without contributing any
8// residual rows.
9//
10// No Cantera C++ type leaves this translation unit; the pybind11 bindings in
11// bindings.cpp convert the output vectors to numpy arrays. This keeps all ABI
12// coupling with libcantera inside one .so, away from the stock `cantera`
13// Python package.
14
15#ifndef RIZER_PLASMA_COLUMN_SOLVER_H
16#define RIZER_PLASMA_COLUMN_SOLVER_H
17
18#include "PropertyTable.h"
19
20#include <vector>
21#include <cstddef>
22
23namespace rizer {
24
27 std::vector<double> r;
29 std::vector<double> T;
30 std::vector<double> sigma;
31 std::vector<double> kappa;
32 double current = 0.0;
35 double electric_field = 0.0;
37 std::size_t n_points = 0;
38};
39
42 std::size_t n_points = 41;
44 double T_center_guess = 10000;
47 double rho_cp = 1.0e3;
51 int loglevel = 0;
54 bool refine_grid = true;
57 double refine_ratio = 4.0;
59 double refine_slope = 0.05;
62 double refine_curve = 0.10;
64 double refine_prune = 0.0;
67
77 std::vector<double> init_r;
79 std::vector<double> init_T;
81};
82
95ColumnResult solveColumn(double R, double electric_field, double T_wall,
96 const PropertyTable& sigma, const PropertyTable& kappa,
97 const PropertyTable& p_rad, const ColumnOptions& opts);
98
99} // namespace rizer
100
101#endif
ColumnResult solveColumn(double R, double electric_field, double T_wall, const PropertyTable &sigma, const PropertyTable &kappa, const PropertyTable &p_rad, const ColumnOptions &opts)
Build, solve, and extract the radial Elenbaas-Heller column.
Solver configuration. All fields have defaults matching a typical H2 arc.
std::vector< double > init_r
Optional seed profile for the initial guess.
int loglevel
Sim1D solver verbosity [-] (0 = silent, 1 = progress, higher = more detail).
double refine_ratio
Refiner: max allowed ratio of adjacent cell widths [-].
double refine_curve
Refiner: max allowed fractional curvature of T per cell [-].
double rho_cp
Volumetric heat capacity [J/m^3/K] — scales the pseudo-transient term used as a Newton fallback.
double refine_slope
Refiner: max allowed fractional change in T slope between adjacent cells [-].
double T_center_guess
Parabolic-seed centerline temperature [K], used to build the default initial guess.
double refine_prune
Refiner: remove grid points whose contribution falls below this threshold [-].
std::vector< double > init_T
Optional seed temperatures [K] at each init_r location.
std::size_t n_points
Initial uniform grid point count [-] (refined during solve if refine_grid).
bool refine_grid
Enable Cantera adaptive grid refinement [-] (true/false) during the solve.
Output of a completed column solve.
double electric_field
Axial E field [V/m] used for this solve (echo of the input).
std::size_t n_points
Number of grid points after adaptive refinement.
std::vector< double > T
Converged temperature [K] at each grid point.
double current
Total arc current [A], trapezoidal quadrature.
std::vector< double > sigma
Electrical conductivity [S/m] evaluated at T.
std::vector< double > kappa
Thermal conductivity [W/m/K] evaluated at T.
std::vector< double > r
Radial grid [m] after refinement, r[0]=0, r[N-1]=R.