Skip to content

Commit

Permalink
Updated the whole of OpenFOAM to use the new templated TurbulenceMode…
Browse files Browse the repository at this point in the history
…ls library

The old separate incompressible and compressible libraries have been removed.

Most of the commonly used RANS and LES models have been upgraded to the
new framework but there are a few missing which will be added over the
next few days, in particular the realizable k-epsilon model.  Some of
the less common incompressible RANS models have been introduced into the
new library instantiated for incompressible flow only.  If they prove to
be generally useful they can be templated for compressible and
multiphase application.

The Spalart-Allmaras DDES and IDDES models have been thoroughly
debugged, removing serious errors concerning the use of S rather than
Omega.

The compressible instances of the models have been augmented by a simple
backward-compatible eddyDiffusivity model for thermal transport based on
alphat and alphaEff.  This will be replaced with a separate run-time
selectable thermal transport model framework in a few weeks.

For simplicity and ease of maintenance and further development the
turbulent transport and wall modeling is based on nut/nuEff rather than
mut/muEff for compressible models so that all forms of turbulence models
can use the same wall-functions and other BCs.

All turbulence model selection made in the constant/turbulenceProperties
dictionary with RAS and LES as sub-dictionaries rather than in separate
files which added huge complexity for multiphase.

All tutorials have been updated so study the changes and update your own
cases by comparison with similar cases provided.

Sorry for the inconvenience in the break in backward-compatibility but
this update to the turbulence modeling is an essential step in the
future of OpenFOAM to allow more models to be added and maintained for a
wider range of cases and physics.  Over the next weeks and months more
turbulence models will be added of single and multiphase flow, more
additional sub-models and further development and testing of existing
models.  I hope this brings benefits to all OpenFOAM users.

Henry G. Weller
  • Loading branch information
Henry authored and Henry committed Jan 21, 2015
1 parent 04d4f75 commit 93732c8
Show file tree
Hide file tree
Showing 1,102 changed files with 9,071 additions and 54,713 deletions.
8 changes: 4 additions & 4 deletions applications/solvers/combustion/PDRFoam/Make/options
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \
-I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/laminarFlameSpeed/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
Expand All @@ -20,8 +20,8 @@ EXE_INC = \
EXE_LIBS = \
-lengine \
-lmeshTools \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
-lturbulenceModels \
-lcompressibleTurbulenceModels \
-lfluidThermophysicalModels \
-lreactionThermophysicalModels \
-lspecie \
Expand Down
4 changes: 2 additions & 2 deletions applications/solvers/combustion/PDRFoam/PDRFoam.C
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
Expand Down Expand Up @@ -69,7 +69,7 @@ Description

#include "fvCFD.H"
#include "psiuReactionThermo.H"
#include "RASModel.H"
#include "turbulentFluidThermoModel.H"
#include "laminarFlameSpeed.H"
#include "XiModel.H"
#include "PDRDragModel.H"
Expand Down
4 changes: 2 additions & 2 deletions applications/solvers/combustion/PDRFoam/PDRFoamAutoRefine.C
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
Expand Down Expand Up @@ -58,7 +58,7 @@ Description
#include "fvCFD.H"
#include "dynamicFvMesh.H"
#include "psiuReactionThermo.H"
#include "RASModel.H"
#include "turbulentFluidThermoModel.H"
#include "laminarFlameSpeed.H"
#include "XiModel.H"
#include "PDRDragModel.H"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
Expand All @@ -24,6 +24,7 @@ License
\*---------------------------------------------------------------------------*/

#include "basicXiSubXiEq.H"
#include "zeroGradientFvPatchFields.H"
#include "addToRunTimeSelectionTable.H"

// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
Expand All @@ -24,6 +24,7 @@ License
\*---------------------------------------------------------------------------*/

#include "basicXiSubG.H"
#include "zeroGradientFvPatchFields.H"
#include "addToRunTimeSelectionTable.H"

// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
Expand Down Expand Up @@ -38,7 +38,7 @@ SourceFiles

#include "IOdictionary.H"
#include "psiuReactionThermo.H"
#include "RASModel.H"
#include "turbulentFluidThermoModel.H"
#include "multivariateSurfaceInterpolationScheme.H"
#include "runTimeSelectionTables.H"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
Expand All @@ -24,6 +24,7 @@ License
\*---------------------------------------------------------------------------*/

#include "basic.H"
#include "zeroGradientFvPatchFields.H"
#include "addToRunTimeSelectionTable.H"

// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
Expand All @@ -27,8 +27,6 @@ License
#include "PDRDragModel.H"
#include "addToRunTimeSelectionTable.H"

#include "backwardsCompatibilityWallFunctions.H"

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

namespace Foam
Expand All @@ -47,15 +45,27 @@ addToRunTimeSelectionTable(RASModel, PDRkEpsilon, dictionary);

PDRkEpsilon::PDRkEpsilon
(
const geometricOneField& alpha,
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& alphaRhoPhi,
const surfaceScalarField& phi,
const fluidThermo& thermophysicalModel,
const word& turbulenceModelName,
const word& modelName
)
:
kEpsilon(rho, U, phi, thermophysicalModel, turbulenceModelName, modelName),
Foam::RASModels::kEpsilon<eddyDiffusivity<compressible::turbulenceModel> >
(
geometricOneField(),
rho,
U,
phi,
phi,
thermophysicalModel,
turbulenceModelName,
modelName
),

C4_
(
Expand Down Expand Up @@ -96,12 +106,12 @@ void PDRkEpsilon::correct()
if (!turbulence_)
{
// Re-calculate viscosity
mut_ = rho_*Cmu_*sqr(k_)/epsilon_;
mut_.correctBoundaryConditions();
nut_ = Cmu_*sqr(k_)/epsilon_;
nut_.correctBoundaryConditions();

// Re-calculate thermal diffusivity
alphat_ = mut_/Prt_;
alphat_.correctBoundaryConditions();
//***HGWalphat_ = mut_/Prt_;
//alphat_.correctBoundaryConditions();

return;
}
Expand All @@ -116,7 +126,7 @@ void PDRkEpsilon::correct()
}

tmp<volTensorField> tgradU = fvc::grad(U_);
volScalarField G(GName(), mut_*(tgradU() && dev(twoSymm(tgradU()))));
volScalarField G(GName(), rho_*nut_*(tgradU() && dev(twoSymm(tgradU()))));
tgradU.clear();

// Update espsilon and G at the wall
Expand All @@ -143,7 +153,7 @@ void PDRkEpsilon::correct()
(
betav*fvm::ddt(rho_, epsilon_)
+ fvm::div(phi_, epsilon_)
- fvm::laplacian(DepsilonEff(), epsilon_)
- fvm::laplacian(rho_*DepsilonEff(), epsilon_)
==
C1_*betav*G*epsilon_/k_
+ 1.5*pow(Cmu_, 3.0/4.0)*GR*sqrt(k_)/LI
Expand All @@ -165,7 +175,7 @@ void PDRkEpsilon::correct()
(
betav*fvm::ddt(rho_, k_)
+ fvm::div(phi_, k_)
- fvm::laplacian(DkEff(), k_)
- fvm::laplacian(rho_*DkEff(), k_)
==
betav*G + GR
- fvm::SuSp((2.0/3.0)*betav*rho_*divU, k_)
Expand All @@ -177,12 +187,12 @@ void PDRkEpsilon::correct()
bound(k_, kMin_);

// Re-calculate viscosity
mut_ = rho_*Cmu_*sqr(k_)/epsilon_;
mut_.correctBoundaryConditions();
nut_ = Cmu_*sqr(k_)/epsilon_;
nut_.correctBoundaryConditions();

// Re-calculate thermal diffusivity
alphat_ = mut_/Prt_;
alphat_.correctBoundaryConditions();
//***HGWalphat_ = mut_/Prt_;
//alphat_.correctBoundaryConditions();
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
Expand Down Expand Up @@ -60,8 +60,8 @@ SourceFiles
#ifndef compressiblePDRkEpsilon_H
#define compressiblePDRkEpsilon_H


#include "kEpsilon.H"
#include "turbulentFluidThermoModel.H"

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

Expand All @@ -78,7 +78,13 @@ namespace RASModels

class PDRkEpsilon
:
public kEpsilon
public Foam::RASModels::kEpsilon
<
eddyDiffusivity
<
compressible::turbulenceModel
>
>
{
// Private data

Expand All @@ -97,8 +103,10 @@ public:
//- Construct from components
PDRkEpsilon
(
const geometricOneField& alpha,
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& alphaRhoPhi,
const surfaceScalarField& phi,
const fluidThermo& thermophysicalModel,
const word& turbulenceModelName = turbulenceModel::typeName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
Expand All @@ -24,6 +24,7 @@ License
\*---------------------------------------------------------------------------*/

#include "XiEqModel.H"
#include "zeroGradientFvPatchFields.H"

// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
Expand Down Expand Up @@ -43,7 +43,7 @@ SourceFiles

#include "IOdictionary.H"
#include "psiuReactionThermo.H"
#include "RASModel.H"
#include "turbulentFluidThermoModel.H"
#include "runTimeSelectionTables.H"

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
Expand Down Expand Up @@ -40,7 +40,7 @@ SourceFiles

#include "IOdictionary.H"
#include "psiuReactionThermo.H"
#include "RASModel.H"
#include "turbulentFluidThermoModel.H"
#include "runTimeSelectionTables.H"

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
Expand Down Expand Up @@ -92,8 +92,9 @@ SourceFiles

#include "IOdictionary.H"
#include "psiuReactionThermo.H"
#include "RASModel.H"
#include "turbulentFluidThermoModel.H"
#include "multivariateSurfaceInterpolationScheme.H"
#include "fvcDiv.H"
#include "runTimeSelectionTables.H"

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
Expand All @@ -24,6 +24,11 @@ License
\*---------------------------------------------------------------------------*/

#include "transport.H"
#include "surfaceInterpolate.H"
#include "fvmDdt.H"
#include "fvcLaplacian.H"
#include "fvmDiv.H"
#include "fvmSup.H"
#include "addToRunTimeSelectionTable.H"

// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
Expand Down
8 changes: 4 additions & 4 deletions applications/solvers/combustion/XiFoam/Make/options
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/laminarFlameSpeed/lnInclude

EXE_LIBS = \
Expand All @@ -16,9 +17,8 @@ EXE_LIBS = \
-lsampling \
-lmeshTools \
-lengine \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
-lcompressibleLESModels \
-lturbulenceModels \
-lcompressibleTurbulenceModels \
-lfluidThermophysicalModels \
-lreactionThermophysicalModels \
-lspecie \
Expand Down
Loading

0 comments on commit 93732c8

Please sign in to comment.