29 #include "surfaceInterpolate.H" 38 namespace functionObjects
51 writeHeader(
file(),
"Wall heat-flux");
52 writeCommented(
file(),
"Time");
53 writeTabbed(
file(),
"patch");
54 writeTabbed(
file(),
"min");
55 writeTabbed(
file(),
"max");
56 writeTabbed(
file(),
"integral");
78 volScalarField::Boundary& wallHeatFluxBf =
79 twallHeatFlux.
ref().boundaryFieldRef();
81 const volScalarField::Boundary& heBf =
84 const volScalarField::Boundary& alphaBf =
89 if (!wallHeatFluxBf[
patchi].coupled())
95 if (foundObject<volScalarField>(
"qr"))
99 const volScalarField::Boundary& radHeatFluxBf =
104 if (!wallHeatFluxBf[
patchi].coupled())
111 return twallHeatFlux;
131 resetLocalObjectName(typeName);
158 if (patchSet_.empty())
162 if (isA<wallPolyPatch>(pbm[
patchi]))
164 patchSet_.insert(patchi);
168 Info<<
" processing all wall patches" << nl <<
endl;
172 Info<<
" processing wall patches: " <<
nl;
177 if (isA<wallPolyPatch>(pbm[patchi]))
179 filteredPatchSet.
insert(patchi);
185 <<
"Requested wall heat-flux on non-wall boundary " 192 patchSet_ = filteredPatchSet;
205 foundObject<compressible::turbulenceModel>
212 lookupObject<compressible::turbulenceModel>
220 calcWallHeatFlux(turbModel.
alphaEff(), turbModel.transport().he())
228 return store(name, calcWallHeatFlux(thermo.
alpha(), thermo.
he()));
233 <<
"Unable to find compressible turbulence model in the " 254 const surfaceScalarField::Boundary& magSf =
255 mesh_.magSf().boundaryField();
264 const scalar minHfp =
gMin(hfp);
265 const scalar maxHfp =
gMax(hfp);
266 const scalar integralHfp =
gSum(magSf[patchi]*hfp);
271 << mesh_.time().value()
275 <<
tab << integralHfp
279 Log <<
" min/max/integ(" << pp.
name() <<
") = " 280 << minHfp <<
", " << maxHfp <<
", " << integralHfp <<
endl;
virtual bool write()
Write function.
Calculates the natural logarithm of the specified scalar field.
#define forAll(list, i)
Loop across all elements in list.
virtual bool write()
Write function.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const word & name() const
Return name.
wallHeatFlux(const word &name, const Time &runTime, const dictionary &)
Construct from Time and dictionary.
virtual bool execute()
Calculate the wall heat-flux.
errorManipArg< error, int > exit(error &err, const int errNo=1)
A list of keyword definitions, which are a keyword followed by any number of values (e...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Type gMin(const FieldField< Field, Type > &f)
const Boundary & boundaryField() const
Return const-reference to the boundary field.
T & ref() const
Return non-const reference or generate a fatal error.
virtual bool write()
Write the wall heat-flux.
addToRunTimeSelectionTable(functionObject, Qdot, dictionary)
Ostream & endl(Ostream &os)
Add newline and flush stream.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
virtual ~wallHeatFlux()
Destructor.
static bool master(const label communicator=0)
Am I the master process.
virtual const volScalarField & alpha() const
Thermal diffusivity for enthalpy of mixture [kg/m/s].
Calculate the snGrad of the given volField.
Templated wrapper class to provide compressible turbulence models thermal diffusivity based thermal t...
rhoReactionThermo & thermo
bool insert(const Key &key)
Insert a new entry.
labelHashSet patchSet(const UList< wordRe > &patchNames, const bool warnNotFound=true, const bool usePatchGroups=true) const
Return the set of patch IDs corresponding to the given names.
const ObjectType & lookupObject(const word &fieldName) const
Lookup object from the objectRegistry.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Macros for easy insertion into run-time selection tables.
virtual volScalarField & he()=0
Enthalpy/Internal energy [J/kg].
const word dictName() const
Return the local dictionary name (final part of scoped name)
static tmp< GeometricField< scalar, fvPatchField, volMesh > > New(const word &name, const Mesh &, const dimensionSet &, const word &patchFieldType=fvPatchField< scalar >::calculatedType())
Return a temporary field constructed from name, mesh, dimensionSet.
virtual tmp< volScalarField > alphaEff() const
Effective thermal turbulent diffusivity of mixture [kg/m/s].
tmp< volScalarField > calcWallHeatFlux(const volScalarField &alpha, const volScalarField &he)
Calculate the heat-flux.
virtual bool read(const dictionary &)
Read optional controls.
bool read(const char *, int32_t &)
Type gSum(const FieldField< Field, Type > &f)
static const word propertiesName
Default name of the turbulence properties dictionary.
A class for handling words, derived from string.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
Type gMax(const FieldField< Field, Type > &f)
virtual void writeFileHeader(const label i)
File header information.
Fundamental solid thermodynamic properties.
word name(const complex &)
Return a string representation of a complex.
defineTypeNameAndDebug(Qdot, 0)
dimensionedScalar pow3(const dimensionedScalar &ds)
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
#define WarningInFunction
Report a warning using Foam::Warning.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
FunctionObject base class for managing a list of objects on behalf of the inheriting function object...
virtual bool read(const dictionary &)
Read the list of objects to be written.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
#define Log
Report write to Foam::Info if the local log switch is true.
virtual bool read(const dictionary &)
Read the wallHeatFlux data.
virtual const word & name() const
Return name.
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
Calculates and write the heat-flux at wall patches as the volScalarField field 'wallHeatFlux'.
List< wordRe > wordReList
A List of wordRe (word or regular expression)
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
A class for managing temporary objects.
functionObject base class for creating, maintaining and writing log files e.g. integrated of averaged...