|
rizer.cantera_ext
C++ Cantera 1-D plasma extension (custom Domain1D models and solvers)
|
The channel side of the circuit coupling. More...
#include <CircuitCoupling.h>
Public Member Functions | |
| ChannelCircuit (const PlasmaChannel1D &channel, double gap, const std::function< double(double, double)> &plasma_voltage, std::size_t channel_offset, std::size_t n_vars) | |
| Build the coupling, or an inactive one when no callback is given. | |
| bool | active () const |
| void | seedResistance (const std::vector< double > &x) |
| Set the resistance from the current state without asking the circuit for a voltage. | |
| void | closeOver (double t0, double t1, const std::vector< double > &x) |
| Close the circuit over one step: freeze \(R_p\) at the state the step starts from and ask the callback for \(V_p\) at both ends. | |
| double | electricField (double t) const |
| Applied field over the step closeOver() last covered [V/m]. | |
| CircuitSample | sample (const std::vector< double > &x) const |
The channel side of the circuit coupling.
Definition at line 51 of file CircuitCoupling.h.
| rizer::ChannelCircuit::ChannelCircuit | ( | const PlasmaChannel1D & | channel, |
| double | gap, | ||
| const std::function< double(double, double)> & | plasma_voltage, | ||
| std::size_t | channel_offset, | ||
| std::size_t | n_vars ) |
Build the coupling, or an inactive one when no callback is given.
The cross-section quadrature is fixed at construction: cell areas \(\pi(r_{j+1}^2-r_j^2)\) over the same faces the hydro sub-step and the conduction stencil use, with the outer face clipped back to the last node. Without the clip the mirrored wall face would add half a cell of cross-section the gap does not have, and a channel that had spread to the wall would contribute conductance with it.
| [in] | channel | Domain whose faces define the quadrature; held by reference and must outlive this object |
| [in] | gap | Inter-electrode gap [m]; must be > 0 when plasma_voltage is set |
| [in] | plasma_voltage | \(V_p(t, R_p)\) [V] given [s] and [Ohm]; unset leaves the coupling inactive. Held by reference and must outlive this object: the binding's callable wraps a Python object, and the solve runs with the GIL released, so a copy here would change its reference count without the GIL |
| [in] | channel_offset | This domain's offset into the global state [-] |
| [in] | n_vars | Components per node, 2+K [-] |
| std::runtime_error | if active with a non-positive gap, or with fewer than 2 radial nodes, which leaves the cross-section no area to integrate over |
Definition at line 18 of file CircuitCoupling.cpp.
|
inline |
Definition at line 83 of file CircuitCoupling.h.
| void rizer::ChannelCircuit::closeOver | ( | double | t0, |
| double | t1, | ||
| const std::vector< double > & | x ) |
Close the circuit over one step: freeze \(R_p\) at the state the step starts from and ask the callback for \(V_p\) at both ends.
Call it after the first hydro half-step, so the resistance the circuit sees is the expanded channel's: the conductivity reads the hydro-updated density per node. Call it once per window, since a stateful circuit advances its own history on every call.
| [in] | t0 | Start of the step [s] |
| [in] | t1 | End of the step [s] |
| [in] | x | Live flat global state |
Definition at line 78 of file CircuitCoupling.cpp.
| double rizer::ChannelCircuit::electricField | ( | double | t | ) | const |
Applied field over the step closeOver() last covered [V/m].
Linear in \(V_p\) across the step, which is what keeps a stateful circuit's own history monotonic: it is asked for t0 and t1 once each, never at the integrator's internal trial times.
| [in] | t | Time within the step [s] |
Definition at line 92 of file CircuitCoupling.cpp.
| CircuitSample rizer::ChannelCircuit::sample | ( | const std::vector< double > & | x | ) | const |
| [in] | x | Live flat global state |
Definition at line 102 of file CircuitCoupling.cpp.
| void rizer::ChannelCircuit::seedResistance | ( | const std::vector< double > & | x | ) |
Set the resistance from the current state without asking the circuit for a voltage.
For the t=0 frame, which no step has been driven through: the resistance recorded against it is the initial state's and the voltage stays zero.
| [in] | x | Live flat global state (per-node Tg/Te/Y_k) |
Definition at line 69 of file CircuitCoupling.cpp.