functionObjects::wallHeatFlux: Added phase support

wallHeatFlux can now be used to calculate the phase wall heat-flux in
multiphase systems, e.g.

    multiphaseEulerFoam -postProcess -func 'wallHeatFlux(phase=water)' -latestTime
This commit is contained in:
Henry Weller
2021-12-03 16:45:46 +00:00
parent e6acc7d991
commit 7d4dcacbd4
2 changed files with 22 additions and 11 deletions

View File

@ -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<word>("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>
(
thermophysicalTransportModel::typeName
thermophysicalTransportModelName
)
)
{
const thermophysicalTransportModel& ttm =
lookupObject<thermophysicalTransportModel>
(
thermophysicalTransportModel::typeName
thermophysicalTransportModelName
);
return store(name, calcWallHeatFlux(ttm.q()));
return store(fieldName, calcWallHeatFlux(ttm.q()));
}
else if (foundObject<solidThermo>(physicalProperties::typeName))
{
const solidThermo& thermo =
lookupObject<solidThermo>(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<volScalarField>(type());
const volScalarField& wallHeatFlux = obr_.lookupObject<volScalarField>
(
IOobject::groupName(type(), phaseName_)
);
const fvPatchList& patches = mesh_.boundary();

View File

@ -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);