29 #include "surfaceInterpolate.H" 38 namespace functionObjects
48 void Foam::functionObjects::wallHeatFlux::writeFileHeader(
const label i)
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]");
63 Foam::functionObjects::wallHeatFlux::calcWallHeatFlux
68 tmp<volScalarField> twallHeatFlux
79 twallHeatFlux.ref().boundaryFieldRef();
85 const label patchi = iter.key();
90 if (foundObject<volScalarField>(
"qr"))
98 const label patchi = iter.key();
104 return twallHeatFlux;
153 if (patchSet_.empty())
157 if (isA<wallPolyPatch>(pbm[patchi]))
159 patchSet_.insert(patchi);
163 Info<<
" processing all wall patches" << nl <<
endl;
167 Info<<
" processing wall patches: " <<
nl;
171 label patchi = iter.key();
172 if (isA<wallPolyPatch>(pbm[patchi]))
174 filteredPatchSet.
insert(patchi);
180 <<
"Requested wall heat-flux on non-wall boundary " 181 <<
"type patch: " << pbm[
patchi].name() <<
endl;
187 patchSet_ = filteredPatchSet;
191 resetLocalObjectName(typeName);
201 const word thermophysicalTransportModelName
208 foundObject<thermophysicalTransportModel>
210 thermophysicalTransportModelName
215 lookupObject<thermophysicalTransportModel>
217 thermophysicalTransportModelName
220 return store(fieldName, calcWallHeatFlux(ttm.
q()));
222 else if (foundObject<solidThermo>(physicalProperties::typeName))
225 lookupObject<solidThermo>(physicalProperties::typeName);
227 return store(fieldName, calcWallHeatFlux(thermo.
q()));
232 <<
"Unable to find compressible turbulence model in the " 259 label patchi = iter.key();
264 const scalar minqp =
gMin(qp);
265 const scalar maxqp =
gMax(qp);
266 const scalar
Q =
gSum(magSf[patchi]*qp);
267 const scalar q = Q/
gSum(magSf[patchi]);
272 << mesh_.time().userTimeValue()
281 Log <<
" min, max, Q [W], q [W/m^2] for patch " << pp.
name() <<
" = " 282 << minqp <<
", " << maxqp <<
", " << Q <<
", " << q <<
endl;
const fvPatchList & patches
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.
FvWallInfoData< WallInfo, label > label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
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.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
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].
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.
GeometricBoundaryField< scalar, fvPatchField, volMesh > Boundary
Type of the boundary field.
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.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
HashSet< label, Hash< label > > labelHashSet
A HashSet with label keys.
const dimensionSet dimTime
virtual bool read(const dictionary &)
Read optional controls.
bool read(const char *, int32_t &)
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.
static word groupName(Name name, const word &group)
static const word null
An empty word.
Calculates and outputs the second invariant of the velocity gradient tensor [1/s^2].
Type gMax(const FieldField< Field, Type > &f)
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.
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
functionObject base class for creating, maintaining and writing log files e.g. integrated of averaged...