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

Function printGas

test_problems/surfSolverTest/surfaceSolver2.cpp:23–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21using namespace Cantera;
22
23void printGas(ostream& oooo, shared_ptr<ThermoPhase> gasTP,
24 shared_ptr<InterfaceKinetics> iKin_ptr, double* src)
25{
26 double x[MSSIZE];
27 double C[MSSIZE];
28 oooo.precision(3);
29 string gasPhaseName = "gas";
30 gasTP->getMoleFractions(x);
31 gasTP->getConcentrations(C);
32 double Temp = gasTP->temperature();
33 double p = gasTP->pressure();
34 oooo << "Gas Temperature = " << Temp << endl;
35 oooo << "Gas Pressure = " << p << endl;
36 size_t nGas = iKin_ptr->phaseIndex(gasPhaseName);
37 size_t kstart = iKin_ptr->kineticsSpeciesIndex(0, nGas);
38 oooo << "Gas Phase: " << gasPhaseName << " "
39 << "(" << kstart << ")" << endl;
40 oooo << " Name "
41 << " Conc MoleF SrcRate " << endl;
42 oooo << " "
43 << " (kmol/m^3) (kmol/m^2/s) " << endl;
44 double sum = 0.0;
45 size_t nspGas = gasTP->nSpecies();
46 for (size_t k = 0; k < nspGas; k++) {
47 kstart = iKin_ptr->kineticsSpeciesIndex(k, nGas);
48 fmt::print(oooo, "{:4d} {:>24s} {:14g} {:14g} {:14e}\n",
49 k, gasTP->speciesName(k), C[k], x[k], src[kstart]);
50 sum += x[k];
51 }
52 oooo << "Sum of gas mole fractions= " << sum << endl;
53 oooo << endl;
54
55
56}
57
58void printBulk(ostream& oooo, shared_ptr<ThermoPhase> bulkPhaseTP,
59 shared_ptr<InterfaceKinetics> iKin_ptr, double* src)

Callers 1

mainFunction · 0.70

Calls 8

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

Tested by

no test coverage detected