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

Function printBulk

test_problems/surfSolverTest/surfaceSolver2.cpp:58–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56}
57
58void printBulk(ostream& oooo, shared_ptr<ThermoPhase> bulkPhaseTP,
59 shared_ptr<InterfaceKinetics> iKin_ptr, double* src)
60{
61 double x[MSSIZE];
62 double C[MSSIZE];
63 oooo.precision(3);
64 string bulkParticlePhaseName = bulkPhaseTP->name();
65 bulkPhaseTP->getMoleFractions(x);
66 bulkPhaseTP->getConcentrations(C);
67 size_t nBulk = iKin_ptr->phaseIndex(bulkParticlePhaseName);
68 size_t kstart = iKin_ptr->kineticsSpeciesIndex(0, nBulk);
69 double dens = bulkPhaseTP->density();
70 oooo << "Bulk Phase: " << bulkParticlePhaseName << " "
71 << "(" << kstart << ")" << endl;
72 double Temp = bulkPhaseTP->temperature();
73 double p = bulkPhaseTP->pressure();
74 oooo << "Bulk Temperature = " << Temp << endl;
75 oooo << "Bulk Pressure = " << p << endl;
76 oooo << " Name "
77 << " Conc MoleF SrcRate " << endl;
78 oooo << " "
79 << " (kmol/m^3) (kmol/m^2/s) " << endl;
80 double sum = 0.0;
81 double Wsum = 0.0;
82 const vector<double>& molecW = bulkPhaseTP->molecularWeights();
83 size_t nspBulk = bulkPhaseTP->nSpecies();
84 for (size_t k = 0; k < nspBulk; k++) {
85 kstart = iKin_ptr->kineticsSpeciesIndex(k, nBulk);
86 fmt::print(oooo, "{:4d} {:>24s} {:14g} {:14g} {:14e}\n",
87 k, bulkPhaseTP->speciesName(k), C[k], x[k], src[kstart]);
88 sum += x[k];
89 Wsum += src[kstart] * molecW[k];
90 }
91 oooo << "Bulk Weight Growth Rate = " << Wsum << " kg/m^2/s" << endl;
92 double gr = Wsum / dens;
93 oooo << "Bulk Growth Rate = " << gr << " m/s" << endl;
94 oooo << "Bulk Growth Rate = " << gr * 1.0E6 * 3600.
95 << " microns / hour" << endl;
96 oooo << "Density of bulk phase = " << dens << " kg / m^3 "<< endl;
97 oooo << " = " << dens / 1.0E3
98 <<" gm / cm^3 " << endl;
99 oooo << "Sum of bulk mole fractions= " << sum << endl;
100 oooo << endl;
101}
102
103void printSurf(ostream& oooo, shared_ptr<ThermoPhase> surfPhaseTP,
104 shared_ptr<InterfaceKinetics> iKin_ptr, double* src)

Callers 1

mainFunction · 0.70

Calls 10

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

Tested by

no test coverage detected