41 namespace functionObjects
57 const auto&
U = lookupObject<volVectorField>(
UName_);
61 auto*
turb = findObject<cmpTurbModel>
87 "div(((rho*nuEff)*dev2(T(grad(U)))))" 100 const auto*
turb = findObject<icoTurbModel>
107 tmp<volScalarField> tnuEff =
turb->nuEff();
113 tU = subsetter.interpolate(
U,
false);
114 tnuEff = subsetter.interpolate(
turb->nuEff()(),
false);
123 "div((nuEff*dev2(T(grad(U)))))" 150 const auto&
phi = lookupObject<surfaceScalarField>(
phiName_);
217 if (
dict.readIfPresent<
word>(
"p", pName_))
221 if (
dict.readIfPresent<
word>(
"U", UName_))
226 if (
dict.readIfPresent<word>(
"phi", phiName_))
228 Info<<
" phi: " << phiName_ <<
endl;
231 if (
dict.found(
"cellZones"))
233 zoneSubSetPtr_.reset(
new Detail::zoneSubSet(mesh_,
dict));
237 zoneSubSetPtr_.reset(
nullptr);
249 const auto&
p = lookupObject<volScalarField>(pName_);
250 const auto&
U = lookupObject<volVectorField>(UName_);
251 const auto&
phi = lookupObject<surfaceScalarField>(phiName_);
255 const fvMeshSubset& subsetter = zoneSubSetPtr_->subsetter();
257 fvMesh& subMesh = zoneSubSetPtr_->subsetter().subMesh();
259 subMesh.fvSchemes::readOpt(mesh_.fvSchemes::readOpt());
260 subMesh.fvSchemes::read();
265 scopedName(
"momentErrorMap")
282 lookupObjectRef<volVectorField>(scopedName(
"momentError"));
299 Log <<
" functionObjects::" <<
type() <<
" " <<
name();
303 Log <<
" writing field: " << scopedName(
"momentError") <<
endl;
305 const auto& momentErr =
306 lookupObjectRef<volVectorField>(scopedName(
"momentError"));
312 Log <<
" writing field: " << scopedName(
"momentErrorMap") <<
endl;
314 const fvMeshSubset& subsetter = zoneSubSetPtr_->subsetter();
317 const auto& momentErrMap =
320 scopedName(
"momentErrorMap")
324 zoneSubSetPtr_->mapToZone<
vector>(momentErrMap);
static tmp< DimensionedField< Type, volMesh > > interpolate(const DimensionedField< Type, volMesh > &, const fvMesh &sMesh, const labelUList &cellMap)
Map volume internal (dimensioned) field.
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
defineTypeNameAndDebug(ObukhovLength, 0)
const Type & lookupObject(const word &name, const bool recursive=false) const
Lookup and return const reference to the object of the given Type. Fatal if not found or the wrong ty...
Type & lookupObjectRef(const word &name, const bool recursive=false) const
Lookup and return non-const reference to the object of the given Type. Fatal if not found or the wron...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
constexpr char nl
The newline '\n' character (0x0a)
word UName_
Name of velocity field.
compressible::turbulenceModel & turb
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
Ostream & endl(Ostream &os)
Add newline and flush stream.
tmp< volScalarField > trho
bool store()
Register object with its registry and transfer ownership to the registry.
Ignore writing from objectRegistry::writeObject()
Templated wrapper class to provide compressible turbulence models thermal diffusivity based thermal t...
const Time & time() const
Return the top-level database.
GeometricField< vector, fvPatchField, volMesh > volVectorField
tmp< GeometricField< Type, fvPatchField, volMesh > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
momentumError(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
Macros for easy insertion into run-time selection tables.
virtual const objectRegistry & thisDb() const
Return the object registry - resolve conflict polyMesh/lduMesh.
const fvMesh & subMesh() const
Return reference to subset mesh.
Templated abstract base class for single-phase incompressible turbulence models.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
const dimensionSet dimVolume(pow3(dimLength))
Dimension set for the base types, which can be used to implement rigorous dimension checking for alge...
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Calculate the gradient of the given field.
static const word propertiesName
Default name of the turbulence properties dictionary.
A class for handling words, derived from Foam::string.
virtual bool write()
Write.
Calculate the laplacian of the given field.
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
static const GeometricField< vector, fvPatchField, volMesh > & null() noexcept
Return a null GeometricField (reference to a nullObject).
virtual bool write(const token &tok)=0
Write token to stream or otherwise handle it.
Calculate the divergence of the given field.
tmp< volVectorField > divDevRhoReff()
Return the effective viscous stress (laminar + turbulent).
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
static word timeName(const scalar t, const int precision=precision_)
Return a time name for the given scalar time value formatted with the given precision.
addToRunTimeSelectionTable(functionObject, ObukhovLength, dictionary)
Holds a reference to the original mesh (the baseMesh) and optionally to a subset of that mesh (the su...
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
word phiName_
Name of flux field.
void calcMomentError()
Calculate the momentum error.
virtual bool execute()
Execute.
dimensionedSymmTensor dev2(const dimensionedSymmTensor &dt)
Mesh data needed to do the Finite Volume discretisation.
messageStream Info
Information stream (stdout output on master, null elsewhere)
virtual bool read(const dictionary &dict)
Read optional controls.
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
A class for managing temporary objects.
Defines the attributes of an object for which implicit objectRegistry management is supported...
Request registration (bool: true)
word scopedName(const word &name) const
Return a scoped (prefixed) name.
const fvMesh & mesh_
Reference to the fvMesh.
virtual bool read(const dictionary &)
Read the forces data.
autoPtr< Detail::zoneSubSet > zoneSubSetPtr_
Sub-set mesh.
static constexpr const zero Zero
Global zero (0)
const dimensionSet dimVelocity
const Time & time_
Reference to the time database.