diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C index 9b4c373420fbddff86a589d03d4a1f9492999883..4e5686f3c3993717e78a9ddb98e5fdec137c57a2 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C @@ -29,7 +29,7 @@ License // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::kineticTheoryModel::kineticTheoryModel +Foam::RASModels::kineticTheoryModel::kineticTheoryModel ( const volScalarField& alpha, const geometricOneField& rho, @@ -139,13 +139,13 @@ Foam::kineticTheoryModel::kineticTheoryModel // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -Foam::kineticTheoryModel::~kineticTheoryModel() +Foam::RASModels::kineticTheoryModel::~kineticTheoryModel() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -bool Foam::kineticTheoryModel::read() +bool Foam::RASModels::kineticTheoryModel::read() { if ( @@ -175,21 +175,24 @@ bool Foam::kineticTheoryModel::read() } -Foam::tmp<Foam::volScalarField> Foam::kineticTheoryModel::k() const +Foam::tmp<Foam::volScalarField> +Foam::RASModels::kineticTheoryModel::k() const { notImplemented("kineticTheoryModel::k()"); return nut_; } -Foam::tmp<Foam::volScalarField> Foam::kineticTheoryModel::epsilon() const +Foam::tmp<Foam::volScalarField> +Foam::RASModels::kineticTheoryModel::epsilon() const { notImplemented("kineticTheoryModel::epsilon()"); return nut_; } -Foam::tmp<Foam::volSymmTensorField> Foam::kineticTheoryModel::R() const +Foam::tmp<Foam::volSymmTensorField> +Foam::RASModels::kineticTheoryModel::R() const { return tmp<volSymmTensorField> ( @@ -211,7 +214,8 @@ Foam::tmp<Foam::volSymmTensorField> Foam::kineticTheoryModel::R() const /* -Foam::tmp<Foam::volScalarField> Foam::kineticTheoryModel::pp() const +Foam::tmp<Foam::volScalarField> +Foam::RASModels::kineticTheoryModel::pp() const { // Particle pressure coefficient @@ -244,7 +248,8 @@ Foam::tmp<Foam::volScalarField> Foam::kineticTheoryModel::pp() const */ -Foam::tmp<Foam::volScalarField> Foam::kineticTheoryModel::pPrime() const +Foam::tmp<Foam::volScalarField> +Foam::RASModels::kineticTheoryModel::pPrime() const { // Local references const volScalarField& alpha = this->alpha_; @@ -271,7 +276,8 @@ Foam::tmp<Foam::volScalarField> Foam::kineticTheoryModel::pPrime() const } -Foam::tmp<Foam::surfaceScalarField> Foam::kineticTheoryModel::pPrimef() const +Foam::tmp<Foam::surfaceScalarField> +Foam::RASModels::kineticTheoryModel::pPrimef() const { // Local references const volScalarField& alpha = this->alpha_; @@ -298,7 +304,8 @@ Foam::tmp<Foam::surfaceScalarField> Foam::kineticTheoryModel::pPrimef() const } -Foam::tmp<Foam::volSymmTensorField> Foam::kineticTheoryModel::devRhoReff() const +Foam::tmp<Foam::volSymmTensorField> +Foam::RASModels::kineticTheoryModel::devRhoReff() const { return tmp<volSymmTensorField> ( @@ -320,7 +327,8 @@ Foam::tmp<Foam::volSymmTensorField> Foam::kineticTheoryModel::devRhoReff() const } -Foam::tmp<Foam::fvVectorMatrix> Foam::kineticTheoryModel::divDevRhoReff +Foam::tmp<Foam::fvVectorMatrix> +Foam::RASModels::kineticTheoryModel::divDevRhoReff ( volVectorField& U ) const @@ -338,7 +346,7 @@ Foam::tmp<Foam::fvVectorMatrix> Foam::kineticTheoryModel::divDevRhoReff } -void Foam::kineticTheoryModel::correct() +void Foam::RASModels::kineticTheoryModel::correct() { // Local references volScalarField alpha(max(this->alpha_, 0.0)); diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.H index 4f6164682f634f8fcc2558801188d2ddd754d0f5..776b523f56916f4a9ce9cc4e267eb24ad9c191a8 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.H +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.H @@ -61,6 +61,8 @@ SourceFiles namespace Foam { +namespace RASModels +{ /*---------------------------------------------------------------------------*\ Class kineticTheoryModel Declaration @@ -212,6 +214,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +} // End namespace RASModels } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/phaseIncompressibleTurbulenceModels.C b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/phaseIncompressibleTurbulenceModels.C index a1817fefb5bb6cd67671bde45d38b6ac06d38dbf..2cf5da40215d24c6f53d45f246ab63c3a0325768 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/phaseIncompressibleTurbulenceModels.C +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/phaseIncompressibleTurbulenceModels.C @@ -26,258 +26,62 @@ License #include "PhaseIncompressibleTurbulenceModel.H" #include "phaseModel.H" #include "addToRunTimeSelectionTable.H" - -namespace Foam -{ - typedef TurbulenceModel - < - volScalarField, - geometricOneField, - incompressibleTurbulenceModel, - phaseModel - > basePhaseIncompressibleTransportTurbulenceModel; - - defineTemplateRunTimeSelectionTable - ( - basePhaseIncompressibleTransportTurbulenceModel, - dictionary - ); - - typedef PhaseIncompressibleTurbulenceModel<phaseModel> - incompressibleTransportTurbulenceModel; -} - +#include "makeTurbulenceModel.H" #include "laminar.H" - -namespace Foam -{ - typedef laminar<incompressibleTransportTurbulenceModel> - incompressibleLaminar; - - defineNamedTemplateTypeNameAndDebug(incompressibleLaminar, 0); - - addToRunTimeSelectionTable - ( - basePhaseIncompressibleTransportTurbulenceModel, - incompressibleLaminar, - dictionary - ); -} - - #include "RASModel.H" -#include "kEpsilon.H" -#include "LaheyKEpsilon.H" -#include "continuousGasKEpsilon.H" - -namespace Foam -{ - typedef RASModel<incompressibleTransportTurbulenceModel> - incompressibleRASModel; - - defineNamedTemplateTypeNameAndDebug(incompressibleRASModel, 0); +#include "LESModel.H" - defineTemplateRunTimeSelectionTable(incompressibleRASModel, dictionary); +makeBaseTurbulenceModel +( + volScalarField, + geometricOneField, + incompressibleTurbulenceModel, + PhaseIncompressibleTurbulenceModel, + phaseModel +); - addToRunTimeSelectionTable - ( - basePhaseIncompressibleTransportTurbulenceModel, - incompressibleRASModel, - dictionary - ); +#define makeRASModel(Type) \ + makeTemplatedTurbulenceModel \ + (phaseModelPhaseIncompressibleTurbulenceModel, RAS, Type) - namespace RASModels - { - typedef kEpsilon<incompressibleTransportTurbulenceModel> - incompressiblekEpsilon; +#define makeLESModel(Type) \ + makeTemplatedTurbulenceModel \ + (phaseModelPhaseIncompressibleTurbulenceModel, LES, Type) - defineNamedTemplateTypeNameAndDebug(incompressiblekEpsilon, 0); +#include "kEpsilon.H" +makeRASModel(kEpsilon); - addToRunTimeSelectionTable - ( - incompressibleRASModel, - incompressiblekEpsilon, - dictionary - ); - } +#include "LaheyKEpsilon.H" +makeRASModel(LaheyKEpsilon); - namespace RASModels - { - typedef LaheyKEpsilon<incompressibleTransportTurbulenceModel> - incompressibleLaheyKEpsilon; +#include "continuousGasKEpsilon.H" +makeRASModel(continuousGasKEpsilon); - defineNamedTemplateTypeNameAndDebug(incompressibleLaheyKEpsilon, 0); +#include "Smagorinsky.H" +makeLESModel(Smagorinsky); - addToRunTimeSelectionTable - ( - incompressibleRASModel, - incompressibleLaheyKEpsilon, - dictionary - ); - } +#include "kEqn.H" +makeLESModel(kEqn); - namespace RASModels - { - typedef continuousGasKEpsilon<incompressibleTransportTurbulenceModel> - incompressiblecontinuousGasKEpsilon; +#include "SmagorinskyZhang.H" +makeLESModel(SmagorinskyZhang); - defineNamedTemplateTypeNameAndDebug - ( - incompressiblecontinuousGasKEpsilon, - 0 - ); +#include "NicenoKEqn.H" +makeLESModel(NicenoKEqn); - addToRunTimeSelectionTable - ( - incompressibleRASModel, - incompressiblecontinuousGasKEpsilon, - dictionary - ); - } -} +#include "continuousGasKEqn.H" +makeLESModel(continuousGasKEqn); #include "kineticTheoryModel.H" - -namespace Foam -{ - typedef PhaseIncompressibleTurbulenceModel<phaseModel> - incompressibleTransportTurbulenceModel; - - typedef RASModel<incompressibleTransportTurbulenceModel> - incompressibleRASModel; - - defineTypeNameAndDebug(kineticTheoryModel, 0); - - addToRunTimeSelectionTable - ( - incompressibleRASModel, - kineticTheoryModel, - dictionary - ); -} +makeTurbulenceModel +(phaseModelPhaseIncompressibleTurbulenceModel, RAS, kineticTheoryModel); #include "phasePressureModel.H" - -namespace Foam -{ - typedef PhaseIncompressibleTurbulenceModel<phaseModel> - incompressibleTransportTurbulenceModel; - - typedef RASModel<incompressibleTransportTurbulenceModel> - incompressibleRASModel; - - defineTypeNameAndDebug(phasePressureModel, 0); - - addToRunTimeSelectionTable - ( - incompressibleRASModel, - phasePressureModel, - dictionary - ); -} - - -#include "LESModel.H" -#include "Smagorinsky.H" -#include "SmagorinskyZhang.H" -#include "kEqn.H" -#include "NicenoKEqn.H" -#include "continuousGasKEqn.H" - -namespace Foam -{ - typedef LESModel<incompressibleTransportTurbulenceModel> - incompressibleLESModel; - - defineNamedTemplateTypeNameAndDebug(incompressibleLESModel, 0); - - defineTemplateRunTimeSelectionTable(incompressibleLESModel, dictionary); - - addToRunTimeSelectionTable - ( - basePhaseIncompressibleTransportTurbulenceModel, - incompressibleLESModel, - dictionary - ); - - namespace LESModels - { - typedef Smagorinsky<incompressibleTransportTurbulenceModel> - incompressibleSmagorinsky; - - defineNamedTemplateTypeNameAndDebug(incompressibleSmagorinsky, 0); - - addToRunTimeSelectionTable - ( - incompressibleLESModel, - incompressibleSmagorinsky, - dictionary - ); - } - - namespace LESModels - { - typedef SmagorinskyZhang<incompressibleTransportTurbulenceModel> - incompressibleSmagorinskyZhang; - - defineNamedTemplateTypeNameAndDebug(incompressibleSmagorinskyZhang, 0); - - addToRunTimeSelectionTable - ( - incompressibleLESModel, - incompressibleSmagorinskyZhang, - dictionary - ); - } - - namespace LESModels - { - typedef kEqn<incompressibleTransportTurbulenceModel> - incompressiblekEqn; - - defineNamedTemplateTypeNameAndDebug(incompressiblekEqn, 0); - - addToRunTimeSelectionTable - ( - incompressibleLESModel, - incompressiblekEqn, - dictionary - ); - } - - namespace LESModels - { - typedef NicenoKEqn<incompressibleTransportTurbulenceModel> - incompressibleNicenoKEqn; - - defineNamedTemplateTypeNameAndDebug(incompressibleNicenoKEqn, 0); - - addToRunTimeSelectionTable - ( - incompressibleLESModel, - incompressibleNicenoKEqn, - dictionary - ); - } - - namespace LESModels - { - typedef continuousGasKEqn<incompressibleTransportTurbulenceModel> - incompressiblecontinuousGasKEqn; - - defineNamedTemplateTypeNameAndDebug(incompressiblecontinuousGasKEqn, 0); - - addToRunTimeSelectionTable - ( - incompressibleLESModel, - incompressiblecontinuousGasKEqn, - dictionary - ); - } -} +makeTurbulenceModel +(phaseModelPhaseIncompressibleTurbulenceModel, RAS, phasePressureModel); // ************************************************************************* // diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C index dda70d371483111a4d71c9612d99d9974dca6577..182515d71e15ddb5612fa57168f12eba0419ec62 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C @@ -28,7 +28,7 @@ License // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::phasePressureModel::phasePressureModel +Foam::RASModels::phasePressureModel::phasePressureModel ( const volScalarField& alpha, const geometricOneField& rho, @@ -75,13 +75,13 @@ Foam::phasePressureModel::phasePressureModel // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -Foam::phasePressureModel::~phasePressureModel() +Foam::RASModels::phasePressureModel::~phasePressureModel() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -bool Foam::phasePressureModel::read() +bool Foam::RASModels::phasePressureModel::read() { if ( @@ -105,21 +105,24 @@ bool Foam::phasePressureModel::read() } -Foam::tmp<Foam::volScalarField> Foam::phasePressureModel::k() const +Foam::tmp<Foam::volScalarField> +Foam::RASModels::phasePressureModel::k() const { notImplemented("phasePressureModel::k()"); return nut_; } -Foam::tmp<Foam::volScalarField> Foam::phasePressureModel::epsilon() const +Foam::tmp<Foam::volScalarField> +Foam::RASModels::phasePressureModel::epsilon() const { notImplemented("phasePressureModel::epsilon()"); return nut_; } -Foam::tmp<Foam::volSymmTensorField> Foam::phasePressureModel::R() const +Foam::tmp<Foam::volSymmTensorField> +Foam::RASModels::phasePressureModel::R() const { return tmp<volSymmTensorField> ( @@ -145,7 +148,8 @@ Foam::tmp<Foam::volSymmTensorField> Foam::phasePressureModel::R() const } -Foam::tmp<Foam::volScalarField> Foam::phasePressureModel::pPrime() const +Foam::tmp<Foam::volScalarField> +Foam::RASModels::phasePressureModel::pPrime() const { return g0_ @@ -157,7 +161,8 @@ Foam::tmp<Foam::volScalarField> Foam::phasePressureModel::pPrime() const } -Foam::tmp<Foam::surfaceScalarField> Foam::phasePressureModel::pPrimef() const +Foam::tmp<Foam::surfaceScalarField> +Foam::RASModels::phasePressureModel::pPrimef() const { return g0_ @@ -169,7 +174,8 @@ Foam::tmp<Foam::surfaceScalarField> Foam::phasePressureModel::pPrimef() const } -Foam::tmp<Foam::volSymmTensorField> Foam::phasePressureModel::devRhoReff() const +Foam::tmp<Foam::volSymmTensorField> +Foam::RASModels::phasePressureModel::devRhoReff() const { return tmp<volSymmTensorField> ( @@ -195,7 +201,8 @@ Foam::tmp<Foam::volSymmTensorField> Foam::phasePressureModel::devRhoReff() const } -Foam::tmp<Foam::fvVectorMatrix> Foam::phasePressureModel::divDevRhoReff +Foam::tmp<Foam::fvVectorMatrix> +Foam::RASModels::phasePressureModel::divDevRhoReff ( volVectorField& U ) const @@ -211,7 +218,7 @@ Foam::tmp<Foam::fvVectorMatrix> Foam::phasePressureModel::divDevRhoReff } -void Foam::phasePressureModel::correct() +void Foam::RASModels::phasePressureModel::correct() {} diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/phasePressureModel/phasePressureModel.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/phasePressureModel/phasePressureModel.H index aebdf09014609b12899065078933a6f1d77824a8..6d85be7b654239a5ee5e9eb94837f8ced95a2d5f 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/phasePressureModel/phasePressureModel.H +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/phasePressureModel/phasePressureModel.H @@ -60,6 +60,8 @@ SourceFiles namespace Foam { +namespace RASModels +{ /*---------------------------------------------------------------------------*\ Class phasePressureModel Declaration @@ -179,6 +181,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +} // End namespace RASModels } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/TurbulenceModels/compressible/compressibleTurbulenceModels.C b/src/TurbulenceModels/compressible/compressibleTurbulenceModels.C index 444908bfaeb0b10e143186bdd1ac87f36437e50c..8d1542c22a0d5a0ee6e6044e0cb27ab3ba3b6102 100644 --- a/src/TurbulenceModels/compressible/compressibleTurbulenceModels.C +++ b/src/TurbulenceModels/compressible/compressibleTurbulenceModels.C @@ -26,116 +26,37 @@ License #include "CompressibleTurbulenceModel.H" #include "fluidThermo.H" #include "addToRunTimeSelectionTable.H" - -namespace Foam -{ - typedef TurbulenceModel - < - geometricOneField, - volScalarField, - compressibleTurbulenceModel, - fluidThermo - > baseCompressibleFluidThermoTurbulenceModel; - - defineTemplateRunTimeSelectionTable - ( - baseCompressibleFluidThermoTurbulenceModel, - dictionary - ); - - - typedef CompressibleTurbulenceModel<fluidThermo> - compressibleFluidThermoTurbulenceModel; -} - +#include "makeTurbulenceModel.H" #include "laminar.H" - -namespace Foam -{ - typedef laminar<compressibleFluidThermoTurbulenceModel> compressibleLaminar; - - defineNamedTemplateTypeNameAndDebug(compressibleLaminar, 0); - - addToRunTimeSelectionTable - ( - baseCompressibleFluidThermoTurbulenceModel, - compressibleLaminar, - dictionary - ); -} - - #include "RASModel.H" -#include "kEpsilon.H" - -namespace Foam -{ - typedef RASModel<compressibleFluidThermoTurbulenceModel> - compressibleRASModel; - - defineNamedTemplateTypeNameAndDebug(compressibleRASModel, 0); - - defineTemplateRunTimeSelectionTable(compressibleRASModel, dictionary); - - addToRunTimeSelectionTable - ( - baseCompressibleFluidThermoTurbulenceModel, - compressibleRASModel, - dictionary - ); - - namespace RASModels - { - typedef kEpsilon<compressibleFluidThermoTurbulenceModel> - compressibleKEpsilon; - - defineNamedTemplateTypeNameAndDebug(compressibleKEpsilon, 0); - - addToRunTimeSelectionTable - ( - compressibleRASModel, - compressibleKEpsilon, - dictionary - ); - } -} - - #include "LESModel.H" -#include "Smagorinsky.H" -namespace Foam -{ - typedef LESModel<compressibleFluidThermoTurbulenceModel> - compressibleLESModel; +makeBaseTurbulenceModel +( + geometricOneField, + volScalarField, + compressibleTurbulenceModel, + CompressibleTurbulenceModel, + fluidThermo +); - defineNamedTemplateTypeNameAndDebug(compressibleLESModel, 0); +#define makeRASModel(Type) \ + makeTemplatedTurbulenceModel \ + (fluidThermoCompressibleTurbulenceModel, RAS, Type) - defineTemplateRunTimeSelectionTable(compressibleLESModel, dictionary); +#define makeLESModel(Type) \ + makeTemplatedTurbulenceModel \ + (fluidThermoCompressibleTurbulenceModel, LES, Type) - addToRunTimeSelectionTable - ( - baseCompressibleFluidThermoTurbulenceModel, - compressibleLESModel, - dictionary - ); - - namespace LESModels - { - typedef Smagorinsky<compressibleFluidThermoTurbulenceModel> - compressibleSmagorinsky; +#include "kEpsilon.H" +makeRASModel(kEpsilon); - defineNamedTemplateTypeNameAndDebug(compressibleSmagorinsky, 0); +#include "Smagorinsky.H" +makeLESModel(Smagorinsky); - addToRunTimeSelectionTable - ( - compressibleLESModel, - compressibleSmagorinsky, - dictionary - ); - } -} +#include "kEqn.H" +makeLESModel(kEqn); // ************************************************************************* // diff --git a/src/TurbulenceModels/incompressible/incompressibleTurbulenceModels.C b/src/TurbulenceModels/incompressible/incompressibleTurbulenceModels.C index ab7890ebc6a76bd973d1e472a9c3fe07a9e12696..50a813841e360f81304595ad6ad3f0e4cc6ce0ba 100644 --- a/src/TurbulenceModels/incompressible/incompressibleTurbulenceModels.C +++ b/src/TurbulenceModels/incompressible/incompressibleTurbulenceModels.C @@ -26,136 +26,37 @@ License #include "IncompressibleTurbulenceModel.H" #include "transportModel.H" #include "addToRunTimeSelectionTable.H" - -namespace Foam -{ - typedef TurbulenceModel - < - geometricOneField, - geometricOneField, - incompressibleTurbulenceModel, - transportModel - > baseIncompressibleTransportTurbulenceModel; - - defineTemplateRunTimeSelectionTable - ( - baseIncompressibleTransportTurbulenceModel, - dictionary - ); - - typedef IncompressibleTurbulenceModel - < - transportModel - > incompressibleTransportTurbulenceModel; -} - +#include "makeTurbulenceModel.H" #include "laminar.H" - -namespace Foam -{ - typedef laminar<incompressibleTransportTurbulenceModel> - incompressibleLaminar; - - defineNamedTemplateTypeNameAndDebug(incompressibleLaminar, 0); - - addToRunTimeSelectionTable - ( - baseIncompressibleTransportTurbulenceModel, - incompressibleLaminar, - dictionary - ); -} - - - #include "RASModel.H" -#include "kEpsilon.H" - -namespace Foam -{ - typedef RASModel<incompressibleTransportTurbulenceModel> - incompressibleRASModel; - - defineNamedTemplateTypeNameAndDebug(incompressibleRASModel, 0); - - defineTemplateRunTimeSelectionTable(incompressibleRASModel, dictionary); - - addToRunTimeSelectionTable - ( - baseIncompressibleTransportTurbulenceModel, - incompressibleRASModel, - dictionary - ); - - namespace RASModels - { - typedef kEpsilon<incompressibleTransportTurbulenceModel> - incompressibleKEpsilon; - - defineNamedTemplateTypeNameAndDebug(incompressibleKEpsilon, 0); - - addToRunTimeSelectionTable - ( - incompressibleRASModel, - incompressibleKEpsilon, - dictionary - ); - } -} - - #include "LESModel.H" -#include "Smagorinsky.H" -#include "kEqn.H" - -namespace Foam -{ - typedef LESModel<incompressibleTransportTurbulenceModel> - incompressibleLESModel; - defineNamedTemplateTypeNameAndDebug(incompressibleLESModel, 0); +makeBaseTurbulenceModel +( + geometricOneField, + geometricOneField, + incompressibleTurbulenceModel, + IncompressibleTurbulenceModel, + transportModel +); - defineTemplateRunTimeSelectionTable(incompressibleLESModel, dictionary); +#define makeRASModel(Type) \ + makeTemplatedTurbulenceModel \ + (transportModelIncompressibleTurbulenceModel, RAS, Type) - addToRunTimeSelectionTable - ( - baseIncompressibleTransportTurbulenceModel, - incompressibleLESModel, - dictionary - ); +#define makeLESModel(Type) \ + makeTemplatedTurbulenceModel \ + (transportModelIncompressibleTurbulenceModel, LES, Type) - namespace LESModels - { - typedef Smagorinsky<incompressibleTransportTurbulenceModel> - incompressibleSmagorinsky; - - defineNamedTemplateTypeNameAndDebug(incompressibleSmagorinsky, 0); - - addToRunTimeSelectionTable - ( - incompressibleLESModel, - incompressibleSmagorinsky, - dictionary - ); - } - - - namespace LESModels - { - typedef kEqn<incompressibleTransportTurbulenceModel> - incompressiblekEqn; +#include "kEpsilon.H" +makeRASModel(kEpsilon); - defineNamedTemplateTypeNameAndDebug(incompressiblekEqn, 0); +#include "Smagorinsky.H" +makeLESModel(Smagorinsky); - addToRunTimeSelectionTable - ( - incompressibleLESModel, - incompressiblekEqn, - dictionary - ); - } -} +#include "kEqn.H" +makeLESModel(kEqn); // ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModels/makeTurbulenceModel.H b/src/TurbulenceModels/turbulenceModels/makeTurbulenceModel.H new file mode 100644 index 0000000000000000000000000000000000000000..cea2079b454f52c277fa304294527957b9d06493 --- /dev/null +++ b/src/TurbulenceModels/turbulenceModels/makeTurbulenceModel.H @@ -0,0 +1,126 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#define makeBaseTurbulenceModel(Alpha, Rho, baseModel, BaseModel, Transport) \ + \ + namespace Foam \ + { \ + typedef TurbulenceModel \ + < \ + Alpha, \ + Rho, \ + baseModel, \ + Transport \ + > Transport##baseModel; \ + \ + defineTemplateRunTimeSelectionTable \ + ( \ + Transport##baseModel, \ + dictionary \ + ); \ + \ + typedef BaseModel<Transport> Transport##BaseModel; \ + \ + \ + typedef laminar<Transport##BaseModel> Laminar##Transport##BaseModel; \ + \ + defineNamedTemplateTypeNameAndDebug(Laminar##Transport##BaseModel, 0); \ + \ + addToRunTimeSelectionTable \ + ( \ + Transport##baseModel, \ + Laminar##Transport##BaseModel, \ + dictionary \ + ); \ + \ + \ + typedef RASModel<Transport##BaseModel> RAS##Transport##BaseModel; \ + \ + defineNamedTemplateTypeNameAndDebug(RAS##Transport##BaseModel, 0); \ + \ + defineTemplateRunTimeSelectionTable \ + (RAS##Transport##BaseModel, dictionary); \ + \ + addToRunTimeSelectionTable \ + ( \ + Transport##baseModel, \ + RAS##Transport##BaseModel, \ + dictionary \ + ); \ + \ + \ + typedef LESModel<Transport##BaseModel> LES##Transport##BaseModel; \ + \ + defineNamedTemplateTypeNameAndDebug(LES##Transport##BaseModel, 0); \ + \ + defineTemplateRunTimeSelectionTable \ + (LES##Transport##BaseModel, dictionary); \ + \ + addToRunTimeSelectionTable \ + ( \ + Transport##baseModel, \ + LES##Transport##BaseModel, \ + dictionary \ + ); \ + } + + +#define makeTemplatedTurbulenceModel(BaseModel, SType, Type) \ + namespace Foam \ + { \ + namespace SType##Models \ + { \ + typedef Type<BaseModel> Type##SType##BaseModel; \ + \ + defineNamedTemplateTypeNameAndDebug(Type##SType##BaseModel, 0); \ + \ + addToRunTimeSelectionTable \ + ( \ + SType##BaseModel, \ + Type##SType##BaseModel, \ + dictionary \ + ); \ + } \ + } + + +#define makeTurbulenceModel(BaseModel, SType, Type) \ + namespace Foam \ + { \ + namespace SType##Models \ + { \ + defineTypeNameAndDebug(Type, 0); \ + \ + addToRunTimeSelectionTable \ + ( \ + SType##BaseModel, \ + Type, \ + dictionary \ + ); \ + } \ + } + + +// ************************************************************************* //