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-plus
Commits
26e95863
Commit
26e95863
authored
Jan 23, 2015
by
Henry
Browse files
turbulenceModels: minor function reorganization
parent
1f7b7442
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/TurbulenceModels/turbulenceModels/LES/Smagorinsky/Smagorinsky.C
View file @
26e95863
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-201
4
OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-201
5
OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -32,6 +32,46 @@ namespace Foam
namespace
LESModels
{
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
template
<
class
BasicTurbulenceModel
>
tmp
<
volScalarField
>
Smagorinsky
<
BasicTurbulenceModel
>::
k
(
const
tmp
<
volTensorField
>&
gradU
)
const
{
volSymmTensorField
D
(
symm
(
gradU
));
volScalarField
a
(
this
->
Ce_
/
this
->
delta
());
volScalarField
b
((
2
.
0
/
3
.
0
)
*
tr
(
D
));
volScalarField
c
(
2
*
Ck_
*
this
->
delta
()
*
(
dev
(
D
)
&&
D
));
return
tmp
<
volScalarField
>
(
new
volScalarField
(
IOobject
(
IOobject
::
groupName
(
"k"
,
this
->
U_
.
group
()),
this
->
runTime_
.
timeName
(),
this
->
mesh_
),
sqr
((
-
b
+
sqrt
(
sqr
(
b
)
+
4
*
a
*
c
))
/
(
2
*
a
))
)
);
}
template
<
class
BasicTurbulenceModel
>
void
Smagorinsky
<
BasicTurbulenceModel
>::
correctNut
()
{
volScalarField
k
(
this
->
k
(
fvc
::
grad
(
this
->
U_
)));
this
->
nut_
=
Ck_
*
this
->
delta
()
*
sqrt
(
k
);
this
->
nut_
.
correctBoundaryConditions
();
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template
<
class
BasicTurbulenceModel
>
...
...
@@ -95,25 +135,11 @@ bool Smagorinsky<BasicTurbulenceModel>::read()
}
template
<
class
BasicTurbulenceModel
>
tmp
<
volScalarField
>
Smagorinsky
<
BasicTurbulenceModel
>::
k
(
const
tmp
<
volTensorField
>&
gradU
)
const
{
volSymmTensorField
D
(
symm
(
gradU
));
volScalarField
a
(
this
->
Ce_
/
this
->
delta
());
volScalarField
b
((
2
.
0
/
3
.
0
)
*
tr
(
D
));
volScalarField
c
(
2
*
Ck_
*
this
->
delta
()
*
(
dev
(
D
)
&&
D
));
return
sqr
((
-
b
+
sqrt
(
sqr
(
b
)
+
4
*
a
*
c
))
/
(
2
*
a
));
}
template
<
class
BasicTurbulenceModel
>
tmp
<
volScalarField
>
Smagorinsky
<
BasicTurbulenceModel
>::
epsilon
()
const
{
volScalarField
k
(
this
->
k
(
fvc
::
grad
(
this
->
U_
)));
return
tmp
<
volScalarField
>
(
new
volScalarField
...
...
@@ -122,26 +148,14 @@ tmp<volScalarField> Smagorinsky<BasicTurbulenceModel>::epsilon() const
(
IOobject
::
groupName
(
"epsilon"
,
this
->
U_
.
group
()),
this
->
runTime_
.
timeName
(),
this
->
mesh_
,
IOobject
::
NO_READ
,
IOobject
::
NO_WRITE
this
->
mesh_
),
this
->
Ce_
*
k
()
*
sqrt
(
k
()
)
/
this
->
delta
()
this
->
Ce_
*
k
*
sqrt
(
k
)
/
this
->
delta
()
)
);
}
template
<
class
BasicTurbulenceModel
>
void
Smagorinsky
<
BasicTurbulenceModel
>::
correctNut
()
{
volScalarField
k
(
this
->
k
(
fvc
::
grad
(
this
->
U_
)));
this
->
nut_
=
Ck_
*
this
->
delta
()
*
sqrt
(
k
);
this
->
nut_
.
correctBoundaryConditions
();
}
template
<
class
BasicTurbulenceModel
>
void
Smagorinsky
<
BasicTurbulenceModel
>::
correct
()
{
...
...
src/TurbulenceModels/turbulenceModels/LES/Smagorinsky/Smagorinsky.H
View file @
26e95863
...
...
@@ -100,6 +100,7 @@ protected:
// calculated from the given velocity gradient
tmp
<
volScalarField
>
k
(
const
tmp
<
volTensorField
>&
gradU
)
const
;
//- Update the SGS eddy viscosity
virtual
void
correctNut
();
...
...
src/TurbulenceModels/turbulenceModels/RAS/RASModel/RASModel.C
View file @
26e95863
...
...
@@ -174,13 +174,6 @@ Foam::RASModel<BasicTurbulenceModel>::New
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template
<
class
BasicTurbulenceModel
>
void
Foam
::
RASModel
<
BasicTurbulenceModel
>::
correct
()
{
BasicTurbulenceModel
::
correct
();
}
template
<
class
BasicTurbulenceModel
>
bool
Foam
::
RASModel
<
BasicTurbulenceModel
>::
read
()
{
...
...
@@ -207,4 +200,11 @@ bool Foam::RASModel<BasicTurbulenceModel>::read()
}
template
<
class
BasicTurbulenceModel
>
void
Foam
::
RASModel
<
BasicTurbulenceModel
>::
correct
()
{
BasicTurbulenceModel
::
correct
();
}
// ************************************************************************* //
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