diff --git a/src/thermophysicalModels/solidSpecie/transport/tabulated/tabulatedSolidTransport.C b/src/thermophysicalModels/solidSpecie/transport/tabulated/tabulatedSolidTransport.C new file mode 100644 index 0000000000000000000000000000000000000000..215b9e595151f0865387bffc3c06ede1ef883e9b --- /dev/null +++ b/src/thermophysicalModels/solidSpecie/transport/tabulated/tabulatedSolidTransport.C @@ -0,0 +1,78 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | www.openfoam.com + \\/ M anipulation | +------------------------------------------------------------------------------- + Copyright (C) 2020 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. +------------------------------------------------------------------------------- +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 "tabulatedSolidTransport.H" +#include "IOstreams.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class Thermo> +Foam::tabulatedSolidTransport<Thermo>::tabulatedSolidTransport +( + const dictionary& dict +) +: + Thermo(dict), + kappa_("kappa", dict.subDict("transport")) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class Thermo> +void Foam::tabulatedSolidTransport<Thermo>::write(Ostream& os) const +{ + os.beginBlock(this->name()); + + Thermo::write(os); + + { + os.beginBlock("transport"); + os.writeEntry("kappa", kappa_.values()); + os.endBlock(); + } + + os.endBlock(); +} + + +// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // + +template<class Thermo> +Foam::Ostream& Foam::operator<< +( + Ostream& os, + const tabulatedSolidTransport<Thermo>& pt +) +{ + pt.write(os); + return os; +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/solidSpecie/transport/tabulated/tabulatedSolidTransport.H b/src/thermophysicalModels/solidSpecie/transport/tabulated/tabulatedSolidTransport.H new file mode 100644 index 0000000000000000000000000000000000000000..f0e9d27365b059be258496765b2baa4a57fbd771 --- /dev/null +++ b/src/thermophysicalModels/solidSpecie/transport/tabulated/tabulatedSolidTransport.H @@ -0,0 +1,177 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | www.openfoam.com + \\/ M anipulation | +------------------------------------------------------------------------------- + Copyright (C) 2022 OpenCFD Ltd +------------------------------------------------------------------------------- +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/>. + +Class + Foam::tabulatedSolidTransport + +Description + Transport properties package using non-uniform tabulated data for + thermal conductivity vs temperature. + +Usage + + \table + Property | Description + kappa | Thermal conductivity vs temperature table + \endtable + + Example of the specification of the transport properties: + \verbatim + transport + { + kappa + ( + (200 2.56e-5) + (350 3.33e-5) + (400 4.72e-5) + ); + } + \endverbatim + +SourceFiles + tabulatedSolidTransportI.H + tabulatedSolidTransport.C + +See also + Foam::thermophysicalFunctions::nonUniformTable + +\*---------------------------------------------------------------------------*/ + +#ifndef tabulatedSolidTransport_H +#define tabulatedSolidTransport_H + +#include "nonUniformTableThermophysicalFunction.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward Declarations +template<class Thermo> class tabulatedSolidTransport; + +template<class Thermo> +Ostream& operator<<(Ostream&, const tabulatedSolidTransport<Thermo>&); + + +/*---------------------------------------------------------------------------*\ + Class tabulatedSolidTransport Declaration +\*---------------------------------------------------------------------------*/ + +template<class Thermo> +class tabulatedSolidTransport +: + public Thermo +{ + // Private Data + + //- Thermal conductivity table [W/m/K] + nonUniformTable kappa_; + + + // Private Member Functions + + //- Construct from components + inline tabulatedSolidTransport + ( + const Thermo& t, + const nonUniformTable& kappaPoly + ); + + +public: + + // Constructors + + //- Construct as named copy + inline tabulatedSolidTransport(const word&, const tabulatedSolidTransport&); + + //- Construct from dictionary + explicit tabulatedSolidTransport(const dictionary& dict); + + //- Return a clone + inline autoPtr<tabulatedSolidTransport> clone() const; + + // Selector from dictionary + inline static autoPtr<tabulatedSolidTransport> New + ( + const dictionary& dict + ); + + + // Member Functions + + //- The instantiated type name + static word typeName() + { + return "tabulated<" + Thermo::typeName() + '>'; + } + + //- Is the thermal conductivity isotropic + static const bool isotropic = true; + + //- Dynamic viscosity [kg/m/s] + inline scalar mu(const scalar p, const scalar T) const; + + //- Thermal conductivity [W/m/K] + inline scalar kappa(const scalar p, const scalar T) const; + + //- Thermal conductivity [W/m/K] + inline vector Kappa(const scalar p, const scalar T) const; + + //- Thermal diffusivity of enthalpy [kg/m/s] + inline scalar alphah(const scalar p, const scalar T) const; + + //- Write to Ostream + void write(Ostream& os) const; + + + // Ostream Operator + + friend Ostream& operator<< <Thermo> + ( + Ostream&, + const tabulatedSolidTransport& + ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "tabulatedSolidTransportI.H" + +#ifdef NoRepository + #include "tabulatedSolidTransport.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/solidSpecie/transport/tabulated/tabulatedSolidTransportI.H b/src/thermophysicalModels/solidSpecie/transport/tabulated/tabulatedSolidTransportI.H new file mode 100644 index 0000000000000000000000000000000000000000..fd528b11d4c496f9a3b1bec16228aac8cab3fcf2 --- /dev/null +++ b/src/thermophysicalModels/solidSpecie/transport/tabulated/tabulatedSolidTransportI.H @@ -0,0 +1,121 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | www.openfoam.com + \\/ M anipulation | +------------------------------------------------------------------------------- + Copyright (C) 2020 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. +------------------------------------------------------------------------------- +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 "specie.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class Thermo> +inline Foam::tabulatedSolidTransport<Thermo>::tabulatedSolidTransport +( + const Thermo& t, + const nonUniformTable& kappa +) +: + Thermo(t), + kappa_(kappa) +{} + + +template<class Thermo> +inline Foam::tabulatedSolidTransport<Thermo>::tabulatedSolidTransport +( + const word& name, + const tabulatedSolidTransport& pt +) +: + Thermo(name, pt), + kappa_(pt.kappa_) +{} + + +template<class Thermo> +inline Foam::autoPtr<Foam::tabulatedSolidTransport<Thermo>> +Foam::tabulatedSolidTransport<Thermo>::clone() const +{ + return autoPtr<tabulatedSolidTransport<Thermo>>::New(*this); +} + + +template<class Thermo> +inline Foam::autoPtr<Foam::tabulatedSolidTransport<Thermo>> +Foam::tabulatedSolidTransport<Thermo>::New(const dictionary& dict) +{ + return autoPtr<tabulatedSolidTransport<Thermo>>::New(dict); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class Thermo> +inline Foam::scalar Foam::tabulatedSolidTransport<Thermo>::mu +( + const scalar p, + const scalar T +) const +{ + NotImplemented; + return 0; +} + + +template<class Thermo> +inline Foam::scalar Foam::tabulatedSolidTransport<Thermo>::kappa +( + const scalar p, + const scalar T +) const +{ + return kappa_.f(p, T); +} + + +template<class Thermo> +inline Foam::vector Foam::tabulatedSolidTransport<Thermo>::Kappa +( + const scalar p, + const scalar T +) const +{ + const scalar kappa(kappa_.f(p, T)); + return vector(kappa, kappa, kappa); +} + + +template<class Thermo> +inline Foam::scalar Foam::tabulatedSolidTransport<Thermo>::alphah +( + const scalar p, + const scalar T +) const +{ + return kappa(p, T)/this->Cp(p, T); +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/solidThermo/Make/options b/src/thermophysicalModels/solidThermo/Make/options index 2bc4cf5f3683306d71b9573387434c23e15848d5..a45216421f82c7a56730930430ff150614ce9c09 100644 --- a/src/thermophysicalModels/solidThermo/Make/options +++ b/src/thermophysicalModels/solidThermo/Make/options @@ -5,6 +5,7 @@ EXE_INC = \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/solidSpecie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \ -I$(LIB_SRC)/transportModels/compressible/lnInclude LIB_LIBS = \ diff --git a/src/thermophysicalModels/solidThermo/solidThermo/solidThermos.C b/src/thermophysicalModels/solidThermo/solidThermo/solidThermos.C index 785e404422d04da10779a31b985a86f53195fa5c..0132c248759eaa1e690fe1d9ebf675230f204315 100644 --- a/src/thermophysicalModels/solidThermo/solidThermo/solidThermos.C +++ b/src/thermophysicalModels/solidThermo/solidThermo/solidThermos.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2015 OpenFOAM Foundation + Copyright (C) 2022 OpenCFD Ltd ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -35,10 +36,12 @@ License #include "hConstThermo.H" #include "hPowerThermo.H" #include "hPolynomialThermo.H" +#include "hTabulatedThermo.H" #include "constIsoSolidTransport.H" #include "constAnIsoSolidTransport.H" #include "exponentialSolidTransport.H" #include "polynomialSolidTransport.H" +#include "tabulatedSolidTransport.H" #include "pureMixture.H" #include "sensibleEnthalpy.H" #include "sensibleInternalEnergy.H" @@ -101,6 +104,17 @@ makeSolidThermo specie ); +makeSolidThermo +( + solidThermo, + heSolidThermo, + pureMixture, + tabulatedSolidTransport, + sensibleEnthalpy, + hTabulatedThermo, + icoPolynomial, + specie +); makeSolidThermoPhysicsType (