From 6584fa6ce07f892b99b1fe84e197ae4980214c53 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Tue, 17 Oct 2017 12:17:24 +0100 Subject: [PATCH] functionObjects::wallHeatFlux: More efficient evaluation of heat-flux which avoids the need for field interpolation and snGrad specification and evaluation. Resolves patch request https://bugs.openfoam.org/view.php?id=2725 --- .../field/wallHeatFlux/wallHeatFlux.C | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/functionObjects/field/wallHeatFlux/wallHeatFlux.C b/src/functionObjects/field/wallHeatFlux/wallHeatFlux.C index f0f824b9dd..a347cfb43b 100644 --- a/src/functionObjects/field/wallHeatFlux/wallHeatFlux.C +++ b/src/functionObjects/field/wallHeatFlux/wallHeatFlux.C @@ -65,20 +65,18 @@ void Foam::functionObjects::wallHeatFlux::calcHeatFlux volScalarField& wallHeatFlux ) { - surfaceScalarField heatFlux - ( - fvc::interpolate(alpha)*fvc::snGrad(he) - ); - volScalarField::Boundary& wallHeatFluxBf = wallHeatFlux.boundaryFieldRef(); - const surfaceScalarField::Boundary& heatFluxBf = - heatFlux.boundaryField(); + const volScalarField::Boundary& heBf = + he.boundaryField(); + + const volScalarField::Boundary& alphaBf = + alpha.boundaryField(); forAll(wallHeatFluxBf, patchi) { - wallHeatFluxBf[patchi] = heatFluxBf[patchi]; + wallHeatFluxBf[patchi] = alphaBf[patchi]*heBf[patchi].snGrad(); } if (foundObject("qr"))