rizer.cantera_ext
C++ Cantera 1-D plasma extension (custom Domain1D models and solvers)
Loading...
Searching...
No Matches
rizer::ChannelCircuit Class Reference

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

Detailed Description

The channel side of the circuit coupling.

Definition at line 51 of file CircuitCoupling.h.

Constructor & Destructor Documentation

◆ ChannelCircuit()

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.

Parameters
[in]channelDomain whose faces define the quadrature; held by reference and must outlive this object
[in]gapInter-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_offsetThis domain's offset into the global state [-]
[in]n_varsComponents per node, 2+K [-]
Exceptions
std::runtime_errorif 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.

Member Function Documentation

◆ active()

bool rizer::ChannelCircuit::active ( ) const
inline
Returns
Whether a circuit callback was supplied [-]

Definition at line 83 of file CircuitCoupling.h.

◆ closeOver()

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.

Parameters
[in]t0Start of the step [s]
[in]t1End of the step [s]
[in]xLive flat global state

Definition at line 78 of file CircuitCoupling.cpp.

◆ electricField()

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.

Parameters
[in]tTime within the step [s]
Returns
\(V_p(t)/\mathrm{gap}\) [V/m]

Definition at line 92 of file CircuitCoupling.cpp.

◆ sample()

CircuitSample rizer::ChannelCircuit::sample ( const std::vector< double > & x) const
Parameters
[in]xLive flat global state
Returns
The five circuit columns for the frame just recorded

Definition at line 102 of file CircuitCoupling.cpp.

◆ seedResistance()

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.

Parameters
[in]xLive flat global state (per-node Tg/Te/Y_k)

Definition at line 69 of file CircuitCoupling.cpp.


The documentation for this class was generated from the following files: