diff --git a/src/functionObjects/field/wallHeatFlux/wallHeatFlux.C b/src/functionObjects/field/wallHeatFlux/wallHeatFlux.C index b8a9f41aa6..85a74bed40 100644 --- a/src/functionObjects/field/wallHeatFlux/wallHeatFlux.C +++ b/src/functionObjects/field/wallHeatFlux/wallHeatFlux.C @@ -117,9 +117,11 @@ Foam::functionObjects::wallHeatFlux::wallHeatFlux fvMeshFunctionObject(name, runTime, dict), logFiles(obr_, name), writeLocalObjects(obr_, log), + phaseName_(word::null), patchSet_() { read(dict); + resetLocalObjectName(IOobject::groupName(type(), phaseName_)); } @@ -136,6 +138,8 @@ bool Foam::functionObjects::wallHeatFlux::read(const dictionary& dict) fvMeshFunctionObject::read(dict); writeLocalObjects::read(dict); + phaseName_ = dict.lookupOrDefault("phase", word::null); + const polyBoundaryMesh& pbm = mesh_.boundaryMesh(); patchSet_ = @@ -192,30 +196,35 @@ bool Foam::functionObjects::wallHeatFlux::read(const dictionary& dict) bool Foam::functionObjects::wallHeatFlux::execute() { - word name(type()); + const word fieldName(IOobject::groupName(type(), phaseName_)); + + const word thermophysicalTransportModelName + ( + IOobject::groupName(thermophysicalTransportModel::typeName, phaseName_) + ); if ( foundObject ( - thermophysicalTransportModel::typeName + thermophysicalTransportModelName ) ) { const thermophysicalTransportModel& ttm = lookupObject ( - thermophysicalTransportModel::typeName + thermophysicalTransportModelName ); - return store(name, calcWallHeatFlux(ttm.q())); + return store(fieldName, calcWallHeatFlux(ttm.q())); } else if (foundObject(physicalProperties::typeName)) { const solidThermo& thermo = lookupObject(physicalProperties::typeName); - return store(name, calcWallHeatFlux(thermo.q())); + return store(fieldName, calcWallHeatFlux(thermo.q())); } else { @@ -236,8 +245,10 @@ bool Foam::functionObjects::wallHeatFlux::write() logFiles::write(); - const volScalarField& wallHeatFlux = - obr_.lookupObject(type()); + const volScalarField& wallHeatFlux = obr_.lookupObject + ( + IOobject::groupName(type(), phaseName_) + ); const fvPatchList& patches = mesh_.boundary(); diff --git a/src/functionObjects/field/wallHeatFlux/wallHeatFlux.H b/src/functionObjects/field/wallHeatFlux/wallHeatFlux.H index 5ba903dbb8..92f0598013 100644 --- a/src/functionObjects/field/wallHeatFlux/wallHeatFlux.H +++ b/src/functionObjects/field/wallHeatFlux/wallHeatFlux.H @@ -94,16 +94,16 @@ class wallHeatFlux public logFiles, public writeLocalObjects { + // Private Data -protected: - - // Protected data + //- The name of the phase + word phaseName_; //- Optional list of patches to process labelHashSet patchSet_; - // Protected Member Functions + // Private Member Functions //- File header information virtual void writeFileHeader(const label i);