wallHeatFlux: Output values only on the patches specified

Resolves bug report https://bugs.openfoam.org/view.php?id=3481
This commit is contained in:
Will Bainbridge
2020-04-15 15:05:28 +01:00
parent 5a80034f93
commit d3fed1155a

View File

@ -78,33 +78,27 @@ Foam::functionObjects::wallHeatFlux::calcWallHeatFlux
volScalarField::Boundary& wallHeatFluxBf =
twallHeatFlux.ref().boundaryFieldRef();
const volScalarField::Boundary& heBf =
he.boundaryField();
const volScalarField::Boundary& heBf = he.boundaryField();
const volScalarField::Boundary& alphaBf = alpha.boundaryField();
const volScalarField::Boundary& alphaBf =
alpha.boundaryField();
forAll(wallHeatFluxBf, patchi)
forAllConstIter(labelHashSet, patchSet_, iter)
{
if (!wallHeatFluxBf[patchi].coupled())
{
wallHeatFluxBf[patchi] = alphaBf[patchi]*heBf[patchi].snGrad();
}
const label patchi = iter.key();
wallHeatFluxBf[patchi] = alphaBf[patchi]*heBf[patchi].snGrad();
}
if (foundObject<volScalarField>("qr"))
{
const volScalarField& qr = lookupObject<volScalarField>("qr");
const volScalarField::Boundary& radHeatFluxBf =
qr.boundaryField();
const volScalarField::Boundary& radHeatFluxBf = qr.boundaryField();
forAll(wallHeatFluxBf, patchi)
forAllConstIter(labelHashSet, patchSet_, iter)
{
if (!wallHeatFluxBf[patchi].coupled())
{
wallHeatFluxBf[patchi] -= radHeatFluxBf[patchi];
}
const label patchi = iter.key();
wallHeatFluxBf[patchi] -= radHeatFluxBf[patchi];
}
}