From b3d794ee97fdca4eed1a17be46a731d17091121a Mon Sep 17 00:00:00 2001 From: Henry Date: Thu, 1 Aug 2013 17:14:42 +0100 Subject: [PATCH] TurbulenceModels: Added structure for LES model and the Smagorinsky model within this structure. --- .../Make/options | 2 +- .../Make/options | 2 +- .../kineticTheoryModel/kineticTheoryModel.C | 8 +- .../kineticTheoryModel/kineticTheoryModel.H | 8 +- .../phaseIncompressibleTurbulenceModels.C | 61 +++- .../phasePressureModel/phasePressureModel.C | 8 +- .../phasePressureModel/phasePressureModel.H | 12 +- applications/test/PisoFoam/Make/options | 2 +- applications/test/RhoPimpleFoam/Make/options | 2 +- src/TurbulenceModels/Allwmake | 2 +- .../compressible/Make/options | 3 +- .../incompressible/Make/options | 3 +- .../incompressibleTurbulenceModels.C | 52 +++- .../turbulenceModels/LES/LESModel/LESModel.C | 187 +++++++++++ .../turbulenceModels/LES/LESModel/LESModel.H | 239 +++++++++++++++ .../LES/LESdeltas/LESdelta/LESdelta.C | 138 +++++++++ .../LES/LESdeltas/LESdelta/LESdelta.H | 160 ++++++++++ .../LES/LESdeltas/PrandtlDelta/PrandtlDelta.C | 96 ++++++ .../LES/LESdeltas/PrandtlDelta/PrandtlDelta.H | 110 +++++++ .../cubeRootVolDelta/cubeRootVolDelta.C | 119 +++++++ .../cubeRootVolDelta/cubeRootVolDelta.H | 108 +++++++ .../LES/LESdeltas/maxDeltaxyz/maxDeltaxyz.C | 145 +++++++++ .../LES/LESdeltas/maxDeltaxyz/maxDeltaxyz.H | 111 +++++++ .../LES/LESdeltas/smoothDelta/smoothDelta.C | 192 ++++++++++++ .../LES/LESdeltas/smoothDelta/smoothDelta.H | 290 ++++++++++++++++++ .../smoothDelta/smoothDeltaDeltaDataI.H | 227 ++++++++++++++ .../LES/LESfilters/LESfilter/LESfilter.C | 67 ++++ .../LES/LESfilters/LESfilter/LESfilter.H | 158 ++++++++++ .../anisotropicFilter/anisotropicFilter.C | 239 +++++++++++++++ .../anisotropicFilter/anisotropicFilter.H | 131 ++++++++ .../LESfilters/laplaceFilter/laplaceFilter.C | 151 +++++++++ .../LESfilters/laplaceFilter/laplaceFilter.H | 132 ++++++++ .../LESfilters/simpleFilter/simpleFilter.C | 128 ++++++++ .../LESfilters/simpleFilter/simpleFilter.H | 121 ++++++++ .../LES/Smagorinsky/Smagorinsky.C | 168 ++++++++++ .../LES/Smagorinsky/Smagorinsky.H | 168 ++++++++++ .../Make/files | 18 +- .../Make/options | 0 .../RAS/RASModel/RASModel.C | 39 ++- .../RAS/RASModel/RASModel.H | 8 - ...ndaryLayerInletEpsilonFvPatchScalarField.C | 0 ...ndaryLayerInletEpsilonFvPatchScalarField.H | 0 ...daryLayerInletVelocityFvPatchVectorField.C | 0 ...daryLayerInletVelocityFvPatchVectorField.H | 0 .../incompressibleRASBoundaryConditionsDoc.H | 0 ...thDissipationRateInletFvPatchScalarField.C | 0 ...thDissipationRateInletFvPatchScalarField.H | 0 ...ngLengthFrequencyInletFvPatchScalarField.C | 0 ...ngLengthFrequencyInletFvPatchScalarField.H | 0 ...silonLowReWallFunctionFvPatchScalarField.C | 0 ...silonLowReWallFunctionFvPatchScalarField.H | 0 .../epsilonWallFunctionFvPatchScalarField.C | 0 .../epsilonWallFunctionFvPatchScalarField.H | 0 .../fWallFunctionFvPatchScalarField.C | 0 .../fWallFunctionFvPatchScalarField.H | 0 .../kLowReWallFunctionFvPatchScalarField.C | 0 .../kLowReWallFunctionFvPatchScalarField.H | 0 .../kqRWallFunctionFvPatchField.C | 0 .../kqRWallFunctionFvPatchField.H | 0 .../kqRWallFunctionFvPatchFields.C | 0 .../kqRWallFunctionFvPatchFields.H | 0 .../nutLowReWallFunctionFvPatchScalarField.C | 0 .../nutLowReWallFunctionFvPatchScalarField.H | 0 .../nutURoughWallFunctionFvPatchScalarField.C | 0 .../nutURoughWallFunctionFvPatchScalarField.H | 0 ...tUSpaldingWallFunctionFvPatchScalarField.C | 0 ...tUSpaldingWallFunctionFvPatchScalarField.H | 0 ...UTabulatedWallFunctionFvPatchScalarField.C | 0 ...UTabulatedWallFunctionFvPatchScalarField.H | 0 .../nutUWallFunctionFvPatchScalarField.C | 0 .../nutUWallFunctionFvPatchScalarField.H | 0 .../nutWallFunctionFvPatchScalarField.C | 0 .../nutWallFunctionFvPatchScalarField.H | 0 ...tkAtmRoughWallFunctionFvPatchScalarField.C | 0 ...tkAtmRoughWallFunctionFvPatchScalarField.H | 0 .../nutkRoughWallFunctionFvPatchScalarField.C | 0 .../nutkRoughWallFunctionFvPatchScalarField.H | 0 .../nutkWallFunctionFvPatchScalarField.C | 0 .../nutkWallFunctionFvPatchScalarField.H | 0 .../omegaWallFunctionFvPatchScalarField.C | 0 .../omegaWallFunctionFvPatchScalarField.H | 0 .../v2WallFunctionFvPatchScalarField.C | 0 .../v2WallFunctionFvPatchScalarField.H | 0 .../RAS/kEpsilon/kEpsilon.C | 10 +- .../RAS/kEpsilon/kEpsilon.H | 5 +- .../TurbulenceModel/TurbulenceModel.C | 0 .../TurbulenceModel/TurbulenceModel.H | 0 .../fixedShearStressFvPatchVectorField.C | 0 .../fixedShearStressFvPatchVectorField.H | 0 .../porousBafflePressureFvPatchField.C | 0 .../porousBafflePressureFvPatchField.H | 0 .../porousBafflePressureFvPatchFieldFwd.H | 0 .../eddyViscosity/eddyViscosity.C | 36 +-- .../eddyViscosity/eddyViscosity.H | 11 +- .../laminar/laminar.C | 0 .../laminar/laminar.H | 0 .../turbulenceModel.C | 0 .../turbulenceModel.H | 0 .../turbulenceModelDoc.H | 0 .../constant/turbulenceProperties.air | 16 + 100 files changed, 3799 insertions(+), 94 deletions(-) create mode 100644 src/TurbulenceModels/turbulenceModels/LES/LESModel/LESModel.C create mode 100644 src/TurbulenceModels/turbulenceModels/LES/LESModel/LESModel.H create mode 100644 src/TurbulenceModels/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.C create mode 100644 src/TurbulenceModels/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.H create mode 100644 src/TurbulenceModels/turbulenceModels/LES/LESdeltas/PrandtlDelta/PrandtlDelta.C create mode 100644 src/TurbulenceModels/turbulenceModels/LES/LESdeltas/PrandtlDelta/PrandtlDelta.H create mode 100644 src/TurbulenceModels/turbulenceModels/LES/LESdeltas/cubeRootVolDelta/cubeRootVolDelta.C create mode 100644 src/TurbulenceModels/turbulenceModels/LES/LESdeltas/cubeRootVolDelta/cubeRootVolDelta.H create mode 100644 src/TurbulenceModels/turbulenceModels/LES/LESdeltas/maxDeltaxyz/maxDeltaxyz.C create mode 100644 src/TurbulenceModels/turbulenceModels/LES/LESdeltas/maxDeltaxyz/maxDeltaxyz.H create mode 100644 src/TurbulenceModels/turbulenceModels/LES/LESdeltas/smoothDelta/smoothDelta.C create mode 100644 src/TurbulenceModels/turbulenceModels/LES/LESdeltas/smoothDelta/smoothDelta.H create mode 100644 src/TurbulenceModels/turbulenceModels/LES/LESdeltas/smoothDelta/smoothDeltaDeltaDataI.H create mode 100644 src/TurbulenceModels/turbulenceModels/LES/LESfilters/LESfilter/LESfilter.C create mode 100644 src/TurbulenceModels/turbulenceModels/LES/LESfilters/LESfilter/LESfilter.H create mode 100644 src/TurbulenceModels/turbulenceModels/LES/LESfilters/anisotropicFilter/anisotropicFilter.C create mode 100644 src/TurbulenceModels/turbulenceModels/LES/LESfilters/anisotropicFilter/anisotropicFilter.H create mode 100644 src/TurbulenceModels/turbulenceModels/LES/LESfilters/laplaceFilter/laplaceFilter.C create mode 100644 src/TurbulenceModels/turbulenceModels/LES/LESfilters/laplaceFilter/laplaceFilter.H create mode 100644 src/TurbulenceModels/turbulenceModels/LES/LESfilters/simpleFilter/simpleFilter.C create mode 100644 src/TurbulenceModels/turbulenceModels/LES/LESfilters/simpleFilter/simpleFilter.H create mode 100644 src/TurbulenceModels/turbulenceModels/LES/Smagorinsky/Smagorinsky.C create mode 100644 src/TurbulenceModels/turbulenceModels/LES/Smagorinsky/Smagorinsky.H rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/Make/files (84%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/Make/options (100%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/RAS/RASModel/RASModel.C (90%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/RAS/RASModel/RASModel.H (97%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/RAS/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.C (100%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/RAS/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.H (100%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/RAS/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.C (100%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/RAS/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.H (100%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/RAS/derivedFvPatchFields/doc/incompressibleRASBoundaryConditionsDoc.H (100%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C (100%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.H (100%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C (100%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H (100%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonLowReWallFunction/epsilonLowReWallFunctionFvPatchScalarField.C (100%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonLowReWallFunction/epsilonLowReWallFunctionFvPatchScalarField.H (100%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C (100%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.H (100%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/RAS/derivedFvPatchFields/wallFunctions/fWallFunctions/fWallFunction/fWallFunctionFvPatchScalarField.C (100%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/RAS/derivedFvPatchFields/wallFunctions/fWallFunctions/fWallFunction/fWallFunctionFvPatchScalarField.H (100%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.C (100%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.H (100%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchField.C (100%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchField.H (100%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchFields.C (100%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchFields.H (100%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutLowReWallFunction/nutLowReWallFunctionFvPatchScalarField.C (100%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutLowReWallFunction/nutLowReWallFunctionFvPatchScalarField.H (100%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C (100%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.H (100%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.C (100%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.H (100%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.C (100%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.H (100%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUWallFunction/nutUWallFunctionFvPatchScalarField.C (100%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUWallFunction/nutUWallFunctionFvPatchScalarField.H (100%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.C (100%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.H (100%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkAtmRoughWallFunction/nutkAtmRoughWallFunctionFvPatchScalarField.C (100%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkAtmRoughWallFunction/nutkAtmRoughWallFunctionFvPatchScalarField.H (100%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.C (100%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.H (100%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.C (100%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.H (100%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C (100%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.H (100%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/RAS/derivedFvPatchFields/wallFunctions/v2WallFunctions/v2WallFunction/v2WallFunctionFvPatchScalarField.C (100%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/RAS/derivedFvPatchFields/wallFunctions/v2WallFunctions/v2WallFunction/v2WallFunctionFvPatchScalarField.H (100%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/RAS/kEpsilon/kEpsilon.C (96%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/RAS/kEpsilon/kEpsilon.H (97%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/TurbulenceModel/TurbulenceModel.C (100%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/TurbulenceModel/TurbulenceModel.H (100%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/derivedFvPatchFields/fixedShearStress/fixedShearStressFvPatchVectorField.C (100%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/derivedFvPatchFields/fixedShearStress/fixedShearStressFvPatchVectorField.H (100%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.C (100%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.H (100%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchFieldFwd.H (100%) rename src/TurbulenceModels/{turbulenceModel/RAS => turbulenceModels}/eddyViscosity/eddyViscosity.C (81%) rename src/TurbulenceModels/{turbulenceModel/RAS => turbulenceModels}/eddyViscosity/eddyViscosity.H (95%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/laminar/laminar.C (100%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/laminar/laminar.H (100%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/turbulenceModel.C (100%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/turbulenceModel.H (100%) rename src/TurbulenceModels/{turbulenceModel => turbulenceModels}/turbulenceModelDoc.H (100%) diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/Make/options b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/Make/options index ac52ae02ae..e178081548 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/Make/options +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/Make/options @@ -2,7 +2,7 @@ EXE_INC = \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/transportModels/incompressible/lnInclude \ - -I$(LIB_SRC)/TurbulenceModels/turbulenceModel/lnInclude \ + -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/phaseIncompressible/lnInclude \ -IphaseIncompressibleTurbulenceModels/lnInclude \ diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/Make/options b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/Make/options index 8608cd8610..2563e4ed94 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/Make/options +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/Make/options @@ -3,7 +3,7 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/transportModels/incompressible/transportModel \ - -I$(LIB_SRC)/TurbulenceModels/turbulenceModel/lnInclude \ + -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/phaseIncompressible/lnInclude \ -I../twoPhaseSystem/lnInclude \ diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C index 3af90199a6..d26226feda 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C @@ -24,10 +24,8 @@ License \*---------------------------------------------------------------------------*/ #include "kineticTheoryModel.H" -#include "surfaceInterpolate.H" #include "mathematicalConstants.H" #include "twoPhaseSystem.H" -#include "fvcDiv.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -43,7 +41,7 @@ Foam::kineticTheoryModel::kineticTheoryModel const word& type ) : - RASModels::eddyViscosity > + eddyViscosity > > ( type, alpha, @@ -517,9 +515,9 @@ bool Foam::kineticTheoryModel::read() { if ( - RASModels::eddyViscosity + eddyViscosity < - PhaseIncompressibleTurbulenceModel + RASModel > >::read() ) { diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.H index e7146f8e62..981aaf5a68 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.H +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.H @@ -34,11 +34,11 @@ SourceFiles #ifndef kineticTheoryModel_H #define kineticTheoryModel_H +#include "RASModel.H" #include "eddyViscosity.H" #include "PhaseIncompressibleTurbulenceModel.H" -#include "dragModel.H" #include "phaseModel.H" -#include "autoPtr.H" +#include "dragModel.H" #include "viscosityModel.H" #include "conductivityModel.H" #include "radialModel.H" @@ -57,9 +57,9 @@ namespace Foam class kineticTheoryModel : - public RASModels::eddyViscosity + public eddyViscosity < - PhaseIncompressibleTurbulenceModel + RASModel > > { // Private data diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/phaseIncompressibleTurbulenceModels.C b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/phaseIncompressibleTurbulenceModels.C index f47e3943a1..9c4d21d451 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/phaseIncompressibleTurbulenceModels.C +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/phaseIncompressibleTurbulenceModels.C @@ -24,13 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "PhaseIncompressibleTurbulenceModel.H" -#include "laminar.H" -#include "RASModel.H" -#include "kEpsilon.H" -#include "LaheyKEpsilon.H" -#include "continuousGasKEpsilon.H" -#include "kineticTheoryModel.H" -#include "phasePressureModel.H" #include "phaseModel.H" #include "addToRunTimeSelectionTable.H" @@ -52,7 +45,13 @@ namespace Foam typedef PhaseIncompressibleTurbulenceModel incompressibleTransportTurbulenceModel; +} + +#include "laminar.H" + +namespace Foam +{ typedef laminar incompressibleLaminar; @@ -64,8 +63,16 @@ namespace Foam incompressibleLaminar, dictionary ); +} +#include "RASModel.H" +#include "kEpsilon.H" +#include "LaheyKEpsilon.H" +#include "continuousGasKEpsilon.H" + +namespace Foam +{ typedef RASModel incompressibleRASModel; @@ -131,6 +138,8 @@ namespace Foam } +#include "kineticTheoryModel.H" + namespace Foam { typedef PhaseIncompressibleTurbulenceModel @@ -150,6 +159,8 @@ namespace Foam } +#include "phasePressureModel.H" + namespace Foam { typedef PhaseIncompressibleTurbulenceModel @@ -169,4 +180,40 @@ namespace Foam } +#include "LESModel.H" +#include "Smagorinsky.H" + +namespace Foam +{ + typedef LESModel + incompressibleLESModel; + + defineNamedTemplateTypeNameAndDebug(incompressibleLESModel, 0); + + defineTemplateRunTimeSelectionTable(incompressibleLESModel, dictionary); + + addToRunTimeSelectionTable + ( + basePhaseIncompressibleTransportTurbulenceModel, + incompressibleLESModel, + dictionary + ); + + namespace LESModels + { + typedef Smagorinsky + incompressibleSmagorinsky; + + defineNamedTemplateTypeNameAndDebug(incompressibleSmagorinsky, 0); + + addToRunTimeSelectionTable + ( + incompressibleLESModel, + incompressibleSmagorinsky, + dictionary + ); + } +} + + // ************************************************************************* // diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C index 99cc91994c..6c0d8852db 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C @@ -24,9 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "phasePressureModel.H" -#include "surfaceInterpolate.H" #include "twoPhaseSystem.H" -#include "dimensionedType.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -42,7 +40,7 @@ Foam::phasePressureModel::phasePressureModel const word& type ) : - RASModels::eddyViscosity > + eddyViscosity > > ( type, alpha, @@ -196,9 +194,9 @@ bool Foam::phasePressureModel::read() { if ( - RASModels::eddyViscosity + eddyViscosity < - PhaseIncompressibleTurbulenceModel + RASModel > >::read() ) { diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/phasePressureModel/phasePressureModel.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/phasePressureModel/phasePressureModel.H index 1c4028f16a..2441094639 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/phasePressureModel/phasePressureModel.H +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/phasePressureModel/phasePressureModel.H @@ -34,16 +34,10 @@ SourceFiles #ifndef phasePressureModel_H #define phasePressureModel_H +#include "RASModel.H" #include "eddyViscosity.H" #include "PhaseIncompressibleTurbulenceModel.H" -#include "dragModel.H" #include "phaseModel.H" -#include "autoPtr.H" -#include "viscosityModel.H" -#include "conductivityModel.H" -#include "radialModel.H" -#include "granularPressureModel.H" -#include "frictionalStressModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -57,9 +51,9 @@ namespace Foam class phasePressureModel : - public RASModels::eddyViscosity + public eddyViscosity < - PhaseIncompressibleTurbulenceModel + RASModel > > { // Private data diff --git a/applications/test/PisoFoam/Make/options b/applications/test/PisoFoam/Make/options index 8e32793a19..23368faba6 100644 --- a/applications/test/PisoFoam/Make/options +++ b/applications/test/PisoFoam/Make/options @@ -1,5 +1,5 @@ EXE_INC = \ - -I$(LIB_SRC)/TurbulenceModels/turbulenceModel/lnInclude \ + -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \ -I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \ diff --git a/applications/test/RhoPimpleFoam/Make/options b/applications/test/RhoPimpleFoam/Make/options index cc667ece05..44d8f226ca 100644 --- a/applications/test/RhoPimpleFoam/Make/options +++ b/applications/test/RhoPimpleFoam/Make/options @@ -1,5 +1,5 @@ EXE_INC = \ - -I$(LIB_SRC)/TurbulenceModels/turbulenceModel/lnInclude \ + -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/finiteVolume/cfdTools \ diff --git a/src/TurbulenceModels/Allwmake b/src/TurbulenceModels/Allwmake index c0daf57343..561610c0ce 100755 --- a/src/TurbulenceModels/Allwmake +++ b/src/TurbulenceModels/Allwmake @@ -3,7 +3,7 @@ cd ${0%/*} || exit 1 # run from this directory makeType=${1:-libso} set -x -wmake libso turbulenceModel +wmake libso turbulenceModels wmake libso incompressible wmake libso compressible wmakeLnInclude phaseIncompressible diff --git a/src/TurbulenceModels/compressible/Make/options b/src/TurbulenceModels/compressible/Make/options index 73c2a143ce..5d1b7bc8c9 100644 --- a/src/TurbulenceModels/compressible/Make/options +++ b/src/TurbulenceModels/compressible/Make/options @@ -1,5 +1,5 @@ EXE_INC = \ - -I../turbulenceModel/lnInclude \ + -I../turbulenceModels/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ @@ -9,4 +9,5 @@ LIB_LIBS = \ -lfiniteVolume \ -lmeshTools \ -lfluidThermophysicalModels \ + -lturbulenceModels \ -lspecie diff --git a/src/TurbulenceModels/incompressible/Make/options b/src/TurbulenceModels/incompressible/Make/options index 0763d29c16..617607373e 100644 --- a/src/TurbulenceModels/incompressible/Make/options +++ b/src/TurbulenceModels/incompressible/Make/options @@ -1,10 +1,11 @@ EXE_INC = \ - -I../turbulenceModel/lnInclude \ + -I../turbulenceModels/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/transportModels/incompressible/lnInclude LIB_LIBS = \ -lincompressibleTransportModels \ + -lturbulenceModels \ -lfiniteVolume \ -lmeshTools diff --git a/src/TurbulenceModels/incompressible/incompressibleTurbulenceModels.C b/src/TurbulenceModels/incompressible/incompressibleTurbulenceModels.C index 6d3b8aef5f..2c4072105d 100644 --- a/src/TurbulenceModels/incompressible/incompressibleTurbulenceModels.C +++ b/src/TurbulenceModels/incompressible/incompressibleTurbulenceModels.C @@ -24,9 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "IncompressibleTurbulenceModel.H" -#include "laminar.H" -#include "RASModel.H" -#include "kEpsilon.H" #include "transportModel.H" #include "addToRunTimeSelectionTable.H" @@ -50,7 +47,13 @@ namespace Foam < transportModel > incompressibleTransportTurbulenceModel; +} + +#include "laminar.H" + +namespace Foam +{ typedef laminar incompressibleLaminar; @@ -62,8 +65,15 @@ namespace Foam incompressibleLaminar, dictionary ); +} + +#include "RASModel.H" +#include "kEpsilon.H" + +namespace Foam +{ typedef RASModel incompressibleRASModel; @@ -95,4 +105,40 @@ namespace Foam } +#include "LESModel.H" +#include "Smagorinsky.H" + +namespace Foam +{ + typedef LESModel + incompressibleLESModel; + + defineNamedTemplateTypeNameAndDebug(incompressibleLESModel, 0); + + defineTemplateRunTimeSelectionTable(incompressibleLESModel, dictionary); + + addToRunTimeSelectionTable + ( + baseIncompressibleTransportTurbulenceModel, + incompressibleLESModel, + dictionary + ); + + namespace LESModels + { + typedef Smagorinsky + incompressibleSmagorinsky; + + defineNamedTemplateTypeNameAndDebug(incompressibleSmagorinsky, 0); + + addToRunTimeSelectionTable + ( + incompressibleLESModel, + incompressibleSmagorinsky, + dictionary + ); + } +} + + // ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModels/LES/LESModel/LESModel.C b/src/TurbulenceModels/turbulenceModels/LES/LESModel/LESModel.C new file mode 100644 index 0000000000..6b4b7b74f8 --- /dev/null +++ b/src/TurbulenceModels/turbulenceModels/LES/LESModel/LESModel.C @@ -0,0 +1,187 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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 . + +\*---------------------------------------------------------------------------*/ + +#include "LESModel.H" + +// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * // + +template +void Foam::LESModel::printCoeffs(const word& type) +{ + if (printCoeffs_) + { + Info<< type << "Coeffs" << coeffDict_ << endl; + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::LESModel::LESModel +( + const word& type, + const alphaField& alpha, + const rhoField& rho, + const volVectorField& U, + const surfaceScalarField& alphaPhi, + const surfaceScalarField& phi, + const transportModel& transport, + const word& propertiesName +) +: + BasicTurbulenceModel + ( + alpha, + rho, + U, + alphaPhi, + phi, + transport, + propertiesName + ), + + LESDict_(this->subOrEmptyDict("LES")), + turbulence_(LESDict_.lookup("turbulence")), + printCoeffs_(LESDict_.lookupOrDefault("printCoeffs", false)), + coeffDict_(LESDict_.subOrEmptyDict(type + "Coeffs")), + + kMin_ + ( + dimensioned::lookupOrAddToDict + ( + "kMin", + LESDict_, + SMALL, + sqr(dimVelocity) + ) + ), + + delta_(LESdelta::New("delta", U.mesh(), LESDict_)) +{ + // Force the construction of the mesh deltaCoeffs which may be needed + // for the construction of the derived models and BCs + this->mesh_.deltaCoeffs(); +} + + +// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // + +template +Foam::autoPtr > +Foam::LESModel::New +( + const alphaField& alpha, + const rhoField& rho, + const volVectorField& U, + const surfaceScalarField& alphaPhi, + const surfaceScalarField& phi, + const transportModel& transport, + const word& propertiesName +) +{ + // get model name, but do not register the dictionary + // otherwise it is registered in the database twice + const word modelType + ( + IOdictionary + ( + IOobject + ( + IOobject::groupName(propertiesName, U.group()), + U.time().constant(), + U.db(), + IOobject::MUST_READ_IF_MODIFIED, + IOobject::NO_WRITE, + false + ) + ).subDict("LES").lookup("LESModel") + ); + + Info<< "Selecting LES turbulence model " << modelType << endl; + + typename dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(modelType); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalErrorIn + ( + "LESModel::New" + "(" + "const volScalarField&, " + "const volVectorField&, " + "const surfaceScalarField&, " + "transportModel&, " + "const word&" + ")" + ) << "Unknown LESModel type " + << modelType << nl << nl + << "Valid LESModel types:" << endl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); + } + + return autoPtr + ( + cstrIter()(alpha, rho, U, alphaPhi, phi, transport, propertiesName) + ); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +void Foam::LESModel::correct() +{ + BasicTurbulenceModel::correct(); +} + + +template +bool Foam::LESModel::read() +{ + if (turbulenceModel::read()) + { + LESDict_ <<= this->subDict("LES"); + LESDict_.lookup("turbulence") >> turbulence_; + + if (const dictionary* dictPtr = LESDict_.subDictPtr(type() + "Coeffs")) + { + coeffDict_ <<= *dictPtr; + } + + kMin_.readIfPresent(LESDict_); + + return true; + } + else + { + return false; + } +} + + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModels/LES/LESModel/LESModel.H b/src/TurbulenceModels/turbulenceModels/LES/LESModel/LESModel.H new file mode 100644 index 0000000000..6c6bb36d31 --- /dev/null +++ b/src/TurbulenceModels/turbulenceModels/LES/LESModel/LESModel.H @@ -0,0 +1,239 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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 . + +Namespace + Foam::LESModels + +Description + Namespace for LES SGS models. + +Class + Foam::LESModel + +Description + Templated abstract base class for LES SGS models + +SourceFiles + LESModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef LESModel_H +#define LESModel_H + +#include "TurbulenceModel.H" +#include "LESdelta.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class LESModel Declaration +\*---------------------------------------------------------------------------*/ + +template +class LESModel +: + public BasicTurbulenceModel +{ + +protected: + + // Protected data + + //- LES coefficients dictionary + dictionary LESDict_; + + //- Turbulence on/off flag + Switch turbulence_; + + //- Flag to print the model coeffs at run-time + Switch printCoeffs_; + + //- Model coefficients dictionary + dictionary coeffDict_; + + //- Lower limit of k + dimensionedScalar kMin_; + + //- Run-time selectable delta model + autoPtr delta_; + + + // Protected Member Functions + + //- Print model coefficients + virtual void printCoeffs(const word& type); + + +private: + + // Private Member Functions + + //- Disallow default bitwise copy construct + LESModel(const LESModel&); + + //- Disallow default bitwise assignment + void operator=(const LESModel&); + + +public: + + typedef typename BasicTurbulenceModel::alphaField alphaField; + typedef typename BasicTurbulenceModel::rhoField rhoField; + typedef typename BasicTurbulenceModel::transportModel transportModel; + + + //- Runtime type information + TypeName("LES"); + + + // Declare run-time constructor selection table + + declareRunTimeSelectionTable + ( + autoPtr, + LESModel, + dictionary, + ( + const alphaField& alpha, + const rhoField& rho, + const volVectorField& U, + const surfaceScalarField& alphaPhi, + const surfaceScalarField& phi, + const transportModel& transport, + const word& propertiesName + ), + (alpha, rho, U, alphaPhi, phi, transport, propertiesName) + ); + + + // Constructors + + //- Construct from components + LESModel + ( + const word& type, + const alphaField& alpha, + const rhoField& rho, + const volVectorField& U, + const surfaceScalarField& alphaPhi, + const surfaceScalarField& phi, + const transportModel& transport, + const word& propertiesName + ); + + + // Selectors + + //- Return a reference to the selected LES model + static autoPtr New + ( + const alphaField& alpha, + const rhoField& rho, + const volVectorField& U, + const surfaceScalarField& alphaPhi, + const surfaceScalarField& phi, + const transportModel& transport, + const word& propertiesName = turbulenceModel::propertiesName + ); + + + //- Destructor + virtual ~LESModel() + {} + + + // Member Functions + + // Access + + //- Const access to the coefficients dictionary + virtual const dictionary& coeffDict() const + { + return coeffDict_; + } + + //- Return the lower allowable limit for k (default: SMALL) + const dimensionedScalar& kMin() const + { + return kMin_; + } + + //- Allow kMin to be changed + dimensionedScalar& kMin() + { + return kMin_; + } + + //- Access function to filter width + inline const volScalarField& delta() const + { + return delta_(); + } + + + //- Return the effective viscosity + virtual tmp nuEff() const + { + return tmp + ( + new volScalarField + ( + IOobject::groupName("nuEff", this->U_.group()), + this->nut() + this->nu() + ) + ); + } + + //- Return the effective viscosity on patch + virtual tmp nuEff(const label patchi) const + { + return this->nut(patchi) + this->nu(patchi); + } + + //- Solve the turbulence equations and correct the turbulence viscosity + virtual void correct(); + + //- Read LESProperties dictionary + virtual bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "LESModel.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.C b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.C new file mode 100644 index 0000000000..5a8ff1c3fb --- /dev/null +++ b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.C @@ -0,0 +1,138 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2012 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 . + +\*---------------------------------------------------------------------------*/ + +#include "LESdelta.H" +#include "calculatedFvPatchFields.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(LESdelta, 0); + defineRunTimeSelectionTable(LESdelta, dictionary); +} + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::LESdelta::LESdelta(const word& name, const fvMesh& mesh) +: + mesh_(mesh), + delta_ + ( + IOobject + ( + name, + mesh.time().timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + dimensionedScalar(name, dimLength, SMALL), + calculatedFvPatchScalarField::typeName + ) +{} + + +// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // + +Foam::autoPtr Foam::LESdelta::New +( + const word& name, + const fvMesh& mesh, + const dictionary& dict +) +{ + const word deltaType(dict.lookup("delta")); + + Info<< "Selecting LES delta type " << deltaType << endl; + + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(deltaType); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalErrorIn + ( + "LESdelta::New(const fvMesh&, const dictionary&)" + ) << "Unknown LESdelta type " + << deltaType << nl << nl + << "Valid LESdelta types are :" << endl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); + } + + return autoPtr(cstrIter()(name, mesh, dict)); +} + + +Foam::autoPtr Foam::LESdelta::New +( + const word& name, + const fvMesh& mesh, + const dictionary& dict, + const dictionaryConstructorTable& additionalConstructors +) +{ + const word deltaType(dict.lookup("delta")); + + Info<< "Selecting LES delta type " << deltaType << endl; + + // First on additional ones + dictionaryConstructorTable::const_iterator cstrIter = + additionalConstructors.find(deltaType); + + if (cstrIter != additionalConstructors.end()) + { + return autoPtr(cstrIter()(name, mesh, dict)); + } + else + { + dictionaryConstructorTable::const_iterator cstrIter = + dictionaryConstructorTablePtr_->find(deltaType); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalErrorIn + ( + "LESdelta::New(const fvMesh&, const dictionary&)" + ) << "Unknown LESdelta type " + << deltaType << nl << nl + << "Valid LESdelta types are :" << endl + << additionalConstructors.sortedToc() + << " and " + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); + return autoPtr(); + } + else + { + return autoPtr(cstrIter()(name, mesh, dict)); + } + } +} + + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.H b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.H new file mode 100644 index 0000000000..c84ae74c3b --- /dev/null +++ b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.H @@ -0,0 +1,160 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2012 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 . + +Class + Foam::LESdelta + +Description + Abstract base class for LES deltas + +SourceFiles + LESdelta.C + +\*---------------------------------------------------------------------------*/ + +#ifndef LESdelta_H +#define LESdelta_H + +#include "volFields.H" +#include "typeInfo.H" +#include "autoPtr.H" +#include "runTimeSelectionTables.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +class fvMesh; + +/*---------------------------------------------------------------------------*\ + Class LESdelta Declaration +\*---------------------------------------------------------------------------*/ + +class LESdelta +{ + +protected: + + // Protected data + + const fvMesh& mesh_; + + volScalarField delta_; + + +private: + + // Private Member Functions + + // Disallow default bitwise copy construct and assignment + LESdelta(const LESdelta&); + void operator=(const LESdelta&); + + +public: + + //- Runtime type information + TypeName("LESdelta"); + + + // Declare run-time constructor selection table + + declareRunTimeSelectionTable + ( + autoPtr, + LESdelta, + dictionary, + ( + const word& name, + const fvMesh& mesh, + const dictionary& LESdeltaDict + ), + (name, mesh, LESdeltaDict) + ); + + + // Constructors + + //- Construct from name and mesh + LESdelta(const word& name, const fvMesh&); + + + // Selectors + + //- Return a reference to the selected LES delta + static autoPtr New + ( + const word& name, + const fvMesh&, + const dictionary& + ); + + //- Return a reference to the selected LES delta + static autoPtr New + ( + const word& name, + const fvMesh&, + const dictionary&, + const dictionaryConstructorTable& + ); + + + //- Destructor + virtual ~LESdelta() + {} + + + // Member Functions + + //- Return mesh reference + const fvMesh& mesh() const + { + return mesh_; + } + + //- Read the LESdelta dictionary + virtual void read(const dictionary&) = 0; + + // Correct values + virtual void correct() = 0; + + + // Member Operators + + virtual operator const volScalarField&() const + { + return delta_; + } +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/PrandtlDelta/PrandtlDelta.C b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/PrandtlDelta/PrandtlDelta.C new file mode 100644 index 0000000000..7c72253775 --- /dev/null +++ b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/PrandtlDelta/PrandtlDelta.C @@ -0,0 +1,96 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2013 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 . + +\*---------------------------------------------------------------------------*/ + +#include "PrandtlDelta.H" +#include "wallDist.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(PrandtlDelta, 0); + addToRunTimeSelectionTable(LESdelta, PrandtlDelta, dictionary); +} + + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +void Foam::PrandtlDelta::calcDelta() +{ + delta_ = min + ( + static_cast(geometricDelta_()), + (kappa_/Cdelta_)*wallDist(mesh_).y() + ); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::PrandtlDelta::PrandtlDelta +( + const word& name, + const fvMesh& mesh, + const dictionary& dict +) +: + LESdelta(name, mesh), + geometricDelta_(LESdelta::New(name, mesh, dict.subDict(type() + "Coeffs"))), + kappa_(dict.lookupOrDefault("kappa", 0.41)), + Cdelta_ + ( + dict.subDict(type() + "Coeffs").lookupOrDefault("Cdelta", 0.158) + ) +{ + calcDelta(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::PrandtlDelta::read(const dictionary& dict) +{ + const dictionary& coeffDict(dict.subDict(type() + "Coeffs")); + + geometricDelta_().read(coeffDict); + dict.readIfPresent("kappa", kappa_); + coeffDict.readIfPresent("Cdelta", Cdelta_); + calcDelta(); +} + + +void Foam::PrandtlDelta::correct() +{ + geometricDelta_().correct(); + + if (mesh_.changing()) + { + calcDelta(); + } +} + + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/PrandtlDelta/PrandtlDelta.H b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/PrandtlDelta/PrandtlDelta.H new file mode 100644 index 0000000000..d8840ff1a8 --- /dev/null +++ b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/PrandtlDelta/PrandtlDelta.H @@ -0,0 +1,110 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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 . + +Class + Foam::PrandtlDelta + +Description + Simple cube-root of cell volume delta used in LES models. + +SourceFiles + PrandtlDelta.C + +\*---------------------------------------------------------------------------*/ + +#ifndef PrandtlDelta_H +#define PrandtlDelta_H + +#include "LESdelta.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class PrandtlDelta Declaration +\*---------------------------------------------------------------------------*/ + +class PrandtlDelta +: + public LESdelta +{ + // Private data + + autoPtr geometricDelta_; + scalar kappa_; + scalar Cdelta_; + + + // Private Member Functions + + //- Disallow default bitwise copy construct and assignment + PrandtlDelta(const PrandtlDelta&); + void operator=(const PrandtlDelta&); + + // Calculate the delta values + void calcDelta(); + + +public: + + //- Runtime type information + TypeName("Prandtl"); + + + // Constructors + + //- Construct from name, mesh and IOdictionary + PrandtlDelta + ( + const word& name, + const fvMesh& mesh, + const dictionary& + ); + + + //- Destructor + virtual ~PrandtlDelta() + {} + + + // Member Functions + + //- Read the LESdelta dictionary + virtual void read(const dictionary&); + + // Correct values + virtual void correct(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/cubeRootVolDelta/cubeRootVolDelta.C b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/cubeRootVolDelta/cubeRootVolDelta.C new file mode 100644 index 0000000000..cdacbc6690 --- /dev/null +++ b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/cubeRootVolDelta/cubeRootVolDelta.C @@ -0,0 +1,119 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2013 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 . + +\*---------------------------------------------------------------------------*/ + +#include "cubeRootVolDelta.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(cubeRootVolDelta, 0); + addToRunTimeSelectionTable(LESdelta, cubeRootVolDelta, dictionary); +} + + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +void Foam::cubeRootVolDelta::calcDelta() +{ + label nD = mesh().nGeometricD(); + + if (nD == 3) + { + delta_.internalField() = deltaCoeff_*pow(mesh().V(), 1.0/3.0); + } + else if (nD == 2) + { + WarningIn("cubeRootVolDelta::calcDelta()") + << "Case is 2D, LES is not strictly applicable\n" + << endl; + + const Vector