diff --git a/src/thermophysicalModels/basic/rhoThermo/heRhoThermo.C b/src/thermophysicalModels/basic/rhoThermo/heRhoThermo.C index 6611218c30..9faeed3de4 100644 --- a/src/thermophysicalModels/basic/rhoThermo/heRhoThermo.C +++ b/src/thermophysicalModels/basic/rhoThermo/heRhoThermo.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2015-2017 OpenCFD Ltd. + Copyright (C) 2015-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -74,6 +74,9 @@ void Foam::heRhoThermo::calculate const typename MixtureType::thermoType& mixture_ = this->cellMixture(celli); + const typename MixtureType::thermoType& volMixture_ = + this->cellVolMixture(pCells[celli], TCells[celli], celli); + if (this->updateT()) { TCells[celli] = mixture_.THE @@ -85,7 +88,7 @@ void Foam::heRhoThermo::calculate } psiCells[celli] = mixture_.psi(pCells[celli], TCells[celli]); - rhoCells[celli] = mixture_.rho(pCells[celli], TCells[celli]); + rhoCells[celli] = volMixture_.rho(pCells[celli], TCells[celli]); muCells[celli] = mixture_.mu(pCells[celli], TCells[celli]); alphaCells[celli] = mixture_.alphah(pCells[celli], TCells[celli]); @@ -116,10 +119,19 @@ void Foam::heRhoThermo::calculate const typename MixtureType::thermoType& mixture_ = this->patchFaceMixture(patchi, facei); + const typename MixtureType::thermoType& volMixture_ = + this->patchFaceVolMixture + ( + pp[facei], + pT[facei], + patchi, + facei + ); + phe[facei] = mixture_.HE(pp[facei], pT[facei]); ppsi[facei] = mixture_.psi(pp[facei], pT[facei]); - prho[facei] = mixture_.rho(pp[facei], pT[facei]); + prho[facei] = volMixture_.rho(pp[facei], pT[facei]); pmu[facei] = mixture_.mu(pp[facei], pT[facei]); palpha[facei] = mixture_.alphah(pp[facei], pT[facei]); } @@ -131,13 +143,22 @@ void Foam::heRhoThermo::calculate const typename MixtureType::thermoType& mixture_ = this->patchFaceMixture(patchi, facei); + const typename MixtureType::thermoType& volMixture_ = + this->patchFaceVolMixture + ( + pp[facei], + pT[facei], + patchi, + facei + ); + if (this->updateT()) { pT[facei] = mixture_.THE(phe[facei], pp[facei], pT[facei]); } ppsi[facei] = mixture_.psi(pp[facei], pT[facei]); - prho[facei] = mixture_.rho(pp[facei], pT[facei]); + prho[facei] = volMixture_.rho(pp[facei], pT[facei]); pmu[facei] = mixture_.mu(pp[facei], pT[facei]); palpha[facei] = mixture_.alphah(pp[facei], pT[facei]); } diff --git a/src/thermophysicalModels/reactionThermo/mixtures/homogeneousMixture/homogeneousMixture.H b/src/thermophysicalModels/reactionThermo/mixtures/homogeneousMixture/homogeneousMixture.H index 6d77bf2deb..4503b002ef 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/homogeneousMixture/homogeneousMixture.H +++ b/src/thermophysicalModels/reactionThermo/mixtures/homogeneousMixture/homogeneousMixture.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -106,6 +107,16 @@ public: return mixture(b_[celli]); } + const ThermoType& cellVolMixture + ( + const scalar p, + const scalar T, + const label celli + ) const + { + return mixture(b_[celli]); + } + const ThermoType& patchFaceMixture ( const label patchi, @@ -115,6 +126,19 @@ public: return mixture(b_.boundaryField()[patchi][facei]); } + + const ThermoType& patchFaceVolMixture + ( + const scalar p, + const scalar T, + const label patchi, + const label facei + ) const + { + return mixture(b_.boundaryField()[patchi][facei]); + } + + const ThermoType& cellReactants(const label) const { return reactants_; diff --git a/src/thermophysicalModels/reactionThermo/mixtures/inhomogeneousMixture/inhomogeneousMixture.H b/src/thermophysicalModels/reactionThermo/mixtures/inhomogeneousMixture/inhomogeneousMixture.H index 2c38501c60..58a130273e 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/inhomogeneousMixture/inhomogeneousMixture.H +++ b/src/thermophysicalModels/reactionThermo/mixtures/inhomogeneousMixture/inhomogeneousMixture.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -120,6 +121,16 @@ public: return mixture(ft_[celli], b_[celli]); } + const ThermoType& cellVolMixture + ( + const scalar p, + const scalar T, + const label celli + ) const + { + return mixture(ft_[celli], b_[celli]); + } + const ThermoType& patchFaceMixture ( const label patchi, @@ -133,6 +144,21 @@ public: ); } + const ThermoType& patchFaceVolMixture + ( + const scalar p, + const scalar T, + const label patchi, + const label facei + ) const + { + return mixture + ( + ft_.boundaryField()[patchi][facei], + b_.boundaryField()[patchi][facei] + ); + } + const ThermoType& cellReactants(const label celli) const { return mixture(ft_[celli], 1); diff --git a/src/thermophysicalModels/reactionThermo/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.H b/src/thermophysicalModels/reactionThermo/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.H index db3354a591..84e16c5b24 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.H +++ b/src/thermophysicalModels/reactionThermo/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -123,6 +124,16 @@ public: return mixture(ft_[celli], fu_[celli]); } + const ThermoType& cellVolMixture + ( + const scalar p, + const scalar T, + const label celli + ) const + { + return mixture(ft_[celli], fu_[celli]); + } + const ThermoType& patchFaceMixture ( const label patchi, @@ -136,6 +147,22 @@ public: ); } + const ThermoType& patchFaceVolMixture + ( + const scalar p, + const scalar T, + const label patchi, + const label facei + ) const + { + return mixture + ( + ft_.boundaryField()[patchi][facei], + fu_.boundaryField()[patchi][facei] + ); + } + + const ThermoType& cellReactants(const label celli) const { return mixture(ft_[celli], ft_[celli]);