*** empty log message ***
This commit is contained in:
parent
2595829ba7
commit
dcae4f3acd
8 changed files with 32 additions and 21 deletions
|
|
@ -5,11 +5,11 @@ gas mixtures.
|
|||
|
||||
"""
|
||||
# for pydoc
|
||||
import solution, constants, ck2ctml
|
||||
import solution, constants
|
||||
|
||||
from constants import *
|
||||
from Cantera.solution import Solution
|
||||
from ck2ctml import ck2ctml
|
||||
|
||||
#import _cantera
|
||||
import os
|
||||
|
||||
|
|
|
|||
|
|
@ -136,9 +136,9 @@ namespace Cantera {
|
|||
}
|
||||
else {
|
||||
m_factored = false;
|
||||
//ofstream fout("bandmatrix.csv");
|
||||
//fout << *this << endl;
|
||||
//fout.close();
|
||||
ofstream fout("bandmatrix.csv");
|
||||
fout << *this << endl;
|
||||
fout.close();
|
||||
//throw CanteraError("BandMatrix::factor",
|
||||
// "DGBTRF returned info = "+int2str(info)+".\n"
|
||||
// +"Matrix written to file bandmatrix.csv\n");
|
||||
|
|
@ -188,14 +188,14 @@ namespace Cantera {
|
|||
ipiv().begin(), b, columns(), info);
|
||||
|
||||
// error handling
|
||||
//if (info != 0) {
|
||||
// ofstream fout("bandmatrix.csv");
|
||||
// fout << *this << endl;
|
||||
// fout.close();
|
||||
if (info != 0) {
|
||||
ofstream fout("bandmatrix.csv");
|
||||
fout << *this << endl;
|
||||
fout.close();
|
||||
// throw CanteraError("BandMatrix::solve",
|
||||
// "DGBTRS returned info = "+int2str(info)+".\n"
|
||||
// +"Matrix written to file bandmatrix.csv\n");
|
||||
//}
|
||||
}
|
||||
return info;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -129,14 +129,14 @@ namespace Cantera {
|
|||
*/
|
||||
int invert(DenseMatrix& A, int nn) {
|
||||
integer n = (nn > 0 ? nn : A.nRows());
|
||||
int info=0;
|
||||
integer info;
|
||||
ct_dgetrf(n, n, A.begin(), A.nRows(), A.ipiv().begin(), info);
|
||||
if (info != 0)
|
||||
throw CanteraError("invert",
|
||||
"DGETRF returned INFO="+int2str(info));
|
||||
|
||||
vector_fp work(n);
|
||||
integer lwork = n;
|
||||
integer lwork = work.size();
|
||||
ct_dgetri(n, A.begin(), A.nRows(), A.ipiv().begin(),
|
||||
work.begin(), lwork, info);
|
||||
if (info != 0)
|
||||
|
|
|
|||
|
|
@ -291,7 +291,7 @@ namespace Cantera {
|
|||
new_points = refine(loglevel);
|
||||
}
|
||||
else {
|
||||
writelog("grid refinement disabled.\n");
|
||||
if (loglevel > 0) writelog("grid refinement disabled.\n");
|
||||
new_points = 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -114,22 +114,27 @@ namespace Cantera {
|
|||
if (m_bulk_ok) return;
|
||||
int n,m;
|
||||
// get the gaseous binary diffusion coefficients
|
||||
//cout << "Gas binary diffusion coefficients: " << endl;
|
||||
m_gastran->getBinaryDiffCoeffs(m_nsp, m_d.begin());
|
||||
doublereal por2tort = m_porosity / m_tortuosity;
|
||||
for (n = 0; n < m_nsp; n++)
|
||||
for (m = 0; m < m_nsp; m++)
|
||||
m_d(n,m) *= por2tort;
|
||||
m_bulk_ok = true;
|
||||
//cout << m_d << endl;
|
||||
}
|
||||
|
||||
void DustyGasTransport::updateKnudsenDiffCoeffs() {
|
||||
if (m_knudsen_ok) return;
|
||||
doublereal K_g = m_pore_radius * m_porosity / m_tortuosity;
|
||||
const doublereal FourThirds = 4.0/3.0;
|
||||
//cout << "Knudsen diffusion coefficients: " << endl;
|
||||
for (int k = 0; k < m_nsp; k++) {
|
||||
m_dk[k] = FourThirds * K_g * sqrt((8.0 * GasConstant * m_temp)/
|
||||
(Pi * m_mw[k]));
|
||||
//cout << m_dk[k] << ", ";
|
||||
}
|
||||
//cout << endl;
|
||||
m_knudsen_ok = true;
|
||||
}
|
||||
|
||||
|
|
@ -146,8 +151,9 @@ namespace Cantera {
|
|||
|
||||
// evaluate diagonal term
|
||||
sum = 0.0;
|
||||
for (j = 0; j < m_nsp; j++) sum += m_x[j]/m_d(k,j);
|
||||
for (j = 0; j < m_nsp; j++) if (j != k) sum += m_x[j]/m_d(k,j);
|
||||
m_multidiff(k,k) = 1.0/m_dk[k] + sum;
|
||||
//cout << "H matrix = " << endl << m_multidiff << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -183,12 +189,14 @@ namespace Cantera {
|
|||
|
||||
// update the mole fractions
|
||||
updateTransport_C();
|
||||
|
||||
eval_H_matrix();
|
||||
|
||||
// invert H
|
||||
int ierr = invert(m_multidiff, m_nsp);
|
||||
|
||||
eval_H_matrix();
|
||||
|
||||
// invert H
|
||||
int ierr = invert(m_multidiff);
|
||||
|
||||
//cout << "Diffusion coeff matrix: " << endl;
|
||||
//cout << m_multidiff << endl;
|
||||
if (ierr != 0) {
|
||||
throw CanteraError("DustyGasTransport::updateMultiDiffCoeffs",
|
||||
"invert returned ierr = "+int2str(ierr));
|
||||
|
|
|
|||
|
|
@ -46,7 +46,6 @@ namespace Cantera {
|
|||
|
||||
public:
|
||||
|
||||
|
||||
/// default constructor
|
||||
DustyGasTransport(thermo_t* thermo=0);
|
||||
virtual ~DustyGasTransport() {}
|
||||
|
|
@ -108,6 +107,7 @@ namespace Cantera {
|
|||
m_perm = B;
|
||||
}
|
||||
|
||||
Transport& gasTransport() { return *m_gastran; }
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -197,6 +197,8 @@ namespace Cantera {
|
|||
m_models["Multi"] = cMulticomponent;
|
||||
m_models["Solid"] = cSolidTransport;
|
||||
m_models["DustyGas"] = cDustyGasTransport;
|
||||
m_models["CK_Multi"] = CK_Multicomponent;
|
||||
m_models["CK_Mix"] = CK_MixtureAveraged;
|
||||
m_models["None"] = 0;
|
||||
}
|
||||
|
||||
|
|
@ -246,7 +248,7 @@ namespace Cantera {
|
|||
break;
|
||||
case cDustyGasTransport:
|
||||
tr = new DustyGasTransport;
|
||||
gastr = new MixTransport;
|
||||
gastr = new MultiTransport;
|
||||
initTransport(gastr, phase, 0, log_level);
|
||||
dtr = (DustyGasTransport*)tr;
|
||||
dtr->initialize(phase, gastr);
|
||||
|
|
|
|||
|
|
@ -2,4 +2,5 @@
|
|||
#define CT_TRANSPORT_INCL
|
||||
|
||||
#include "kernel/transport/TransportFactory.h"
|
||||
#include "kernel/transport/DustyGasTransport.h"
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue