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

Function printSurf

test_problems/surfSolverTest/surfaceSolver.cpp:102–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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