diff --git a/src/functionObjects/field/wallHeatFlux/wallHeatFlux.C b/src/functionObjects/field/wallHeatFlux/wallHeatFlux.C index 2c7531fc8..584c6d366 100644 --- a/src/functionObjects/field/wallHeatFlux/wallHeatFlux.C +++ b/src/functionObjects/field/wallHeatFlux/wallHeatFlux.C @@ -24,6 +24,8 @@ License \*---------------------------------------------------------------------------*/ #include "wallHeatFlux.H" +#include "turbulentFluidThermoModel.H" +#include "solidThermo.H" #include "surfaceInterpolate.H" #include "fvcSnGrad.H" #include "wallPolyPatch.H" @@ -58,13 +60,14 @@ void Foam::functionObjects::wallHeatFlux::writeFileHeader(const label i) void Foam::functionObjects::wallHeatFlux::calcHeatFlux ( - const compressible::turbulenceModel& model, + const volScalarField& alpha, + const volScalarField& he, volScalarField& wallHeatFlux ) { surfaceScalarField heatFlux ( - fvc::interpolate(model.alphaEff())*fvc::snGrad(model.transport().he()) + fvc::interpolate(alpha)*fvc::snGrad(he) ); volScalarField::Boundary& wallHeatFluxBf = @@ -198,10 +201,7 @@ bool Foam::functionObjects::wallHeatFlux::read(const dictionary& dict) bool Foam::functionObjects::wallHeatFlux::execute() { - volScalarField& wallHeatFlux = const_cast - ( - lookupObject(type()) - ); + volScalarField& wallHeatFlux = lookupObjectRef(type()); if ( @@ -217,7 +217,19 @@ bool Foam::functionObjects::wallHeatFlux::execute() turbulenceModel::propertiesName ); - calcHeatFlux(turbModel, wallHeatFlux); + calcHeatFlux + ( + turbModel.alphaEff(), + turbModel.transport().he(), + wallHeatFlux + ); + } + else if (foundObject(solidThermo::dictName)) + { + const solidThermo& thermo = + lookupObject(solidThermo::dictName); + + calcHeatFlux(thermo.alpha(), thermo.he(), wallHeatFlux); } else { diff --git a/src/functionObjects/field/wallHeatFlux/wallHeatFlux.H b/src/functionObjects/field/wallHeatFlux/wallHeatFlux.H index 3ccb8d763..a890ccdbf 100644 --- a/src/functionObjects/field/wallHeatFlux/wallHeatFlux.H +++ b/src/functionObjects/field/wallHeatFlux/wallHeatFlux.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2016-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -41,6 +41,7 @@ Description type wallHeatFlux; libs ("libfieldFunctionObjects.so"); ... + region fluid; patches (".*Wall"); } \endverbatim @@ -50,6 +51,7 @@ Usage Property | Description | Required | Default value type | type name: wallHeatFlux | yes | patches | list of patches to process | no | all wall patches + region | region to be evaluated | no | default region \endtable Note @@ -76,9 +78,7 @@ SourceFiles #include "logFiles.H" #include "writeLocalObjects.H" #include "volFieldsFwd.H" -#include "surfaceFieldsFwd.H" #include "HashSet.H" -#include "turbulentFluidThermoModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -114,7 +114,8 @@ protected: //- Calculate the heat-flux void calcHeatFlux ( - const compressible::turbulenceModel& turbModel, + const volScalarField& alpha, + const volScalarField& he, volScalarField& wallHeatFlux );