29 #include "surfaceInterpolate.H" 38 namespace functionObjects
52 writeCommented(
file(),
"Time");
53 writeTabbed(
file(),
"patch");
54 writeTabbed(
file(),
"min [W/m^2]");
55 writeTabbed(
file(),
"max [W/m^2]");
56 writeTabbed(
file(),
"Q [W]");
57 writeTabbed(
file(),
"q [W/m^2]");
78 volScalarField::Boundary& wallHeatFluxBf =
79 twallHeatFlux.
ref().boundaryFieldRef();
90 if (foundObject<volScalarField>(
"qr"))
94 const volScalarField::Boundary& radHeatFluxBf = qr.
boundaryField();
104 return twallHeatFlux;
149 if (patchSet_.empty())
153 if (isA<wallPolyPatch>(pbm[
patchi]))
155 patchSet_.insert(patchi);
159 Info<<
" processing all wall patches" << nl <<
endl;
163 Info<<
" processing wall patches: " <<
nl;
168 if (isA<wallPolyPatch>(pbm[patchi]))
170 filteredPatchSet.
insert(patchi);
176 <<
"Requested wall heat-flux on non-wall boundary " 183 patchSet_ = filteredPatchSet;
187 resetLocalObjectName(typeName);
199 foundObject<thermophysicalTransportModel>
201 thermophysicalTransportModel::typeName
206 lookupObject<thermophysicalTransportModel>
208 thermophysicalTransportModel::typeName
211 return store(name, calcWallHeatFlux(ttm.
q()));
218 return store(name, calcWallHeatFlux(thermo.
q()));
223 <<
"Unable to find compressible turbulence model in the " 244 const surfaceScalarField::Boundary& magSf = mesh_.magSf().boundaryField();
253 const scalar minqp =
gMin(qp);
254 const scalar maxqp =
gMax(qp);
255 const scalar
Q =
gSum(magSf[patchi]*qp);
256 const scalar q = Q/
gSum(magSf[patchi]);
261 << mesh_.time().value()
270 Log <<
" min, max, Q [W], q [W/m^2] for patch " << pp.
name() <<
" = " 271 << minqp <<
", " << maxqp <<
", " << Q <<
", " << q <<
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.
fluidReactionThermo & thermo
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.
virtual tmp< surfaceScalarField > q() const =0
Return the heat flux [W/m^2].
T & ref() const
Return non-const reference or generate a fatal error.
virtual bool write()
Write the wall heat-flux.
addToRunTimeSelectionTable(functionObject, Qdot, dictionary)
static tmp< GeometricField< scalar, fvPatchField, volMesh > > New(const word &name, const Internal &, const PtrList< fvPatchField< scalar >> &)
Return a temporary field constructed from name,.
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.
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.
const dimensionSet dimTime
virtual bool read(const dictionary &)
Read optional controls.
bool read(const char *, int32_t &)
tmp< volScalarField > calcWallHeatFlux(const surfaceScalarField &q)
Calculate the heat-flux.
Type gSum(const FieldField< Field, Type > &f)
void writeHeader(std::ostream &, const bool isBinary, const std::string &title)
Write header.
Calculate the gradient of the given field.
A class for handling words, derived from string.
Calculates and outputs the second invariant of the velocity gradient tensor [1/s^2].
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
static const word dictName
Name of the thermophysical properties dictionary.
Type gMax(const FieldField< Field, Type > &f)
virtual void writeFileHeader(const label i)
File header information.
Base-class for solid thermodynamic properties.
const dimensionSet dimMass
word name(const complex &)
Return a string representation of a complex.
defineTypeNameAndDebug(Qdot, 0)
Abstract base class for thermophysical transport models (RAS, LES and laminar).
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.
#define Log
Report write to Foam::Info if the local log switch is true.
virtual tmp< surfaceScalarField > q() const =0
Return the heat flux [W].
virtual bool read(const dictionary &)
Read the wallHeatFlux data.
virtual const word & name() const
Return name.
Specialisation 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)
A class for managing temporary objects.
functionObject base class for creating, maintaining and writing log files e.g. integrated of averaged...