ENH: LES turbulence - named k and epsilon fields returned by utililty functions

This commit is contained in:
andy 2012-08-22 09:58:18 +01:00
parent 5541a62875
commit 33d24875f7
4 changed files with 98 additions and 12 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -51,7 +51,7 @@ namespace LESModels
{
/*---------------------------------------------------------------------------*\
Class GenEddyVisc Declaration
Class GenEddyVisc Declaration
\*---------------------------------------------------------------------------*/
class GenEddyVisc
@ -108,7 +108,21 @@ public:
//- Return sub-grid disipation rate
virtual tmp<volScalarField> epsilon() const
{
return ce_*k()*sqrt(k())/delta();
return tmp<volScalarField>
(
new volScalarField
(
IOobject
(
"epsilon",
runTime_.timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
ce_*k()*sqrt(k())/delta()
)
);
}
//- Return viscosity

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -52,7 +52,7 @@ namespace LESModels
{
/*---------------------------------------------------------------------------*\
Class GenSGSStress Declaration
Class GenSGSStress Declaration
\*---------------------------------------------------------------------------*/
class GenSGSStress
@ -109,14 +109,43 @@ public:
//- Return the SGS turbulent kinetic energy
virtual tmp<volScalarField> k() const
{
return 0.5*tr(B_);
return tmp<volScalarField>
(
new volScalarField
(
IOobject
(
"k",
runTime_.timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
0.5*tr(B_)
)
);
}
//- Return the SGS turbulent dissipation
virtual tmp<volScalarField> epsilon() const
{
const volScalarField K(k());
return ce_*K*sqrt(K)/delta();
return tmp<volScalarField>
(
new volScalarField
(
IOobject
(
"epsilon",
runTime_.timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
ce_*K*sqrt(K)/delta()
)
);
}
//- Return the SGS viscosity

View File

@ -51,7 +51,7 @@ namespace LESModels
{
/*---------------------------------------------------------------------------*\
Class GenEddyVisc Declaration
Class GenEddyVisc Declaration
\*---------------------------------------------------------------------------*/
class GenEddyVisc
@ -104,7 +104,21 @@ public:
//- Return sub-grid disipation rate
virtual tmp<volScalarField> epsilon() const
{
return ce_*k()*sqrt(k())/delta();
return tmp<volScalarField>
(
new volScalarField
(
IOobject
(
"epsilon",
runTime_.timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
ce_*k()*sqrt(k())/delta()
)
);
}
//- Return the SGS viscosity.

View File

@ -52,7 +52,7 @@ namespace LESModels
{
/*---------------------------------------------------------------------------*\
Class GenSGSStress Declaration
Class GenSGSStress Declaration
\*---------------------------------------------------------------------------*/
class GenSGSStress
@ -104,14 +104,43 @@ public:
//- Return the SGS turbulent kinetic energy.
virtual tmp<volScalarField> k() const
{
return 0.5*tr(B_);
return tmp<volScalarField>
(
new volScalarField
(
IOobject
(
"k",
runTime_.timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
0.5*tr(B_)
)
);
}
//- Return the SGS turbulent dissipation.
virtual tmp<volScalarField> epsilon() const
{
const volScalarField K(k());
return ce_*K*sqrt(K)/delta();
return tmp<volScalarField>
(
new volScalarField
(
IOobject
(
"epsilon",
runTime_.timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
ce_*K*sqrt(K)/delta()
)
);
}
//- Return the SGS viscosity.