17 #define COLL_INT_POLY_DEGREE 8
19 GasTransport::GasTransport(ThermoPhase* thermo) :
39 void GasTransport::update_T()
41 if (m_thermo->nSpecies() != m_nsp) {
43 init(m_thermo, m_mode, m_log_level);
46 double T = m_thermo->temperature();
55 m_sqrt_t = sqrt(m_temp);
56 m_t14 = sqrt(m_sqrt_t);
57 m_t32 = m_temp * m_sqrt_t;
60 m_polytempvec[0] = 1.0;
61 m_polytempvec[1] = m_logt;
62 m_polytempvec[2] = m_logt*m_logt;
63 m_polytempvec[3] = m_logt*m_logt*m_logt;
64 m_polytempvec[4] = m_logt*m_logt*m_logt*m_logt;
73 doublereal GasTransport::viscosity()
82 doublereal vismix = 0.0;
88 multiply(m_phi, m_molefracs.data(), m_spwork.data());
90 for (
size_t k = 0; k < m_nsp; k++) {
91 vismix += m_molefracs[k] * m_visc[k]/m_spwork[k];
97 void GasTransport::updateViscosity_T()
100 updateSpeciesViscosities();
104 for (
size_t j = 0; j < m_nsp; j++) {
105 for (
size_t k = j; k < m_nsp; k++) {
106 double vratiokj = m_visc[k]/m_visc[j];
107 double wratiojk = m_mw[j]/m_mw[k];
110 double factor1 = 1.0 + (m_sqvisc[k]/m_sqvisc[j]) * m_wratjk(k,j);
111 m_phi(k,j) = factor1*factor1 / (sqrt(8.0) * m_wratkj1(j,k));
112 m_phi(j,k) = m_phi(k,j)/(vratiokj * wratiojk);
118 void GasTransport::updateSpeciesViscosities()
121 if (m_mode == CK_Mode) {
122 for (
size_t k = 0; k < m_nsp; k++) {
123 m_visc[k] = exp(
dot4(m_polytempvec, m_visccoeffs[k]));
124 m_sqvisc[k] = sqrt(m_visc[k]);
127 for (
size_t k = 0; k < m_nsp; k++) {
129 m_sqvisc[k] = m_t14 *
dot5(m_polytempvec, m_visccoeffs[k]);
130 m_visc[k] = (m_sqvisc[k] * m_sqvisc[k]);
136 void GasTransport::updateDiff_T()
141 if (m_mode == CK_Mode) {
142 for (
size_t i = 0; i < m_nsp; i++) {
143 for (
size_t j = i; j < m_nsp; j++) {
144 m_bdiff(i,j) = exp(
dot4(m_polytempvec, m_diffcoeffs[ic]));
145 m_bdiff(j,i) = m_bdiff(i,j);
150 for (
size_t i = 0; i < m_nsp; i++) {
151 for (
size_t j = i; j < m_nsp; j++) {
152 m_bdiff(i,j) = m_temp * m_sqrt_t*
dot5(m_polytempvec,
154 m_bdiff(j,i) = m_bdiff(i,j);
162 void GasTransport::getBinaryDiffCoeffs(
const size_t ld, doublereal*
const d)
170 throw CanteraError(
"GasTransport::getBinaryDiffCoeffs",
"ld is too small");
172 doublereal rp = 1.0/m_thermo->pressure();
173 for (
size_t i = 0; i < m_nsp; i++) {
174 for (
size_t j = 0; j < m_nsp; j++) {
175 d[ld*j + i] = rp * m_bdiff(i,j);
180 void GasTransport::getMixDiffCoeffs(doublereal*
const d)
190 doublereal mmw = m_thermo->meanMolecularWeight();
191 doublereal p = m_thermo->pressure();
193 d[0] = m_bdiff(0,0) / p;
195 for (
size_t k = 0; k < m_nsp; k++) {
197 for (
size_t j = 0; j < m_nsp; j++) {
199 sum2 += m_molefracs[j] / m_bdiff(j,k);
203 d[k] = m_bdiff(k,k) / p;
205 d[k] = (mmw - m_molefracs[k] * m_mw[k])/(p * mmw * sum2);
211 void GasTransport::getMixDiffCoeffsMole(doublereal*
const d)
221 doublereal p = m_thermo->pressure();
223 d[0] = m_bdiff(0,0) / p;
225 for (
size_t k = 0; k < m_nsp; k++) {
227 for (
size_t j = 0; j < m_nsp; j++) {
229 sum2 += m_molefracs[j] / m_bdiff(j,k);
233 d[k] = m_bdiff(k,k) / p;
235 d[k] = (1 - m_molefracs[k]) / (p * sum2);
241 void GasTransport::getMixDiffCoeffsMass(doublereal*
const d)
251 doublereal mmw = m_thermo->meanMolecularWeight();
252 doublereal p = m_thermo->pressure();
255 d[0] = m_bdiff(0,0) / p;
257 for (
size_t k=0; k<m_nsp; k++) {
260 for (
size_t i=0; i<m_nsp; i++) {
264 sum1 += m_molefracs[i] / m_bdiff(k,i);
265 sum2 += m_molefracs[i] * m_mw[i] / m_bdiff(k,i);
268 sum2 *= p * m_molefracs[k] / (mmw - m_mw[k]*m_molefracs[k]);
269 d[k] = 1.0 / (sum1 + sum2);
274 void GasTransport::init(
thermo_t* thermo,
int mode,
int log_level)
279 m_log_level = log_level;
282 setupCollisionParameters();
283 setupCollisionIntegral();
285 m_molefracs.resize(m_nsp);
286 m_spwork.resize(m_nsp);
287 m_visc.resize(m_nsp);
288 m_sqvisc.resize(m_nsp);
289 m_phi.resize(m_nsp, m_nsp, 0.0);
290 m_bdiff.resize(m_nsp, m_nsp);
293 m_mw = m_thermo->molecularWeights();
295 m_wratjk.resize(m_nsp, m_nsp, 0.0);
296 m_wratkj1.resize(m_nsp, m_nsp, 0.0);
297 for (
size_t j = 0; j < m_nsp; j++) {
298 for (
size_t k = j; k < m_nsp; k++) {
299 m_wratjk(j,k) = sqrt(m_mw[j]/m_mw[k]);
300 m_wratjk(k,j) = sqrt(m_wratjk(j,k));
301 m_wratkj1(j,k) = sqrt(1.0 + m_mw[k]/m_mw[j]);
306 void GasTransport::setupCollisionParameters()
308 m_epsilon.resize(m_nsp, m_nsp, 0.0);
309 m_delta.resize(m_nsp, m_nsp, 0.0);
310 m_reducedMass.resize(m_nsp, m_nsp, 0.0);
311 m_dipole.resize(m_nsp, m_nsp, 0.0);
312 m_diam.resize(m_nsp, m_nsp, 0.0);
313 m_crot.resize(m_nsp);
314 m_zrot.resize(m_nsp);
315 m_polar.resize(m_nsp,
false);
316 m_alpha.resize(m_nsp, 0.0);
317 m_poly.resize(m_nsp);
318 m_sigma.resize(m_nsp);
320 m_w_ac.resize(m_nsp);
321 m_disp.resize(m_nsp, 0.0);
322 m_quad_polar.resize(m_nsp, 0.0);
324 const vector_fp& mw = m_thermo->molecularWeights();
327 for (
size_t i = 0; i < m_nsp; i++) {
328 m_poly[i].resize(m_nsp);
331 double f_eps, f_sigma;
333 for (
size_t i = 0; i < m_nsp; i++) {
334 for (
size_t j = i; j < m_nsp; j++) {
336 m_reducedMass(i,j) = mw[i] * mw[j] / (
Avogadro * (mw[i] + mw[j]));
339 m_diam(i,j) = 0.5*(m_sigma[i] + m_sigma[j]);
342 m_epsilon(i,j) = sqrt(m_eps[i]*m_eps[j]);
345 m_dipole(i,j) = sqrt(m_dipole(i,i)*m_dipole(j,j));
348 double d = m_diam(i,j);
349 m_delta(i,j) = 0.5 * m_dipole(i,j)*m_dipole(i,j)
350 / (4 *
Pi *
epsilon_0 * m_epsilon(i,j) * d * d * d);
351 makePolarCorrections(i, j, f_eps, f_sigma);
352 m_diam(i,j) *= f_sigma;
353 m_epsilon(i,j) *= f_eps;
356 m_reducedMass(j,i) = m_reducedMass(i,j);
357 m_diam(j,i) = m_diam(i,j);
358 m_epsilon(j,i) = m_epsilon(i,j);
359 m_dipole(j,i) = m_dipole(i,j);
360 m_delta(j,i) = m_delta(i,j);
365 void GasTransport::setupCollisionIntegral()
367 double tstar_min = 1.e8, tstar_max = 0.0;
368 for (
size_t i = 0; i < m_nsp; i++) {
369 for (
size_t j = i; j < m_nsp; j++) {
372 tstar_min = std::min(tstar_min,
Boltzmann * m_thermo->minTemp()/m_epsilon(i,j));
373 tstar_max = std::max(tstar_max,
Boltzmann * m_thermo->maxTemp()/m_epsilon(i,j));
378 if (m_mode == CK_Mode) {
384 debuglog(
"*** collision_integrals ***\n", m_log_level);
386 integrals.
init(tstar_min, tstar_max, m_log_level);
387 fitCollisionIntegrals(integrals);
388 debuglog(
"*** end of collision_integrals ***\n", m_log_level);
390 debuglog(
"*** property fits ***\n", m_log_level);
391 fitProperties(integrals);
392 debuglog(
"*** end of property fits ***\n", m_log_level);
395 void GasTransport::getTransportData()
397 for (
size_t k = 0; k < m_thermo->nSpecies(); k++) {
398 shared_ptr<Species> s = m_thermo->species(k);
403 "Missing gas-phase transport data for species '{}'.", s->name);
408 }
else if (sptran->
geometry ==
"linear") {
410 }
else if (sptran->
geometry ==
"nonlinear") {
416 m_dipole(k,k) = sptran->
dipole;
417 m_polar[k] = (sptran->
dipole > 0);
426 void GasTransport::makePolarCorrections(
size_t i,
size_t j,
427 doublereal& f_eps, doublereal& f_sigma)
430 if (m_polar[i] == m_polar[j]) {
438 size_t kp = (m_polar[i] ? i : j);
439 size_t knp = (i == kp ? j : i);
440 double d3np, d3p, alpha_star, mu_p_star, xi;
441 d3np = pow(m_sigma[knp],3);
442 d3p = pow(m_sigma[kp],3);
443 alpha_star = m_alpha[knp]/d3np;
444 mu_p_star = m_dipole(kp,kp)/sqrt(4 *
Pi *
epsilon_0 * d3p * m_eps[kp]);
445 xi = 1.0 + 0.25 * alpha_star * mu_p_star * mu_p_star *
446 sqrt(m_eps[kp]/m_eps[knp]);
447 f_sigma = pow(xi, -1.0/6.0);
457 "fits to A*, B*, and C* vs. log(T*).\n"
458 "These are done only for the required dstar(j,k) values.\n\n");
459 if (m_log_level < 3) {
460 writelog(
"*** polynomial coefficients not printed (log_level < 3) ***\n");
464 m_omega22_poly.clear();
465 m_astar_poly.clear();
466 m_bstar_poly.clear();
467 m_cstar_poly.clear();
468 for (
size_t i = 0; i < m_nsp; i++) {
469 for (
size_t j = i; j < m_nsp; j++) {
471 double dstar = (m_mode != CK_Mode) ? m_delta(i,j) : 0.0;
478 auto dptr = find(fitlist.begin(), fitlist.end(), dstar);
479 if (dptr == fitlist.end()) {
480 vector_fp ca(degree+1), cb(degree+1), cc(degree+1);
482 integrals.fit(degree, dstar, ca.data(), cb.data(), cc.data());
483 integrals.fit_omega22(degree, dstar, co22.data());
484 m_omega22_poly.push_back(co22);
485 m_astar_poly.push_back(ca);
486 m_bstar_poly.push_back(cb);
487 m_cstar_poly.push_back(cc);
488 m_poly[i][j] =
static_cast<int>(m_astar_poly.size()) - 1;
489 fitlist.push_back(dstar);
492 m_poly[i][j] =
static_cast<int>((dptr - fitlist.begin()));
494 m_poly[j][i] = m_poly[i][j];
502 const size_t np = 50;
503 int degree = (m_mode == CK_Mode ? 3 : 4);
504 double dt = (m_thermo->maxTemp() - m_thermo->minTemp())/(np-1);
505 vector_fp tlog(np), spvisc(np), spcond(np);
508 m_visccoeffs.clear();
509 m_condcoeffs.clear();
512 for (
size_t n = 0; n < np; n++) {
513 double t = m_thermo->minTemp() + dt*n;
521 if (m_log_level && m_log_level < 2) {
522 writelog(
"*** polynomial coefficients not printed (log_level < 2) ***\n");
524 double visc, err, relerr,
525 mxerr = 0.0, mxrelerr = 0.0, mxerr_cond = 0.0, mxrelerr_cond = 0.0;
528 writelog(
"Polynomial fits for viscosity:\n");
529 if (m_mode == CK_Mode) {
530 writelog(
"log(viscosity) fit to cubic polynomial in log(T)\n");
532 writelogf(
"viscosity/sqrt(T) fit to polynomial of degree "
533 "%d in log(T)", degree);
537 double T_save = m_thermo->temperature();
538 const vector_fp& mw = m_thermo->molecularWeights();
539 for (
size_t k = 0; k < m_nsp; k++) {
540 double tstar =
Boltzmann * 298.0 / m_eps[k];
543 double fz_298 = 1.0 + pow(
Pi, 1.5) / sqrt(tstar) * (0.5 + 1.0 / tstar) +
544 (0.25 *
Pi *
Pi + 2) / tstar;
546 for (
size_t n = 0; n < np; n++) {
547 double t = m_thermo->minTemp() + dt*n;
548 m_thermo->setTemperature(t);
549 vector_fp cp_R_all(m_thermo->nSpecies());
550 m_thermo->getCp_R_ref(&cp_R_all[0]);
551 double cp_R = cp_R_all[k];
553 double sqrt_T = sqrt(t);
554 double om22 = integrals.omega22(tstar, m_delta(k,k));
555 double om11 = integrals.omega11(tstar, m_delta(k,k));
558 double diffcoeff = 3.0/16.0 * sqrt(2.0 *
Pi/m_reducedMass(k,k)) *
560 (
Pi * m_sigma[k] * m_sigma[k] * om11);
564 (om22 *
Pi * m_sigma[k]*m_sigma[k]);
567 double f_int = mw[k]/(
GasConstant * t) * diffcoeff/visc;
568 double cv_rot = m_crot[k];
569 double A_factor = 2.5 - f_int;
570 double fz_tstar = 1.0 + pow(
Pi, 1.5) / sqrt(tstar) * (0.5 + 1.0 / tstar) +
571 (0.25 *
Pi *
Pi + 2) / tstar;
572 double B_factor = m_zrot[k] * fz_298 / fz_tstar + 2.0/
Pi * (5.0/3.0 * cv_rot + f_int);
573 double c1 = 2.0/
Pi * A_factor/B_factor;
574 double cv_int = cp_R - 2.5 - cv_rot;
575 double f_rot = f_int * (1.0 + c1);
576 double f_trans = 2.5 * (1.0 - c1 * cv_rot/1.5);
577 double cond = (visc/mw[k])*
GasConstant*(f_trans * 1.5
578 + f_rot * cv_rot + f_int * cv_int);
580 if (m_mode == CK_Mode) {
581 spvisc[n] = log(visc);
582 spcond[n] = log(cond);
592 spvisc[n] = sqrt(visc/sqrt_T);
597 spcond[n] = cond/sqrt_T;
598 w[n] = 1.0/(spvisc[n]*spvisc[n]);
599 w2[n] = 1.0/(spcond[n]*spcond[n]);
602 polyfit(np, degree, tlog.data(), spvisc.data(), w.data(), c.data());
603 polyfit(np, degree, tlog.data(), spcond.data(), w2.data(), c2.data());
606 for (
size_t n = 0; n < np; n++) {
608 if (m_mode == CK_Mode) {
609 val = exp(spvisc[n]);
610 fit = exp(
poly3(tlog[n], c.data()));
612 double sqrt_T = exp(0.5*tlog[n]);
613 val = sqrt_T * pow(spvisc[n],2);
614 fit = sqrt_T * pow(
poly4(tlog[n], c.data()),2);
618 mxerr = std::max(mxerr, fabs(err));
619 mxrelerr = std::max(mxrelerr, fabs(relerr));
623 for (
size_t n = 0; n < np; n++) {
625 if (m_mode == CK_Mode) {
626 val = exp(spcond[n]);
627 fit = exp(
poly3(tlog[n], c2.data()));
629 double sqrt_T = exp(0.5*tlog[n]);
630 val = sqrt_T * spcond[n];
631 fit = sqrt_T *
poly4(tlog[n], c2.data());
635 mxerr_cond = std::max(mxerr_cond, fabs(err));
636 mxrelerr_cond = std::max(mxrelerr_cond, fabs(relerr));
638 m_visccoeffs.push_back(c);
639 m_condcoeffs.push_back(c2);
641 if (m_log_level >= 2) {
645 m_thermo->setTemperature(T_save);
648 writelogf(
"Maximum viscosity absolute error: %12.6g\n", mxerr);
649 writelogf(
"Maximum viscosity relative error: %12.6g\n", mxrelerr);
650 writelog(
"\nPolynomial fits for conductivity:\n");
651 if (m_mode == CK_Mode) {
652 writelog(
"log(conductivity) fit to cubic polynomial in log(T)");
655 "polynomial of degree %d in log(T)", degree);
657 if (m_log_level >= 2) {
658 for (
size_t k = 0; k < m_nsp; k++) {
659 writelog(m_thermo->speciesName(k) +
": [" +
660 vec2str(m_condcoeffs[k]) +
"]\n");
663 writelogf(
"Maximum conductivity absolute error: %12.6g\n", mxerr_cond);
664 writelogf(
"Maximum conductivity relative error: %12.6g\n", mxrelerr_cond);
667 writelogf(
"\nbinary diffusion coefficients:\n");
668 if (m_mode == CK_Mode) {
669 writelog(
"log(D) fit to cubic polynomial in log(T)");
671 writelogf(
"D/T**(3/2) fit to polynomial of degree %d in log(T)",degree);
675 fitDiffCoeffs(integrals);
681 const size_t np = 50;
682 int degree = (m_mode == CK_Mode ? 3 : 4);
683 double dt = (m_thermo->maxTemp() - m_thermo->minTemp())/(np-1);
688 for (
size_t n = 0; n < np; n++) {
689 double t = m_thermo->minTemp() + dt*n;
696 mxerr = 0.0, mxrelerr = 0.0;
699 m_diffcoeffs.clear();
700 for (
size_t k = 0; k < m_nsp; k++) {
701 for (
size_t j = k; j < m_nsp; j++) {
702 for (
size_t n = 0; n < np; n++) {
703 double t = m_thermo->minTemp() + dt*n;
704 double eps = m_epsilon(j,k);
706 double sigma = m_diam(j,k);
707 double om11 = integrals.omega11(tstar, m_delta(j,k));
708 double diffcoeff = 3.0/16.0 * sqrt(2.0 *
Pi/m_reducedMass(k,j))
709 * pow(
Boltzmann * t, 1.5) / (
Pi * sigma * sigma * om11);
714 getBinDiffCorrection(t, integrals, k, j, 1.0, 1.0, fkj, fjk);
716 if (m_mode == CK_Mode) {
717 diff[n] = log(diffcoeff);
720 diff[n] = diffcoeff/pow(t, 1.5);
721 w[n] = 1.0/(diff[n]*diff[n]);
724 polyfit(np, degree, tlog.data(), diff.data(), w.data(), c.data());
726 for (
size_t n = 0; n < np; n++) {
728 if (m_mode == CK_Mode) {
730 fit = exp(
poly3(tlog[n], c.data()));
732 double t = exp(tlog[n]);
733 double pre = pow(t, 1.5);
735 fit = pre *
poly4(tlog[n], c.data());
739 mxerr = std::max(mxerr, fabs(err));
740 mxrelerr = std::max(mxrelerr, fabs(relerr));
742 m_diffcoeffs.push_back(c);
743 if (m_log_level >= 2) {
744 writelog(m_thermo->speciesName(k) +
"__" +
745 m_thermo->speciesName(j) +
": [" +
vec2str(c) +
"]\n");
750 writelogf(
"Maximum binary diffusion coefficient absolute error:"
752 writelogf(
"Maximum binary diffusion coefficient relative error:"
758 size_t k,
size_t j,
double xk,
double xj,
double& fkj,
double& fjk)
760 double w1 = m_thermo->molecularWeight(k);
761 double w2 = m_thermo->molecularWeight(j);
762 double wsum = w1 + w2;
763 double wmwp = (w1 - w2)/wsum;
764 double sqw12 = sqrt(w1*w2);
765 double sig1 = m_sigma[k];
766 double sig2 = m_sigma[j];
767 double sig12 = 0.5*(m_sigma[k] + m_sigma[j]);
768 double sigratio = sig1*sig1/(sig2*sig2);
769 double sigratio2 = sig1*sig1/(sig12*sig12);
770 double sigratio3 = sig2*sig2/(sig12*sig12);
771 double tstar1 =
Boltzmann * t / m_eps[k];
772 double tstar2 =
Boltzmann * t / m_eps[j];
773 double tstar12 =
Boltzmann * t / sqrt(m_eps[k] * m_eps[j]);
774 double om22_1 = integrals.omega22(tstar1, m_delta(k,k));
775 double om22_2 = integrals.omega22(tstar2, m_delta(j,j));
776 double om11_12 = integrals.omega11(tstar12, m_delta(k,j));
777 double astar_12 = integrals.astar(tstar12, m_delta(k,j));
778 double bstar_12 = integrals.bstar(tstar12, m_delta(k,j));
779 double cstar_12 = integrals.cstar(tstar12, m_delta(k,j));
781 double cnst = sigratio * sqrt(2.0*w2/wsum) * 2.0 * w1*w1/(wsum * w2);
782 double p1 = cnst * om22_1 / om11_12;
784 cnst = (1.0/sigratio) * sqrt(2.0*w1/wsum) * 2.0*w2*w2/(wsum*w1);
785 double p2 = cnst * om22_2 / om11_12;
786 double p12 = 15.0 * wmwp*wmwp + 8.0*w1*w2*astar_12/(wsum*wsum);
788 cnst = (2.0/(w2*wsum))*sqrt(2.0*w2/wsum)*sigratio2;
789 double q1 = cnst*((2.5 - 1.2*bstar_12)*w1*w1 + 3.0*w2*w2
790 + 1.6*w1*w2*astar_12);
792 cnst = (2.0/(w1*wsum))*sqrt(2.0*w1/wsum)*sigratio3;
793 double q2 = cnst*((2.5 - 1.2*bstar_12)*w2*w2 + 3.0*w1*w1
794 + 1.6*w1*w2*astar_12);
795 double q12 = wmwp*wmwp*15.0*(2.5 - 1.2*bstar_12)
796 + 4.0*w1*w2*astar_12*(11.0 - 2.4*bstar_12)/(wsum*wsum)
797 + 1.6*wsum*om22_1*om22_2/(om11_12*om11_12*sqw12)
798 * sigratio2 * sigratio3;
800 cnst = 6.0*cstar_12 - 5.0;
801 fkj = 1.0 + 0.1*cnst*cnst *
802 (p1*xk*xk + p2*xj*xj + p12*xk*xj)/
803 (q1*xk*xk + q2*xj*xj + q12*xk*xj);
804 fjk = 1.0 + 0.1*cnst*cnst *
805 (p2*xk*xk + p1*xj*xj + p12*xk*xj)/
806 (q2*xk*xk + q1*xj*xj + q12*xk*xj);
#define COLL_INT_POLY_DEGREE
polynomial degree used for fitting collision integrals except in CK mode, where the degree is 6.
Monk and Monchick collision integrals.
Base class for exceptions thrown by Cantera classes.
Transport data for a single gas-phase species which can be used in mixture-averaged or multicomponent...
double polarizability
The polarizability of the molecule [m^3]. Default 0.0.
std::string geometry
A string specifying the molecular geometry.
double diameter
The Lennard-Jones collision diameter [m].
double acentric_factor
Pitzer's acentric factor [dimensionless]. Default 0.0.
double quadrupole_polarizability
quadrupole. Default 0.0.
double rotational_relaxation
The rotational relaxation number (the number of collisions it takes to equilibrate the rotational deg...
double dispersion_coefficient
dispersion normalized by e^2. [m^5] Default 0.0.
double dipole
The permanent dipole moment of the molecule [Coulomb-m]. Default 0.0.
double well_depth
The Lennard-Jones well depth [J].
Calculation of Collision integrals.
void init(doublereal tsmin, doublereal tsmax, int loglevel=0)
Initialize the object for calculation.
size_t nSpecies() const
Returns the number of species in the phase.
Base class for a phase with thermodynamic properties.
const double Boltzmann
Boltzmann constant [J/K].
const double Avogadro
Avogadro's Number [number/kmol].
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
const double epsilon_0
Permittivity of free space [F/m].
const double GasConstant
Universal Gas Constant [J/kmol/K].
void writelog(const std::string &fmt, const Args &... args)
Write a formatted message to the screen.
void writelogf(const char *fmt, const Args &... args)
Write a formatted message to the screen.
Namespace for the Cantera kernel.
void multiply(const DenseMatrix &A, const double *const b, double *const prod)
Multiply A*b and return the result in prod. Uses BLAS routine DGEMV.
std::string vec2str(const vector_fp &v, const std::string &fmt, const std::string &sep)
Convert a vector to a string (separated by commas)
doublereal dot4(const V &x, const V &y)
Templated Inner product of two vectors of length 4.
doublereal dot5(const V &x, const V &y)
Templated Inner product of two vectors of length 5.
R poly3(D x, R *c)
Templated evaluation of a polynomial of order 3.
R poly4(D x, R *c)
Evaluates a polynomial of order 4.
double polyfit(size_t n, size_t deg, const double *xp, const double *yp, const double *wp, double *pp)
Fits a polynomial function to a set of data points.
Contains declarations for string manipulation functions within Cantera.