|
17 | 17 | namespace Cantera |
18 | 18 | { |
19 | 19 |
|
| 20 | +FlowReactor::FlowReactor(shared_ptr<Solution> sol, const string& name) |
| 21 | + : FlowReactor(sol, true, name) |
| 22 | +{ |
| 23 | +} |
| 24 | + |
| 25 | +FlowReactor::FlowReactor(shared_ptr<Solution> sol, bool clone, const string& name) |
| 26 | + : IdealGasReactor(sol, clone, name) |
| 27 | +{ |
| 28 | + m_nv = 4 + m_nsp; // rho, u, P, T, and species mass fractions |
| 29 | + m_rho = m_thermo->density(); |
| 30 | + // resize temporary arrays |
| 31 | + m_wdot.resize(m_nsp); |
| 32 | + m_hk.resize(m_nsp); |
| 33 | +} |
| 34 | + |
20 | 35 | void FlowReactor::getStateDae(double* y, double* ydot) |
21 | 36 | { |
22 | 37 | m_thermo->getMassFractions(y+m_offset_Y); |
@@ -132,20 +147,6 @@ void FlowReactor::getStateDae(double* y, double* ydot) |
132 | 147 | solve(a, ydot, 1, 0); |
133 | 148 | } |
134 | 149 |
|
135 | | -void FlowReactor::initialize(double t0) |
136 | | -{ |
137 | | - Reactor::initialize(t0); |
138 | | - // initialize state |
139 | | - m_rho = m_thermo->density(); |
140 | | - // resize temporary arrays |
141 | | - m_wdot.resize(m_nsp); |
142 | | - m_hk.resize(m_nsp); |
143 | | - // set number of variables to the number of non-species equations |
144 | | - // i.e., density, velocity, pressure and temperature |
145 | | - // plus the number of species in the gas phase |
146 | | - m_nv = m_offset_Y + m_nsp; |
147 | | -} |
148 | | - |
149 | 150 | void FlowReactor::updateState(double* y) |
150 | 151 | { |
151 | 152 | // Set the mass fractions and density of the mixture. |
|
0 commit comments