driftFluxFoam: Change turbulence modelling to new templated framework

Added k-epsilon model with buoyancy correction
This commit is contained in:
Henry
2014-04-28 15:31:28 +01:00
committed by Andrew Heather
parent 6723be5056
commit 63bef62f8e
33 changed files with 668 additions and 618 deletions

View File

@ -1,4 +1,5 @@
incompressibleTwoPhaseInteractingMixture/incompressibleTwoPhaseInteractingMixture.C
compressibleTurbulenceModels.C
driftFluxFoam.C
EXE = $(FOAM_APPBIN)/driftFluxFoam

View File

@ -9,13 +9,17 @@ EXE_INC = \
-I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
-I./relativeVelocityModels/lnInclude
EXE_LIBS = \
-ldriftFluxTransportModels \
-ldriftFluxRelativeVelocityModels \
-lfiniteVolume \
-lmeshTools \
-lsampling \
-lfvOptions \
-lincompressibleTransportModels \
-ldriftFluxTransportModels \
-ldriftFluxRelativeVelocityModels
-lturbulenceModels \
-lcompressibleTurbulenceModels

View File

@ -5,8 +5,7 @@
fvm::ddt(rho, U)
+ fvm::div(rhoPhi, U)
+ fvc::div(UdmModel.tauDm())
- fvm::laplacian(muEff, U)
- fvc::div(muEff*dev2(T(fvc::grad(U))))
+ turbulence->divDevRhoReff(U)
==
fvOptions(rho, U)
);

View File

@ -27,7 +27,7 @@
mesh,
linear<scalar>(mesh),
fv::uncorrectedSnGrad<scalar>(mesh)
).fvmLaplacian(fvc::interpolate(mut/rho), alpha1)
).fvmLaplacian(fvc::interpolate(turbulence->nut()), alpha1)
);
Info<< "Phase-1 volume fraction = "

View File

@ -55,7 +55,7 @@
fvScalarMatrix alpha1Eqn
(
fvm::ddt(alpha1) - fvc::ddt(alpha1)
- fvm::laplacian(mut/rho, alpha1)
- fvm::laplacian(turbulence->nut(), alpha1)
);
alpha1Eqn.solve(mesh.solver("alpha1Diffusion"));
@ -71,5 +71,5 @@
}
rhoPhi = phiAlpha*(rho1 - rho2) + phi*rho2;
rho == alpha1*rho1 + alpha2*rho2;
rho = mixture.rho();
}

View File

@ -0,0 +1,73 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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 "CompressibleTurbulenceModel.H"
#include "incompressibleTwoPhaseInteractingMixture.H"
#include "addToRunTimeSelectionTable.H"
#include "makeTurbulenceModel.H"
#include "laminar.H"
#include "RASModel.H"
#include "LESModel.H"
makeBaseTurbulenceModel
(
geometricOneField,
volScalarField,
compressibleTurbulenceModel,
CompressibleTurbulenceModel,
incompressibleTwoPhaseInteractingMixture
);
#define makeRASModel(Type) \
makeTemplatedTurbulenceModel \
( \
incompressibleTwoPhaseInteractingMixtureCompressibleTurbulenceModel, \
RAS, \
Type \
)
#define makeLESModel(Type) \
makeTemplatedTurbulenceModel \
( \
incompressibleTwoPhaseInteractingMixtureCompressibleTurbulenceModel, \
LES, \
Type \
)
#include "kEpsilon.H"
makeRASModel(kEpsilon);
#include "buoyantKEpsilon.H"
makeRASModel(buoyantKEpsilon);
#include "Smagorinsky.H"
makeLESModel(Smagorinsky);
#include "kEqn.H"
makeLESModel(kEqn);
// ************************************************************************* //

View File

@ -29,17 +29,14 @@
#include "createPhi.H"
// Transport
// ~~~~~~~~~
Info<< "Reading transportProperties\n" << endl;
incompressibleTwoPhaseInteractingMixture twoPhaseProperties(U, phi);
incompressibleTwoPhaseInteractingMixture mixture(U, phi);
volScalarField& alpha1(twoPhaseProperties.alpha1());
volScalarField& alpha2(twoPhaseProperties.alpha2());
volScalarField& alpha1(mixture.alpha1());
volScalarField& alpha2(mixture.alpha2());
const dimensionedScalar& rho1 = twoPhaseProperties.rhod();
const dimensionedScalar& rho2 = twoPhaseProperties.rhoc();
const dimensionedScalar& rho1 = mixture.rhod();
const dimensionedScalar& rho2 = mixture.rhoc();
IOdictionary transportProperties
(
@ -64,9 +61,8 @@
IOobject::NO_READ,
IOobject::NO_WRITE
),
alpha1*rho1 + alpha2*rho2
mixture.rho()
);
rho.oldTime();
// Mass flux
surfaceScalarField rhoPhi
@ -84,190 +80,28 @@
// Relative Velocity
// ~~~~~~~~~~~~~~~~~
autoPtr<relativeVelocityModel> UdmModelPtr
(
relativeVelocityModel::New
(
transportProperties,
twoPhaseProperties
mixture
)
);
relativeVelocityModel& UdmModel(UdmModelPtr());
// Turbulence
// ~~~~~~~~~~
IOdictionary RASProperties
// Construct compressible turbulence model
autoPtr
<
CompressibleTurbulenceModel<incompressibleTwoPhaseInteractingMixture>
> turbulence
(
IOobject
(
"RASProperties",
runTime.constant(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
CompressibleTurbulenceModel<incompressibleTwoPhaseInteractingMixture>
::New(rho, U, rhoPhi, mixture)
);
Switch turbulence(RASProperties.lookup("turbulence"));
dictionary kEpsilonDict(RASProperties.subDictPtr("kEpsilonCoeffs"));
dimensionedScalar Cmu
(
dimensionedScalar::lookupOrAddToDict
(
"Cmu",
kEpsilonDict,
0.09
)
);
dimensionedScalar C1
(
dimensionedScalar::lookupOrAddToDict
(
"C1",
kEpsilonDict,
1.44
)
);
dimensionedScalar C2
(
dimensionedScalar::lookupOrAddToDict
(
"C2",
kEpsilonDict,
1.92
)
);
dimensionedScalar C3
(
dimensionedScalar::lookupOrAddToDict
(
"C3",
kEpsilonDict,
0.85
)
);
dimensionedScalar sigmak
(
dimensionedScalar::lookupOrAddToDict
(
"sigmak",
kEpsilonDict,
1.0
)
);
dimensionedScalar sigmaEps
(
dimensionedScalar::lookupOrAddToDict
(
"sigmaEps",
kEpsilonDict,
1.3
)
);
dictionary wallFunctionDict(RASProperties.subDictPtr("wallFunctionCoeffs"));
dimensionedScalar kappa
(
dimensionedScalar::lookupOrAddToDict
(
"kappa",
wallFunctionDict,
0.41
)
);
dimensionedScalar E
(
dimensionedScalar::lookupOrAddToDict
(
"E",
wallFunctionDict,
9.8
)
);
if (RASProperties.lookupOrDefault("printCoeffs", false))
{
Info<< "kEpsilonCoeffs" << kEpsilonDict << nl
<< "wallFunctionCoeffs" << wallFunctionDict << endl;
}
nearWallDist y(mesh);
Info<< "Reading field k\n" << endl;
volScalarField k
(
IOobject
(
"k",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
Info<< "Reading field epsilon\n" << endl;
volScalarField epsilon
(
IOobject
(
"epsilon",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
Info<< "Calculating field mut\n" << endl;
volScalarField mut
(
IOobject
(
"mut",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
Cmu*rho*sqr(k)/epsilon
);
Info<< "Calculating field muEff\n" << endl;
volScalarField muEff
(
IOobject
(
"muEff",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mut + twoPhaseProperties.mu()
);
// Pressure
// ~~~~~~~~
Info<< "Calculating field (g.h)f\n" << endl;
volScalarField gh("gh", g & mesh.C());
surfaceScalarField ghf("gh", g & mesh.Cf());
@ -309,6 +143,4 @@
// MULES Correction
// ~~~~~~~~~~~~~~~~
tmp<surfaceScalarField> tphiAlphaCorr0;

View File

@ -38,10 +38,8 @@ Description
#include "subCycle.H"
#include "incompressibleTwoPhaseInteractingMixture.H"
#include "relativeVelocityModel.H"
#include "nearWallDist.H"
#include "wallFvPatch.H"
#include "bound.H"
#include "Switch.H"
#include "turbulenceModel.H"
#include "CompressibleTurbulenceModel.H"
#include "pimpleControl.H"
#include "fvIOoptionList.H"
#include "fixedFluxPressureFvPatchScalarField.H"
@ -86,7 +84,7 @@ int main(int argc, char *argv[])
#include "alphaEqnSubCycle.H"
twoPhaseProperties.correct();
mixture.correct();
#include "UEqn.H"
@ -98,7 +96,7 @@ int main(int argc, char *argv[])
if (pimple.turbCorr())
{
#include "kEpsilon.H"
turbulence->correct();
}
}

View File

@ -133,21 +133,36 @@ public:
return mu_;
}
//- Return the dynamic mixture viscosity for patch
virtual tmp<scalarField> mu(const label patchi) const
{
return mu_.boundaryField()[patchi];
}
//- Return the mixture density
virtual tmp<volScalarField> rho() const
{
return alpha1_*rhod_ + alpha2_*rhoc_;
}
//- Return the mixture density for patch
virtual tmp<scalarField> rho(const label patchi) const
{
return
alpha1_.boundaryField()[patchi]*rhod_.value()
+ alpha2_.boundaryField()[patchi]*rhoc_.value();
}
//- Return the mixture viscosity
virtual tmp<volScalarField> nu() const
{
notImplemented("incompressibleTwoPhaseInteractingMixture::nu()");
return volScalarField::null();
return mu_/rho();
}
//- Return the mixture viscosity for patch
virtual tmp<scalarField> nu(const label patchi) const
{
notImplemented
(
"incompressibleTwoPhaseInteractingMixture::nu(const label)"
);
return scalarField::null();
return mu_.boundaryField()[patchi]/rho(patchi);
}
//- Correct the laminar viscosity

View File

@ -1,82 +0,0 @@
if (turbulence)
{
if (mesh.changing())
{
y.correct();
}
dimensionedScalar k0("k0", k.dimensions(), 0);
dimensionedScalar kMin("kMin", k.dimensions(), SMALL);
dimensionedScalar epsilon0("epsilon0", epsilon.dimensions(), 0);
dimensionedScalar epsilonMin("epsilonMin", epsilon.dimensions(), SMALL);
tmp<volTensorField> tgradU = fvc::grad(U);
volScalarField G(mut*(tgradU() && dev(twoSymm(tgradU()))));
tgradU.clear();
volScalarField Gcoef
(
Cmu*k/sigmak*(g & fvc::grad(rho))/(epsilon + epsilonMin)
);
volScalarField mul(twoPhaseProperties.mu());
#include "wallFunctions.H"
// Dissipation equation
fvScalarMatrix epsEqn
(
fvm::ddt(rho, epsilon)
+ fvm::div(rhoPhi, epsilon)
- fvm::laplacian
(
mut/sigmaEps + mul, epsilon,
"laplacian(DepsilonEff,epsilon)"
)
==
C1*G*epsilon/(k + kMin)
- fvm::SuSp(C1*(1.0 - C3)*Gcoef, epsilon)
- fvm::Sp(C2*rho*epsilon/(k + kMin), epsilon)
);
#include "wallDissipation.H"
epsEqn.relax();
epsEqn.solve();
bound(epsilon, epsilon0);
// Turbulent kinetic energy equation
fvScalarMatrix kEqn
(
fvm::ddt(rho, k)
+ fvm::div(rhoPhi, k)
- fvm::laplacian
(
mut/sigmak + mul, k,
"laplacian(DkEff,k)"
)
==
G
- fvm::SuSp(Gcoef, k)
- fvm::Sp(rho*epsilon/(k + kMin), k)
);
kEqn.relax();
kEqn.solve();
bound(k, k0);
//- Re-calculate viscosity
mut = rho*Cmu*sqr(k)/(epsilon + epsilonMin);
#include "wallViscosity.H"
muEff = mut + mul;
}
else
{
muEff = mut + twoPhaseProperties.mu();
}

View File

@ -1,50 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 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/>.
Global
wallDissipation
Description
Set wall dissipation in the epsilon matrix
\*---------------------------------------------------------------------------*/
{
const fvPatchList& patches = mesh.boundary();
forAll(patches, patchi)
{
const fvPatch& p = patches[patchi];
if (isA<wallFvPatch>(p))
{
epsEqn.setValues
(
p.faceCells(),
epsilon.boundaryField()[patchi].patchInternalField()
);
}
}
}
// ************************************************************************* //

View File

@ -1,85 +0,0 @@
{
labelList cellBoundaryFaceCount(epsilon.size(), 0);
const scalar Cmu25 = ::pow(Cmu.value(), 0.25);
const scalar Cmu75 = ::pow(Cmu.value(), 0.75);
const scalar kappa_ = kappa.value();
const fvPatchList& patches = mesh.boundary();
//- Initialise the near-wall P field to zero
forAll(patches, patchi)
{
const fvPatch& curPatch = patches[patchi];
if (isA<wallFvPatch>(curPatch))
{
forAll(curPatch, facei)
{
label faceCelli = curPatch.faceCells()[facei];
epsilon[faceCelli] = 0.0;
G[faceCelli] = 0.0;
}
}
}
//- Accumulate the wall face contributions to epsilon and G
// Increment cellBoundaryFaceCount for each face for averaging
forAll(patches, patchi)
{
const fvPatch& curPatch = patches[patchi];
if (isA<wallFvPatch>(curPatch))
{
const scalarField& mutw = mut.boundaryField()[patchi];
const scalarField& mulw = mul.boundaryField()[patchi];
scalarField magFaceGradU
(
mag(U.boundaryField()[patchi].snGrad())
);
forAll(curPatch, facei)
{
label faceCelli = curPatch.faceCells()[facei];
// For corner cells (with two boundary or more faces),
// epsilon and G in the near-wall cell are calculated
// as an average
cellBoundaryFaceCount[faceCelli]++;
epsilon[faceCelli] +=
Cmu75*::pow(k[faceCelli], 1.5)
/(kappa_*y[patchi][facei]);
G[faceCelli] +=
(mutw[facei] + mulw[facei])
*magFaceGradU[facei]
*Cmu25*::sqrt(k[faceCelli])
/(kappa_*y[patchi][facei]);
}
}
}
// perform the averaging
forAll(patches, patchi)
{
const fvPatch& curPatch = patches[patchi];
if (isA<wallFvPatch>(curPatch))
{
forAll(curPatch, facei)
{
label faceCelli = curPatch.faceCells()[facei];
epsilon[faceCelli] /= cellBoundaryFaceCount[faceCelli];
G[faceCelli] /= cellBoundaryFaceCount[faceCelli];
cellBoundaryFaceCount[faceCelli] = 1;
}
}
}
}

View File

@ -1,38 +0,0 @@
{
const scalar Cmu25 = ::pow(Cmu.value(), 0.25);
const scalar kappa_ = kappa.value();
const scalar E_ = E.value();
const fvPatchList& patches = mesh.boundary();
forAll(patches, patchi)
{
const fvPatch& curPatch = patches[patchi];
if (isA<wallFvPatch>(curPatch))
{
scalarField& mutw = mut.boundaryField()[patchi];
const scalarField& mulw = mul.boundaryField()[patchi];
const scalarField& rhow = rho.boundaryField()[patchi];
forAll(curPatch, facei)
{
label faceCelli = curPatch.faceCells()[facei];
scalar yPlus =
Cmu25*y[patchi][facei]*::sqrt(k[faceCelli])
/(mulw[facei]/rhow[facei]);
if (yPlus > 11.6)
{
mutw[facei] =
mulw[facei]*(yPlus*kappa_/::log(E_*yPlus) - 1);
}
else
{
mutw[facei] = 0.0;
}
}
}
}
}

View File

@ -1,5 +1,6 @@
EXE_INC = \
-I../turbulenceModels/lnInclude \
-IlnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \

View File

@ -0,0 +1,136 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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 "buoyantKEpsilon.H"
#include "addToRunTimeSelectionTable.H"
#include "uniformDimensionedFields.H"
#include "fvcGrad.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace RASModels
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class BasicTurbulenceModel>
buoyantKEpsilon<BasicTurbulenceModel>::buoyantKEpsilon
(
const alphaField& alpha,
const rhoField& rho,
const volVectorField& U,
const surfaceScalarField& alphaRhoPhi,
const surfaceScalarField& phi,
const transportModel& transport,
const word& propertiesName,
const word& type
)
:
kEpsilon<BasicTurbulenceModel>
(
alpha,
rho,
U,
alphaRhoPhi,
phi,
transport,
propertiesName,
type
),
Cg_
(
dimensioned<scalar>::lookupOrAddToDict
(
"Cg",
this->coeffDict_,
0.85
)
)
{
if (type == typeName)
{
kEpsilon<BasicTurbulenceModel>::correctNut();
this->printCoeffs(type);
}
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class BasicTurbulenceModel>
bool buoyantKEpsilon<BasicTurbulenceModel>::read()
{
if (kEpsilon<BasicTurbulenceModel>::read())
{
Cg_.readIfPresent(this->coeffDict());
return true;
}
else
{
return false;
}
}
template<class BasicTurbulenceModel>
tmp<volScalarField>
buoyantKEpsilon<BasicTurbulenceModel>::Gcoef() const
{
const uniformDimensionedVectorField& g =
this->mesh_.objectRegistry::template
lookupObject<uniformDimensionedVectorField>("g");
return
(this->Cmu_*this->k_/this->sigmak_)
*(g & fvc::grad(this->rho_))/(this->epsilon_ + this->epsilonMin_);
}
template<class BasicTurbulenceModel>
tmp<fvScalarMatrix>
buoyantKEpsilon<BasicTurbulenceModel>::kSource() const
{
return -fvm::SuSp(Gcoef(), this->k_);
}
template<class BasicTurbulenceModel>
tmp<fvScalarMatrix>
buoyantKEpsilon<BasicTurbulenceModel>::epsilonSource() const
{
return -fvm::SuSp(this->C1_*(1.0 - this->Cg_)*Gcoef(), this->epsilon_);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace RASModels
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,161 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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::RASModels::buoyantKEpsilon
Group
grpRASTurbulence
Description
k-epsilon model for the gas-phase in a two-phase system
supporting phase-inversion.
In the limit that the gas-phase fraction approaches zero a contribution from
the other phase is blended into the k and epsilon equations up to the
phase-fraction of alphaInversion at which point phase-inversion is
considered to have occurred and the model reverts to the pure single-phase
form.
This model is unpublished and is provided as a stable numerical framework
on which a more physical model may be built.
The default model coefficients correspond to the following:
\verbatim
buoyantKEpsilonCoeffs
{
Cmu 0.09;
C1 1.44;
C2 1.92;
C3 -0.33;
Cg 0.85;
sigmak 1.0;
sigmaEps 1.3;
alphaInversion 0.7;
}
\endverbatim
SourceFiles
buoyantKEpsilon.C
\*---------------------------------------------------------------------------*/
#ifndef buoyantKEpsilon_H
#define buoyantKEpsilon_H
#include "kEpsilon.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace RASModels
{
/*---------------------------------------------------------------------------*\
Class buoyantKEpsilon Declaration
\*---------------------------------------------------------------------------*/
template<class BasicTurbulenceModel>
class buoyantKEpsilon
:
public kEpsilon<BasicTurbulenceModel>
{
// Private Member Functions
// Disallow default bitwise copy construct and assignment
buoyantKEpsilon(const buoyantKEpsilon&);
buoyantKEpsilon& operator=(const buoyantKEpsilon&);
protected:
// Protected data
// Model coefficients
dimensionedScalar Cg_;
// Protected Member Functions
tmp<volScalarField> Gcoef() const;
virtual tmp<fvScalarMatrix> kSource() const;
virtual tmp<fvScalarMatrix> epsilonSource() const;
public:
typedef typename BasicTurbulenceModel::alphaField alphaField;
typedef typename BasicTurbulenceModel::rhoField rhoField;
typedef typename BasicTurbulenceModel::transportModel transportModel;
//- Runtime type information
TypeName("buoyantKEpsilon");
// Constructors
//- Construct from components
buoyantKEpsilon
(
const alphaField& alpha,
const rhoField& rho,
const volVectorField& U,
const surfaceScalarField& alphaRhoPhi,
const surfaceScalarField& phi,
const transportModel& transport,
const word& propertiesName = turbulenceModel::propertiesName,
const word& type = typeName
);
//- Destructor
virtual ~buoyantKEpsilon()
{}
// Member Functions
//- Re-read model coefficients if they have changed
virtual bool read();
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace RASModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "buoyantKEpsilon.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -52,6 +52,9 @@ makeBaseTurbulenceModel
#include "kEpsilon.H"
makeRASModel(kEpsilon);
#include "buoyantKEpsilon.H"
makeRASModel(buoyantKEpsilon);
#include "Smagorinsky.H"
makeLESModel(Smagorinsky);

View File

@ -34,17 +34,25 @@ boundaryField
bottomWall
{
type zeroGradient;
type epsilonWallFunction;
value $internalField;
Cmu 0.09;
kappa 0.41;
E 9.8;
}
endWall
{
type zeroGradient;
type epsilonWallFunction;
value $internalField;
Cmu 0.09;
kappa 0.41;
E 9.8;
}
top
{
type zeroGradient;
type slip;
}
frontAndBack

View File

@ -34,17 +34,19 @@ boundaryField
bottomWall
{
type zeroGradient;
type kqRWallFunction;
value $internalField;
}
endWall
{
type zeroGradient;
type kqRWallFunction;
value $internalField;
}
top
{
type zeroGradient;
type slip;
}
frontAndBack

View File

@ -0,0 +1,66 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.3.x |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object nut;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -1 0 0 0 0];
internalField uniform 0;
boundaryField
{
inlet
{
type calculated;
value $internalField;
}
outlet
{
type calculated;
value $internalField;
}
bottomWall
{
type nutkWallFunction;
Cmu 0.09;
kappa 0.41;
E 9.8;
value uniform 0;
}
endWall
{
type nutkWallFunction;
Cmu 0.09;
kappa 0.41;
E 9.8;
value uniform 0;
}
top
{
type slip;
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //

View File

@ -11,15 +11,23 @@ FoamFile
format ascii;
class dictionary;
location "constant";
object RASProperties;
object turbulenceProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
RASModel kEpsilon;
simulationType RAS;
turbulence on;
RAS
{
RASModel buoyantKEpsilon;
printCoeffs on;
turbulence on;
printCoeffs on;
buoyantKEpsilonCoeffs
{
Cg 0.85;
}
}
// ************************************************************************* //

View File

@ -36,7 +36,7 @@ divSchemes
div(rhoPhi,k) Gauss limitedLinear 1;
div(rhoPhi,epsilon) Gauss limitedLinear 1;
div((muEff*dev2(T(grad(U))))) Gauss linear;
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
}
laplacianSchemes

View File

@ -10,35 +10,42 @@ FoamFile
version 2.0;
format ascii;
class volScalarField;
location "0";
object epsilon;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -3 0 0 0 0];
internalField uniform 7e-3;
internalField uniform 0.007;
boundaryField
{
rotor
{
type zeroGradient;
type epsilonWallFunction;
value $internalField;
Cmu 0.09;
kappa 0.41;
E 9.8;
}
stator
{
type zeroGradient;
type epsilonWallFunction;
value $internalField;
Cmu 0.09;
kappa 0.41;
E 9.8;
}
front
{
type empty;
}
back
{
type empty;
}
}
// ************************************************************************* //

View File

@ -10,6 +10,7 @@ FoamFile
version 2.0;
format ascii;
class volScalarField;
location "0";
object k;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -22,23 +23,23 @@ boundaryField
{
rotor
{
type zeroGradient;
type kqRWallFunction;
value $internalField;
}
stator
{
type zeroGradient;
type kqRWallFunction;
value $internalField;
}
front
{
type empty;
}
back
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,51 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.3.x |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object nut;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -1 0 0 0 0];
internalField uniform 0;
boundaryField
{
rotor
{
type nutkWallFunction;
Cmu 0.09;
kappa 0.41;
E 9.8;
value uniform 0;
}
stator
{
type nutkWallFunction;
Cmu 0.09;
kappa 0.41;
E 9.8;
value uniform 0;
}
front
{
type empty;
}
back
{
type empty;
}
}
// ************************************************************************* //

View File

@ -11,15 +11,18 @@ FoamFile
format ascii;
class dictionary;
location "constant";
object RASProperties;
object turbulenceProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
RASModel kEpsilon;
simulationType RAS;
turbulence on;
printCoeffs on;
RAS
{
RASModel kEpsilon;
turbulence on;
printCoeffs on;
}
// ************************************************************************* //

View File

@ -35,8 +35,10 @@ divSchemes
"div\(phirb,alpha.*\)" Gauss linear;
div(rhoPhi,k) Gauss limitedLinear 1;
div(rhoPhi,epsilon) Gauss limitedLinear 1;
div(phi,k) Gauss limitedLinear 1;
div(phi,epsilon) Gauss limitedLinear 1;
div((muEff*dev2(T(grad(U))))) Gauss linear;
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
}
laplacianSchemes

View File

@ -22,7 +22,7 @@ boundaryField
{
SYMP3
{
type zeroGradient;
type slip;
}
INLE1

View File

@ -22,7 +22,7 @@ boundaryField
{
SYMP3
{
type zeroGradient;
type slip;
}
INLE1
@ -51,69 +51,10 @@ boundaryField
type zeroGradient;
}
WALL6
"WALL.*"
{
type zeroGradient;
}
WALL8
{
type zeroGradient;
}
WALL61
{
type zeroGradient;
}
WALL62
{
type zeroGradient;
}
WALL63
{
type zeroGradient;
}
WALL64
{
type zeroGradient;
}
WALL65
{
type zeroGradient;
}
WALL66
{
type zeroGradient;
}
WALL67
{
type zeroGradient;
}
WALL68
{
type zeroGradient;
}
WALL69
{
type zeroGradient;
}
WALL7
{
type zeroGradient;
}
WALL70
{
type zeroGradient;
type epsilonWallFunction;
value $internalField;
}
OUTL15

View File

@ -22,7 +22,7 @@ boundaryField
{
SYMP3
{
type zeroGradient;
type slip;
}
INLE1
@ -51,69 +51,10 @@ boundaryField
type zeroGradient;
}
WALL6
"WALL.*"
{
type zeroGradient;
}
WALL8
{
type zeroGradient;
}
WALL61
{
type zeroGradient;
}
WALL62
{
type zeroGradient;
}
WALL63
{
type zeroGradient;
}
WALL64
{
type zeroGradient;
}
WALL65
{
type zeroGradient;
}
WALL66
{
type zeroGradient;
}
WALL67
{
type zeroGradient;
}
WALL68
{
type zeroGradient;
}
WALL69
{
type zeroGradient;
}
WALL7
{
type zeroGradient;
}
WALL70
{
type zeroGradient;
type kqRWallFunction;
value $internalField;
}
OUTL15

View File

@ -0,0 +1,49 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.3.x |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object nut;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -1 0 0 0 0];
internalField uniform 0;
boundaryField
{
SYMP3
{
type slip;
}
INLE1
{
type calculated;
value $internalField;
}
"OUTL.*"
{
type calculated;
value $internalField;
}
"WALL.*"
{
type nutkWallFunction;
value $internalField;
}
}
// ************************************************************************* //

View File

@ -11,15 +11,18 @@ FoamFile
format ascii;
class dictionary;
location "constant";
object RASProperties;
object turbulenceProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
RASModel kEpsilon;
simulationType RAS;
turbulence on;
printCoeffs on;
RAS
{
RASModel kEpsilon;
turbulence on;
printCoeffs on;
}
// ************************************************************************* //

View File

@ -36,7 +36,7 @@ divSchemes
div(rhoPhi,k) Gauss limitedLinear 1;
div(rhoPhi,epsilon) Gauss limitedLinear 1;
div((muEff*dev2(T(grad(U))))) Gauss linear;
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
}
laplacianSchemes