tabulatedSolidTransport: New tabulated solid thermal conductivity model

Description
    Transport properties package using non-uniformly-spaced 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
        {
            values
            (
                (200 380)
                (350 400)
                (400 450)
            );
        }
    }
    \endverbatim
This commit is contained in:
Henry Weller
2021-09-22 19:23:50 +01:00
parent 1ca8ff74a9
commit 3466d8f58c
13 changed files with 450 additions and 37 deletions

View File

@ -39,6 +39,7 @@ transport
constAnIsoSolid
exponentialSolid
polynomialSolid
tabulatedSolid
);
thermo

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2019-2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2019-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -33,6 +33,7 @@ License
#include "eConstThermo.H"
#include "ePolynomialThermo.H"
#include "ePowerThermo.H"
#include "eIcoTabulatedThermo.H"
#include "sensibleInternalEnergy.H"
@ -40,6 +41,7 @@ License
#include "constAnIsoSolidTransport.H"
#include "exponentialSolidTransport.H"
#include "polynomialSolidTransport.H"
#include "tabulatedSolidTransport.H"
#include "thermo.H"
@ -54,13 +56,16 @@ License
forSolidEquations(Mu, sensibleInternalEnergy, eConstThermo, Macro, Args); \
forSolidEquations \
(Mu, sensibleInternalEnergy, ePolynomialThermo, Macro, Args); \
forSolidEquations(Mu, sensibleInternalEnergy, ePowerThermo, Macro, Args)
forSolidEquations(Mu, sensibleInternalEnergy, ePowerThermo, Macro, Args) \
forSolidEquations \
(Mu, sensibleInternalEnergy, eIcoTabulatedThermo, Macro, Args)
#define forSolidTransports(Macro, Args...) \
forSolidEnergiesAndThermos(constIsoSolidTransport, Macro, Args); \
forSolidEnergiesAndThermos(constAnIsoSolidTransport, Macro, Args); \
forSolidEnergiesAndThermos(exponentialSolidTransport, Macro, Args); \
forSolidEnergiesAndThermos(polynomialSolidTransport, Macro, Args)
forSolidEnergiesAndThermos(polynomialSolidTransport, Macro, Args) \
forSolidEnergiesAndThermos(tabulatedSolidTransport, Macro, Args)
#define forSolids(Macro, Args...) \
forSolidTransports(Macro, Args)

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-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -47,11 +47,16 @@ void Foam::constAnIsoSolidTransport<Thermo>::constAnIsoSolidTransport::write
Ostream& os
) const
{
os << this->name() << endl;
os << token::BEGIN_BLOCK << incrIndent << nl;
Thermo::write(os);
dictionary dict("transport");
dict.add("kappa", kappa_);
os << indent << dict.dictName() << dict;
os << decrIndent << token::END_BLOCK << nl;
}

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-2019 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -47,11 +47,16 @@ void Foam::constIsoSolidTransport<Thermo>::constIsoSolidTransport::write
Ostream& os
) const
{
os << this->name() << endl;
os << token::BEGIN_BLOCK << incrIndent << nl;
Thermo::write(os);
dictionary dict("transport");
dict.add("kappa", kappa_);
os << indent << dict.dictName() << dict;
os << decrIndent << token::END_BLOCK << nl;
}

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-2019 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -54,6 +54,9 @@ void Foam::exponentialSolidTransport<Thermo>::exponentialSolidTransport::write
Ostream& os
) const
{
os << this->name() << endl;
os << token::BEGIN_BLOCK << incrIndent << nl;
Thermo::write(os);
dictionary dict("transport");
@ -61,6 +64,8 @@ void Foam::exponentialSolidTransport<Thermo>::exponentialSolidTransport::write
dict.add("n0", n0_);
dict.add("Tref", Tref_);
os << indent << dict.dictName() << dict;
os << decrIndent << token::END_BLOCK << nl;
}

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-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -42,8 +42,7 @@ Foam::polynomialSolidTransport<Thermo, PolySize>::polynomialSolidTransport
"kappaCoeffs<" + Foam::name(PolySize) + '>'
)
)
{
}
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
@ -51,6 +50,9 @@ Foam::polynomialSolidTransport<Thermo, PolySize>::polynomialSolidTransport
template<class Thermo, int PolySize>
void Foam::polynomialSolidTransport<Thermo, PolySize>::write(Ostream& os) const
{
os << this->name() << endl;
os << token::BEGIN_BLOCK << incrIndent << nl;
Thermo::write(os);
dictionary dict("transport");
@ -61,6 +63,8 @@ void Foam::polynomialSolidTransport<Thermo, PolySize>::write(Ostream& os) const
kappaCoeffs_
);
os << indent << dict.dictName() << dict;
os << decrIndent << token::END_BLOCK << nl;
}

View File

@ -0,0 +1,76 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021 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 "tabulatedSolidTransport.H"
#include "IOstreams.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Thermo>
Foam::tabulatedSolidTransport<Thermo>::tabulatedSolidTransport
(
const dictionary& dict
)
:
Thermo(dict),
kappa_("kappa", dict.subDict("transport").subDict("kappa"))
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Thermo>
void Foam::tabulatedSolidTransport<Thermo>::tabulatedSolidTransport::write
(
Ostream& os
) const
{
os << this->name() << endl;
os << token::BEGIN_BLOCK << incrIndent << nl;
Thermo::write(os);
dictionary dict("transport");
dict.add("kappa", kappa_.values());
os << indent << dict.dictName() << dict;
os << decrIndent << token::END_BLOCK << nl;
}
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
template<class Thermo>
Foam::Ostream& Foam::operator<<
(
Ostream& os, const tabulatedSolidTransport<Thermo>& et
)
{
et.write(os);
return os;
}
// ************************************************************************* //

View File

@ -0,0 +1,188 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021 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/>.
Class
Foam::tabulatedSolidTransport
Description
Transport properties package using non-uniformly-spaced 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
{
values
(
(200 380)
(350 400)
(400 450)
);
}
}
\endverbatim
SourceFiles
tabulatedSolidTransportI.H
tabulatedSolidTransport.C
\*---------------------------------------------------------------------------*/
#ifndef tabulatedSolidTransport_H
#define tabulatedSolidTransport_H
#include "NonUniformTable1.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
template<class Thermo> class tabulatedSolidTransport;
template<class Thermo>
inline tabulatedSolidTransport<Thermo> operator*
(
const scalar,
const tabulatedSolidTransport<Thermo>&
);
template<class Thermo>
Ostream& operator<<
(
Ostream&,
const tabulatedSolidTransport<Thermo>&
);
/*---------------------------------------------------------------------------*\
Class tabulatedSolidTransport Declaration
\*---------------------------------------------------------------------------*/
template<class Thermo>
class tabulatedSolidTransport
:
public Thermo
{
typedef Function1s::NonUniformTable<scalar> nonUniformTable;
// Private Data
//- Thermal conductivity table [W/m/K]
nonUniformTable kappa_;
// Private Member Functions
//- Construct from components
inline tabulatedSolidTransport
(
const Thermo& t,
const nonUniformTable& kappa
);
public:
// Constructors
//- Construct as named copy
inline tabulatedSolidTransport
(
const word&,
const tabulatedSolidTransport&
);
//- Construct from dictionary
tabulatedSolidTransport(const dictionary&);
//- Construct and return a clone
inline autoPtr<tabulatedSolidTransport> clone() const;
// Selector from dictionary
inline static autoPtr<tabulatedSolidTransport> New
(
const dictionary& dict
);
// Member Functions
//- Return the instantiated type name
static word typeName()
{
return "tabulatedSolid<" + Thermo::typeName() + '>';
}
//- Is the thermal conductivity isotropic
static const bool isotropic = true;
//- 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;
//- Dynamic viscosity [kg/m/s]
inline scalar mu(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,109 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021 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/>.
\*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * * 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& tst
)
:
Thermo(name, tst),
kappa_(tst.kappa_)
{}
template<class Thermo>
inline Foam::autoPtr<Foam::tabulatedSolidTransport<Thermo>>
Foam::tabulatedSolidTransport<Thermo>::clone() const
{
return autoPtr<tabulatedSolidTransport<Thermo>>
(
new tabulatedSolidTransport<Thermo>(*this)
);
}
template<class Thermo>
inline Foam::autoPtr<Foam::tabulatedSolidTransport<Thermo>>
Foam::tabulatedSolidTransport<Thermo>::New
(
const dictionary& dict
)
{
return autoPtr<tabulatedSolidTransport<Thermo>>
(
new tabulatedSolidTransport<Thermo>(dict)
);
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Thermo>
inline Foam::scalar Foam::tabulatedSolidTransport<Thermo>::kappa
(
const scalar p, const scalar T
) const
{
return kappa_.value(T);
}
template<class Thermo>
inline Foam::vector Foam::tabulatedSolidTransport<Thermo>::Kappa
(
const scalar p, const scalar T
) const
{
const scalar kappa = kappa_.value(T);
return vector(kappa, kappa, kappa);
}
template<class Thermo>
inline Foam::scalar Foam::tabulatedSolidTransport<Thermo>::
mu(const scalar p, const scalar T) const
{
NotImplemented;
return scalar(0);
}
// ************************************************************************* //

View File

@ -39,11 +39,14 @@ Usage
equationOfState
{
rho
(
(200 1010)
(350 1000)
(400 980)
);
{
values
(
(200 1010)
(350 1000)
(400 980)
);
}
}
\endverbatim

View File

@ -43,11 +43,14 @@ Usage
Hf 0;
Sf 0;
Cv
(
(200 1005)
(350 1010)
(400 1020)
);
{
values
(
(200 1005)
(350 1010)
(400 1020)
);
}
}
\endverbatim

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2020-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -44,11 +44,14 @@ Usage
Hf 0;
Sf 0;
Cp
(
(200 1005)
(350 1010)
(400 1020)
);
{
values
(
(200 1005)
(350 1010)
(400 1020)
);
}
}
\endverbatim

View File

@ -40,18 +40,24 @@ Usage
transport
{
mu
(
(200 1.82e-05)
(350 2.61e-05)
(400 3.93e-05)
);
{
values
(
(200 1.82e-05)
(350 2.61e-05)
(400 3.93e-05)
);
}
kappa
(
(200 2.56e-5)
(350 3.33e-5)
(400 4.72e-5)
);
{
values
(
(200 2.56e-5)
(350 3.33e-5)
(400 4.72e-5)
);
}
}
\endverbatim
@ -109,8 +115,8 @@ class icoTabulatedTransport
inline icoTabulatedTransport
(
const Thermo& t,
const nonUniformTable& muPoly,
const nonUniformTable& kappaPoly
const nonUniformTable& mu,
const nonUniformTable& kappa
);