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
d95e2120
Commit
d95e2120
authored
Feb 23, 2018
by
Andrew Heather
Browse files
ENH: turbulenceFields FO - added nuTilda and turbulence length scale
parent
869e1175
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/functionObjects/field/turbulenceFields/turbulenceFields.C
View file @
d95e2120
...
...
@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015-201
7
OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015-201
8
OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -54,12 +54,14 @@ Foam::functionObjects::turbulenceFields::compressibleFieldNames_
{
compressibleField
::
cfK
,
"k"
},
{
compressibleField
::
cfEpsilon
,
"epsilon"
},
{
compressibleField
::
cfOmega
,
"omega"
},
{
compressibleField
::
cfNuTilda
,
"nuTilda"
},
{
compressibleField
::
cfMut
,
"mut"
},
{
compressibleField
::
cfMuEff
,
"muEff"
},
{
compressibleField
::
cfAlphat
,
"alphat"
},
{
compressibleField
::
cfAlphaEff
,
"alphaEff"
},
{
compressibleField
::
cfR
,
"R"
},
{
compressibleField
::
cfDevRhoReff
,
"devRhoReff"
},
{
compressibleField
::
cfL
,
"L"
}
};
...
...
@@ -72,10 +74,12 @@ Foam::functionObjects::turbulenceFields::incompressibleFieldNames_
{
incompressibleField
::
ifK
,
"k"
},
{
incompressibleField
::
ifEpsilon
,
"epsilon"
},
{
incompressibleField
::
ifOmega
,
"omega"
},
{
incompressibleField
::
ifNuTilda
,
"nuTilda"
},
{
incompressibleField
::
ifNut
,
"nut"
},
{
incompressibleField
::
ifNuEff
,
"nuEff"
},
{
incompressibleField
::
ifR
,
"R"
},
{
incompressibleField
::
ifDevReff
,
"devReff"
},
{
incompressibleField
::
ifL
,
"L"
},
};
...
...
@@ -193,6 +197,11 @@ bool Foam::functionObjects::turbulenceFields::execute()
processField
<
scalar
>
(
f
,
omega
(
model
));
break
;
}
case
cfNuTilda
:
{
processField
<
scalar
>
(
f
,
nuTilda
(
model
));
break
;
}
case
cfMut
:
{
processField
<
scalar
>
(
f
,
model
.
mut
());
...
...
@@ -223,6 +232,11 @@ bool Foam::functionObjects::turbulenceFields::execute()
processField
<
symmTensor
>
(
f
,
model
.
devRhoReff
());
break
;
}
case
cfL
:
{
processField
<
scalar
>
(
f
,
L
(
model
));
break
;
}
default:
{
FatalErrorInFunction
...
...
@@ -256,6 +270,11 @@ bool Foam::functionObjects::turbulenceFields::execute()
processField
<
scalar
>
(
f
,
omega
(
model
));
break
;
}
case
ifNuTilda
:
{
processField
<
scalar
>
(
f
,
nuTilda
(
model
));
break
;
}
case
ifNut
:
{
processField
<
scalar
>
(
f
,
model
.
nut
());
...
...
@@ -276,6 +295,11 @@ bool Foam::functionObjects::turbulenceFields::execute()
processField
<
symmTensor
>
(
f
,
model
.
devReff
());
break
;
}
case
ifL
:
{
processField
<
scalar
>
(
f
,
L
(
model
));
break
;
}
default:
{
FatalErrorInFunction
...
...
src/functionObjects/field/turbulenceFields/turbulenceFields.H
View file @
d95e2120
...
...
@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015-201
7
OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015-201
8
OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -65,6 +65,7 @@ Usage
k | turbulence kinetic energy
epsilon | turbulence kinetic energy dissipation rate
omega | turbulence specific dissipation rate
nuTilda | turbulence modified viscosity
nut | turbulence viscosity (incompressible)
nuEff | effective turbulence viscosity (incompressible)
mut | turbulence viscosity (compressible)
...
...
@@ -74,6 +75,7 @@ Usage
R | Reynolds stress tensor
devReff | Deviatoric part of the effective Reynolds stress
devRhoReff | Divergence of the Reynolds stress
L | turbulence length scale
\endplaintable
See also
...
...
@@ -116,12 +118,14 @@ public:
cfK
,
cfEpsilon
,
cfOmega
,
cfNuTilda
,
cfMut
,
cfMuEff
,
cfAlphat
,
cfAlphaEff
,
cfR
,
cfDevRhoReff
cfDevRhoReff
,
cfL
};
static
const
Enum
<
compressibleField
>
compressibleFieldNames_
;
...
...
@@ -130,10 +134,12 @@ public:
ifK
,
ifEpsilon
,
ifOmega
,
ifNuTilda
,
ifNut
,
ifNuEff
,
ifR
,
ifDevReff
ifDevReff
,
ifL
};
static
const
Enum
<
incompressibleField
>
incompressibleFieldNames_
;
...
...
@@ -165,6 +171,14 @@ protected:
template
<
class
Model
>
tmp
<
volScalarField
>
omega
(
const
Model
&
model
)
const
;
//- Return nuTilda calculated from k and omega
template
<
class
Model
>
tmp
<
volScalarField
>
nuTilda
(
const
Model
&
model
)
const
;
//- Return L calculated from k and epsilon
template
<
class
Model
>
tmp
<
volScalarField
>
L
(
const
Model
&
model
)
const
;
private:
...
...
src/functionObjects/field/turbulenceFields/turbulenceFieldsTemplates.C
View file @
d95e2120
...
...
@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation |
Copyright (C) 2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -91,7 +91,7 @@ Foam::functionObjects::turbulenceFields::omega
(
IOobject
(
"omega"
,
"omega
.tmp
"
,
k
.
mesh
().
time
().
timeName
(),
k
.
mesh
()
),
...
...
@@ -102,4 +102,43 @@ Foam::functionObjects::turbulenceFields::omega
}
template
<
class
Model
>
Foam
::
tmp
<
Foam
::
volScalarField
>
Foam
::
functionObjects
::
turbulenceFields
::
nuTilda
(
const
Model
&
model
)
const
{
return
tmp
<
volScalarField
>
(
new
volScalarField
(
"nuTilda.tmp"
,
model
.
k
()
/
omega
(
model
))
);
}
template
<
class
Model
>
Foam
::
tmp
<
Foam
::
volScalarField
>
Foam
::
functionObjects
::
turbulenceFields
::
L
(
const
Model
&
model
)
const
{
const
scalar
Cmu
=
0
.
09
;
// Assume k and epsilon are available
const
volScalarField
k
(
model
.
k
());
const
volScalarField
epsilon
(
model
.
epsilon
());
const
dimensionedScalar
eps0
(
"eps0"
,
epsilon
.
dimensions
(),
SMALL
);
return
tmp
<
volScalarField
>
(
new
volScalarField
(
"L.tmp"
,
pow
(
Cmu
,
0
.
75
)
*
pow
(
k
,
1
.
5
)
/
(
epsilon
+
eps0
)
)
);
}
// ************************************************************************* //
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