Go to the documentation of this file.
39 namespace functionObjects
53 { derivedType::NONE ,
"none" },
54 { derivedType::MASS_FLUX ,
"rhoU" },
55 { derivedType::TOTAL_PRESSURE ,
"pTotal" },
67 const word& derivedName,
78 const bool isNew = !result;
120 const word& derivedName,
132 const bool isNew = !result;
201 label nbad = 0, ngood = 0;
203 for (
const word& key : derivedNames)
209 case derivedType::NONE:
212 case derivedType::UNKNOWN:
214 derivedNames[nbad++] = key;
229 <<
"Ignoring unknown derived names: "
250 Log <<
type() <<
" calculating:";
258 case derivedType::MASS_FLUX:
260 isNew =
calc_rhoU(mesh_, knownNames[category], rhoRef_);
262 Log <<
" " << knownNames[category];
263 if (isNew)
Log <<
" (new)";
267 case derivedType::TOTAL_PRESSURE:
269 isNew =
calc_pTotal(mesh_, knownNames[category], rhoRef_);
271 Log <<
" " << knownNames[category];
272 if (isNew)
Log <<
" (new)";
293 case derivedType::NONE:
294 case derivedType::UNKNOWN:
300 mesh_.cfindObject<
regIOobject>(knownNames[category]);
305 <<
" writing field " << ioptr->name() <<
endl;
322 mesh_.thisDb().checkOut(knownNames[category]);
329 if (&mpm.
mesh() == &mesh_)
331 removeDerivedFields();
340 removeDerivedFields();
Type * getObjectPtr(const word &name, const bool recursive=false) const
const dimensionSet dimPressure
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
A class for handling words, derived from Foam::string.
const dimensionSet dimVelocity
const dimensionSet dimDensity
A List obtained as a section of another List.
static word timeName(const scalar t, const int precision=precision_)
virtual void updateMesh(const mapPolyMesh &mpm)
Update for changes of mesh.
Ostream & endl(Ostream &os)
Add newline and flush stream.
static bool calc_rhoU(const fvMesh &mesh, const word &derivedName, const scalar rhoRef)
EnumType get(const word &enumName) const
The enumeration corresponding to the given name.
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
Mesh consisting of general polyhedral cells.
#define forAll(list, i)
Loop across all elements in list.
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
Info<< "Reading mechanical properties\n"<< endl;IOdictionary mechanicalProperties(IOobject("mechanicalProperties", runTime.constant(), mesh, IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE));const dictionary &rhoDict(mechanicalProperties.subDict("rho"));word rhoType(rhoDict.get< word >"type"));autoPtr< volScalarField > rhoPtr
messageStream Info
Information stream (uses stdout - output is on the master only)
word name(const complex &c)
Return string representation of complex.
virtual bool execute()
Calculate the derived fields.
static const Enum< derivedType > knownNames
Names for derivedType.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
const Type & lookupObject(const word &name, const bool recursive=false) const
void resize(const label newSize)
Adjust allocated size of list.
virtual bool write()
Write derived fields.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
virtual bool read(const dictionary &dict)
Read optional controls.
Macros for easy insertion into run-time selection tables.
virtual bool write(const token &tok)=0
Write token to stream or otherwise handle it.
Mesh data needed to do the Finite Volume discretisation.
virtual bool read(const dictionary &dict)
Read the data.
GeometricField< vector, fvPatchField, volMesh > volVectorField
void removeDerivedFields()
Remove (checkOut) derived fields from the object registry.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
derivedFields(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
const Type * findObject(const word &name, const bool recursive=false) const
Return const pointer to the object of the given Type.
FlatOutput< Container > flatOutput(const Container &obj, label len=0)
Global flatOutput function.
addToRunTimeSelectionTable(functionObject, ObukhovLength, dictionary)
virtual const word & type() const =0
Runtime type information.
static bool calc_pTotal(const fvMesh &mesh, const word &derivedName, const scalar rhoRef)
derivedType
Options for the derived/calculated field type.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
defineTypeNameAndDebug(ObukhovLength, 0)
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
const Time & time() const
Return the top-level database.
const polyMesh & mesh() const
Return polyMesh.
virtual void movePoints(const polyMesh &m)
Update for mesh point-motion.
#define WarningInFunction
Report a warning using Foam::Warning.
List< derivedType > derivedTypes_
List of derived field (types) to create.
scalar rhoRef_
Reference density (to convert from kinematic to static pressure)