38 namespace functionObjects
44 proudmanAcousticPower,
53 Foam::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" 80 Foam::functionObjects::proudmanAcousticPower::a()
const 86 const basicThermo&
thermo = *thermoPtr;
101 Foam::functionObjects::proudmanAcousticPower::k()
const 103 if (kName_ !=
"none")
105 return lookupObject<volScalarField>(kName_);
116 Foam::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;
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;
virtual bool read(const dictionary &)
Read the Proudman acoustic power data.
word dictName() const
The local dictionary name (final part of scoped name)
const Type & value() const noexcept
Return const reference to value.
defineTypeNameAndDebug(ObukhovLength, 0)
virtual bool execute()
Calculate the Proudman acoustic power.
errorManipArg< error, int > exit(error &err, const int errNo=1)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const word & name() const noexcept
Return the object name.
constexpr char nl
The newline '\n' character (0x0a)
compressible::turbulenceModel & turb
dimensionedScalar sqrt(const dimensionedScalar &ds)
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual bool write()
Write the Proudman acoustic power.
bool store()
Register object with its registry and transfer ownership to the registry.
label k
Boltzmann constant.
Ignore writing from objectRegistry::writeObject()
const dimensionSet dimless
Dimensionless.
const Time & time() const
Return the top-level database.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
dimensionedScalar pow5(const dimensionedScalar &ds)
Macros for easy insertion into run-time selection tables.
const word & name() const noexcept
Return the name of this functionObject.
psiReactionThermo & thermo
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))
const dimensionedScalar e
Elementary charge.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
static const word propertiesName
Default name of the turbulence properties dictionary.
A class for handling words, derived from Foam::string.
virtual const word & type() const =0
Runtime type information.
virtual bool write(const bool writeOnProc=true) const
Write using setting from DB.
proudmanAcousticPower(const word &name, const Time &runTime, const dictionary &)
Construct from Time and dictionary.
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())
Return tmp field (NO_READ, NO_WRITE) from name, mesh, dimensions and patch type. [Takes current timeN...
const dimensionSet dimPower
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)
const dimensionSet dimDensity
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< ' ';}gmvFile<< nl;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
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.
dimensionedScalar log10(const dimensionedScalar &ds)
Do not request registration (bool: false)
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)
const dimensionSet dimVelocity