mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: turbulenceFields FO - added turbulence intensity to list of available fields
This commit is contained in:
@ -61,7 +61,8 @@ Foam::functionObjects::turbulenceFields::compressibleFieldNames_
|
|||||||
{ compressibleField::cfAlphaEff, "alphaEff" },
|
{ compressibleField::cfAlphaEff, "alphaEff" },
|
||||||
{ compressibleField::cfR, "R" },
|
{ compressibleField::cfR, "R" },
|
||||||
{ compressibleField::cfDevRhoReff, "devRhoReff" },
|
{ compressibleField::cfDevRhoReff, "devRhoReff" },
|
||||||
{ compressibleField::cfL, "L" }
|
{ compressibleField::cfL, "L" },
|
||||||
|
{ compressibleField::cfI, "I" }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -80,6 +81,7 @@ Foam::functionObjects::turbulenceFields::incompressibleFieldNames_
|
|||||||
{ incompressibleField::ifR, "R" },
|
{ incompressibleField::ifR, "R" },
|
||||||
{ incompressibleField::ifDevReff, "devReff" },
|
{ incompressibleField::ifDevReff, "devReff" },
|
||||||
{ incompressibleField::ifL, "L" },
|
{ incompressibleField::ifL, "L" },
|
||||||
|
{ incompressibleField::ifI, "I" }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -236,6 +238,11 @@ bool Foam::functionObjects::turbulenceFields::execute()
|
|||||||
processField<scalar>(f, L(model));
|
processField<scalar>(f, L(model));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case cfI:
|
||||||
|
{
|
||||||
|
processField<scalar>(f, I(model));
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
@ -298,6 +305,11 @@ bool Foam::functionObjects::turbulenceFields::execute()
|
|||||||
processField<scalar>(f, L(model));
|
processField<scalar>(f, L(model));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case ifI:
|
||||||
|
{
|
||||||
|
processField<scalar>(f, I(model));
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
|
|||||||
@ -76,6 +76,7 @@ Usage
|
|||||||
devReff | Deviatoric part of the effective Reynolds stress
|
devReff | Deviatoric part of the effective Reynolds stress
|
||||||
devRhoReff | Divergence of the Reynolds stress
|
devRhoReff | Divergence of the Reynolds stress
|
||||||
L | turbulence length scale
|
L | turbulence length scale
|
||||||
|
I | turbulence intensity
|
||||||
\endplaintable
|
\endplaintable
|
||||||
|
|
||||||
See also
|
See also
|
||||||
@ -125,7 +126,8 @@ public:
|
|||||||
cfAlphaEff,
|
cfAlphaEff,
|
||||||
cfR,
|
cfR,
|
||||||
cfDevRhoReff,
|
cfDevRhoReff,
|
||||||
cfL
|
cfL,
|
||||||
|
cfI
|
||||||
};
|
};
|
||||||
static const Enum<compressibleField> compressibleFieldNames_;
|
static const Enum<compressibleField> compressibleFieldNames_;
|
||||||
|
|
||||||
@ -139,7 +141,8 @@ public:
|
|||||||
ifNuEff,
|
ifNuEff,
|
||||||
ifR,
|
ifR,
|
||||||
ifDevReff,
|
ifDevReff,
|
||||||
ifL
|
ifL,
|
||||||
|
ifI
|
||||||
};
|
};
|
||||||
static const Enum<incompressibleField> incompressibleFieldNames_;
|
static const Enum<incompressibleField> incompressibleFieldNames_;
|
||||||
|
|
||||||
@ -179,6 +182,10 @@ protected:
|
|||||||
template<class Model>
|
template<class Model>
|
||||||
tmp<volScalarField> L(const Model& model) const;
|
tmp<volScalarField> L(const Model& model) const;
|
||||||
|
|
||||||
|
//- Return I calculated from k and U
|
||||||
|
template<class Model>
|
||||||
|
tmp<volScalarField> I(const Model& model) const;
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|||||||
@ -85,9 +85,7 @@ Foam::functionObjects::turbulenceFields::omega
|
|||||||
const volScalarField k(model.k());
|
const volScalarField k(model.k());
|
||||||
const volScalarField epsilon(model.epsilon());
|
const volScalarField epsilon(model.epsilon());
|
||||||
|
|
||||||
return tmp<volScalarField>
|
return tmp<volScalarField>::New
|
||||||
(
|
|
||||||
new volScalarField
|
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
@ -97,7 +95,6 @@ Foam::functionObjects::turbulenceFields::omega
|
|||||||
),
|
),
|
||||||
epsilon/(Cmu*k),
|
epsilon/(Cmu*k),
|
||||||
epsilon.boundaryField().types()
|
epsilon.boundaryField().types()
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -109,9 +106,10 @@ Foam::functionObjects::turbulenceFields::nuTilda
|
|||||||
const Model& model
|
const Model& model
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
return tmp<volScalarField>
|
return tmp<volScalarField>::New
|
||||||
(
|
(
|
||||||
new volScalarField("nuTilda.tmp", model.k()/omega(model))
|
"nuTilda.tmp",
|
||||||
|
model.k()/omega(model)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -130,15 +128,30 @@ Foam::functionObjects::turbulenceFields::L
|
|||||||
const volScalarField epsilon(model.epsilon());
|
const volScalarField epsilon(model.epsilon());
|
||||||
const dimensionedScalar eps0("eps0", epsilon.dimensions(), SMALL);
|
const dimensionedScalar eps0("eps0", epsilon.dimensions(), SMALL);
|
||||||
|
|
||||||
return tmp<volScalarField>
|
return tmp<volScalarField>::New
|
||||||
(
|
|
||||||
new volScalarField
|
|
||||||
(
|
(
|
||||||
"L.tmp",
|
"L.tmp",
|
||||||
pow(Cmu, 0.75)*pow(k, 1.5)/(epsilon + eps0)
|
pow(Cmu, 0.75)*pow(k, 1.5)/(epsilon + eps0)
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Model>
|
||||||
|
Foam::tmp<Foam::volScalarField>
|
||||||
|
Foam::functionObjects::turbulenceFields::I
|
||||||
|
(
|
||||||
|
const Model& model
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
// Assume k is available
|
||||||
|
const volScalarField uPrime(sqrt((2.0/3.0)*model.k()));
|
||||||
|
const dimensionedScalar U0("U0", dimVelocity, SMALL);
|
||||||
|
|
||||||
|
return tmp<volScalarField>::New
|
||||||
|
(
|
||||||
|
"I.tmp",
|
||||||
|
uPrime/max(max(uPrime, mag(model.U())), U0)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
Reference in New Issue
Block a user