25 PecosTransport::PecosTransport() :
59 m_dipoleDiag.resize(m_nsp);
60 for (
int i = 0; i < m_nsp; i++) {
61 m_dipoleDiag[i] = tr.
dipole(i,i);
64 m_phi.
resize(m_nsp, m_nsp, 0.0);
65 m_wratjk.
resize(m_nsp, m_nsp, 0.0);
66 m_wratkj1.
resize(m_nsp, m_nsp, 0.0);
68 for (j = 0; j < m_nsp; j++)
69 for (k = j; k < m_nsp; k++) {
70 m_wratjk(j,k) = sqrt(m_mw[j]/m_mw[k]);
71 m_wratjk(k,j) = sqrt(m_wratjk(j,k));
72 m_wratkj1(j,k) = sqrt(1.0 + m_mw[k]/m_mw[j]);
75 m_polytempvec.resize(5);
77 m_sqvisc.resize(m_nsp);
79 m_bdiff.
resize(m_nsp, m_nsp);
81 m_molefracs.resize(m_nsp);
82 m_spwork.resize(m_nsp);
100 cv_int.resize(m_nsp);
102 for (k = 0; k < m_nsp; k++) {
103 cv_rot[k] = tr.
crot[k];
105 cv_int[k] = cp_R[k] - 2.5 - cv_rot[k];
144 doublereal vismix = 0.0;
153 for (k = 0; k < m_nsp; k++) {
154 vismix += m_molefracs[k] * m_visc[k]/m_spwork[k];
180 for (i = 0; i < m_nsp; i++)
181 for (j = 0; j < m_nsp; j++) {
182 d[ld*j + i] = rp * m_bdiff(i,j);
191 doublereal c1 = ElectronCharge / (
Boltzmann * m_temp);
192 for (k = 0; k < m_nsp; k++) {
217 doublereal lambda = 0.0;
230 for (k = 0; k < m_nsp; k++) {
231 lambda += m_molefracs[k] * m_cond[k]/m_spwork[k];
252 for (k = 0; k < m_nsp; k++) {
270 const doublereal*
const grad_T,
271 size_t ldx,
const doublereal*
const grad_X,
272 size_t ldf, doublereal*
const fluxes)
288 doublereal correction=0.0;
290 for (k = 0; k < m_nsp; k++) {
291 correction += rhon * mw[k] * m_spwork[k] * grad_X[n*ldx + k];
294 for (n = 0; n < ndim; n++) {
295 for (k = 0; k < m_nsp; k++) {
296 fluxes[n*ldf + k] = -rhon * mw[k] * m_spwork[k] * grad_X[n*ldx + k] + y[k]*correction;
297 sum[n] += fluxes[n*ldf + k];
301 for (n = 0; n < ndim; n++) {
302 for (k = 0; k < m_nsp; k++) {
303 fluxes[n*ldf + k] -= y[k]*sum[n];
329 doublereal sumxw = 0.0, sum2;
332 d[0] = m_bdiff(0,0) / p;
334 for (k = 0; k < m_nsp; k++) {
335 sumxw += m_molefracs[k] * m_mw[k];
337 for (k = 0; k < m_nsp; k++) {
339 for (j = 0; j < m_nsp; j++) {
341 sum2 += m_molefracs[j] / m_bdiff(j,k);
345 d[k] = m_bdiff(k,k) / p;
347 d[k] = (sumxw - m_molefracs[k] * m_mw[k])/(p * mmw * sum2);
365 d[0] = m_bdiff(0,0) / p;
367 for (
int k = 0; k < m_nsp; k++) {
369 for (
int j = 0; j < m_nsp; j++) {
371 sum2 += m_molefracs[j] / m_bdiff(j,k);
375 d[k] = m_bdiff(k,k) / p;
377 d[k] = (1 - m_molefracs[k]) / (p * sum2);
397 d[0] = m_bdiff(0,0) / p;
399 for (
int k=0; k<m_nsp; k++) {
402 for (
int i=0; i<m_nsp; i++) {
406 sum1 += m_molefracs[i] / m_bdiff(k,i);
407 sum2 += m_molefracs[i] * m_mw[i] / m_bdiff(k,i);
410 sum2 *= p * m_molefracs[k] / (mmw - m_mw[k]*m_molefracs[k]);
411 d[k] = 1.0 / (sum1 + sum2);
429 "negative temperature "+
fp2str(t));
432 m_logt = log(m_temp);
434 m_sqrt_t = sqrt(m_temp);
435 m_t14 = sqrt(m_sqrt_t);
436 m_t32 = m_temp * m_sqrt_t;
440 m_polytempvec[0] = 1.0;
441 m_polytempvec[1] = m_logt;
442 m_polytempvec[2] = m_logt*m_logt;
443 m_polytempvec[3] = m_logt*m_logt*m_logt;
444 m_polytempvec[4] = m_logt*m_logt*m_logt*m_logt;
448 m_viscmix_ok =
false;
452 m_diffmix_ok =
false;
453 m_bindiff_ok =
false;
455 m_condmix_ok =
false;
469 m_viscmix_ok =
false;
470 m_diffmix_ok =
false;
471 m_condmix_ok =
false;
477 for (k = 0; k < m_nsp; k++) {
478 m_molefracs[k] = std::max(
Tiny, m_molefracs[k]);
504 doublereal fivehalves = 5/2;
505 for (k = 0; k < m_nsp; k++) {
507 m_cond[k] = m_visc[k] * (fivehalves * cv_int[k] + cv_rot[k] +
m_thermo->
cv_vib(k,m_temp));
510 m_condmix_ok =
false;
524 if (m_mode == CK_Mode) {
525 for (i = 0; i < m_nsp; i++) {
526 for (j = i; j < m_nsp; j++) {
527 m_bdiff(i,j) = exp(
dot4(m_polytempvec, m_diffcoeffs[ic]));
528 m_bdiff(j,i) = m_bdiff(i,j);
533 for (i = 0; i < m_nsp; i++) {
534 for (j = i; j < m_nsp; j++) {
535 m_bdiff(i,j) = m_temp * m_sqrt_t*
dot5(m_polytempvec,
537 m_bdiff(j,i) = m_bdiff(i,j);
544 m_diffmix_ok =
false;
568 for (k = 0; k < m_nsp; k++) {
569 m_visc[k] = 0.10*std::exp(a[k]*(m_logt*m_logt) + b[k]*m_logt + c[k]);
570 m_sqvisc[k] = sqrt(m_visc[k]);
629 (
"Air 2.68142000000e-02 3.17783800000e-01 -1.13155513000e+01\n"
630 "CPAir 2.68142000000e-02 3.17783800000e-01 -1.13155513000e+01\n"
631 "N 1.15572000000e-02 6.03167900000e-01 -1.24327495000e+01\n"
632 "N2 2.68142000000e-02 3.17783800000e-01 -1.13155513000e+01\n"
633 "CPN2 2.68142000000e-02 3.17783800000e-01 -1.13155513000e+01\n"
634 "NO 4.36378000000e-02 -3.35511000000e-02 -9.57674300000e+00\n"
635 "O 2.03144000000e-02 4.29440400000e-01 -1.16031403000e+01\n"
636 "O2 4.49290000000e-02 -8.26158000000e-02 -9.20194750000e+00\n"
637 "C -8.3285e-3 0.7703240 -12.7378000\n"
638 "C2 -8.4311e-3 0.7876060 -13.0268000\n"
639 "C3 -8.4312e-3 0.7876090 -12.8240000\n"
640 "C2H -2.4241e-2 1.0946550 -14.5835500\n"
641 "CN -8.3811e-3 0.7860330 -12.9406000\n"
642 "CO -0.019527394 1.013295 -13.97873\n"
643 "CO2 -0.019527387 1.047818 -14.32212\n"
644 "HCN -2.4241e-2 1.0946550 -14.5835500\n"
645 "H -8.3912e-3 0.7743270 -13.6653000\n"
646 "H2 -8.3346e-3 0.7815380 -13.5351000\n"
647 "e 0.00000000000e+00 0.00000000000e+00 -1.16031403000e+01\n");
651 string ss1,ss2,ss3,ss4,sss;
655 while (std::getline(blot, line)) {
657 istringstream ss(line);
658 std::getline(ss, ss1,
' ');
659 std::getline(ss, ss2,
' ');
660 std::getline(ss, ss3,
' ');
661 std::getline(ss, ss4,
' ');
665 for (k = 0; k < m_nsp; k++) {
669 if (sss.compare(ss1) == 0) {
670 a[k] = atof(ss2.c_str());
671 b[k] = atof(ss3.c_str());
672 c[k] = atof(ss4.c_str());
714 doublereal vratiokj, wratiojk, factor1;
722 for (j = 0; j < m_nsp; j++) {
723 for (k = j; k < m_nsp; k++) {
724 vratiokj = m_visc[k]/m_visc[j];
725 wratiojk = m_mw[j]/m_mw[k];
729 factor1 = 1.0 + (m_sqvisc[k]/m_sqvisc[j]) * m_wratjk(k,j);
730 m_phi(k,j) = factor1*factor1 /
732 m_phi(j,k) = m_phi(k,j)/(vratiokj * wratiojk);