ENH: wallHeatFlux FO - removed hard-coding of qr name

This commit is contained in:
Andrew Heather
2017-07-07 11:49:14 +01:00
parent 2910240040
commit 91b6f37c73
2 changed files with 10 additions and 3 deletions

View File

@ -75,9 +75,9 @@ void Foam::functionObjects::wallHeatFlux::calcHeatFlux
wallHeatFluxBf[patchi] = heatFluxBf[patchi]; wallHeatFluxBf[patchi] = heatFluxBf[patchi];
} }
if (foundObject<volScalarField>("qr")) if (foundObject<volScalarField>(qrName_))
{ {
const volScalarField& qr = lookupObject<volScalarField>("qr"); const volScalarField& qr = lookupObject<volScalarField>(qrName_);
const volScalarField::Boundary& radHeatFluxBf = qr.boundaryField(); const volScalarField::Boundary& radHeatFluxBf = qr.boundaryField();
@ -100,7 +100,8 @@ Foam::functionObjects::wallHeatFlux::wallHeatFlux
: :
fvMeshFunctionObject(name, runTime, dict), fvMeshFunctionObject(name, runTime, dict),
writeFile(obr_, name, typeName, dict), writeFile(obr_, name, typeName, dict),
patchSet_() patchSet_(),
qrName_("qr")
{ {
volScalarField* wallHeatFluxPtr volScalarField* wallHeatFluxPtr
( (
@ -148,6 +149,8 @@ bool Foam::functionObjects::wallHeatFlux::read(const dictionary& dict)
wordReList(dict.lookupOrDefault("patches", wordReList())) wordReList(dict.lookupOrDefault("patches", wordReList()))
); );
dict.readIfPresent("qr", qrName_);
Info<< type() << " " << name() << ":" << nl; Info<< type() << " " << name() << ":" << nl;
if (patchSet_.empty()) if (patchSet_.empty())

View File

@ -51,6 +51,7 @@ Usage
Property | Description | Required | Default value Property | Description | Required | Default value
type | type name: wallHeatFlux | yes | type | type name: wallHeatFlux | yes |
patches | list of patches to process | no | all wall patches patches | list of patches to process | no | all wall patches
qr | name of radiative heat flux field | no | qr
\endtable \endtable
See also See also
@ -96,6 +97,9 @@ protected:
//- Optional list of patches to process //- Optional list of patches to process
labelHashSet patchSet_; labelHashSet patchSet_;
//- Name of radiative heat flux name, default = qr
word qrName_;
// Protected Member Functions // Protected Member Functions