32 #include "surfaceInterpolate.H" 43 namespace functionObjects
78 for (
const label patchi : patchSet_)
80 wallHeatFluxBf[patchi] = alphaBf[patchi]*heBf[patchi].snGrad();
84 const auto* qrPtr = cfindObject<volScalarField>(qrName_);
90 for (
const label patchi : patchSet_)
92 wallHeatFluxBf[patchi] -= radHeatFluxBf[patchi];
108 writeFile(obr_,
name, typeName,
dict),
130 mesh_.objectRegistry::store(wallHeatFluxPtr);
148 mesh_.boundaryMesh().patchSet
153 dict.readIfPresent(
"qr", qrName_);
157 if (patchSet_.empty())
161 if (isA<wallPolyPatch>(
pbm[patchi]))
163 patchSet_.insert(patchi);
167 Info<<
" processing all wall patches" <<
nl <<
endl;
171 Info<<
" processing wall patches: " <<
nl;
173 for (
const label patchi : patchSet_)
175 if (isA<wallPolyPatch>(
pbm[patchi]))
177 filteredPatchSet.
insert(patchi);
183 <<
"Requested wall heat-flux on non-wall boundary " 184 <<
"type patch: " <<
pbm[patchi].name() <<
endl;
190 patchSet_ = filteredPatchSet;
199 auto& wallHeatFlux = lookupObjectRef<volScalarField>(scopedName(typeName));
203 foundObject<compressible::turbulenceModel>
210 lookupObject<compressible::turbulenceModel>
218 turbModel.transport().he(),
224 const fluidThermo&
thermo =
236 const solidThermo&
thermo =
239 calcHeatFlux(
thermo.alpha(),
thermo.he(), wallHeatFlux);
243 foundObject<multiphaseInterSystem>
247 const auto&
thermo = lookupObject<multiphaseInterSystem>
252 calcHeatFlux(
thermo.kappaEff()(),
thermo.T(), wallHeatFlux);
257 <<
"Unable to find compressible turbulence model in the " 265 for (
const label patchi : patchSet_)
271 const scalar minHfp =
gMin(hfp);
272 const scalar maxHfp =
gMax(hfp);
273 const scalar integralHfp =
gSum(magSf[patchi]*hfp);
277 writeCurrentTime(file());
287 Log <<
" min/max/integ(" <<
pp.name() <<
") = " 288 << minHfp <<
", " << maxHfp <<
", " << integralHfp <<
endl;
290 this->setResult(
"min(" +
pp.name() +
")", minHfp);
291 this->setResult(
"max(" +
pp.name() +
")", maxHfp);
292 this->setResult(
"int(" +
pp.name() +
")", integralHfp);
302 const auto& wallHeatFlux =
303 lookupObject<volScalarField>(scopedName(typeName));
306 <<
" writing field " << wallHeatFlux.
name() <<
endl;
308 wallHeatFlux.
write();
word dictName() const
The local dictionary name (final part of scoped name)
const polyBoundaryMesh & pbm
virtual OFstream & file()
Return access to the file (if only 1)
defineTypeNameAndDebug(ObukhovLength, 0)
wallHeatFlux(const word &name, const Time &runTime, const dictionary &)
Construct from Time and dictionary.
virtual bool execute()
Calculate the wall heat-flux.
virtual void writeHeader(Ostream &os, const string &str) const
Write a commented header to stream.
errorManipArg< error, int > exit(error &err, const int errNo=1)
static const word phasePropertiesName
Default name of the phase properties dictionary.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Type gMin(const FieldField< Field, Type > &f)
const word & name() const noexcept
Return the object name.
virtual void writeFileHeader(Ostream &os) const
File header information.
virtual bool write()
Write the wall heat-flux.
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Calculate the snGrad of the given volField.
GeometricBoundaryField< scalar, fvsPatchField, surfaceMesh > Boundary
Type of boundary fields.
Ignore writing from objectRegistry::writeObject()
Templated wrapper class to provide compressible turbulence models thermal diffusivity based thermal t...
const Time & time() const
Return the top-level database.
Abstract base-class for Time/database function objects.
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Macros for easy insertion into run-time selection tables.
#define forAll(list, i)
Loop across all elements in list.
virtual tmp< volScalarField > alphaEff() const
Return the effective turbulent thermal diffusivity for enthalpy.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
psiReactionThermo & thermo
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
virtual void writeCommented(Ostream &os, const string &str) const
Write a commented string to stream.
Type gSum(const FieldField< Field, Type > &f)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
static const word propertiesName
Default name of the turbulence properties dictionary.
A class for handling words, derived from Foam::string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
virtual bool write(const bool writeOnProc=true) const
Write using setting from DB.
A List of wordRe with additional matching capabilities.
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO...
An Ostream is an abstract base class for all output systems (streams, files, token lists...
static word timeName(const scalar t, const int precision=precision_)
Return time name of given scalar time formatted with the given precision.
Type gMax(const FieldField< Field, Type > &f)
OBJstream os(runTime.globalPath()/outputName)
addToRunTimeSelectionTable(functionObject, ObukhovLength, dictionary)
virtual bool read(const dictionary &dict)
Read.
void calcHeatFlux(const volScalarField &alpha, const volScalarField &he, volScalarField &wallHeatFlux)
Calculate the heat-flux.
dimensionedScalar pow3(const dimensionedScalar &ds)
#define WarningInFunction
Report a warning using Foam::Warning.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
static bool master(const label communicator=worldComm)
True if process corresponds to the master rank in the communicator.
const polyBoundaryMesh & patches
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
messageStream Info
Information stream (stdout output on master, null elsewhere)
virtual bool read(const dictionary &dict)
Read optional controls.
Computes the wall-heat flux at selected wall patches.
virtual bool read(const dictionary &dict)
Read the wallHeatFlux data.
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Defines the attributes of an object for which implicit objectRegistry management is supported...
Request registration (bool: true)
word scopedName(const word &name) const
Return a scoped (prefixed) name.
const fvMesh & mesh_
Reference to the fvMesh.
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
PtrList< fvPatch > fvPatchList
Store lists of fvPatch as a PtrList.
static constexpr const zero Zero
Global zero (0)
virtual void writeTabbed(Ostream &os, const string &str) const
Write a tabbed string to stream.