ENH: Adding hTabulated solid thermo

This commit is contained in:
sergio
2022-03-11 10:57:29 -08:00
parent 3f586f76f3
commit 3ea8492a7c
5 changed files with 391 additions and 0 deletions

View File

@ -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;
}
// ************************************************************************* //

View File

@ -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
// ************************************************************************* //

View File

@ -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);
}
// ************************************************************************* //

View File

@ -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 = \

View File

@ -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
(