Commit 6b074985 authored by Mark Olesen's avatar Mark Olesen
Browse files

ENH: improve separation of turbulence models macros (define vs make)

parent 65d9cd50
......@@ -36,7 +36,7 @@ License
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makeTurbulenceModelTypes
defineTurbulenceModelTypes
(
volScalarField,
geometricOneField,
......
......@@ -33,7 +33,9 @@ License
#include "turbulentTransportModel.H"
#include "LESModel.H"
makeTurbulenceModelTypes
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
defineTurbulenceModelTypes
(
volScalarField,
geometricOneField,
......
......@@ -39,7 +39,7 @@ License
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makeTurbulenceModelTypes
defineTurbulenceModelTypes
(
volScalarField,
volScalarField,
......@@ -71,22 +71,38 @@ makeBaseTurbulenceModel
makeTemplatedTurbulenceModel \
(fluidThermoPhaseCompressibleTurbulenceModel, LES, Type)
// -------------------------------------------------------------------------- //
// Laminar models
// -------------------------------------------------------------------------- //
#include "Stokes.H"
makeLaminarModel(Stokes);
#include "Maxwell.H"
makeLaminarModel(Maxwell);
// -------------------------------------------------------------------------- //
// RAS models
// -------------------------------------------------------------------------- //
#include "kEpsilon.H"
makeRASModel(kEpsilon);
#include "kOmegaSST.H"
makeRASModel(kOmegaSST);
// -------------------------------------------------------------------------- //
// LES models
// -------------------------------------------------------------------------- //
#include "Smagorinsky.H"
makeLESModel(Smagorinsky);
#include "kEqn.H"
makeLESModel(kEqn);
// ************************************************************************* //
......@@ -36,7 +36,7 @@ License
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makeTurbulenceModelTypes
defineTurbulenceModelTypes
(
geometricOneField,
volScalarField,
......@@ -78,15 +78,29 @@ makeBaseTurbulenceModel
Type \
)
// -------------------------------------------------------------------------- //
// Laminar models
// -------------------------------------------------------------------------- //
#include "Stokes.H"
makeLaminarModel(Stokes);
// -------------------------------------------------------------------------- //
// RAS models
// -------------------------------------------------------------------------- //
#include "kEpsilon.H"
makeRASModel(kEpsilon);
#include "buoyantKEpsilon.H"
makeRASModel(buoyantKEpsilon);
// -------------------------------------------------------------------------- //
// LES models
// -------------------------------------------------------------------------- //
#include "Smagorinsky.H"
makeLESModel(Smagorinsky);
......
......@@ -37,6 +37,18 @@ License
#include "RASModel.H"
#include "LESModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
defineTurbulenceModelTypes
(
geometricOneField,
volScalarField,
compressibleTurbulenceModel,
CompressibleTurbulenceModel,
ThermalDiffusivity,
multiphaseSystem
);
makeBaseTurbulenceModel
(
geometricOneField,
......@@ -59,16 +71,32 @@ makeBaseTurbulenceModel
makeTemplatedTurbulenceModel \
(multiphaseSystemCompressibleTurbulenceModel, LES, Type)
// -------------------------------------------------------------------------- //
// Laminar models
// -------------------------------------------------------------------------- //
#include "Stokes.H"
makeLaminarModel(Stokes);
// -------------------------------------------------------------------------- //
// RAS models
// -------------------------------------------------------------------------- //
#include "kEpsilon.H"
makeRASModel(kEpsilon);
// -------------------------------------------------------------------------- //
// LES models
// -------------------------------------------------------------------------- //
#include "Smagorinsky.H"
makeLESModel(Smagorinsky);
#include "kEqn.H"
makeLESModel(kEqn);
// ************************************************************************* //
......@@ -40,7 +40,7 @@ License
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makeTurbulenceModelTypes
defineTurbulenceModelTypes
(
volScalarField,
volScalarField,
......@@ -72,9 +72,19 @@ makeBaseTurbulenceModel
makeTemplatedTurbulenceModel \
(phaseModelPhaseCompressibleTurbulenceModel, LES, Type)
// -------------------------------------------------------------------------- //
// Laminar models
// -------------------------------------------------------------------------- //
#include "Stokes.H"
makeLaminarModel(Stokes);
// -------------------------------------------------------------------------- //
// RAS models
// -------------------------------------------------------------------------- //
#include "kEpsilon.H"
makeRASModel(kEpsilon);
......@@ -93,6 +103,11 @@ makeRASModel(LaheyKEpsilon);
#include "continuousGasKEpsilon.H"
makeRASModel(continuousGasKEpsilon);
// -------------------------------------------------------------------------- //
// LES models
// -------------------------------------------------------------------------- //
#include "Smagorinsky.H"
makeLESModel(Smagorinsky);
......@@ -108,6 +123,11 @@ makeLESModel(NicenoKEqn);
#include "continuousGasKEqn.H"
makeLESModel(continuousGasKEqn);
// -------------------------------------------------------------------------- //
// Additional models
// -------------------------------------------------------------------------- //
#include "kineticTheoryModel.H"
makeTurbulenceModel
(phaseModelPhaseCompressibleTurbulenceModel, RAS, kineticTheoryModel);
......@@ -116,4 +136,5 @@ makeTurbulenceModel
makeTurbulenceModel
(phaseModelPhaseCompressibleTurbulenceModel, RAS, phasePressureModel);
// ************************************************************************* //
......@@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2015-2016 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -29,48 +30,52 @@ License
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define makeTurbulenceModelTypes( \
//- Define turbulence model typedefs, with EddyDiffusivity
#define defineTurbulenceModelTypes( \
Alpha, Rho, baseModel, BaseModel, TDModel, Transport) \
\
namespace Foam \
{ \
typedef TurbulenceModel \
< \
Alpha, \
Rho, \
baseModel, \
Transport \
> Transport##baseModel; \
\
typedef TDModel<BaseModel<Transport>> \
Transport##BaseModel; \
\
typedef laminarModel<Transport##BaseModel> \
laminar##Transport##BaseModel; \
\
typedef RASModel<EddyDiffusivity<Transport##BaseModel>> \
RAS##Transport##BaseModel; \
\
typedef LESModel<EddyDiffusivity<Transport##BaseModel>> \
LES##Transport##BaseModel; \
}
// Legacy name
#define makeTurbulenceModelTypes(a, b, c, d, e, f) \
defineTurbulenceModelTypes(a, b, c, d, e, f)
#define makeBaseTurbulenceModel( \
Alpha, Rho, baseModel, BaseModel, TDModel, Transport) \
\
/* Uses previously defined typedefs */ \
namespace Foam \
{ \
typedef TurbulenceModel \
< \
Alpha, \
Rho, \
baseModel, \
Transport \
> Transport##baseModel; \
\
/* Turbulence selection table */ \
defineTemplateRunTimeSelectionTable \
( \
Transport##baseModel, \
dictionary \
); \
\
typedef TDModel<BaseModel<Transport>> \
Transport##BaseModel; \
\
\
typedef laminarModel<Transport##BaseModel> \
laminar##Transport##BaseModel; \
\
/* Laminar models */ \
defineNamedTemplateTypeNameAndDebug(laminar##Transport##BaseModel, 0); \
\
defineTemplateRunTimeSelectionTable \
......@@ -83,10 +88,7 @@ License
dictionary \
); \
\
\
typedef RASModel<EddyDiffusivity<Transport##BaseModel>> \
RAS##Transport##BaseModel; \
\
/* RAS models */ \
defineNamedTemplateTypeNameAndDebug(RAS##Transport##BaseModel, 0); \
\
defineTemplateRunTimeSelectionTable \
......@@ -100,9 +102,7 @@ License
); \
\
\
typedef LESModel<EddyDiffusivity<Transport##BaseModel>> \
LES##Transport##BaseModel; \
\
/* LES model types */ \
defineNamedTemplateTypeNameAndDebug(LES##Transport##BaseModel, 0); \
\
defineTemplateRunTimeSelectionTable \
......@@ -139,7 +139,7 @@ License
#define makeTemplatedTurbulenceModel(BaseModel, SType, Type) \
typedef Foam::SType##Models::Type<Foam::EddyDiffusivity<Foam::BaseModel>> \
typedef Foam::SType##Models::Type<Foam::EddyDiffusivity<Foam::BaseModel>> \
Type##SType##BaseModel; \
defineNamedTemplateTypeNameAndDebug(Type##SType##BaseModel, 0); \
\
......
......@@ -29,6 +29,16 @@ License
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
defineTurbulenceModelTypes
(
geometricOneField,
volScalarField,
compressibleTurbulenceModel,
CompressibleTurbulenceModel,
ThermalDiffusivity,
fluidThermo
);
makeBaseTurbulenceModel
(
geometricOneField,
......
......@@ -29,6 +29,15 @@ License
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
defineTurbulenceModelTypes
(
geometricOneField,
geometricOneField,
incompressibleTurbulenceModel,
IncompressibleTurbulenceModel,
transportModel
);
makeBaseTurbulenceModel
(
geometricOneField,
......
......@@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2013-2016 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -25,37 +26,52 @@ License
\*---------------------------------------------------------------------------*/
#define makeTurbulenceModelTypes(Alpha, Rho, baseModel, BaseModel, Transport) \
//- Define turbulence model typedefs, with EddyDiffusivity
#define defineTurbulenceModelTypes( \
Alpha, Rho, baseModel, BaseModel, Transport) \
\
namespace Foam \
{ \
typedef BaseModel<Transport> Transport##BaseModel; \
typedef TurbulenceModel \
< \
Alpha, \
Rho, \
baseModel, \
Transport \
> Transport##baseModel; \
\
typedef BaseModel<Transport> \
Transport##BaseModel; \
\
typedef laminarModel<Transport##BaseModel> \
laminar##Transport##BaseModel; \
typedef RASModel<Transport##BaseModel> RAS##Transport##BaseModel; \
typedef LESModel<Transport##BaseModel> LES##Transport##BaseModel; \
\
typedef RASModel<Transport##BaseModel> \
RAS##Transport##BaseModel; \
\
typedef LESModel<Transport##BaseModel> \
LES##Transport##BaseModel; \
}
// Legacy name
#define makeTurbulenceModelTypes(a, b, c, d, e) \
defineTurbulenceModelTypes(a, b, c, d, e)
#define makeBaseTurbulenceModel(Alpha, Rho, baseModel, BaseModel, Transport) \
/* Turbulence typedefs */ \
defineTurbulenceModelTypes(Alpha, Rho, baseModel, BaseModel, Transport) \
\
namespace Foam \
{ \
typedef TurbulenceModel \
< \
Alpha, \
Rho, \
baseModel, \
Transport \
> Transport##baseModel; \
\
/* Turbulence selection table */ \
defineTemplateRunTimeSelectionTable \
( \
Transport##baseModel, \
dictionary \
); \
\
\
/* Laminar models */ \
defineNamedTemplateTypeNameAndDebug(laminar##Transport##BaseModel, 0); \
\
defineTemplateRunTimeSelectionTable \
......@@ -68,7 +84,7 @@ License
dictionary \
); \
\
\
/* RAS models */ \
defineNamedTemplateTypeNameAndDebug(RAS##Transport##BaseModel, 0); \
\
defineTemplateRunTimeSelectionTable \
......@@ -81,7 +97,7 @@ License
dictionary \
); \
\
\
/* LES models */ \
defineNamedTemplateTypeNameAndDebug(LES##Transport##BaseModel, 0); \
\
defineTemplateRunTimeSelectionTable \
......
......@@ -35,7 +35,7 @@ License
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makeTurbulenceModelTypes
defineTurbulenceModelTypes
(
volScalarField,
volScalarField,
......@@ -67,15 +67,30 @@ makeBaseTurbulenceModel
makeTemplatedTurbulenceModel \
(phaseModelPhaseCompressibleTurbulenceModel, LES, Type)
// -------------------------------------------------------------------------- //
// Laminar models
// -------------------------------------------------------------------------- //
#include "Stokes.H"
makeLaminarModel(Stokes);
// -------------------------------------------------------------------------- //
// RAS models
// -------------------------------------------------------------------------- //
#include "kEpsilon.H"
makeRASModel(kEpsilon);
#include "kOmegaSST.H"
makeRASModel(kOmegaSST);
// -------------------------------------------------------------------------- //
// LES models
// -------------------------------------------------------------------------- //
#include "Smagorinsky.H"
makeLESModel(Smagorinsky);
......
......@@ -35,7 +35,7 @@ License
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makeTurbulenceModelTypes
defineTurbulenceModelTypes
(
volScalarField,
volScalarField,
......@@ -67,9 +67,19 @@ makeBaseTurbulenceModel
makeTemplatedTurbulenceModel \
(phaseModelPhaseCompressibleTurbulenceModel, LES, Type)
// -------------------------------------------------------------------------- //
// Laminar models
// -------------------------------------------------------------------------- //
#include "Stokes.H"
makeLaminarModel(Stokes);
// -------------------------------------------------------------------------- //
// RAS models
// -------------------------------------------------------------------------- //
#include "kEpsilon.H"
makeRASModel(kEpsilon);
......@@ -94,6 +104,11 @@ makeLESModel(Smagorinsky);
#include "kEqn.H"
makeLESModel(kEqn);
// -------------------------------------------------------------------------- //
// LES models
// -------------------------------------------------------------------------- //
#include "SmagorinskyZhang.H"
makeLESModel(SmagorinskyZhang);
......@@ -103,6 +118,11 @@ makeLESModel(NicenoKEqn);
#include "continuousGasKEqn.H"
makeLESModel(continuousGasKEqn);
// -------------------------------------------------------------------------- //
// Additional models
// -------------------------------------------------------------------------- //
#include "kineticTheoryModel.H"
makeTurbulenceModel
(phaseModelPhaseCompressibleTurbulenceModel, RAS, kineticTheoryModel);
......@@ -111,4 +131,5 @@ makeTurbulenceModel
makeTurbulenceModel
(phaseModelPhaseCompressibleTurbulenceModel, RAS, phasePressureModel);
// ************************************************************************* //
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment