MCPcopy Create free account
hub / github.com/Cantera/cantera / evalSurfaces

Method evalSurfaces

src/zeroD/Reactor.cpp:295–322  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

293}
294
295void Reactor::evalSurfaces(double* LHS, double* RHS, double* sdot)
296{
297 fill(sdot, sdot + m_nsp, 0.0);
298 size_t loc = 0; // offset into ydot
299
300 for (auto S : m_surfaces) {
301 Kinetics* kin = S->kinetics();
302 SurfPhase* surf = S->thermo();
303
304 double rs0 = 1.0/surf->siteDensity();
305 size_t nk = surf->nSpecies();
306 double sum = 0.0;
307 S->syncState();
308 kin->getNetProductionRates(&m_work[0]);
309 for (size_t k = 1; k < nk; k++) {
310 RHS[loc + k] = m_work[k] * rs0 * surf->size(k);
311 sum -= RHS[loc + k];
312 }
313 RHS[loc] = sum;
314 loc += nk;
315
316 size_t bulkloc = kin->kineticsSpeciesIndex(m_thermo->speciesName(0));
317 double wallarea = S->area();
318 for (size_t k = 0; k < m_nsp; k++) {
319 sdot[k] += m_work[bulkloc + k] * wallarea;
320 }
321 }
322}
323
324vector<size_t> Reactor::steadyConstraints() const
325{

Callers

nothing calls this directly

Calls 10

getNetProductionRatesMethod · 0.80
kineticsMethod · 0.45
thermoMethod · 0.45
siteDensityMethod · 0.45
nSpeciesMethod · 0.45
syncStateMethod · 0.45
sizeMethod · 0.45
kineticsSpeciesIndexMethod · 0.45
speciesNameMethod · 0.45
areaMethod · 0.45

Tested by

no test coverage detected