rizer.cantera_ext
C++ Cantera 1-D plasma extension (custom Domain1D models and solvers)
Toggle main menu visibility
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
23
namespace
rizer
{
24
26
struct
ColumnResult
{
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
41
struct
ColumnOptions
{
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
95
ColumnResult
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
PropertyTable.h
rizer::PropertyTable
Definition
PropertyTable.h:31
rizer
Definition
CollisionModel.cpp:7
rizer::solveColumn
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.
Definition
PlasmaColumnSolver.cpp:13
rizer::ColumnOptions
Solver configuration. All fields have defaults matching a typical H2 arc.
Definition
PlasmaColumnSolver.h:41
rizer::ColumnOptions::init_r
std::vector< double > init_r
Optional seed profile for the initial guess.
Definition
PlasmaColumnSolver.h:77
rizer::ColumnOptions::loglevel
int loglevel
Sim1D solver verbosity [-] (0 = silent, 1 = progress, higher = more detail).
Definition
PlasmaColumnSolver.h:51
rizer::ColumnOptions::refine_ratio
double refine_ratio
Refiner: max allowed ratio of adjacent cell widths [-].
Definition
PlasmaColumnSolver.h:57
rizer::ColumnOptions::refine_curve
double refine_curve
Refiner: max allowed fractional curvature of T per cell [-].
Definition
PlasmaColumnSolver.h:62
rizer::ColumnOptions::rho_cp
double rho_cp
Volumetric heat capacity [J/m^3/K] — scales the pseudo-transient term used as a Newton fallback.
Definition
PlasmaColumnSolver.h:47
rizer::ColumnOptions::refine_slope
double refine_slope
Refiner: max allowed fractional change in T slope between adjacent cells [-].
Definition
PlasmaColumnSolver.h:59
rizer::ColumnOptions::T_center_guess
double T_center_guess
Parabolic-seed centerline temperature [K], used to build the default initial guess.
Definition
PlasmaColumnSolver.h:44
rizer::ColumnOptions::refine_prune
double refine_prune
Refiner: remove grid points whose contribution falls below this threshold [-].
Definition
PlasmaColumnSolver.h:64
rizer::ColumnOptions::init_T
std::vector< double > init_T
Optional seed temperatures [K] at each init_r location.
Definition
PlasmaColumnSolver.h:79
rizer::ColumnOptions::n_points
std::size_t n_points
Initial uniform grid point count [-] (refined during solve if refine_grid).
Definition
PlasmaColumnSolver.h:42
rizer::ColumnOptions::refine_grid
bool refine_grid
Enable Cantera adaptive grid refinement [-] (true/false) during the solve.
Definition
PlasmaColumnSolver.h:54
rizer::ColumnResult
Output of a completed column solve.
Definition
PlasmaColumnSolver.h:26
rizer::ColumnResult::electric_field
double electric_field
Axial E field [V/m] used for this solve (echo of the input).
Definition
PlasmaColumnSolver.h:35
rizer::ColumnResult::n_points
std::size_t n_points
Number of grid points after adaptive refinement.
Definition
PlasmaColumnSolver.h:37
rizer::ColumnResult::T
std::vector< double > T
Converged temperature [K] at each grid point.
Definition
PlasmaColumnSolver.h:29
rizer::ColumnResult::current
double current
Total arc current [A], trapezoidal quadrature.
Definition
PlasmaColumnSolver.h:32
rizer::ColumnResult::sigma
std::vector< double > sigma
Electrical conductivity [S/m] evaluated at T.
Definition
PlasmaColumnSolver.h:30
rizer::ColumnResult::kappa
std::vector< double > kappa
Thermal conductivity [W/m/K] evaluated at T.
Definition
PlasmaColumnSolver.h:31
rizer::ColumnResult::r
std::vector< double > r
Radial grid [m] after refinement, r[0]=0, r[N-1]=R.
Definition
PlasmaColumnSolver.h:27
rizer
cantera_ext
src
PlasmaColumnSolver.h
Generated by
1.17.0