solidThermo: Added support for run-time compilation

This required standardisation of the mapping between the class and selection
names of the solid transport models:

constIso -> constIsoSolid
exponential -> exponentialSolid
polynomial -> polynomialSolid
This commit is contained in:
Henry Weller
2021-09-22 14:39:18 +01:00
parent 59a91e28f1
commit 1ca8ff74a9
15 changed files with 184 additions and 16 deletions

View File

@ -0,0 +1,76 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
format ascii;
class dictionary;
object solidThermo;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
type
(
heSolidThermo
);
typeBase
(
heSolidThermo solidThermo
);
energy
(
sensibleInternalEnergy
);
mixture
(
pureMixture
);
transport
(
constIsoSolid
constAnIsoSolid
exponentialSolid
polynomialSolid
);
thermo
(
eConst
ePolynomial
ePower
eIcoTabulated
);
equationOfState
(
rhoConst
);
specie
(
specie
);
codeOptions
#{
EXE_INC = \
-I$(LIB_SRC)/physicalProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidSpecie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude
#};
// ************************************************************************* //

View File

@ -0,0 +1,92 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) YEAR 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/>.
\*---------------------------------------------------------------------------*/
#include "forThermo.H"
#include "makeSolidThermo.H"
#include "${specie}.H"
#include "thermo.H"
// EoS
#include "${equationOfState}.H"
// Thermo
#include "${thermo}Thermo.H"
#include "${energy}.H"
// Transport
#include "${transport}Transport.H"
// psi/rho
#include "${typeBase}.H"
#include "${type}.H"
// Mixture
#include "${mixture}.H"
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
extern "C"
{
// dynamicCode:
// SHA1 = ${SHA1sum}
//
// Unique function name that can be checked if the correct library version
// has been loaded
void ${typeName}_${SHA1sum}(bool load)
{
if (load)
{
// code that can be explicitly executed after loading
}
else
{
// code that can be explicitly executed before unloading
}
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
forThermo
(
${transport}Transport,
${energy},
${thermo}Thermo,
${equationOfState},
${specie},
makeSolidThermo,
${typeBase},
${type},
${mixture}
);
}
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -112,7 +112,7 @@ public:
//- Return the instantiated type name
static word typeName()
{
return "constIso<" + Thermo::typeName() + '>';
return "constIsoSolid<" + Thermo::typeName() + '>';
}
//- Is the thermal conductivity isotropic

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -121,7 +121,7 @@ public:
//- Return the instantiated type name
static word typeName()
{
return "exponential<" + Thermo::typeName() + '>';
return "exponentialSolid<" + Thermo::typeName() + '>';
}
//- Is the thermal conductivity isotropic

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-2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -152,7 +152,7 @@ public:
//- Return the instantiated type name
static word typeName()
{
return "polynomial<" + Thermo::typeName() + '>';
return "polynomialSolid<" + Thermo::typeName() + '>';
}
//- Is the thermal conductivity isotropic

View File

@ -79,7 +79,7 @@ Description
\
defineSolidThermo(BaseThermo, CThermo, Mixture, ThermoPhys); \
\
addSolidThermo(BaseThermo, CThermo##Mixture##ThermoPhys, fvMesh
addSolidThermo(BaseThermo, CThermo##Mixture##ThermoPhys, fvMesh);
#define makeSolidThermos(BaseThermo, CThermo, Mixture, ThermoPhys) \

View File

@ -18,7 +18,7 @@ thermoType
{
type heSolidThermo;
mixture pureMixture;
transport constIso;
transport constIsoSolid;
thermo eConst;
equationOfState rhoConst;
specie specie;

View File

@ -19,7 +19,7 @@ thermoType
{
type heSolidThermo;
mixture pureMixture;
transport constIso;
transport constIsoSolid;
thermo eConst;
equationOfState rhoConst;
specie specie;

View File

@ -17,7 +17,7 @@ thermoType
{
type heSolidThermo;
mixture pureMixture;
transport constIso;
transport constIsoSolid;
thermo eConst;
equationOfState rhoConst;
specie specie;

View File

@ -17,7 +17,7 @@ thermoType
{
type heSolidThermo;
mixture pureMixture;
transport constIso;
transport constIsoSolid;
thermo eConst;
equationOfState rhoConst;
specie specie;

View File

@ -17,7 +17,7 @@ thermoType
{
type heSolidThermo;
mixture pureMixture;
transport constIso;
transport constIsoSolid;
thermo eConst;
equationOfState rhoConst;
specie specie;

View File

@ -18,7 +18,7 @@ thermoType
{
type heSolidThermo;
mixture pureMixture;
transport constIso;
transport constIsoSolid;
thermo eConst;
equationOfState rhoConst;
specie specie;

View File

@ -18,7 +18,7 @@ thermoType
{
type heSolidThermo;
mixture pureMixture;
transport constIso;
transport constIsoSolid;
thermo eConst;
equationOfState rhoConst;
specie specie;

View File

@ -17,7 +17,7 @@ thermoType
{
type heSolidThermo;
mixture pureMixture;
transport constIso;
transport constIsoSolid;
thermo eConst;
equationOfState rhoConst;
specie specie;

View File

@ -18,7 +18,7 @@ thermoType
{
type heSolidThermo;
mixture pureMixture;
transport constIso;
transport constIsoSolid;
thermo eConst;
equationOfState rhoConst;
specie specie;