GasState rhoQc2 fix error (multiply e) and pass GasState state to calculateMuD in diffusivityModel

This commit is contained in:
Yeongdo Park 2018-11-04 16:37:57 -05:00
parent 094da99cfc
commit 18b24fbe4d
2 changed files with 10 additions and 7 deletions

View file

@ -109,8 +109,9 @@ inline Foam::scalar Foam::GasState::rhoQc2() const
{
sumZN += X_[i] * thermos(i).z();
}
sumZN *= (rho()/W()) * Foam::constant::physicoChemical::NA.value() * 1000;
return sumZN;
return sumZN * (rho()/W())
* Foam::constant::electromagnetic::e.value()
* Foam::constant::physicoChemical::NA.value() * 1000.0;
}

View file

@ -710,14 +710,13 @@ void Foam::diffusivityModel::correct()
forAll (species_, i)
{
localY[i] = Y[i][celli];
localX[i] = Y[i][celli] * WbarI / Wpure[i];
}
GasState state (pi, Ti, localY);
calculateMuD ( muI, Dij, pi, Ti, rhoQc2i, localY, localX);
localX = state.X();
// calculateMuD ( muI, Dij, state);
calculateMuD (muI, Dij, state);
forAll (Dii, i)
{
@ -777,10 +776,13 @@ void Foam::diffusivityModel::correct()
forAll (species_, i)
{
localY[i] = Y[i].boundaryField()[patchi][facei];
localX[i] = localY[i] * WbarI / Wpure[i];
}
calculateMuD ( muI, Dij, pi, Ti, rhoQc2i, localY, localX);
GasState state (pi, Ti, localY);
localX = state.X();
calculateMuD (muI, Dij, state);
forAll (Dii, i)
{