28 #include "surfaceInterpolate.H"
38 namespace functionObjects
56 "stressUSf",
"divStressU",
"divStressDotU",
"stressDDotGradU",
57 "pUSf",
"divPU",
"gradPU",
"pDivU",
58 "tauUSf",
"divTauU",
"divTauDotU",
"tauDDotGradU"
64 void Foam::functionObjects::power::writeFileHeader(
const label i)
71 "Domain-integrated power [x " +
Foam::name(1.0/factor_) +
"]"
78 if ((fieldi % 4) != 0)
119 dict.readIfPresent(
"factor", factor_);
122 resetLocalObjectNames(fields_);
149 store(fields_[1],
fvc::div(store(fields_[0], stressf & Uf)))
150 - store(fields_[2],
fvc::div(stressf) &
U)
156 store(fields_[5],
fvc::div(store(fields_[4], -pIf & Uf)))
163 store(fields_[9],
fvc::div(store(fields_[8], tauf & Uf)))
191 const scalar integratedPower =
196 Log <<
" " << fields_[fieldi] <<
": "
197 << integratedPower <<
nl;
199 file()<<
tab << integratedPower;
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
Generic GeometricField class.
ios_base::fmtflags setf(const ios_base::fmtflags f)
Set flags of stream.
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.
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.
Evaluates and writes the following power fields.
power(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
virtual ~power()
Destructor.
virtual bool execute()
Calculate the power field.
virtual bool write()
Write the power field.
virtual bool read(const dictionary &)
Read the power 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,...
virtual bool read(const dictionary &)
Read the list of objects to be written.
virtual bool write()
Write function.
Abstract base class for turbulence models (RAS, LES and laminar).
virtual tmp< surfaceVectorField > devTau() const =0
Return the effective surface stress.
const volVectorField & U() const
Access function to velocity field.
A class for handling words, derived from string.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
Calculate the divergence of the given field.
Calculate the gradient of the given field.
Volume integrate volField creating a volField.
#define Log
Report write to Foam::Info if the local log switch is true.
defineTypeNameAndDebug(adjustTimeStepToCombustion, 0)
addToRunTimeSelectionTable(functionObject, adjustTimeStepToCombustion, dictionary)
static tmp< SurfaceField< Type > > interpolate(const VolField< Type > &tvf, const surfaceScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
dimensioned< Type > domainIntegrate(const VolField< Type > &vf)
tmp< VolField< typename outerProduct< vector, Type >::type > > grad(const SurfaceField< Type > &ssf)
tmp< VolField< Type > > div(const SurfaceField< Type > &ssf)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
IOstream & fixed(IOstream &io)
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.