Go to the documentation of this file.
32 #include "surfaceInterpolate.H"
42 namespace functionObjects
72 volScalarField::Boundary& wallHeatFluxBf =
wallHeatFlux.boundaryFieldRef();
74 const volScalarField::Boundary& heBf =
he.boundaryField();
76 const volScalarField::Boundary& alphaBf =
alpha.boundaryField();
78 forAll(wallHeatFluxBf, patchi)
80 if (!wallHeatFluxBf[patchi].coupled())
82 wallHeatFluxBf[patchi] = alphaBf[patchi]*heBf[patchi].snGrad();
86 if (foundObject<volScalarField>(qrName_))
90 const volScalarField::Boundary& radHeatFluxBf = qr.
boundaryField();
92 forAll(wallHeatFluxBf, patchi)
94 if (!wallHeatFluxBf[patchi].coupled())
96 wallHeatFluxBf[patchi] -= radHeatFluxBf[patchi];
105 Foam::functionObjects::wallHeatFlux::wallHeatFlux
124 mesh_.time().timeName(),
134 mesh_.objectRegistry::store(wallHeatFluxPtr);
138 writeFileHeader(file());
163 dict.readIfPresent(
"qr", qrName_);
167 if (patchSet_.empty())
171 if (isA<wallPolyPatch>(pbm[patchi]))
173 patchSet_.insert(patchi);
177 Info<<
" processing all wall patches" <<
nl <<
endl;
181 Info<<
" processing wall patches: " <<
nl;
183 for (
const label patchi : patchSet_)
185 if (isA<wallPolyPatch>(pbm[patchi]))
187 filteredPatchSet.
insert(patchi);
193 <<
"Requested wall heat-flux on non-wall boundary "
194 <<
"type patch: " << pbm[patchi].
name() <<
endl;
200 patchSet_ = filteredPatchSet;
213 foundObject<compressible::turbulenceModel>
220 lookupObject<compressible::turbulenceModel>
228 turbModel.transport().he(),
254 <<
"Unable to find compressible turbulence model in the "
273 const surfaceScalarField::Boundary& magSf =
274 mesh_.magSf().boundaryField();
276 for (
const label patchi : patchSet_)
282 const scalar minHfp =
gMin(hfp);
283 const scalar maxHfp =
gMax(hfp);
284 const scalar integralHfp =
gSum(magSf[patchi]*hfp);
288 writeCurrentTime(file());
298 Log <<
" min/max/integ(" << pp.
name() <<
") = "
299 << minHfp <<
", " << maxHfp <<
", " << integralHfp <<
endl;
Calculates and write the heat-flux at wall patches as the volScalarField field 'wallHeatFlux'.
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.
const word & name() const
Return name.
A class for handling words, derived from Foam::string.
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
static constexpr const zero Zero
Global zero.
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
void calcHeatFlux(const volScalarField &alpha, const volScalarField &he, volScalarField &wallHeatFlux)
Calculate the heat-flux.
bool read(const char *buf, int32_t &val)
Same as readInt32.
Calculate the snGrad of the given volField.
List< wordRe > wordReList
A List of wordRe (word or regular expression)
static const word propertiesName
Default name of the turbulence properties dictionary.
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
File header information.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Type gSum(const FieldField< Field, Type > &f)
virtual const word & name() const
Return name.
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
addToRunTimeSelectionTable(functionObject, add, dictionary)
#define forAll(list, i)
Loop across all elements in list.
virtual bool execute()
Calculate the wall heat-flux.
virtual void writeHeader(Ostream &os, const string &str) const
Write a commented header to stream.
Fundamental solid thermodynamic properties.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
virtual bool read(const dictionary &dict)
Read.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
dimensionedScalar pow3(const dimensionedScalar &ds)
messageStream Info
Information stream (uses stdout - output is on the master only)
word name(const complex &c)
Return string representation of complex.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
word dictName() const
The local dictionary name (final part of scoped name)
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
virtual bool read(const dictionary &dict)
Read optional controls.
Macros for easy insertion into run-time selection tables.
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
errorManipArg< error, int > exit(error &err, const int errNo=1)
static bool master(const label communicator=0)
Am I the master process.
defineTypeNameAndDebug(fvMeshFunctionObject, 0)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
virtual ~wallHeatFlux()
Destructor.
virtual void writeCommented(Ostream &os, const string &str) const
Write a commented string to stream.
virtual tmp< volScalarField > alphaEff() const
Return the effective turbulent thermal diffusivity for enthalpy.
const word & name() const
Return the name of this functionObject.
Templated wrapper class to provide compressible turbulence models thermal diffusivity based thermal t...
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
labelHashSet patchSet(const UList< wordRe > &patchNames, const bool warnNotFound=true, const bool useGroups=true) const
Return the set of patch IDs corresponding to the given names.
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
const polyBoundaryMesh & patches
virtual bool write()
Write the wall heat-flux.
functionObject base class for writing single files
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Type gMin(const FieldField< Field, Type > &f)
#define WarningInFunction
Report a warning using Foam::Warning.
virtual void writeTabbed(Ostream &os, const string &str) const
Write a tabbed string to stream.
Type gMax(const FieldField< Field, Type > &f)
#define Log
Report write to Foam::Info if the local log switch is true.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
virtual bool read(const dictionary &)
Read the wallHeatFlux data.