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),
|
fvMeshFunctionObject(name, runTime, dict),
|
||||||
logFiles(obr_, name),
|
logFiles(obr_, name),
|
||||||
writeLocalObjects(obr_, log),
|
writeLocalObjects(obr_, log),
|
||||||
|
phaseName_(word::null),
|
||||||
patchSet_()
|
patchSet_()
|
||||||
{
|
{
|
||||||
read(dict);
|
read(dict);
|
||||||
|
resetLocalObjectName(IOobject::groupName(type(), phaseName_));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -136,6 +138,8 @@ bool Foam::functionObjects::wallHeatFlux::read(const dictionary& dict)
|
|||||||
fvMeshFunctionObject::read(dict);
|
fvMeshFunctionObject::read(dict);
|
||||||
writeLocalObjects::read(dict);
|
writeLocalObjects::read(dict);
|
||||||
|
|
||||||
|
phaseName_ = dict.lookupOrDefault<word>("phase", word::null);
|
||||||
|
|
||||||
const polyBoundaryMesh& pbm = mesh_.boundaryMesh();
|
const polyBoundaryMesh& pbm = mesh_.boundaryMesh();
|
||||||
|
|
||||||
patchSet_ =
|
patchSet_ =
|
||||||
@ -192,30 +196,35 @@ bool Foam::functionObjects::wallHeatFlux::read(const dictionary& dict)
|
|||||||
|
|
||||||
bool Foam::functionObjects::wallHeatFlux::execute()
|
bool Foam::functionObjects::wallHeatFlux::execute()
|
||||||
{
|
{
|
||||||
word name(type());
|
const word fieldName(IOobject::groupName(type(), phaseName_));
|
||||||
|
|
||||||
|
const word thermophysicalTransportModelName
|
||||||
|
(
|
||||||
|
IOobject::groupName(thermophysicalTransportModel::typeName, phaseName_)
|
||||||
|
);
|
||||||
|
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
foundObject<thermophysicalTransportModel>
|
foundObject<thermophysicalTransportModel>
|
||||||
(
|
(
|
||||||
thermophysicalTransportModel::typeName
|
thermophysicalTransportModelName
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const thermophysicalTransportModel& ttm =
|
const thermophysicalTransportModel& ttm =
|
||||||
lookupObject<thermophysicalTransportModel>
|
lookupObject<thermophysicalTransportModel>
|
||||||
(
|
(
|
||||||
thermophysicalTransportModel::typeName
|
thermophysicalTransportModelName
|
||||||
);
|
);
|
||||||
|
|
||||||
return store(name, calcWallHeatFlux(ttm.q()));
|
return store(fieldName, calcWallHeatFlux(ttm.q()));
|
||||||
}
|
}
|
||||||
else if (foundObject<solidThermo>(physicalProperties::typeName))
|
else if (foundObject<solidThermo>(physicalProperties::typeName))
|
||||||
{
|
{
|
||||||
const solidThermo& thermo =
|
const solidThermo& thermo =
|
||||||
lookupObject<solidThermo>(physicalProperties::typeName);
|
lookupObject<solidThermo>(physicalProperties::typeName);
|
||||||
|
|
||||||
return store(name, calcWallHeatFlux(thermo.q()));
|
return store(fieldName, calcWallHeatFlux(thermo.q()));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -236,8 +245,10 @@ bool Foam::functionObjects::wallHeatFlux::write()
|
|||||||
|
|
||||||
logFiles::write();
|
logFiles::write();
|
||||||
|
|
||||||
const volScalarField& wallHeatFlux =
|
const volScalarField& wallHeatFlux = obr_.lookupObject<volScalarField>
|
||||||
obr_.lookupObject<volScalarField>(type());
|
(
|
||||||
|
IOobject::groupName(type(), phaseName_)
|
||||||
|
);
|
||||||
|
|
||||||
const fvPatchList& patches = mesh_.boundary();
|
const fvPatchList& patches = mesh_.boundary();
|
||||||
|
|
||||||
|
|||||||
@ -94,16 +94,16 @@ class wallHeatFlux
|
|||||||
public logFiles,
|
public logFiles,
|
||||||
public writeLocalObjects
|
public writeLocalObjects
|
||||||
{
|
{
|
||||||
|
// Private Data
|
||||||
|
|
||||||
protected:
|
//- The name of the phase
|
||||||
|
word phaseName_;
|
||||||
// Protected data
|
|
||||||
|
|
||||||
//- Optional list of patches to process
|
//- Optional list of patches to process
|
||||||
labelHashSet patchSet_;
|
labelHashSet patchSet_;
|
||||||
|
|
||||||
|
|
||||||
// Protected Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
//- File header information
|
//- File header information
|
||||||
virtual void writeFileHeader(const label i);
|
virtual void writeFileHeader(const label i);
|
||||||
|
|||||||
Reference in New Issue
Block a user