28 #include "surfaceInterpolate.H"
37 namespace functionObjects
47 void Foam::functionObjects::wallHeatFlux::writeFileHeader(
const label i)
62 Foam::functionObjects::wallHeatFlux::calcWallHeatFlux
67 tmp<volScalarField> twallHeatFlux
78 twallHeatFlux.ref().boundaryFieldRef();
89 if (foundObject<volScalarField>(
"qr"))
103 return twallHeatFlux;
119 phaseName_(
word::null),
144 patchSet_ = mesh_.poly().boundary().
patchSet(
dict,
true);
146 if (patchSet_.empty())
150 if (isA<wallPolyPatch>(pbm[
patchi]))
167 if (isA<wallPolyPatch>(pbm[
patchi]))
175 <<
"Requested wall heat-flux on non-wall boundary "
176 <<
"type patch: " << pbm[
patchi].name() <<
endl;
181 patchSet_ = filteredPatchSet;
195 const word thermophysicalTransportModelName
202 foundObject<thermophysicalTransportModel>
204 thermophysicalTransportModelName
209 lookupObject<thermophysicalTransportModel>
211 thermophysicalTransportModelName
214 store(fieldName, calcWallHeatFlux(ttm.
q()));
221 <<
"Unable to find thermophysicalTransportModel "
222 << thermophysicalTransportModelName
223 <<
" in the database"
257 const scalar minqp =
gMin(qp);
258 const scalar maxqp =
gMax(qp);
265 << time_.userTimeValue()
274 Log <<
" min, max, Q [W], q [W/m^2] for patch " << pp.
name() <<
" = "
275 << minqp <<
", " << maxqp <<
", " <<
Q <<
", " << q <<
endl;
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
Macros for easy insertion into run-time selection tables.
Generic GeometricBoundaryField class.
Generic GeometricField class.
GeometricBoundaryField< Type, GeoMesh, PrimitiveField > Boundary
Type of the boundary field.
static tmp< GeometricField< Type, GeoMesh, PrimitiveField > > New(const word &name, const Internal &, const PtrList< Patch > &, const HashPtrTable< Source > &=HashPtrTable< Source >())
Return a temporary field constructed from name,.
bool insert(const Key &key)
Insert a new entry.
static word groupName(Name name, const word &group)
virtual const fileName & name() const
Return the name of the stream.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
static bool master(const label communicator=0)
Am I the master process.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Abstract base-class for Time/database functionObjects.
virtual const word & type() const =0
Runtime type information.
Calculates and outputs the second invariant of the velocity gradient tensor [1/s^2].
Specialisation of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
functionObject base class for creating, maintaining and writing log files e.g. integrated of averaged...
OFstream & file()
Return access to the file (if only 1)
virtual bool write()
Write function.
Calculates the natural logarithm of the specified scalar field.
const ObjectType & lookupObject(const word &fieldName) const
Lookup object from the objectRegistry.
virtual bool read(const dictionary &)
Read optional controls.
Calculates and write the heat-flux at wall patches as the volScalarField field 'wallHeatFlux'.
wallHeatFlux(const word &name, const Time &runTime, const dictionary &)
Construct from Time and dictionary.
virtual bool execute()
Calculate the wall heat-flux.
virtual bool write()
Write the wall heat-flux.
virtual ~wallHeatFlux()
Destructor.
virtual bool read(const dictionary &)
Read the wallHeatFlux data.
void writeTabbed(Ostream &os, const string &str) const
Write a tabbed string to stream.
void writeHeader(Ostream &os, const string &str) const
Write a commented header to stream.
void writeCommented(Ostream &os, const string &str) const
Write a commented string to stream.
FunctionObject base class for managing a list of objects on behalf of the inheriting function object,...
void resetLocalObjectName(const word &name)
Reset the list of local object names from a single word.
virtual bool read(const dictionary &)
Read the list of objects to be written.
virtual bool write()
Write function.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
virtual label size() const
Return size.
virtual const word & name() const
Return name.
labelHashSet patchSet(const UList< wordRe > &patchNames, const bool warnNotFound=true, const bool usePatchGroups=true) const
Return the patch set corresponding to the given names.
Abstract base class for all fluid and solid thermophysical transport models.
virtual tmp< surfaceScalarField > q() const =0
Return the heat flux [W/m^2].
A class for managing temporary objects.
Template function which returns the un-mangled name of a given type. Useful for types which do not ha...
A class for handling words, derived from string.
static const word null
An empty word.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Calculate the gradient of the given field.
const fvPatchList & patches
#define WarningInFunction
Report a warning using Foam::Warning.
#define Log
Report write to Foam::Info if the local log switch is true.
defineTypeNameAndDebug(fvMeshFunctionObject, 0)
addToRunTimeSelectionTable(functionObject, fvModel, dictionary)
Type gMin(const UList< Type > &f, const label comm)
errorManipArg< error, int > exit(error &err, const int errNo=1)
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
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 dimensionSet & dimMass
Ostream & endl(Ostream &os)
Add newline and flush stream.
String typeName(const std::type_info &info)
Return the un-mangled name given the standard type info.
SurfaceField< scalar > surfaceScalarField
Ostream & incrIndent(Ostream &os)
Increment the indent level.
Type gSum(const UList< Type > &f, const label comm)
const dimensionSet & dimTime
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
VolField< scalar > volScalarField
void pow3(LagrangianPatchField< scalar > &f, const LagrangianPatchField< scalar > &f1)
Type gMax(const UList< Type > &f, const label comm)
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
HashSet< label, Hash< label > > labelHashSet
A HashSet with label keys.
Ostream & indent(Ostream &os)
Indent stream.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.