pure composition test for cantera mixture averaged diffusivity
This commit is contained in:
parent
0a89513335
commit
fa0af403cf
1 changed files with 32 additions and 3 deletions
|
|
@ -122,11 +122,40 @@ int main(int argc, char *argv[])
|
|||
diff.correct();
|
||||
|
||||
// Cantera gas transport
|
||||
gas_.setState_TPY(T[i], p0, XY.data());
|
||||
|
||||
gas_.setState_TPY(T[i], p[0], XY.data());
|
||||
|
||||
scalarField Dc (composition.species().size(), 0.0);
|
||||
tr_->getMixDiffCoeffsMass(Dc.data());
|
||||
scalarField Dij (composition.species().size()*composition.species().size(), 0.0);
|
||||
|
||||
const scalar relTol = 1.0e-15;
|
||||
|
||||
// check for singular case (Xi = 1)
|
||||
label idxFracOne = -1;
|
||||
scalar sumX = sum(XY);
|
||||
forAll (XY, i)
|
||||
{
|
||||
if ((sumX-XY[i])/sumX < relTol)
|
||||
{
|
||||
idxFracOne = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (idxFracOne < 0)
|
||||
{
|
||||
tr_->getMixDiffCoeffsMass(Dc.data());
|
||||
}
|
||||
else
|
||||
{
|
||||
label nSp = nCanteraSp_;
|
||||
tr_->getBinaryDiffCoeffs(nSp, Dij.data());
|
||||
|
||||
forAll(Dc, i)
|
||||
{
|
||||
Dc[i] = Dij[nSp*idxFracOne+i] / p[0];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
forAll(thermo.composition().species(), k)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue