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

Function printBulk

test_problems/surfSolverTest/surfaceSolver.cpp:56–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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