TurbulenceModels: Refactored to transfer all heat and specie transport to the new ThermophysicalTransportModels library

This provides an extensible and run-time selectable framework to support complex
energy and specie transport models, in particular multi-component diffusion.
Currently only the Fourier for laminar and eddyDiffusivity for RAS and LES
turbulent flows are provided but the interface is general and the set of models
will be expanded in the near future.
This commit is contained in:
Henry Weller
2020-04-12 10:35:52 +01:00
parent 25b34809c7
commit 08e686eb18
82 changed files with 245 additions and 975 deletions

View File

@ -11,7 +11,8 @@ EXE_INC = \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
-I$(LIB_SRC)/ThermophysicalTransportModels/lnInclude
LIB_LIBS = \
-lfiniteVolume \
@ -22,6 +23,7 @@ LIB_LIBS = \
-lcompressibleTransportModels \
-lincompressibleTurbulenceModels \
-lcompressibleTurbulenceModels \
-lthermophysicalTransportModels \
-lmeshTools \
-lsurfMesh \
-llagrangian \

View File

@ -25,7 +25,7 @@ License
#include "turbulenceFields.H"
#include "turbulentTransportModel.H"
#include "turbulentFluidThermoModel.H"
#include "thermophysicalTransportModel.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -49,7 +49,7 @@ template<>
const char* Foam::NamedEnum
<
Foam::functionObjects::turbulenceFields::compressibleField,
9
8
>::names[] =
{
"k",
@ -57,7 +57,6 @@ const char* Foam::NamedEnum
"omega",
"mut",
"muEff",
"alphat",
"alphaEff",
"R",
"devRhoReff"
@ -66,7 +65,7 @@ const char* Foam::NamedEnum
const Foam::NamedEnum
<
Foam::functionObjects::turbulenceFields::compressibleField,
9
8
> Foam::functionObjects::turbulenceFields::compressibleFieldNames_;
template<>
@ -163,10 +162,15 @@ bool Foam::functionObjects::turbulenceFields::read(const dictionary& dict)
bool Foam::functionObjects::turbulenceFields::execute()
{
if (obr_.foundObject<compressible::turbulenceModel>(modelName()))
if (obr_.foundObject<thermophysicalTransportModel>(modelName()))
{
const compressible::turbulenceModel& model =
obr_.lookupObject<compressible::turbulenceModel>(modelName());
const thermophysicalTransportModel& ttm =
obr_.lookupObject<thermophysicalTransportModel>
(
thermophysicalTransportModel::typeName
);
const compressibleTurbulenceModel& model = ttm.momentumTransport();
forAllConstIter(wordHashSet, fieldSet_, iter)
{
@ -198,14 +202,9 @@ bool Foam::functionObjects::turbulenceFields::execute()
processField<scalar>(f, model.muEff());
break;
}
case compressibleField::alphat:
{
processField<scalar>(f, model.alphat());
break;
}
case compressibleField::alphaEff:
{
processField<scalar>(f, model.alphaEff());
processField<scalar>(f, ttm.alphaEff());
break;
}
case compressibleField::R:

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2013-2019 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -114,12 +114,11 @@ public:
omega,
mut,
muEff,
alphat,
alphaEff,
R,
devRhoReff
};
static const NamedEnum<compressibleField, 9> compressibleFieldNames_;
static const NamedEnum<compressibleField, 8> compressibleFieldNames_;
enum class incompressibleField
{

View File

@ -24,7 +24,7 @@ License
\*---------------------------------------------------------------------------*/
#include "wallHeatFlux.H"
#include "turbulentFluidThermoModel.H"
#include "thermophysicalTransportModel.H"
#include "solidThermo.H"
#include "surfaceInterpolate.H"
#include "fvcSnGrad.H"
@ -202,22 +202,22 @@ bool Foam::functionObjects::wallHeatFlux::execute()
if
(
foundObject<compressible::turbulenceModel>
foundObject<thermophysicalTransportModel>
(
turbulenceModel::typeName
thermophysicalTransportModel::typeName
)
)
{
const compressible::turbulenceModel& turbModel =
lookupObject<compressible::turbulenceModel>
const thermophysicalTransportModel& ttm =
lookupObject<thermophysicalTransportModel>
(
turbulenceModel::typeName
thermophysicalTransportModel::typeName
);
return store
(
name,
calcWallHeatFlux(turbModel.alphaEff(), turbModel.transport().he())
calcWallHeatFlux(ttm.alphaEff(), ttm.thermo().he())
);
}
else if (foundObject<solidThermo>(solidThermo::dictName))