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
d968ee30
Commit
d968ee30
authored
Nov 18, 2015
by
Henry Weller
Browse files
TurbulenceModels: Improved instantiation of single-phase models in solvers
Simplifies lookup of RAS or LES models
parent
3050ff92
Changes
18
Hide whitespace changes
Inline
Side-by-side
applications/solvers/combustion/PDRFoam/createFields.H
View file @
d968ee30
...
...
@@ -49,7 +49,7 @@ mesh.setFluxRequired(p.name());
Info
<<
"Creating turbulence model
\n
"
<<
endl
;
autoPtr
<
compressible
::
RASModel
>
turbulence
(
compressible
::
RASModel
::
New
compressible
::
New
<
compressible
::
RASModel
>
(
rho
,
U
,
...
...
applications/solvers/compressible/rhoSimpleFoam/createFields.H
View file @
d968ee30
...
...
@@ -71,7 +71,7 @@ dimensionedScalar rhoMin
Info
<<
"Creating turbulence model
\n
"
<<
endl
;
autoPtr
<
compressible
::
RASModel
>
turbulence
(
compressible
::
RASModel
::
New
compressible
::
New
<
compressible
::
RASModel
>
(
rho
,
U
,
...
...
applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/createFields.H
View file @
d968ee30
...
...
@@ -70,7 +70,7 @@ dimensionedScalar rhoMin
Info
<<
"Creating turbulence model
\n
"
<<
endl
;
autoPtr
<
compressible
::
RASModel
>
turbulence
(
compressible
::
RASModel
::
New
compressible
::
New
<
compressible
::
RASModel
>
(
rho
,
U
,
...
...
applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/createFields.H
View file @
d968ee30
...
...
@@ -49,7 +49,7 @@ volVectorField U
Info
<<
"Creating turbulence model
\n
"
<<
endl
;
autoPtr
<
incompressible
::
RASModel
>
turbulence
(
incompressible
::
RASModel
::
New
(
U
,
phi
,
laminarTransport
)
incompressible
::
New
<
incompressible
::
RASModel
>
(
U
,
phi
,
laminarTransport
)
);
// Kinematic density for buoyancy force
...
...
applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/createFields.H
View file @
d968ee30
...
...
@@ -49,7 +49,7 @@ volVectorField U
Info
<<
"Creating turbulence model
\n
"
<<
endl
;
autoPtr
<
incompressible
::
RASModel
>
turbulence
(
incompressible
::
RASModel
::
New
(
U
,
phi
,
laminarTransport
)
incompressible
::
New
<
incompressible
::
RASModel
>
(
U
,
phi
,
laminarTransport
)
);
// Kinematic density for buoyancy force
...
...
applications/solvers/heatTransfer/buoyantSimpleFoam/createFields.H
View file @
d968ee30
...
...
@@ -39,7 +39,7 @@ volVectorField U
Info
<<
"Creating turbulence model
\n
"
<<
endl
;
autoPtr
<
compressible
::
RASModel
>
turbulence
(
compressible
::
RASModel
::
New
compressible
::
New
<
compressible
::
RASModel
>
(
rho
,
U
,
...
...
applications/solvers/heatTransfer/thermoFoam/setAlphaEff.H
View file @
d968ee30
...
...
@@ -44,7 +44,7 @@
{
autoPtr
<
compressible
::
RASModel
>
turbulence
(
compressible
::
RASModel
::
New
compressible
::
New
<
compressible
::
RASModel
>
(
rho
,
U
,
...
...
@@ -59,7 +59,7 @@
{
autoPtr
<
compressible
::
LESModel
>
turbulence
(
compressible
::
LESModel
::
New
compressible
::
New
<
compressible
::
LESModel
>
(
rho
,
U
,
...
...
applications/solvers/incompressible/adjointShapeOptimizationFoam/createFields.H
View file @
d968ee30
...
...
@@ -82,7 +82,7 @@ singlePhaseTransportModel laminarTransport(U, phi);
autoPtr
<
incompressible
::
RASModel
>
turbulence
(
incompressible
::
RASModel
::
New
(
U
,
phi
,
laminarTransport
)
incompressible
::
New
<
incompressible
::
RASModel
>
(
U
,
phi
,
laminarTransport
)
);
...
...
applications/solvers/incompressible/boundaryFoam/createFields.H
View file @
d968ee30
...
...
@@ -33,7 +33,7 @@ singlePhaseTransportModel laminarTransport(U, phi);
autoPtr
<
incompressible
::
RASModel
>
turbulence
(
incompressible
::
RASModel
::
New
(
U
,
phi
,
laminarTransport
)
incompressible
::
New
<
incompressible
::
RASModel
>
(
U
,
phi
,
laminarTransport
)
);
dimensionedVector
Ubar
(
"Ubar"
,
dimVelocity
,
laminarTransport
);
...
...
applications/solvers/incompressible/simpleFoam/SRFSimpleFoam/createFields.H
View file @
d968ee30
...
...
@@ -66,5 +66,5 @@ singlePhaseTransportModel laminarTransport(U, phi);
autoPtr
<
incompressible
::
RASModel
>
turbulence
(
incompressible
::
RASModel
::
New
(
U
,
phi
,
laminarTransport
)
incompressible
::
New
<
incompressible
::
RASModel
>
(
U
,
phi
,
laminarTransport
)
);
applications/utilities/postProcessing/turbulence/createTurbulenceFields/createFields.H
View file @
d968ee30
...
...
@@ -18,5 +18,5 @@
autoPtr
<
incompressible
::
RASModel
>
RASModel
(
incompressible
::
RASModel
::
New
(
U
,
phi
,
laminarTransport
)
incompressible
::
New
<
incompressible
::
RASModel
>
(
U
,
phi
,
laminarTransport
)
);
applications/utilities/postProcessing/wall/wallShearStress/wallShearStress.C
View file @
d968ee30
...
...
@@ -55,7 +55,7 @@ void calcIncompressible
autoPtr
<
incompressible
::
RASModel
>
model
(
incompressible
::
RASModel
::
New
(
U
,
phi
,
laminarTransport
)
incompressible
::
New
<
incompressible
::
RASModel
>
(
U
,
phi
,
laminarTransport
)
);
const
volSymmTensorField
Reff
(
model
->
devReff
());
...
...
@@ -104,7 +104,7 @@ void calcCompressible
autoPtr
<
compressible
::
RASModel
>
model
(
compressible
::
RASModel
::
New
compressible
::
New
<
compressible
::
RASModel
>
(
rho
,
U
,
...
...
src/TurbulenceModels/compressible/SpecificCompressibleTurbulenceModel/SpecificCompressibleTurbulenceModel.C
deleted
100644 → 0
View file @
3050ff92
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015 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
"SpecificCompressibleTurbulenceModel.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template
<
class
BasicCompressibleTurbulenceModel
>
Foam
::
SpecificCompressibleTurbulenceModel
<
BasicCompressibleTurbulenceModel
>::
SpecificCompressibleTurbulenceModel
(
const
word
&
type
,
const
geometricOneField
&
alpha
,
const
volScalarField
&
rho
,
const
volVectorField
&
U
,
const
surfaceScalarField
&
alphaRhoPhi
,
const
surfaceScalarField
&
phi
,
const
transportModel
&
transport
,
const
word
&
propertiesName
)
:
BasicCompressibleTurbulenceModel
(
type
,
alpha
,
rho
,
U
,
alphaRhoPhi
,
phi
,
transport
,
propertiesName
)
{}
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
template
<
class
BasicCompressibleTurbulenceModel
>
Foam
::
autoPtr
<
Foam
::
SpecificCompressibleTurbulenceModel
<
BasicCompressibleTurbulenceModel
>
>
Foam
::
SpecificCompressibleTurbulenceModel
<
BasicCompressibleTurbulenceModel
>::
New
(
const
volScalarField
&
rho
,
const
volVectorField
&
U
,
const
surfaceScalarField
&
phi
,
const
transportModel
&
transport
,
const
word
&
propertiesName
)
{
return
autoPtr
<
SpecificCompressibleTurbulenceModel
>
(
static_cast
<
SpecificCompressibleTurbulenceModel
*>
(
BasicCompressibleTurbulenceModel
::
New
(
geometricOneField
(),
rho
,
U
,
phi
,
phi
,
transport
,
propertiesName
).
ptr
())
);
}
// ************************************************************************* //
src/TurbulenceModels/compressible/SpecificCompressibleTurbulenceModel/SpecificCompressibleTurbulenceModel.H
deleted
100644 → 0
View file @
3050ff92
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015 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::SpecificCompressibleTurbulenceModel
Description
Templated abstract base class for specific (RAS/LES) compressible
turbulence models
SourceFiles
SpecificCompressibleTurbulenceModel.C
\*---------------------------------------------------------------------------*/
#ifndef SpecificCompressibleTurbulenceModel_H
#define SpecificCompressibleTurbulenceModel_H
#include
"CompressibleTurbulenceModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace
Foam
{
/*---------------------------------------------------------------------------*\
Class SpecificCompressibleTurbulenceModel Declaration
\*---------------------------------------------------------------------------*/
template
<
class
BasicCompressibleTurbulenceModel
>
class
SpecificCompressibleTurbulenceModel
:
public
BasicCompressibleTurbulenceModel
{
public:
typedef
typename
BasicCompressibleTurbulenceModel
::
transportModel
transportModel
;
// Constructors
//- Construct from components
SpecificCompressibleTurbulenceModel
(
const
word
&
type
,
const
geometricOneField
&
alpha
,
const
volScalarField
&
rho
,
const
volVectorField
&
U
,
const
surfaceScalarField
&
alphaRhoPhi
,
const
surfaceScalarField
&
phi
,
const
transportModel
&
transport
,
const
word
&
propertiesName
);
//- Destructor
virtual
~
SpecificCompressibleTurbulenceModel
()
{}
// Selectors
//- Return a reference to the selected turbulence model
static
autoPtr
<
SpecificCompressibleTurbulenceModel
>
New
(
const
volScalarField
&
rho
,
const
volVectorField
&
U
,
const
surfaceScalarField
&
phi
,
const
transportModel
&
transport
,
const
word
&
propertiesName
=
turbulenceModel
::
propertiesName
);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
}
// End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "SpecificCompressibleTurbulenceModel.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
src/TurbulenceModels/compressible/turbulentFluidThermoModels/turbulentFluidThermoModel.H
View file @
d968ee30
...
...
@@ -42,7 +42,7 @@ SourceFiles
#ifndef turbulentFluidThermoModel_H
#define turbulentFluidThermoModel_H
#include
"
Specific
CompressibleTurbulenceModel.H"
#include
"CompressibleTurbulenceModel.H"
#include
"ThermalDiffusivity.H"
#include
"EddyDiffusivity.H"
#include
"RASModel.H"
...
...
@@ -58,15 +58,31 @@ namespace Foam
typedef
ThermalDiffusivity
<
CompressibleTurbulenceModel
<
fluidThermo
>
>
turbulenceModel
;
typedef
SpecificCompressibleTurbulenceModel
<
RASModel
<
EddyDiffusivity
<
turbulenceModel
>
>
>
RASModel
;
typedef
SpecificCompressibleTurbulenceModel
<
LESModel
<
EddyDiffusivity
<
turbulenceModel
>
>
>
LESModel
;
typedef
RASModel
<
EddyDiffusivity
<
turbulenceModel
>
>
RASModel
;
typedef
LESModel
<
EddyDiffusivity
<
turbulenceModel
>
>
LESModel
;
template
<
class
BasicCompressibleTurbulenceModel
>
autoPtr
<
BasicCompressibleTurbulenceModel
>
New
(
const
volScalarField
&
rho
,
const
volVectorField
&
U
,
const
surfaceScalarField
&
phi
,
const
typename
BasicCompressibleTurbulenceModel
::
transportModel
&
transport
,
const
word
&
propertiesName
=
turbulenceModel
::
propertiesName
)
{
return
BasicCompressibleTurbulenceModel
::
New
(
geometricOneField
(),
rho
,
U
,
phi
,
phi
,
transport
,
propertiesName
);
}
}
}
...
...
src/TurbulenceModels/incompressible/SpecificIncompressibleTurbulenceModel/SpecificIncompressibleTurbulenceModel.C
deleted
100644 → 0
View file @
3050ff92
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015 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
"SpecificIncompressibleTurbulenceModel.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template
<
class
BasicIncompressibleTurbulenceModel
>
Foam
::
SpecificIncompressibleTurbulenceModel
<
BasicIncompressibleTurbulenceModel
>::
SpecificIncompressibleTurbulenceModel
(
const
word
&
type
,
const
geometricOneField
&
alpha
,
const
geometricOneField
&
rho
,
const
volVectorField
&
U
,
const
surfaceScalarField
&
alphaRhoPhi
,
const
surfaceScalarField
&
phi
,
const
transportModel
&
transport
,
const
word
&
propertiesName
)
:
BasicIncompressibleTurbulenceModel
(
type
,
alpha
,
rho
,
U
,
alphaRhoPhi
,
phi
,
transport
,
propertiesName
)
{}
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
template
<
class
BasicIncompressibleTurbulenceModel
>
Foam
::
autoPtr
<
Foam
::
SpecificIncompressibleTurbulenceModel
<
BasicIncompressibleTurbulenceModel
>
>
Foam
::
SpecificIncompressibleTurbulenceModel
<
BasicIncompressibleTurbulenceModel
>::
New
(
const
volVectorField
&
U
,
const
surfaceScalarField
&
phi
,
const
transportModel
&
transport
,
const
word
&
propertiesName
)
{
return
autoPtr
<
SpecificIncompressibleTurbulenceModel
>
(
static_cast
<
SpecificIncompressibleTurbulenceModel
*>
(
BasicIncompressibleTurbulenceModel
::
New
(
geometricOneField
(),
geometricOneField
(),
U
,
phi
,
phi
,
transport
,
propertiesName
).
ptr
())
);
}
// ************************************************************************* //
src/TurbulenceModels/incompressible/SpecificIncompressibleTurbulenceModel/SpecificIncompressibleTurbulenceModel.H
deleted
100644 → 0
View file @
3050ff92
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015 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::SpecificIncompressibleTurbulenceModel
Description
Templated abstract base class for specific (RAS/LES) incompressible
turbulence models
SourceFiles
SpecificIncompressibleTurbulenceModel.C
\*---------------------------------------------------------------------------*/
#ifndef SpecificIncompressibleTurbulenceModel_H
#define SpecificIncompressibleTurbulenceModel_H
#include
"IncompressibleTurbulenceModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace
Foam
{
/*---------------------------------------------------------------------------*\
Class SpecificIncompressibleTurbulenceModel Declaration
\*---------------------------------------------------------------------------*/
template
<
class
BasicIncompressibleTurbulenceModel
>
class
SpecificIncompressibleTurbulenceModel
:
public
BasicIncompressibleTurbulenceModel
{
public:
typedef
typename
BasicIncompressibleTurbulenceModel
::
transportModel
transportModel
;
// Constructors
//- Construct from components
SpecificIncompressibleTurbulenceModel
(
const
word
&
type
,
const
geometricOneField
&
alpha
,
const
geometricOneField
&
rho
,
const
volVectorField
&
U
,
const
surfaceScalarField
&
alphaRhoPhi
,
const
surfaceScalarField
&
phi
,
const
transportModel
&
transport
,
const
word
&
propertiesName
);
//- Destructor
virtual
~
SpecificIncompressibleTurbulenceModel
()
{}