53Foam::functionObjects::proudmanAcousticPower::rhoScale
62 return fld*thermoPtr->rho();
65 if (rhoInf_.
value() < 0)
69 <<
"Incompressible calculation assumed, but no reference density "
70 <<
"set. Please set the entry 'rhoInf' to an appropriate value"
79Foam::tmp<Foam::volScalarField>
80Foam::functionObjects::proudmanAcousticPower::a()
const
86 const basicThermo&
thermo = *thermoPtr;
100Foam::tmp<Foam::volScalarField>
101Foam::functionObjects::proudmanAcousticPower::k()
const
103 if (kName_ !=
"none")
105 return lookupObject<volScalarField>(kName_);
115Foam::tmp<Foam::volScalarField>
116Foam::functionObjects::proudmanAcousticPower::epsilon()
const
118 if (epsilonName_ !=
"none")
120 return lookupObject<volScalarField>(epsilonName_);
123 if (omegaName_ !=
"none")
126 const auto& omega = lookupObject<volScalarField>(omegaName_);
127 const scalar betaStar = 0.09;
128 return betaStar*
k()*omega;
134 return turb.epsilon();
152 epsilonName_(
"none"),
207 dict.readIfPresent(
"alphaEps", alphaEps_);
208 rhoInf_.readIfPresent(
"rhoInf",
dict);
209 aRef_.readIfPresent(
"aRef",
dict);
211 if (
dict.readIfPresent(
"k", kName_))
213 Info<<
" k field: " << kName_ <<
endl;
217 Info<<
" k field from turbulence model" <<
endl;
220 if (
dict.readIfPresent(
"epsilon", epsilonName_))
222 Info<<
" epsilon field: " << epsilonName_ <<
endl;
226 Info<<
" epsilon field from turbulence model (if needed)"
230 if (
dict.readIfPresent(
"omega", omegaName_))
232 Info<<
" omega field: " << omegaName_ <<
endl;
236 Info<<
" omega field from turbulence model (if needed)" <<
endl;
239 if (epsilonName_ !=
"none" && omegaName_ !=
"none")
242 <<
"either epsilon or omega field names can be set but not both"
259 auto& P_A = mesh_.lookupObjectRef<
volScalarField>(scopedName(
"P_A"));
263 auto& L_P = mesh_.lookupObjectRef<
volScalarField>(scopedName(
"L_P"));
275 const auto& P_A = mesh_.lookupObject<
volScalarField>(scopedName(
"P_A"));
277 Log <<
" writing field " << P_A.
name() <<
nl;
281 const auto& L_P = mesh_.lookupObject<
volScalarField>(scopedName(
"L_P"));
283 Log <<
" writing field " << L_P.name() <<
nl;
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
Info<< nl;Info<< "Write faMesh in vtk format:"<< nl;{ vtk::uindirectPatchWriter writer(aMesh.patch(), fileName(aMesh.time().globalPath()/vtkBaseFileName));writer.writeGeometry();globalIndex procAddr(aMesh.nFaces());labelList cellIDs;if(UPstream::master()) { cellIDs.resize(procAddr.totalSize());for(const labelRange &range :procAddr.ranges()) { auto slice=cellIDs.slice(range);slice=identity(range);} } writer.beginCellData(4);writer.writeProcIDs();writer.write("cellID", cellIDs);writer.write("area", aMesh.S().field());writer.write("normal", aMesh.faceAreaNormals());writer.beginPointData(1);writer.write("normal", aMesh.pointAreaNormals());Info<< " "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.time().globalPath()/(vtkBaseFileName+"-edges")));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
compressible::turbulenceModel & turb
static tmp< GeometricField< scalar, fvPatchField, volMesh > > New(const word &name, IOobjectOption::registerOption regOpt, const Mesh &mesh, const dimensionSet &dims, const word &patchFieldType=fvPatchField< scalar >::calculatedType())
@ NO_REGISTER
Do not request registration (bool: false).
@ 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,...
const word & name() const noexcept
Return the object name.
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.
static const word dictName
The dictionary name ("thermophysicalProperties").
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
const Type & value() const noexcept
Return const reference to value.
Abstract base-class for Time/database function objects.
const word & name() const noexcept
Return the name of this functionObject.
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.
virtual const word & type() const =0
Runtime type information.
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 the acoustic power due to the volume of isotropic turbulence using Proudman's formula.
virtual bool read(const dictionary &dict)
Read the function-object dictionary.
proudmanAcousticPower(const word &name, const Time &runTime, const dictionary &)
Construct from name, Time and dictionary.
virtual bool execute()
Execute the function-object operations.
virtual bool write()
Write the function-object results.
ObjectType * getObjectPtr(const word &fieldName) const
Return non-const pointer to the object of the given Type, using a const-cast to have it behave like a...
const Time & time() const
Return the top-level database.
virtual bool write(const bool writeOnProc=true) const
Write using setting from DB.
bool store()
Register object with its registry and transfer ownership to the registry.
A class for managing temporary objects.
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.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Function objects are OpenFOAM utilities to ease workflow configurations and enhance workflows.
dimensionedScalar pow5(const dimensionedScalar &ds)
const dimensionSet dimPower
const dimensionSet dimless
Dimensionless.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
const dimensionSet dimVelocity
messageStream Info
Information stream (stdout output on master, null elsewhere).
dimensionedScalar log10(const dimensionedScalar &ds)
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.
dimensionedScalar sqrt(const dimensionedScalar &ds)
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
static constexpr const zero Zero
Global zero (0).
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
const dimensionSet dimVolume(pow3(dimLength))
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
const dimensionSet dimDensity
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a).
psiReactionThermo & thermo