Commit d4cd8783 authored by Sergio Ferraris's avatar Sergio Ferraris

BUG: Changing rho mixing to volume-based in rhoThermo. Fixes #1812.

parent 7be30924
......@@ -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<BasicPsiThermo, MixtureType>::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<BasicPsiThermo, MixtureType>::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<BasicPsiThermo, MixtureType>::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<BasicPsiThermo, MixtureType>::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]);
}
......
......@@ -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_;
......
......@@ -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);
......
......@@ -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]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment