Class to set RHS for N-module RLC circuit with discharging capacitor, resistance, and inductance, out of each module.
More...
Class to set RHS for N-module RLC circuit with discharging capacitor, resistance, and inductance, out of each module.
This also includes a line inductance and resistance in the load branch along with a load. This circuit looks like the following: ____ ...______________________________
RN R2 R1 R_line
LN L2 L1 L_line
CN C2 C1 V_load | | | |
| |I2 (up) |I1 (up) |
| Ground
Each module can be switched on based on at different times. When the first line is on, we have the simple series RLC circuit with Vload (see series_rlc_with_load_rhs.h). When the successive modules are turned on, we have a a set of equations: 1) KCL -> I0 = sum_j=1^N Ij, where 2) Qdot_j = -Ij, Qdouble_dot = -Idot_j 3) KVL -> V_Cj - V_Rj - V_Lj - V_line - V_load = 0 4) V_Cj = Qj / Cj, V_Rj = Ij Rj = -Qjdot Rj, V_Lj = Ijdot Lj = -Qjdouble_dot Lj 5) V_line = L_Line * I0dot + R_line * I0 = L_line * sum_j=1^N Ijdot + R_line * sum_j=1^N Ij = -L_line * sum_j=1^N Qjdouble_dot - R_line * sum_j=1^N Qjdot We assume a vector [Q = [Q1, Q2, ..., QN], Qdot = [Q1dot, Q2dot ..., QNdot]] Equations 2 and 3 can be written as matrix equation: 6) [id 0] [Qdot] = [0 id] [Q ] + [0_N] (V_line + V_load) [0 L] [Qdouble_dot] [-C^-1 -R] [Qdot] [1_N] where L = diag(L1, L2, ..., LN), R = diag(R1, R2, ..., RN), C = diag(C1, C2, ..., CN) therefore C^-1 = diag(1/C1, 1/C2, ..., 1/CN) and 0_N is a vector of length N of zeros and 1_N is a vector of length N of ones. Also id is an identity matrix of size N x N. If we apply Eq. 5, we can rewrite Eq. 6 as 7) [id 0 ] [Qdot] = [0 id] [Q ] + [0_N] V_load [0 L_tot] [Qdouble_dot] [-C^-1 -R_tot] [Qdot] [1_N] where Ltot = L + L_line E, Rtot = R + R_line E, where E = an N x N matrix of all ones Inverting the left hand side matrix, Eq. 7 can be written 8) [Qdot] = [0 id] [Q ] + [0_N ] V_load [Qdouble_dot] [-Ltot^-1*C^-1 -Ltot^-1*R_tot] [Qdot] [Ltot^-1*1_N] where Ltot^-1 can be written using the Sherman-Morrison formula as: Ltot^-1_ij = L^-1_ij - LT / (Li * Lj) where L^-1 = diag(1/L1, 1/L2, ..., 1/LN) and where LT = L_line / (1 + L_line * sum_k=1^N (1/Lk)) note that another way to write LT is: 1 / LT = 1 / L_line + sum_k=1^N (1/Lk) which is what adding up parallel inductances looks like, but would be problematic for L_line = 0 So in the end, this app is used to solve dqdt = [Qdot, Qdouble_dot] = RHS as written in Eq. 8 using the time integrator
|
| SubmoduleRLCWithLoadRHS () |
| Constructor.
|
|
| ~SubmoduleRLCWithLoadRHS () override |
| Destructor.
|
|
void | setup (const WxCryptSet &wxc) override |
| Setup.
|
|
const std::vector< int > & | getInputVariableIndexes (int flag) const override |
| Grab input variable indices.
|
|
const std::vector< int > & | getAuxiliaryVariableIndexes (int flag) const override |
| Grab auxiliary variable indices.
|
|
const std::vector< int > & | getOutputVariableIndexes (int flag) const override |
| Grab output variable indices.
|
|
void | evaluate_function (const real *q, const real *aux, const solverVariables_t *pSV, real *result) const override |
| Redefinition of the function evaluator.
|
|
| WmApplication () |
|
virtual | ~WmApplication ()=default |
|
virtual void | setup (const WxCryptSet &wxc) |
|
virtual const std::vector< int > & | getAuxiliaryVariableIndexes (int flag=WMAPPLICATIONFLAG_NONE) const |
|
virtual const std::vector< int > & | getCrossVariableIndexes (int flag=WMAPPLICATIONFLAG_NONE) const |
|
const std::vector< std::string > & | getBoundaryNames () const |
|
bool | isOnBoundary (const std::string &boundaryName) const |
|
bool | has (int flag) const |
|
virtual real | numerical_flux (const real *q_l, const real *q_r, const real *aux_l, const real *aux_r, const solverVariables_t *pFV, real *numericalFlux) const |
|
virtual real | internal_flux (const real *q, const real *aux, const solverVariables_t *pSV, std::vector< std::vector< real > > &internalFlux) const |
|
virtual real | source (const real *q, const real *aux, const elementGeometry_t *pEG, real *source) const |
|
virtual void | bc_q (const real *q_in, const real *aux_in, const real *aux_out, const solverVariables_t *pFV, real *q_out) const |
| Boundary Condition Application which sets the boundary condition on ghost nodes.
|
|
virtual real | bcNumericalFlux (const real *q_l, const real *q_r, const real *aux_l, const real *aux_r, const solverVariables_t *pFV, real *numericalFlux) const |
|
virtual void | conserved_to_primitive (const real *q, const real *aux, real *w) const |
|
virtual void | primitive_to_conserved (const real *w, const real *aux, real *q) const |
|
virtual void | evaluate_function (const real *q, const real *aux, const solverVariables_t *pSV, real *result) const |
|
virtual void | bc_q_kinetic (const real *q_in, const real *aux_in, const solverVariables_t *pFV, real *q_out) const |
|
std::shared_ptr< std::string > | app_name () |
|
virtual const std::vector< int > & | getInputVariableIndexes (int flag=0) const |
|
virtual const std::vector< int > & | getOutputVariableIndexes (int flag=0) const |
|