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:
@ -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();
|
||||
|
||||
|
||||
@ -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);
|
||||
|
||||
Reference in New Issue
Block a user