From 6ab699633d8d9f619e7496dba76f7dafc8de12ac Mon Sep 17 00:00:00 2001 From: Andrew Heather <> Date: Wed, 11 Mar 2020 17:44:46 +0000 Subject: [PATCH] ENH: wallHeatFlux - separated field and log writing. Fixes #1613 --- .../field/wallHeatFlux/wallHeatFlux.C | 36 ++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/src/functionObjects/field/wallHeatFlux/wallHeatFlux.C b/src/functionObjects/field/wallHeatFlux/wallHeatFlux.C index cbb48b4a48..e80e8d1871 100644 --- a/src/functionObjects/field/wallHeatFlux/wallHeatFlux.C +++ b/src/functionObjects/field/wallHeatFlux/wallHeatFlux.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2016-2017 OpenFOAM Foundation - Copyright (C) 2016-2018 OpenCFD Ltd. + Copyright (C) 2016-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -255,23 +255,9 @@ bool Foam::functionObjects::wallHeatFlux::execute() << "database" << exit(FatalError); } - return true; -} - - -bool Foam::functionObjects::wallHeatFlux::write() -{ - const volScalarField& wallHeatFlux = lookupObject(type()); - - Log << type() << " " << name() << " write:" << nl - << " writing field " << wallHeatFlux.name() << endl; - - wallHeatFlux.write(); - const fvPatchList& patches = mesh_.boundary(); - const surfaceScalarField::Boundary& magSf = - mesh_.magSf().boundaryField(); + const surfaceScalarField::Boundary& magSf = mesh_.magSf().boundaryField(); for (const label patchi : patchSet_) { @@ -297,8 +283,26 @@ bool Foam::functionObjects::wallHeatFlux::write() Log << " min/max/integ(" << pp.name() << ") = " << minHfp << ", " << maxHfp << ", " << integralHfp << endl; + + this->setResult("min(" + pp.name() + ")", minHfp); + this->setResult("max(" + pp.name() + ")", maxHfp); + this->setResult("int(" + pp.name() + ")", integralHfp); } + + return true; +} + + +bool Foam::functionObjects::wallHeatFlux::write() +{ + const volScalarField& wallHeatFlux = lookupObject(type()); + + Log << type() << " " << name() << " write:" << nl + << " writing field " << wallHeatFlux.name() << endl; + + wallHeatFlux.write(); + return true; }