Skip to content
Snippets Groups Projects
Commit c0ddac32 authored by Henry Weller's avatar Henry Weller
Browse files

turbulenceModels/RAS/kEpsilon/kEpsilon: Added experimental support for fvOptions

parent 2dbf8354
Branches
Tags
No related merge requests found
......@@ -16,7 +16,8 @@ EXE_INC = \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/triSurface/lnInclude
-I$(LIB_SRC)/triSurface/lnInclude \
-I$(LIB_SRC)/fvOptions/lnInclude
EXE_LIBS = \
-lengine \
......@@ -29,4 +30,5 @@ EXE_LIBS = \
-lspecie \
-llaminarFlameSpeedModels \
-lfiniteVolume \
-ldynamicFvMesh
-ldynamicFvMesh \
-lfvOptions
......@@ -7,4 +7,5 @@ EXE_INC = \
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/phaseIncompressible/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/fvOptions/lnInclude
......@@ -6,7 +6,8 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidSpecie/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/fvOptions/lnInclude
LIB_LIBS = \
-lcompressibleTransportModels \
......@@ -16,4 +17,5 @@ LIB_LIBS = \
-lturbulenceModels \
-lspecie \
-lfiniteVolume \
-lmeshTools
-lmeshTools \
-lfvOptions
......@@ -2,10 +2,12 @@ EXE_INC = \
-I../turbulenceModels/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/fvOptions/lnInclude
LIB_LIBS = \
-lincompressibleTransportModels \
-lturbulenceModels \
-lfiniteVolume \
-lmeshTools
-lmeshTools \
-lfvOptions
......@@ -24,6 +24,7 @@ License
\*---------------------------------------------------------------------------*/
#include "kEpsilon.H"
#include "fvOptionList.H"
#include "bound.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -238,6 +239,14 @@ void kEpsilon<BasicTurbulenceModel>::correct()
const volVectorField& U = this->U_;
volScalarField& nut = this->nut_;
// const_cast needed because the operators and functions of fvOptions
// are currently non-const.
fv::optionList& fvOptions = const_cast<fv::optionList&>
(
this->mesh_.objectRegistry::template
lookupObject<fv::optionList>("fvOptions")
);
eddyViscosity<RASModel<BasicTurbulenceModel> >::correct();
volScalarField divU(fvc::div(fvc::absolute(this->phi(), U)));
......@@ -260,11 +269,14 @@ void kEpsilon<BasicTurbulenceModel>::correct()
- fvm::SuSp(((2.0/3.0)*C1_ + C3_)*alpha*rho*divU, epsilon_)
- fvm::Sp(C2_*alpha*rho*epsilon_/k_, epsilon_)
+ epsilonSource()
+ fvOptions(alpha, rho, epsilon_)
);
epsEqn().relax();
fvOptions.constrain(epsEqn());
epsEqn().boundaryManipulate(epsilon_.boundaryField());
solve(epsEqn);
fvOptions.correct(epsilon_);
bound(epsilon_, this->epsilonMin_);
// Turbulent kinetic energy equation
......@@ -278,13 +290,17 @@ void kEpsilon<BasicTurbulenceModel>::correct()
- fvm::SuSp((2.0/3.0)*alpha*rho*divU, k_)
- fvm::Sp(alpha*rho*epsilon_/k_, k_)
+ kSource()
+ fvOptions(alpha, rho, k_)
);
kEqn().relax();
fvOptions.constrain(kEqn());
solve(kEqn);
fvOptions.correct(k_);
bound(k_, this->kMin_);
correctNut();
fvOptions.correct(nut);
}
......
......@@ -38,6 +38,7 @@ SourceFile
#include "fvOption.H"
#include "PtrList.H"
#include "GeometricField.H"
#include "geometricOneField.H"
#include "fvPatchField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -173,6 +174,33 @@ public:
const word& fieldName
);
//- Return source for equation
template<class Type>
tmp<fvMatrix<Type> > operator()
(
const volScalarField& alpha,
const geometricOneField& rho,
GeometricField<Type, fvPatchField, volMesh>& field
);
//- Return source for equation
template<class Type>
tmp<fvMatrix<Type> > operator()
(
const geometricOneField& alpha,
const volScalarField& rho,
GeometricField<Type, fvPatchField, volMesh>& field
);
//- Return source for equation
template<class Type>
tmp<fvMatrix<Type> > operator()
(
const geometricOneField& alpha,
const geometricOneField& rho,
GeometricField<Type, fvPatchField, volMesh>& field
);
// Constraints
......
......@@ -191,6 +191,57 @@ Foam::tmp<Foam::fvMatrix<Type> > Foam::fv::optionList::operator()
}
template<class Type>
Foam::tmp<Foam::fvMatrix<Type> > Foam::fv::optionList::operator()
(
const geometricOneField& alpha,
const geometricOneField& rho,
GeometricField<Type, fvPatchField, volMesh>& field
)
{
return this->operator()(field, field.name());
}
template<class Type>
Foam::tmp<Foam::fvMatrix<Type> > Foam::fv::optionList::operator()
(
const volScalarField& alpha,
const geometricOneField& rho,
GeometricField<Type, fvPatchField, volMesh>& field
)
{
volScalarField one
(
IOobject
(
"one",
this->mesh_.time().timeName(),
this->mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
this->mesh_,
dimensionedScalar("one", dimless, 1.0)
);
return this->operator()(alpha, one, field, field.name());
}
template<class Type>
Foam::tmp<Foam::fvMatrix<Type> > Foam::fv::optionList::operator()
(
const geometricOneField& alpha,
const volScalarField& rho,
GeometricField<Type, fvPatchField, volMesh>& field
)
{
return this->operator()(rho, field, field.name());
}
template<class Type>
void Foam::fv::optionList::constrain(fvMatrix<Type>& eqn)
{
......
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