Skip to content
Snippets Groups Projects
Commit 65fd9b8b authored by Andrew Heather's avatar Andrew Heather
Browse files

ENH: turbulenceFields FO - added nuTilda and turbulence length scale

parent 6a024a7b
Branches
Tags
No related merge requests found
......@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015-2017 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015-2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -54,12 +54,14 @@ Foam::functionObjects::turbulenceFields::compressibleFieldNames_
{ compressibleField::cfK, "k" },
{ compressibleField::cfEpsilon, "epsilon" },
{ compressibleField::cfOmega, "omega" },
{ compressibleField::cfNuTilda, "nuTilda" },
{ compressibleField::cfMut, "mut" },
{ compressibleField::cfMuEff, "muEff" },
{ compressibleField::cfAlphat, "alphat" },
{ compressibleField::cfAlphaEff, "alphaEff" },
{ compressibleField::cfR, "R" },
{ compressibleField::cfDevRhoReff, "devRhoReff" },
{ compressibleField::cfL, "L" }
};
......@@ -72,10 +74,12 @@ Foam::functionObjects::turbulenceFields::incompressibleFieldNames_
{ incompressibleField::ifK, "k" },
{ incompressibleField::ifEpsilon, "epsilon" },
{ incompressibleField::ifOmega, "omega" },
{ incompressibleField::ifNuTilda, "nuTilda" },
{ incompressibleField::ifNut, "nut" },
{ incompressibleField::ifNuEff, "nuEff" },
{ incompressibleField::ifR, "R" },
{ incompressibleField::ifDevReff, "devReff" },
{ incompressibleField::ifL, "L" },
};
......@@ -193,6 +197,11 @@ bool Foam::functionObjects::turbulenceFields::execute()
processField<scalar>(f, omega(model));
break;
}
case cfNuTilda:
{
processField<scalar>(f, nuTilda(model));
break;
}
case cfMut:
{
processField<scalar>(f, model.mut());
......@@ -223,6 +232,11 @@ bool Foam::functionObjects::turbulenceFields::execute()
processField<symmTensor>(f, model.devRhoReff());
break;
}
case cfL:
{
processField<scalar>(f, L(model));
break;
}
default:
{
FatalErrorInFunction
......@@ -256,6 +270,11 @@ bool Foam::functionObjects::turbulenceFields::execute()
processField<scalar>(f, omega(model));
break;
}
case ifNuTilda:
{
processField<scalar>(f, nuTilda(model));
break;
}
case ifNut:
{
processField<scalar>(f, model.nut());
......@@ -276,6 +295,11 @@ bool Foam::functionObjects::turbulenceFields::execute()
processField<symmTensor>(f, model.devReff());
break;
}
case ifL:
{
processField<scalar>(f, L(model));
break;
}
default:
{
FatalErrorInFunction
......
......@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015-2017 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015-2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -65,6 +65,7 @@ Usage
k | turbulence kinetic energy
epsilon | turbulence kinetic energy dissipation rate
omega | turbulence specific dissipation rate
nuTilda | turbulence modified viscosity
nut | turbulence viscosity (incompressible)
nuEff | effective turbulence viscosity (incompressible)
mut | turbulence viscosity (compressible)
......@@ -74,6 +75,7 @@ Usage
R | Reynolds stress tensor
devReff | Deviatoric part of the effective Reynolds stress
devRhoReff | Divergence of the Reynolds stress
L | turbulence length scale
\endplaintable
See also
......@@ -116,12 +118,14 @@ public:
cfK,
cfEpsilon,
cfOmega,
cfNuTilda,
cfMut,
cfMuEff,
cfAlphat,
cfAlphaEff,
cfR,
cfDevRhoReff
cfDevRhoReff,
cfL
};
static const Enum<compressibleField> compressibleFieldNames_;
......@@ -130,10 +134,12 @@ public:
ifK,
ifEpsilon,
ifOmega,
ifNuTilda,
ifNut,
ifNuEff,
ifR,
ifDevReff
ifDevReff,
ifL
};
static const Enum<incompressibleField> incompressibleFieldNames_;
......@@ -165,6 +171,14 @@ protected:
template<class Model>
tmp<volScalarField> omega(const Model& model) const;
//- Return nuTilda calculated from k and omega
template<class Model>
tmp<volScalarField> nuTilda(const Model& model) const;
//- Return L calculated from k and epsilon
template<class Model>
tmp<volScalarField> L(const Model& model) const;
private:
......
......@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -91,7 +91,7 @@ Foam::functionObjects::turbulenceFields::omega
(
IOobject
(
"omega",
"omega.tmp",
k.mesh().time().timeName(),
k.mesh()
),
......@@ -102,4 +102,43 @@ Foam::functionObjects::turbulenceFields::omega
}
template<class Model>
Foam::tmp<Foam::volScalarField>
Foam::functionObjects::turbulenceFields::nuTilda
(
const Model& model
) const
{
return tmp<volScalarField>
(
new volScalarField("nuTilda.tmp", model.k()/omega(model))
);
}
template<class Model>
Foam::tmp<Foam::volScalarField>
Foam::functionObjects::turbulenceFields::L
(
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());
const dimensionedScalar eps0("eps0", epsilon.dimensions(), SMALL);
return tmp<volScalarField>
(
new volScalarField
(
"L.tmp",
pow(Cmu, 0.75)*pow(k, 1.5)/(epsilon + eps0)
)
);
}
// ************************************************************************* //
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment