mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
createTurbulenceFields: utility replaced by 'turbulenceFields' functionObject used with the '-postProcess' option
This commit is contained in:
@ -49,11 +49,12 @@ template<>
|
||||
const char* Foam::NamedEnum
|
||||
<
|
||||
Foam::functionObjects::turbulenceFields::compressibleField,
|
||||
8
|
||||
9
|
||||
>::names[] =
|
||||
{
|
||||
"k",
|
||||
"epsilon",
|
||||
"omega",
|
||||
"mut",
|
||||
"muEff",
|
||||
"alphat",
|
||||
@ -65,18 +66,19 @@ const char* Foam::NamedEnum
|
||||
const Foam::NamedEnum
|
||||
<
|
||||
Foam::functionObjects::turbulenceFields::compressibleField,
|
||||
8
|
||||
9
|
||||
> Foam::functionObjects::turbulenceFields::compressibleFieldNames_;
|
||||
|
||||
template<>
|
||||
const char* Foam::NamedEnum
|
||||
<
|
||||
Foam::functionObjects::turbulenceFields::incompressibleField,
|
||||
6
|
||||
7
|
||||
>::names[] =
|
||||
{
|
||||
"k",
|
||||
"epsilon",
|
||||
"omega",
|
||||
"nut",
|
||||
"nuEff",
|
||||
"R",
|
||||
@ -86,7 +88,7 @@ const char* Foam::NamedEnum
|
||||
const Foam::NamedEnum
|
||||
<
|
||||
Foam::functionObjects::turbulenceFields::incompressibleField,
|
||||
6
|
||||
7
|
||||
> Foam::functionObjects::turbulenceFields::incompressibleFieldNames_;
|
||||
|
||||
const Foam::word Foam::functionObjects::turbulenceFields::modelName
|
||||
@ -144,7 +146,14 @@ Foam::functionObjects::turbulenceFields::~turbulenceFields()
|
||||
|
||||
bool Foam::functionObjects::turbulenceFields::read(const dictionary& dict)
|
||||
{
|
||||
fieldSet_.insert(wordList(dict.lookup("fields")));
|
||||
if (dict.found("field"))
|
||||
{
|
||||
fieldSet_.insert(word(dict.lookup("field")));
|
||||
}
|
||||
else
|
||||
{
|
||||
fieldSet_.insert(wordList(dict.lookup("fields")));
|
||||
}
|
||||
|
||||
Info<< type() << " " << name() << ": ";
|
||||
if (fieldSet_.size())
|
||||
@ -189,6 +198,11 @@ bool Foam::functionObjects::turbulenceFields::execute(const bool postProcess)
|
||||
processField<scalar>(f, model.epsilon());
|
||||
break;
|
||||
}
|
||||
case cfOmega:
|
||||
{
|
||||
processField<scalar>(f, omega(model));
|
||||
break;
|
||||
}
|
||||
case cfMut:
|
||||
{
|
||||
processField<scalar>(f, model.mut());
|
||||
@ -247,6 +261,11 @@ bool Foam::functionObjects::turbulenceFields::execute(const bool postProcess)
|
||||
processField<scalar>(f, model.epsilon());
|
||||
break;
|
||||
}
|
||||
case ifOmega:
|
||||
{
|
||||
processField<scalar>(f, omega(model));
|
||||
break;
|
||||
}
|
||||
case ifNut:
|
||||
{
|
||||
processField<scalar>(f, model.nut());
|
||||
|
||||
@ -64,6 +64,7 @@ Description
|
||||
\plaintable
|
||||
k | turbulence kinetic energy
|
||||
epsilon | turbulence kinetic energy dissipation rate
|
||||
omega | turbulence specific dissipation rate
|
||||
nut | turbulence viscosity (incompressible)
|
||||
nuEff | effective turbulence viscosity (incompressible)
|
||||
mut | turbulence viscosity (compressible)
|
||||
@ -113,6 +114,7 @@ public:
|
||||
{
|
||||
cfK,
|
||||
cfEpsilon,
|
||||
cfOmega,
|
||||
cfMut,
|
||||
cfMuEff,
|
||||
cfAlphat,
|
||||
@ -120,18 +122,19 @@ public:
|
||||
cfR,
|
||||
cfDevRhoReff
|
||||
};
|
||||
static const NamedEnum<compressibleField, 8> compressibleFieldNames_;
|
||||
static const NamedEnum<compressibleField, 9> compressibleFieldNames_;
|
||||
|
||||
enum incompressibleField
|
||||
{
|
||||
ifK,
|
||||
ifEpsilon,
|
||||
ifOmega,
|
||||
ifNut,
|
||||
ifNuEff,
|
||||
ifR,
|
||||
ifDevReff
|
||||
};
|
||||
static const NamedEnum<incompressibleField, 6> incompressibleFieldNames_;
|
||||
static const NamedEnum<incompressibleField, 7> incompressibleFieldNames_;
|
||||
|
||||
static const word modelName;
|
||||
|
||||
@ -157,6 +160,10 @@ protected:
|
||||
const tmp<GeometricField<Type, fvPatchField, volMesh>>& tvalue
|
||||
);
|
||||
|
||||
//- Return omega calculated from k and epsilon
|
||||
template<class Model>
|
||||
tmp<volScalarField> omega(const Model& model) const;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
@ -72,4 +72,34 @@ void Foam::functionObjects::turbulenceFields::processField
|
||||
}
|
||||
|
||||
|
||||
template<class Model>
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::functionObjects::turbulenceFields::omega
|
||||
(
|
||||
const Model& model
|
||||
) const
|
||||
{
|
||||
const scalar Cmu = 0.09;
|
||||
|
||||
// Assume k and epsilon are available
|
||||
const volScalarField k(model.k());
|
||||
const volScalarField epsilon(model.epsilon());
|
||||
|
||||
return tmp<volScalarField>
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"omega",
|
||||
k.mesh().time().timeName(),
|
||||
k.mesh()
|
||||
),
|
||||
epsilon/(Cmu*k),
|
||||
epsilon.boundaryField().types()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
Reference in New Issue
Block a user