diff --git a/etc/codeTemplates/dynamicCode/solidThermo b/etc/codeTemplates/dynamicCode/solidThermo new file mode 100644 index 0000000000..8f250350a2 --- /dev/null +++ b/etc/codeTemplates/dynamicCode/solidThermo @@ -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 +#}; + + +// ************************************************************************* // diff --git a/etc/codeTemplates/dynamicCode/solidThermoTemplate.C b/etc/codeTemplates/dynamicCode/solidThermoTemplate.C new file mode 100644 index 0000000000..38780bd82b --- /dev/null +++ b/etc/codeTemplates/dynamicCode/solidThermoTemplate.C @@ -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 . + +\*---------------------------------------------------------------------------*/ + +#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} + ); +} + +// ************************************************************************* // diff --git a/src/thermophysicalModels/solidSpecie/transport/const/constIsoSolidTransport.H b/src/thermophysicalModels/solidSpecie/transport/const/constIsoSolidTransport.H index 60a4764443..d69688511e 100644 --- a/src/thermophysicalModels/solidSpecie/transport/const/constIsoSolidTransport.H +++ b/src/thermophysicalModels/solidSpecie/transport/const/constIsoSolidTransport.H @@ -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 diff --git a/src/thermophysicalModels/solidSpecie/transport/exponential/exponentialSolidTransport.H b/src/thermophysicalModels/solidSpecie/transport/exponential/exponentialSolidTransport.H index da248108b9..5653579f87 100644 --- a/src/thermophysicalModels/solidSpecie/transport/exponential/exponentialSolidTransport.H +++ b/src/thermophysicalModels/solidSpecie/transport/exponential/exponentialSolidTransport.H @@ -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 diff --git a/src/thermophysicalModels/solidSpecie/transport/polynomial/polynomialSolidTransport.H b/src/thermophysicalModels/solidSpecie/transport/polynomial/polynomialSolidTransport.H index 5b9a6397f0..104b20a56a 100644 --- a/src/thermophysicalModels/solidSpecie/transport/polynomial/polynomialSolidTransport.H +++ b/src/thermophysicalModels/solidSpecie/transport/polynomial/polynomialSolidTransport.H @@ -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 diff --git a/src/thermophysicalModels/solidThermo/makeSolidThermo.H b/src/thermophysicalModels/solidThermo/makeSolidThermo.H index 9c4064af67..dcd2112741 100644 --- a/src/thermophysicalModels/solidThermo/makeSolidThermo.H +++ b/src/thermophysicalModels/solidThermo/makeSolidThermo.H @@ -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) \ diff --git a/tutorials/compressible/rhoPimpleFoam/laminar/blockedChannel/constant/physicalProperties.solid b/tutorials/compressible/rhoPimpleFoam/laminar/blockedChannel/constant/physicalProperties.solid index d614742240..124c36b412 100644 --- a/tutorials/compressible/rhoPimpleFoam/laminar/blockedChannel/constant/physicalProperties.solid +++ b/tutorials/compressible/rhoPimpleFoam/laminar/blockedChannel/constant/physicalProperties.solid @@ -18,7 +18,7 @@ thermoType { type heSolidThermo; mixture pureMixture; - transport constIso; + transport constIsoSolid; thermo eConst; equationOfState rhoConst; specie specie; diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/constant/baffle3DRegion/physicalProperties b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/constant/baffle3DRegion/physicalProperties index 07b8c8f677..c60b853b0b 100644 --- a/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/constant/baffle3DRegion/physicalProperties +++ b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/constant/baffle3DRegion/physicalProperties @@ -19,7 +19,7 @@ thermoType { type heSolidThermo; mixture pureMixture; - transport constIso; + transport constIsoSolid; thermo eConst; equationOfState rhoConst; specie specie; diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/constant/solid/physicalProperties b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/constant/solid/physicalProperties index b2aa92fd19..5b632dd727 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/constant/solid/physicalProperties +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/constant/solid/physicalProperties @@ -17,7 +17,7 @@ thermoType { type heSolidThermo; mixture pureMixture; - transport constIso; + transport constIsoSolid; thermo eConst; equationOfState rhoConst; specie specie; diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/materials/aluminium/physicalProperties b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/materials/aluminium/physicalProperties index 9bccdba254..e392b87354 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/materials/aluminium/physicalProperties +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/materials/aluminium/physicalProperties @@ -17,7 +17,7 @@ thermoType { type heSolidThermo; mixture pureMixture; - transport constIso; + transport constIsoSolid; thermo eConst; equationOfState rhoConst; specie specie; diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/materials/copper/physicalProperties b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/materials/copper/physicalProperties index b2aa92fd19..5b632dd727 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/materials/copper/physicalProperties +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/materials/copper/physicalProperties @@ -17,7 +17,7 @@ thermoType { type heSolidThermo; mixture pureMixture; - transport constIso; + transport constIsoSolid; thermo eConst; equationOfState rhoConst; specie specie; diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/heatedDuct/constant/heater/physicalProperties b/tutorials/heatTransfer/chtMultiRegionFoam/heatedDuct/constant/heater/physicalProperties index 732ea54300..01c09c67b8 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/heatedDuct/constant/heater/physicalProperties +++ b/tutorials/heatTransfer/chtMultiRegionFoam/heatedDuct/constant/heater/physicalProperties @@ -18,7 +18,7 @@ thermoType { type heSolidThermo; mixture pureMixture; - transport constIso; + transport constIsoSolid; thermo eConst; equationOfState rhoConst; specie specie; diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/heatedDuct/constant/metal/physicalProperties b/tutorials/heatTransfer/chtMultiRegionFoam/heatedDuct/constant/metal/physicalProperties index b088323c56..d1f1bdeacf 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/heatedDuct/constant/metal/physicalProperties +++ b/tutorials/heatTransfer/chtMultiRegionFoam/heatedDuct/constant/metal/physicalProperties @@ -18,7 +18,7 @@ thermoType { type heSolidThermo; mixture pureMixture; - transport constIso; + transport constIsoSolid; thermo eConst; equationOfState rhoConst; specie specie; diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/reverseBurner/constant/solid/physicalProperties b/tutorials/heatTransfer/chtMultiRegionFoam/reverseBurner/constant/solid/physicalProperties index 0c72a0b80f..a1ea384c1c 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/reverseBurner/constant/solid/physicalProperties +++ b/tutorials/heatTransfer/chtMultiRegionFoam/reverseBurner/constant/solid/physicalProperties @@ -17,7 +17,7 @@ thermoType { type heSolidThermo; mixture pureMixture; - transport constIso; + transport constIsoSolid; thermo eConst; equationOfState rhoConst; specie specie; diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/shellAndTubeHeatExchanger/constant/solid/physicalProperties b/tutorials/heatTransfer/chtMultiRegionFoam/shellAndTubeHeatExchanger/constant/solid/physicalProperties index 6934c2fce9..7efe54a57c 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/shellAndTubeHeatExchanger/constant/solid/physicalProperties +++ b/tutorials/heatTransfer/chtMultiRegionFoam/shellAndTubeHeatExchanger/constant/solid/physicalProperties @@ -18,7 +18,7 @@ thermoType { type heSolidThermo; mixture pureMixture; - transport constIso; + transport constIsoSolid; thermo eConst; equationOfState rhoConst; specie specie;