| 277 | } |
| 278 | |
| 279 | void InterfaceRateBase::setContext(const Reaction& rxn, const Kinetics& kin) |
| 280 | { |
| 281 | setSpecies(kin.thermo().speciesNames()); |
| 282 | |
| 283 | m_chargeTransfer = rxn.usesElectrochemistry(kin); |
| 284 | if (!m_chargeTransfer) { |
| 285 | return; |
| 286 | } |
| 287 | |
| 288 | m_stoichCoeffs.clear(); |
| 289 | for (const auto& [name, stoich] : rxn.reactants) { |
| 290 | m_stoichCoeffs.emplace_back(kin.kineticsSpeciesIndex(name), -stoich); |
| 291 | } |
| 292 | for (const auto& [name, stoich] : rxn.products) { |
| 293 | m_stoichCoeffs.emplace_back(kin.kineticsSpeciesIndex(name), stoich); |
| 294 | } |
| 295 | |
| 296 | m_netCharges.clear(); |
| 297 | for (const auto& [k, stoich] : m_stoichCoeffs) { |
| 298 | size_t n = kin.speciesPhaseIndex(k); |
| 299 | size_t start = kin.kineticsSpeciesIndex(0, n); |
| 300 | double charge = kin.thermo(n).charge(k - start); |
| 301 | m_netCharges.emplace_back(n, Faraday * charge * stoich); |
| 302 | } |
| 303 | } |
| 304 | |
| 305 | StickingCoverage::StickingCoverage() |
| 306 | : m_motzWise(false) |
no test coverage detected