87 "div(((rho*nuEff)*dev2(T(grad(U)))))"
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)))))"
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")
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);
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
compressible::turbulenceModel & turb
static const this_type & null() noexcept
@ REGISTER
Request registration (bool: true).
@ NO_READ
Nothing to be read.
@ NO_WRITE
Ignore writing from objectRegistry::writeObject().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
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.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Dimension set for the base types, which can be used to implement rigorous dimension checking for alge...
Abstract base-class for Time/database function objects.
virtual bool read(const dictionary &dict)
Read and set the function object if its data have changed.
word scopedName(const word &name) const
Return a scoped (prefixed) name.
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
const fvMesh & mesh_
Reference to the fvMesh.
fvMeshFunctionObject(const fvMeshFunctionObject &)=delete
No copy construct.
Computes balance terms for the steady momentum equation.
word pName_
Name of pressure field.
word UName_
Name of velocity field.
virtual bool read(const dictionary &dict)
Read the function-object dictionary.
word phiName_
Name of flux field.
tmp< volVectorField > divDevRhoReff()
Return the effective viscous stress (laminar + turbulent).
momentumError(const word &name, const Time &runTime, const dictionary &dict)
Construct from name, Time and dictionary.
void calcMomentError()
Calculate the momentum error.
virtual bool execute()
Execute the function-object operations.
autoPtr< Detail::zoneSubSet > zoneSubSetPtr_
Sub-set mesh.
virtual bool write()
Write the function-object results.
const ObjectType & lookupObject(const word &fieldName) const
Lookup and return object (eg, a field) from the (sub) objectRegistry.
const ObjectType * findObject(const word &fieldName) const
Return const pointer to the object (eg, a field) in the (sub) objectRegistry.
ObjectType & lookupObjectRef(const word &fieldName) const
Lookup and return object (eg, a field) from the (sub) objectRegistry.
const Time & time_
Reference to the time database.
Holds a reference to the original mesh (the baseMesh) and optionally to a subset of that mesh (the su...
static tmp< DimensionedField< Type, volMesh > > interpolate(const DimensionedField< Type, volMesh > &, const fvMesh &sMesh, const labelUList &cellMap)
Map volume internal (dimensioned) field.
const fvMesh & subMesh() const
Return reference to subset mesh.
Mesh data needed to do the Finite Volume discretisation.
virtual const objectRegistry & thisDb() const
Return the object registry - resolve conflict polyMesh/lduMesh.
const Time & time() const
Return the top-level database.
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...
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...
bool store()
Register object with its registry and transfer ownership to the registry.
A class for managing temporary objects.
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
static const word propertiesName
Default name of the turbulence properties dictionary.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Calculate the divergence of the given field.
Calculate the gradient of the given field.
Calculate the laplacian of the given field.
ThermalDiffusivity< CompressibleTurbulenceModel< fluidThermo > > turbulenceModel
Function objects are OpenFOAM utilities to ease workflow configurations and enhance workflows.
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh > > grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
tmp< GeometricField< Type, fvPatchField, volMesh > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
IncompressibleTurbulenceModel< transportModel > turbulenceModel
dimensionedSymmTensor dev2(const dimensionedSymmTensor &dt)
GeometricField< vector, fvPatchField, volMesh > volVectorField
const dimensionSet dimVelocity
messageStream Info
Information stream (stdout output on master, null elsewhere).
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Ostream & endl(Ostream &os)
Add newline and flush stream.
static constexpr const zero Zero
Global zero (0).
const dimensionSet dimVolume(pow3(dimLength))
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
constexpr char nl
The newline '\n' character (0x0a).
tmp< volScalarField > trho