binary diffusivity and pure viscosity test
This commit is contained in:
parent
832638290b
commit
86b85b3eef
3 changed files with 97 additions and 2 deletions
|
|
@ -714,6 +714,62 @@ void Foam::diffusivityModel::correct()
|
|||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::scalarField> Foam::diffusivityModel::Dbinary
|
||||
(const scalar T, const scalar p, const UList<scalar> &Y)
|
||||
{
|
||||
const speciesTable &species_(thermo_.composition().species());
|
||||
|
||||
scalarSymmetricSquareMatrix Dij(species_.size());
|
||||
|
||||
scalarField localY(Y);
|
||||
|
||||
scalarField muI(species_.size());
|
||||
|
||||
{
|
||||
const scalar pi = p;
|
||||
const scalar Ti = T;
|
||||
|
||||
GasState state (pi, Ti, localY);
|
||||
|
||||
calculateMuD (muI, Dij, state);
|
||||
|
||||
}
|
||||
|
||||
tmp<scalarField> pDii(new scalarField(UList<scalar>(Dij.v(), Dij.size())));
|
||||
|
||||
return pDii;
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::scalarField> Foam::diffusivityModel::mupure(const scalar T, const scalar p, const UList<scalar> &Y)
|
||||
{
|
||||
const speciesTable &species_(thermo_.composition().species());
|
||||
|
||||
scalarSymmetricSquareMatrix Dij(species_.size());
|
||||
|
||||
scalarField localY(Y);
|
||||
|
||||
scalarField Di(species_.size());
|
||||
scalarField Dii(species_.size());
|
||||
scalarField *pmuI = new scalarField(species_.size());
|
||||
scalarField &muI = *pmuI;
|
||||
|
||||
{
|
||||
const scalar pi = p;
|
||||
const scalar Ti = T;
|
||||
|
||||
GasState state (pi, Ti, localY);
|
||||
|
||||
const scalarField &localX = state.X();
|
||||
|
||||
calculateMuD (muI, Dij, state);
|
||||
|
||||
}
|
||||
|
||||
return tmp<scalarField>(pmuI);
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::scalarField> Foam::diffusivityModel::kpure(const scalar T, const scalar p, const UList<scalar> &Y)
|
||||
{
|
||||
const speciesTable &species_(thermo_.composition().species());
|
||||
|
|
|
|||
|
|
@ -217,6 +217,10 @@ public:
|
|||
|
||||
// Check
|
||||
|
||||
tmp<scalarField> Dbinary(const scalar T, const scalar p, const UList<scalar> &Y);
|
||||
|
||||
tmp<scalarField> mupure(const scalar T, const scalar p, const UList<scalar> &Y);
|
||||
|
||||
tmp<scalarField> kpure(const scalar T, const scalar p, const UList<scalar> &Y);
|
||||
|
||||
// Edit
|
||||
|
|
|
|||
|
|
@ -176,6 +176,8 @@ int main(int argc, char *argv[])
|
|||
thermo.correct();
|
||||
diff.correct();
|
||||
|
||||
scalarField DijO (diff.Dbinary(thermo.T()[0], p[0], XY));
|
||||
|
||||
// Cantera gas transport
|
||||
gas_.setState_TPY(thermo.T()[0], p[0], XY.data());
|
||||
|
||||
|
|
@ -196,14 +198,14 @@ int main(int argc, char *argv[])
|
|||
}
|
||||
}
|
||||
|
||||
tr_->getBinaryDiffCoeffs(nCanteraSp_, Dij.data());
|
||||
|
||||
if (idxFracOne < 0)
|
||||
{
|
||||
tr_->getMixDiffCoeffsMass(Dc.data());
|
||||
}
|
||||
else
|
||||
{
|
||||
tr_->getBinaryDiffCoeffs(nCanteraSp_, Dij.data());
|
||||
|
||||
forAll(Dc, k)
|
||||
{
|
||||
Dc[k] = Dij[nCanteraSp_*idxFracOne+k];
|
||||
|
|
@ -213,6 +215,11 @@ int main(int argc, char *argv[])
|
|||
|
||||
scalarField kSp (diff.kpure(thermo.T()[0], p[0], XY));
|
||||
|
||||
scalarField muSpO (diff.mupure(thermo.T()[0], p[0], XY));
|
||||
|
||||
scalarField muSpC (kSp);
|
||||
|
||||
tr_->getSpeciesViscosities(muSpC.data());
|
||||
|
||||
|
||||
forAll(thermo.composition().species(), k)
|
||||
|
|
@ -227,6 +234,22 @@ int main(int argc, char *argv[])
|
|||
;
|
||||
}
|
||||
|
||||
forAll(thermo.composition().species(), k)
|
||||
{
|
||||
forAll(thermo.composition().species(), j)
|
||||
{
|
||||
logWriter
|
||||
(
|
||||
thermo.composition().species()[k] + "=>" +
|
||||
thermo.composition().species()[j],
|
||||
thermo.T()[0],
|
||||
DijO[nCanteraSp_*k+j],
|
||||
Dij[nCanteraSp_*k+j]
|
||||
)
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
logWriter
|
||||
(
|
||||
"mu",
|
||||
|
|
@ -236,6 +259,18 @@ int main(int argc, char *argv[])
|
|||
)
|
||||
;
|
||||
|
||||
forAll(thermo.composition().species(), k)
|
||||
{
|
||||
logWriter
|
||||
(
|
||||
"mu_"+thermo.composition().species()[k],
|
||||
thermo.T()[0],
|
||||
muSpO[k],
|
||||
muSpC[k]
|
||||
)
|
||||
;
|
||||
}
|
||||
|
||||
logWriter
|
||||
(
|
||||
"k",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue