Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
c0ddac32
Commit
c0ddac32
authored
Nov 28, 2015
by
Henry Weller
Browse files
turbulenceModels/RAS/kEpsilon/kEpsilon: Added experimental support for fvOptions
parent
2dbf8354
Changes
7
Hide whitespace changes
Inline
Side-by-side
applications/solvers/combustion/PDRFoam/Make/options
View file @
c0ddac32
...
...
@@ -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
applications/solvers/lagrangian/DPMFoam/DPMTurbulenceModels/Make/options
View file @
c0ddac32
...
...
@@ -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
src/TurbulenceModels/compressible/Make/options
View file @
c0ddac32
...
...
@@ -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
src/TurbulenceModels/incompressible/Make/options
View file @
c0ddac32
...
...
@@ -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
src/TurbulenceModels/turbulenceModels/RAS/kEpsilon/kEpsilon.C
View file @
c0ddac32
...
...
@@ -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
);
}
...
...
src/fvOptions/fvOption/fvOptionList.H
View file @
c0ddac32
...
...
@@ -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
...
...
src/fvOptions/fvOption/fvOptionListTemplates.C
View file @
c0ddac32
...
...
@@ -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
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment