38namespace functionObjects
53Foam::functionObjects::proudmanAcousticPower::rhoScale
55 const tmp<volScalarField>&
fld
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"
80Foam::functionObjects::proudmanAcousticPower::a()
const
86 const basicThermo&
thermo = *thermoPtr;
96 mesh_.time().timeName(),
107Foam::functionObjects::proudmanAcousticPower::k()
const
109 if (kName_ !=
"none")
111 return lookupObject<volScalarField>(kName_);
122Foam::functionObjects::proudmanAcousticPower::epsilon()
const
124 if (epsilonName_ !=
"none")
126 return lookupObject<volScalarField>(epsilonName_);
129 if (omegaName_ !=
"none")
132 const auto& omega = lookupObject<volScalarField>(omegaName_);
133 const scalar betaStar = 0.09;
134 return betaStar*
k()*omega;
140 return turb.epsilon();
158 epsilonName_(
"none"),
211 dict.readIfPresent(
"alphaEps", alphaEps_);
212 rhoInf_.readIfPresent(
"rhoInf",
dict);
213 aRef_.readIfPresent(
"aRef",
dict);
215 if (
dict.readIfPresent(
"k", kName_))
217 Info<<
" k field: " << kName_ <<
endl;
221 Info<<
" k field from turbulence model" <<
endl;
224 if (
dict.readIfPresent(
"epsilon", epsilonName_))
226 Info<<
" epsilon field: " << epsilonName_ <<
endl;
230 Info<<
" epsilon field from turbulence model (if needed)"
234 if (
dict.readIfPresent(
"omega", omegaName_))
236 Info<<
" omega field: " << omegaName_ <<
endl;
240 Info<<
" omega field from turbulence model (if needed)" <<
endl;
243 if (epsilonName_ !=
"none" && omegaName_ !=
"none")
246 <<
"either epsilon or omega field names can be set but not both"
263 auto& P_A = mesh_.lookupObjectRef<
volScalarField>(scopedName(
"P_A"));
267 auto& L_P = mesh_.lookupObjectRef<
volScalarField>(scopedName(
"L_P"));
279 const auto& P_A = mesh_.lookupObject<
volScalarField>(scopedName(
"P_A"));
281 Log <<
" writing field " << P_A.name() <<
nl;
285 const auto& L_P = mesh_.lookupObject<
volScalarField>(scopedName(
"L_P"));
287 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<< "Wrote faMesh in vtk format: "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.mesh().time().globalPath()/"finiteArea-edges"));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
compressible::turbulenceModel & turb
Defines the attributes of an object for which implicit objectRegistry management is supported,...
virtual bool read()
Re-read model coefficients if they have changed.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
static word timeName(const scalar t, const int precision=precision_)
static const word dictName
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
const Type & value() const
Return const reference to value.
Abstract base-class for Time/database function objects.
const word & name() const noexcept
Return the name of this functionObject.
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.
Computes the acoustic power due to the volume of isotropic turbulence using Proudman's formula.
virtual bool execute()
Calculate the Proudman acoustic power.
virtual bool write()
Write the Proudman acoustic power.
virtual bool read(const dictionary &)
Read the Proudman acoustic power data.
const Time & time() const
Return the top-level database.
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
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.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
dimensionedScalar pow5(const dimensionedScalar &ds)
const dimensionSet dimPower
const dimensionSet dimless
Dimensionless.
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)
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 INVALID.
const dimensionSet dimDensity
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a)