Commit 20220a26 authored by Henry's avatar Henry
Browse files

TurbulenceModels: New macros to instantiate models

parent bb8be32f
......@@ -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));
......
......@@ -61,6 +61,8 @@ SourceFiles
namespace Foam
{
namespace RASModels
{
/*---------------------------------------------------------------------------*\
Class kineticTheoryModel Declaration
......@@ -212,6 +214,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace RASModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
......@@ -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);
// ************************************************************************* //
......@@ -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()
{}
......
......@@ -60,6 +60,8 @@ SourceFiles
namespace Foam
{
namespace RASModels
{
/*---------------------------------------------------------------------------*\
Class phasePressureModel Declaration
......@@ -179,6 +181,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace RASModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
......@@ -26,116 +26,37 @@ License
#include "CompressibleTurbulenceModel.H"
#include "fluidThermo.H"
#include "addToRunTimeSelectionTable.H"
namespace Foam
{
typedef TurbulenceModel
<
geometricOneField,
volScalarField,
compressibleTurbulenceModel,
fluidThermo
> baseCompressibleFluidThermoTurbulenceModel;
defineTemplateRunTimeSelectionTable