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

Function printSurf

test_problems/surfSolverTest/surfaceSolver2.cpp:103–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101}
102
103void printSurf(ostream& oooo, shared_ptr<ThermoPhase> surfPhaseTP,
104 shared_ptr<InterfaceKinetics> iKin_ptr, double* src)
105{
106 double x[MSSIZE];
107 oooo.precision(3);
108 string surfParticlePhaseName = surfPhaseTP->name();
109 surfPhaseTP->getMoleFractions(x);
110 size_t nSurf = iKin_ptr->phaseIndex(surfParticlePhaseName);
111 size_t kstart = iKin_ptr->kineticsSpeciesIndex(0, nSurf);
112 oooo << "Surface Phase: " << surfParticlePhaseName
113 << " (" << kstart << ")" << endl;
114 double Temp = surfPhaseTP->temperature();
115 double p = surfPhaseTP->pressure();
116 oooo << "Surface Temperature = " << Temp << endl;
117 oooo << "Surface Pressure = " << p << endl;
118 oooo << " Name "
119 << " Coverage SrcRate " << endl;
120 double sum = 0.0;
121 size_t nspSurf = surfPhaseTP->nSpecies();
122 for (size_t k = 0; k < nspSurf; k++) {
123 kstart = iKin_ptr->kineticsSpeciesIndex(k, nSurf);
124 double srcK = src[kstart];
125 if (fabs(srcK) < 1.0E-8) {
126 srcK = 0.0;
127 }
128 fmt::print(oooo, "{:4d} {:>24s} {:14g} {:14e}\n",
129 k, surfPhaseTP->speciesName(k), x[k], srcK);
130 sum += x[k];
131 }
132 oooo << "Sum of coverages = " << sum << endl;
133}
134
135int main(int argc, char** argv)
136{

Callers 1

mainFunction · 0.70

Calls 8

nameMethod · 0.45
getMoleFractionsMethod · 0.45
phaseIndexMethod · 0.45
kineticsSpeciesIndexMethod · 0.45
temperatureMethod · 0.45
pressureMethod · 0.45
nSpeciesMethod · 0.45
speciesNameMethod · 0.45

Tested by

no test coverage detected