mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
TurbulenceModels: Add compressible v2f
This commit is contained in:
@ -61,6 +61,14 @@ protected:
|
||||
const volScalarField& rho_;
|
||||
|
||||
|
||||
// Protected member functions
|
||||
|
||||
//- ***HGW Temporary function to be removed when the run-time selectable
|
||||
// thermal transport layer is complete
|
||||
virtual void correctNut()
|
||||
{}
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
@ -72,6 +72,9 @@ makeRASModel(LaunderSharmaKE);
|
||||
#include "kOmegaSST.H"
|
||||
makeRASModel(kOmegaSST);
|
||||
|
||||
#include "v2f.H"
|
||||
makeRASModel(v2f);
|
||||
|
||||
#include "LRR.H"
|
||||
makeRASModel(LRR);
|
||||
|
||||
|
||||
@ -1,267 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "RNGkEpsilon.H"
|
||||
#include "bound.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace incompressible
|
||||
{
|
||||
namespace RASModels
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
defineTypeNameAndDebug(RNGkEpsilon, 0);
|
||||
addToRunTimeSelectionTable(RASModel, RNGkEpsilon, dictionary);
|
||||
|
||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||
|
||||
void RNGkEpsilon::correctNut()
|
||||
{
|
||||
nut_ = Cmu_*sqr(k_)/epsilon_;
|
||||
nut_.correctBoundaryConditions();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
RNGkEpsilon::RNGkEpsilon
|
||||
(
|
||||
const geometricOneField& alpha,
|
||||
const geometricOneField& rho,
|
||||
const volVectorField& U,
|
||||
const surfaceScalarField& alphaRhoPhi,
|
||||
const surfaceScalarField& phi,
|
||||
const transportModel& transport,
|
||||
const word& propertiesName,
|
||||
const word& type
|
||||
)
|
||||
:
|
||||
eddyViscosity<incompressible::RASModel>
|
||||
(
|
||||
type,
|
||||
alpha,
|
||||
rho,
|
||||
U,
|
||||
alphaRhoPhi,
|
||||
phi,
|
||||
transport,
|
||||
propertiesName
|
||||
),
|
||||
|
||||
Cmu_
|
||||
(
|
||||
dimensioned<scalar>::lookupOrAddToDict
|
||||
(
|
||||
"Cmu",
|
||||
coeffDict_,
|
||||
0.0845
|
||||
)
|
||||
),
|
||||
C1_
|
||||
(
|
||||
dimensioned<scalar>::lookupOrAddToDict
|
||||
(
|
||||
"C1",
|
||||
coeffDict_,
|
||||
1.42
|
||||
)
|
||||
),
|
||||
C2_
|
||||
(
|
||||
dimensioned<scalar>::lookupOrAddToDict
|
||||
(
|
||||
"C2",
|
||||
coeffDict_,
|
||||
1.68
|
||||
)
|
||||
),
|
||||
sigmak_
|
||||
(
|
||||
dimensioned<scalar>::lookupOrAddToDict
|
||||
(
|
||||
"sigmak",
|
||||
coeffDict_,
|
||||
0.71942
|
||||
)
|
||||
),
|
||||
sigmaEps_
|
||||
(
|
||||
dimensioned<scalar>::lookupOrAddToDict
|
||||
(
|
||||
"sigmaEps",
|
||||
coeffDict_,
|
||||
0.71942
|
||||
)
|
||||
),
|
||||
eta0_
|
||||
(
|
||||
dimensioned<scalar>::lookupOrAddToDict
|
||||
(
|
||||
"eta0",
|
||||
coeffDict_,
|
||||
4.38
|
||||
)
|
||||
),
|
||||
beta_
|
||||
(
|
||||
dimensioned<scalar>::lookupOrAddToDict
|
||||
(
|
||||
"beta",
|
||||
coeffDict_,
|
||||
0.012
|
||||
)
|
||||
),
|
||||
|
||||
k_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
IOobject::groupName("k", U.group()),
|
||||
runTime_.timeName(),
|
||||
mesh_,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh_
|
||||
),
|
||||
epsilon_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
IOobject::groupName("epsilon", U.group()),
|
||||
runTime_.timeName(),
|
||||
mesh_,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh_
|
||||
)
|
||||
{
|
||||
bound(k_, kMin_);
|
||||
bound(epsilon_, epsilonMin_);
|
||||
|
||||
if (type == typeName)
|
||||
{
|
||||
correctNut();
|
||||
printCoeffs(type);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
bool RNGkEpsilon::read()
|
||||
{
|
||||
if (eddyViscosity<incompressible::RASModel>::read())
|
||||
{
|
||||
Cmu_.readIfPresent(coeffDict());
|
||||
C1_.readIfPresent(coeffDict());
|
||||
C2_.readIfPresent(coeffDict());
|
||||
sigmak_.readIfPresent(coeffDict());
|
||||
sigmaEps_.readIfPresent(coeffDict());
|
||||
eta0_.readIfPresent(coeffDict());
|
||||
beta_.readIfPresent(coeffDict());
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void RNGkEpsilon::correct()
|
||||
{
|
||||
eddyViscosity<incompressible::RASModel>::correct();
|
||||
|
||||
if (!turbulence_)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const volScalarField S2(2*magSqr(symm(fvc::grad(U_))));
|
||||
volScalarField G(GName(), nut_*S2);
|
||||
|
||||
const volScalarField eta(sqrt(S2)*k_/epsilon_);
|
||||
volScalarField R
|
||||
(
|
||||
((eta*(scalar(1) - eta/eta0_))/(scalar(1) + beta_*eta*sqr(eta)))
|
||||
);
|
||||
|
||||
// Update epsilon and G at the wall
|
||||
epsilon_.boundaryField().updateCoeffs();
|
||||
|
||||
// Dissipation equation
|
||||
tmp<fvScalarMatrix> epsEqn
|
||||
(
|
||||
fvm::ddt(epsilon_)
|
||||
+ fvm::div(phi_, epsilon_)
|
||||
- fvm::laplacian(DepsilonEff(), epsilon_)
|
||||
==
|
||||
(C1_ - R)*G*epsilon_/k_
|
||||
- fvm::Sp(C2_*epsilon_/k_, epsilon_)
|
||||
);
|
||||
|
||||
epsEqn().relax();
|
||||
|
||||
epsEqn().boundaryManipulate(epsilon_.boundaryField());
|
||||
|
||||
solve(epsEqn);
|
||||
bound(epsilon_, epsilonMin_);
|
||||
|
||||
|
||||
// Turbulent kinetic energy equation
|
||||
|
||||
tmp<fvScalarMatrix> kEqn
|
||||
(
|
||||
fvm::ddt(k_)
|
||||
+ fvm::div(phi_, k_)
|
||||
- fvm::laplacian(DkEff(), k_)
|
||||
==
|
||||
G - fvm::Sp(epsilon_/k_, k_)
|
||||
);
|
||||
|
||||
kEqn().relax();
|
||||
solve(kEqn);
|
||||
bound(k_, kMin_);
|
||||
|
||||
correctNut();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace RASModels
|
||||
} // End namespace incompressible
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,186 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::incompressible::RASModels::RNGkEpsilon
|
||||
|
||||
Group
|
||||
grpIcoRASTurbulence
|
||||
|
||||
Description
|
||||
Renormalisation group k-epsilon turbulence model for incompressible flows.
|
||||
|
||||
References:
|
||||
\verbatim
|
||||
"Development of Turbulence Models for Shear Flow by a
|
||||
Double Expansion Technique",
|
||||
Yakhot, V., Orszag, S.A., Thangam, S., Gatski, T.B. and Speziale, C.G.",
|
||||
Physics of Fluids A, Vol. 4, No. 7, 1992, pp 1510-1520.
|
||||
\endverbatim
|
||||
|
||||
The default model coefficients are
|
||||
\verbatim
|
||||
RNGkEpsilonCoeffs
|
||||
{
|
||||
Cmu 0.0845;
|
||||
C1 1.42;
|
||||
C2 1.68;
|
||||
sigmak 0.71942;
|
||||
sigmaEps 0.71942;
|
||||
eta0 4.38;
|
||||
beta 0.012;
|
||||
}
|
||||
\endverbatim
|
||||
|
||||
SourceFiles
|
||||
RNGkEpsilon.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef RNGkEpsilon_H
|
||||
#define RNGkEpsilon_H
|
||||
|
||||
#include "turbulentTransportModel.H"
|
||||
#include "eddyViscosity.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace incompressible
|
||||
{
|
||||
namespace RASModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class RNGkEpsilon Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class RNGkEpsilon
|
||||
:
|
||||
public eddyViscosity<incompressible::RASModel>
|
||||
{
|
||||
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
// Model coefficients
|
||||
|
||||
dimensionedScalar Cmu_;
|
||||
dimensionedScalar C1_;
|
||||
dimensionedScalar C2_;
|
||||
dimensionedScalar sigmak_;
|
||||
dimensionedScalar sigmaEps_;
|
||||
dimensionedScalar eta0_;
|
||||
dimensionedScalar beta_;
|
||||
|
||||
|
||||
// Fields
|
||||
|
||||
volScalarField k_;
|
||||
volScalarField epsilon_;
|
||||
|
||||
|
||||
// Protected Member Functions
|
||||
|
||||
virtual void correctNut();
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("RNGkEpsilon");
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
RNGkEpsilon
|
||||
(
|
||||
const geometricOneField& alpha,
|
||||
const geometricOneField& rho,
|
||||
const volVectorField& U,
|
||||
const surfaceScalarField& alphaRhoPhi,
|
||||
const surfaceScalarField& phi,
|
||||
const transportModel& transport,
|
||||
const word& propertiesName = turbulenceModel::propertiesName,
|
||||
const word& type = typeName
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~RNGkEpsilon()
|
||||
{}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Read RASProperties dictionary
|
||||
virtual bool read();
|
||||
|
||||
//- Return the effective diffusivity for k
|
||||
tmp<volScalarField> DkEff() const
|
||||
{
|
||||
return tmp<volScalarField>
|
||||
(
|
||||
new volScalarField("DkEff", nut_/sigmak_ + nu())
|
||||
);
|
||||
}
|
||||
|
||||
//- Return the effective diffusivity for epsilon
|
||||
tmp<volScalarField> DepsilonEff() const
|
||||
{
|
||||
return tmp<volScalarField>
|
||||
(
|
||||
new volScalarField("DepsilonEff", nut_/sigmaEps_ + nu())
|
||||
);
|
||||
}
|
||||
|
||||
//- Return the turbulence kinetic energy
|
||||
virtual tmp<volScalarField> k() const
|
||||
{
|
||||
return k_;
|
||||
}
|
||||
|
||||
//- Return the turbulence kinetic energy dissipation rate
|
||||
virtual tmp<volScalarField> epsilon() const
|
||||
{
|
||||
return epsilon_;
|
||||
}
|
||||
|
||||
//- Solve the turbulence equations and correct the turbulence viscosity
|
||||
virtual void correct();
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace RASModels
|
||||
} // End namespace incompressible
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
Reference in New Issue
Block a user