Go to the documentation of this file.
32 #include "surfaceInterpolate.H"
42 namespace functionObjects
77 for (
const label patchi : patchSet_)
79 wallHeatFluxBf[patchi] = alphaBf[patchi]*heBf[patchi].snGrad();
83 const auto* qrPtr = cfindObject<volScalarField>(qrName_);
89 for (
const label patchi : patchSet_)
91 wallHeatFluxBf[patchi] -= radHeatFluxBf[patchi];
107 writeFile(obr_,
name, typeName,
dict),
128 mesh_.objectRegistry::store(wallHeatFluxPtr);
151 dict.readIfPresent(
"qr", qrName_);
155 if (patchSet_.empty())
159 if (isA<wallPolyPatch>(pbm[patchi]))
161 patchSet_.insert(patchi);
165 Info<<
" processing all wall patches" <<
nl <<
endl;
169 Info<<
" processing wall patches: " <<
nl;
171 for (
const label patchi : patchSet_)
173 if (isA<wallPolyPatch>(pbm[patchi]))
175 filteredPatchSet.
insert(patchi);
181 <<
"Requested wall heat-flux on non-wall boundary "
182 <<
"type patch: " << pbm[patchi].
name() <<
endl;
188 patchSet_ = filteredPatchSet;
197 auto& wallHeatFlux = lookupObjectRef<volScalarField>(scopedName(typeName));
201 foundObject<compressible::turbulenceModel>
208 lookupObject<compressible::turbulenceModel>
216 turbModel.transport().he(),
222 const fluidThermo&
thermo =
234 const solidThermo&
thermo =
237 calcHeatFlux(
thermo.alpha(),
thermo.he(), wallHeatFlux);
242 <<
"Unable to find compressible turbulence model in the "
248 const surfaceScalarField::Boundary& magSf = mesh_.magSf().boundaryField();
250 for (
const label patchi : patchSet_)
252 const fvPatch& pp =
patches[patchi];
256 const scalar minHfp =
gMin(hfp);
257 const scalar maxHfp =
gMax(hfp);
258 const scalar integralHfp =
gSum(magSf[patchi]*hfp);
262 writeCurrentTime(file());
272 Log <<
" min/max/integ(" << pp.name() <<
") = "
273 << minHfp <<
", " << maxHfp <<
", " << integralHfp <<
endl;
275 this->setResult(
"min(" + pp.name() +
")", minHfp);
276 this->setResult(
"max(" + pp.name() +
")", maxHfp);
277 this->setResult(
"int(" + pp.name() +
")", integralHfp);
287 const auto& wallHeatFlux =
288 lookupObject<volScalarField>(scopedName(typeName));
291 <<
" writing field " << wallHeatFlux.name() <<
endl;
293 wallHeatFlux.write();
Computes the wall-heat flux at selected wall patches.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
A class for handling words, derived from Foam::string.
virtual OFstream & file()
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
static constexpr const zero Zero
static const word dictName
const dimensionedScalar alpha
void calcHeatFlux(const volScalarField &alpha, const volScalarField &he, volScalarField &wallHeatFlux)
bool read(const char *buf, int32_t &val)
Calculate the snGrad of the given volField.
static word timeName(const scalar t, const int precision=precision_)
static const word propertiesName
Fundamental fluid thermodynamic properties.
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
virtual void writeFileHeader(Ostream &os) const
static bool master(const label communicator=worldComm)
Ostream & endl(Ostream &os)
Type gSum(const FieldField< Field, Type > &f)
virtual const word & name() const
A HashTable with keys but without contents that is similar to std::unordered_set.
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
Abstract base-class for Time/database function objects.
virtual void writeHeader(Ostream &os, const string &str) const
PtrList< fvPatch > fvPatchList
container classes for fvPatch
Fundamental solid thermodynamic properties.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
virtual bool read(const dictionary &dict)
Generic templated field type.
dimensionedScalar pow3(const dimensionedScalar &ds)
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
virtual bool read(const dictionary &dict)
OBJstream os(runTime.globalPath()/outputName)
Macros for easy insertion into run-time selection tables.
Generic dimensioned Type class.
virtual bool read(const dictionary &dict)
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
errorManipArg< error, int > exit(error &err, const int errNo=1)
word scopedName(const word &name) const
const word & name() const noexcept
#define FatalErrorInFunction
const word & name() const noexcept
virtual void writeCommented(Ostream &os, const string &str) const
virtual tmp< volScalarField > alphaEff() const
addToRunTimeSelectionTable(functionObject, ObukhovLength, dictionary)
Templated wrapper class to provide compressible turbulence models thermal diffusivity based thermal t...
fileName::Type type(const fileName &name, const bool followLink=true)
wallHeatFlux(const word &name, const Time &runTime, const dictionary &)
A List of wordRe with additional matching capabilities.
labelHashSet patchSet(const UList< wordRe > &patchNames, const bool warnNotFound=true, const bool useGroups=true) const
bool insert(const Key &key)
defineTypeNameAndDebug(ObukhovLength, 0)
const polyBoundaryMesh & patches
word name(const expressions::valueTypeCode typeCode)
const Time & time() const
Base class for writing single files from the function objects.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Type gMin(const FieldField< Field, Type > &f)
HashSet< label, Hash< label > > labelHashSet
A HashSet with label keys and label hasher.
Generic GeometricField class.
#define WarningInFunction
virtual void writeTabbed(Ostream &os, const string &str) const
Type gMax(const FieldField< Field, Type > &f)
const Boundary & boundaryField() const