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;
28 std::vector<double> T;
29 std::vector<double> sigma;
30 std::vector<double> kappa;
31 double current = 0.0;
32 double electric_field = 0.0;
33 std::size_t n_points = 0;
34};
35
38 std::size_t n_points = 41;
39 double T_center_guess = 10000;
40 double rho_cp = 1.0e3;
41 int loglevel = 0;
42 bool refine_grid = true;
43 double refine_ratio = 4.0;
44 double refine_slope = 0.05;
45 double refine_curve = 0.10;
46 double refine_prune = 0.0;
47
53 std::vector<double> init_r;
54 std::vector<double> init_T;
55};
56
58ColumnResult solveColumn(double R, double electric_field, double T_wall,
59 const PropertyTable& sigma, const PropertyTable& kappa,
60 const PropertyTable& p_rad, const ColumnOptions& opts);
61
62} // namespace rizer
63
64#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 verbosity (0 = silent, 1 = progress)
double refine_ratio
Refiner: max ratio of adjacent cell widths.
double refine_curve
Refiner: max fractional curvature per cell.
double rho_cp
rho*cp [J/m³/K] — scales the pseudo-transient term
double refine_slope
Refiner: max fractional slope change per cell.
double T_center_guess
parabolic-seed centerline temperature [K]
double refine_prune
Refiner: remove points below this threshold.
std::vector< double > init_T
seed temperatures [K] at init_r
std::size_t n_points
initial uniform grid count (refined during solve)
bool refine_grid
enable Cantera adaptive grid refinement
Output of a completed column solve.
double electric_field
E [V/m] used for this solve.
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
I = 2π·E·∫sigma(T)·r dr [A], trapezoidal.
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