rizer.cantera_ext
C++ Cantera 1-D plasma extension (custom Domain1D models and solvers)
Loading...
Searching...
No Matches
CircuitCoupling.h
Go to the documentation of this file.
1
15
16#ifndef RIZER_CIRCUIT_COUPLING_H
17#define RIZER_CIRCUIT_COUPLING_H
18
19#include "PlasmaChannel1D.h"
20
21#include <cstddef>
22#include <functional>
23#include <vector>
24
25namespace rizer
26{
27
34 {
37 double Rp = 0.0;
41 double Rp_state = 0.0;
43 double Vp = 0.0;
45 double current = 0.0;
47 double electric_field = 0.0;
48 };
49
52 {
53 public:
78 ChannelCircuit(const PlasmaChannel1D &channel, double gap,
79 const std::function<double(double, double)> &plasma_voltage,
80 std::size_t channel_offset, std::size_t n_vars);
81
83 bool active() const { return static_cast<bool>(*m_plasma_voltage); }
84
92 void seedResistance(const std::vector<double> &x);
93
104 void closeOver(double t0, double t1, const std::vector<double> &x);
105
113 double electricField(double t) const;
114
117 CircuitSample sample(const std::vector<double> &x) const;
118
119 private:
127 double conductance(const std::vector<double> &x) const;
128
131 double resistanceFrom(double conductance_value) const;
132
133 const PlasmaChannel1D *m_channel; // Non-owning
134 double m_gap; // Inter-electrode gap [m]
135 const std::function<double(double, double)> *m_plasma_voltage; // Non-owning
136 std::size_t m_channel_offset; // Offset into the global state [-]
137 std::size_t m_n_vars; // Components per node, 2+K [-]
138 std::size_t m_n_points; // Radial grid points [-]
139 std::vector<double> m_cell_area; // Per-node cross-section [m^2]
140
141 // The circuit's state over the step currently being advanced.
142 double m_t0 = 0.0; // Start of that step [s]
143 double m_dt = 1.0; // Its length [s]
144 double m_Vp0 = 0.0; // Terminal voltage at m_t0 [V]
145 double m_Vp1 = 0.0; // Terminal voltage at m_t0 + m_dt [V]
146 double m_Rp; // Resistance the step is driven with [Ohm]
147 };
148
149} // namespace rizer
150
151#endif // RIZER_CIRCUIT_COUPLING_H
The transient two-temperature radial channel as a Cantera Domain1D: per-node source terms from Plasma...
void seedResistance(const std::vector< double > &x)
Set the resistance from the current state without asking the circuit for a voltage.
double electricField(double t) const
Applied field over the step closeOver() last covered [V/m].
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.
CircuitSample sample(const std::vector< double > &x) const
void closeOver(double t0, double t1, const std::vector< double > &x)
Close the circuit over one step: freeze at the state the step starts from and ask the callback for ...
Transient, two-temperature (Te != Tg), finite-rate reacting 1-D radial plasma channel (custom Cantera...
The circuit columns of one recorded frame.
double current
Total current [A].
double Vp
Plasma terminal voltage at the end of the step [V].
double electric_field
Applied field [V/m].
double Rp_state
Resistance OF this frame's own recorded fields, which is what a reader recomputing it from Tg,...
double Rp
Resistance the circuit was DRIVEN with over the step ending at this frame, which is what current was ...