mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Adding tabulated transport and thermo.
TUT: multiphase/icoReactingMultiPhaseInterFoam/inertMultiphaseMultiComponent
This commit is contained in:
@ -43,6 +43,7 @@ License
|
||||
#include "hConstThermo.H"
|
||||
#include "eConstThermo.H"
|
||||
#include "janafThermo.H"
|
||||
#include "hTabulatedThermo.H"
|
||||
#include "sensibleEnthalpy.H"
|
||||
#include "sensibleInternalEnergy.H"
|
||||
#include "thermo.H"
|
||||
@ -54,6 +55,7 @@ License
|
||||
#include "icoPolynomial.H"
|
||||
#include "hPolynomialThermo.H"
|
||||
#include "polynomialTransport.H"
|
||||
#include "tabulatedTransport.H"
|
||||
|
||||
#include "heRhoThermo.H"
|
||||
#include "pureMixture.H"
|
||||
@ -101,6 +103,18 @@ makeThermos
|
||||
specie
|
||||
);
|
||||
|
||||
makeThermos
|
||||
(
|
||||
rhoThermo,
|
||||
heRhoThermo,
|
||||
pureMixture,
|
||||
tabulatedTransport,
|
||||
sensibleEnthalpy,
|
||||
hTabulatedThermo,
|
||||
perfectGas,
|
||||
specie
|
||||
);
|
||||
|
||||
makeThermos
|
||||
(
|
||||
rhoThermo,
|
||||
@ -137,6 +151,18 @@ makeThermos
|
||||
specie
|
||||
);
|
||||
|
||||
makeThermos
|
||||
(
|
||||
rhoThermo,
|
||||
heRhoThermo,
|
||||
pureMixture,
|
||||
tabulatedTransport,
|
||||
sensibleEnthalpy,
|
||||
hTabulatedThermo,
|
||||
icoTabulated,
|
||||
specie
|
||||
);
|
||||
|
||||
makeThermos
|
||||
(
|
||||
rhoThermo,
|
||||
@ -245,6 +271,18 @@ makeThermos
|
||||
specie
|
||||
);
|
||||
|
||||
makeThermos
|
||||
(
|
||||
rhoThermo,
|
||||
heRhoThermo,
|
||||
pureMixture,
|
||||
tabulatedTransport,
|
||||
sensibleEnthalpy,
|
||||
janafThermo,
|
||||
icoTabulated,
|
||||
specie
|
||||
);
|
||||
|
||||
makeThermos
|
||||
(
|
||||
rhoThermo,
|
||||
@ -348,9 +386,9 @@ makeThermos
|
||||
rhoThermo,
|
||||
heRhoThermo,
|
||||
pureMixture,
|
||||
constTransport,
|
||||
tabulatedTransport,
|
||||
sensibleInternalEnergy,
|
||||
hConstThermo,
|
||||
hTabulatedThermo,
|
||||
icoTabulated,
|
||||
specie
|
||||
);
|
||||
|
||||
@ -135,19 +135,19 @@ public:
|
||||
//- Return density [kg/m^3]
|
||||
inline scalar rho(scalar p, scalar T) const;
|
||||
|
||||
//- Return enthalpy contribution [J/kg]
|
||||
//- Return enthalpy departure [J/kg]
|
||||
inline scalar H(const scalar p, const scalar T) const;
|
||||
|
||||
//- Return Cp contribution [J/(kg K]
|
||||
//- Return Cp departure [J/(kg K]
|
||||
inline scalar Cp(scalar p, scalar T) const;
|
||||
|
||||
//- Return internal energy contribution [J/kg]
|
||||
//- Return internal energy departure [J/kg]
|
||||
inline scalar E(const scalar p, const scalar T) const;
|
||||
|
||||
//- Return Cv contribution [J/(kg K]
|
||||
//- Return Cv departure [J/(kg K]
|
||||
inline scalar Cv(scalar p, scalar T) const;
|
||||
|
||||
//- Return entropy contribution to the integral of Cp/T [J/kg/K]
|
||||
//- Return entropy departure to the integral of Cp/T [J/kg/K]
|
||||
inline scalar S(const scalar p, const scalar T) const;
|
||||
|
||||
//- Return compressibility [s^2/m^2]
|
||||
|
||||
@ -0,0 +1,82 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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 "hTabulatedThermo.H"
|
||||
#include "IOstreams.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class EquationOfState>
|
||||
Foam::hTabulatedThermo<EquationOfState>::hTabulatedThermo
|
||||
(
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
EquationOfState(dict),
|
||||
Hf_(dict.subDict("thermodynamics").get<scalar>("Hf")),
|
||||
Sf_(dict.subDict("thermodynamics").get<scalar>("Sf")),
|
||||
Cp_("Cp", dict.subDict("thermodynamics"))
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class EquationOfState>
|
||||
void Foam::hTabulatedThermo<EquationOfState>::write
|
||||
(
|
||||
Ostream& os
|
||||
) const
|
||||
{
|
||||
EquationOfState::write(os);
|
||||
|
||||
// Entries in dictionary format
|
||||
{
|
||||
os.beginBlock("thermodynamics");
|
||||
os.writeEntry("Hf", Hf_);
|
||||
os.writeEntry("Sf", Sf_);
|
||||
os.writeEntry("Cp", Cp_);
|
||||
os.endBlock();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
|
||||
|
||||
template<class EquationOfState>
|
||||
Foam::Ostream& Foam::operator<<
|
||||
(
|
||||
Ostream& os,
|
||||
const hTabulatedThermo<EquationOfState>& pt
|
||||
)
|
||||
{
|
||||
pt.write(os);
|
||||
return os;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,205 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2020 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
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::hTabulatedThermo
|
||||
|
||||
Description
|
||||
Enthalpy based thermodynamics package using non-uniform tabulated data for
|
||||
heat capacity vs temperature.
|
||||
|
||||
Usage
|
||||
|
||||
\table
|
||||
Property | Description
|
||||
Hf | Heat of formation
|
||||
Sf | Standard entropy
|
||||
Cp | Specific heat at constant pressure vs temperature table
|
||||
\endtable
|
||||
|
||||
Example of the specification of the thermodynamic properties:
|
||||
\verbatim
|
||||
thermodynamics
|
||||
{
|
||||
Hf 0;
|
||||
Sf 0;
|
||||
Cp
|
||||
(
|
||||
(200 1005)
|
||||
(350 1010)
|
||||
(400 1020)
|
||||
);
|
||||
}
|
||||
\endverbatim
|
||||
|
||||
SourceFiles
|
||||
hTabulatedThermoI.H
|
||||
hTabulatedThermo.C
|
||||
|
||||
See also
|
||||
Foam::thermophysicalFunctions::nonUniformTable
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef hTabulatedThermo_H
|
||||
#define hTabulatedThermo_H
|
||||
|
||||
#include "integratedNonUniformTableThermophysicalFunction.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// Forward Declarations
|
||||
|
||||
template<class EquationOfState>
|
||||
class hTabulatedThermo;
|
||||
|
||||
template<class EquationOfState>
|
||||
Ostream& operator<<
|
||||
(
|
||||
Ostream&,
|
||||
const hTabulatedThermo<EquationOfState>&
|
||||
);
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class hTabulatedThermo Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class EquationOfState>
|
||||
class hTabulatedThermo
|
||||
:
|
||||
public EquationOfState
|
||||
{
|
||||
// Private Typedefs
|
||||
|
||||
typedef thermophysicalFunctions::integratedNonUniformTable
|
||||
integratedNonUniformTable;
|
||||
|
||||
|
||||
// Private Data
|
||||
|
||||
//- Heat of formation
|
||||
scalar Hf_;
|
||||
|
||||
//- Standard entropy
|
||||
scalar Sf_;
|
||||
|
||||
//- Specific heat at constant pressure table [J/kg/K]
|
||||
integratedNonUniformTable Cp_;
|
||||
|
||||
//- Enthalphy uniform table;
|
||||
//nonUniformTable hCoeffs_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from dictionary
|
||||
explicit hTabulatedThermo(const dictionary& dict);
|
||||
|
||||
//- Construct as a named copy
|
||||
inline hTabulatedThermo(const word&, const hTabulatedThermo&);
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- The instantiated type name
|
||||
static word typeName()
|
||||
{
|
||||
return "hTabulated<" + EquationOfState::typeName() + '>';
|
||||
}
|
||||
|
||||
//- Limit the temperature to be in the temperature range
|
||||
// Currently no limit applied
|
||||
inline scalar limit(const scalar T) const;
|
||||
|
||||
|
||||
// Fundamental Properties
|
||||
|
||||
//- Heat capacity at constant pressure [J/kg/K]
|
||||
inline scalar Cp(const scalar p, const scalar T) const;
|
||||
|
||||
//- Absolute enthalpy [J/kg]
|
||||
inline scalar Ha(const scalar p, const scalar T) const;
|
||||
|
||||
//- Sensible enthalpy [J/kg]
|
||||
inline scalar Hs(const scalar p, const scalar T) const;
|
||||
|
||||
//- Chemical enthalpy [J/kg]
|
||||
inline scalar Hc() const;
|
||||
|
||||
//- Entropy [J/kg/K]
|
||||
inline scalar S(const scalar p, const scalar T) const;
|
||||
|
||||
|
||||
#include "HtoEthermo.H"
|
||||
|
||||
|
||||
// Derivative term used for Jacobian
|
||||
|
||||
//- Derivative of Gibbs free energy w.r.t. temperature
|
||||
inline scalar dGdT(const scalar p, const scalar T) const;
|
||||
|
||||
//- Temperature derivative of heat capacity at constant pressure
|
||||
inline scalar dCpdT(const scalar p, const scalar T) const;
|
||||
|
||||
|
||||
// I-O
|
||||
|
||||
//- Write to Ostream
|
||||
void write(Ostream& os) const;
|
||||
|
||||
|
||||
// Ostream Operator
|
||||
|
||||
friend Ostream& operator<< <EquationOfState>
|
||||
(
|
||||
Ostream&,
|
||||
const hTabulatedThermo&
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "hTabulatedThermoI.H"
|
||||
|
||||
#ifdef NoRepository
|
||||
#include "hTabulatedThermo.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,142 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2020 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
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 "hTabulatedThermo.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class EquationOfState>
|
||||
inline Foam::hTabulatedThermo<EquationOfState>::hTabulatedThermo
|
||||
(
|
||||
const word& name,
|
||||
const hTabulatedThermo& pt
|
||||
)
|
||||
:
|
||||
EquationOfState(name, pt),
|
||||
Hf_(pt.Hf_),
|
||||
Sf_(pt.Sf_),
|
||||
Cp_(pt.Cp_)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class EquationOfState>
|
||||
inline Foam::scalar Foam::hTabulatedThermo<EquationOfState>::limit
|
||||
(
|
||||
const scalar T
|
||||
) const
|
||||
{
|
||||
return T;
|
||||
}
|
||||
|
||||
|
||||
template<class EquationOfState>
|
||||
inline Foam::scalar Foam::hTabulatedThermo<EquationOfState>::Cp
|
||||
(
|
||||
const scalar p,
|
||||
const scalar T
|
||||
) const
|
||||
{
|
||||
return Cp_.f(p, T) + EquationOfState::Cp(p, T);
|
||||
}
|
||||
|
||||
|
||||
template<class EquationOfState>
|
||||
inline Foam::scalar Foam::hTabulatedThermo<EquationOfState>::Ha
|
||||
(
|
||||
const scalar p,
|
||||
const scalar T
|
||||
) const
|
||||
{
|
||||
return Hs(p, T) + Hf_;
|
||||
}
|
||||
|
||||
|
||||
template<class EquationOfState>
|
||||
inline Foam::scalar Foam::hTabulatedThermo<EquationOfState>::Hs
|
||||
(
|
||||
const scalar p,
|
||||
const scalar T
|
||||
) const
|
||||
{
|
||||
return Cp_.intfdT(p, T) + EquationOfState::H(p, T);
|
||||
}
|
||||
|
||||
|
||||
template<class EquationOfState>
|
||||
inline Foam::scalar Foam::hTabulatedThermo<EquationOfState>::Hc()
|
||||
const
|
||||
{
|
||||
return Hf_;
|
||||
}
|
||||
|
||||
|
||||
template<class EquationOfState>
|
||||
inline Foam::scalar Foam::hTabulatedThermo<EquationOfState>::S
|
||||
(
|
||||
const scalar p,
|
||||
const scalar T
|
||||
) const
|
||||
{
|
||||
return Cp_.intfByTdT(p, T) + EquationOfState::Sp(p, T) + Sf_;
|
||||
}
|
||||
|
||||
|
||||
template<class EquationOfState>
|
||||
inline Foam::scalar Foam::hTabulatedThermo<EquationOfState>::dGdT
|
||||
(
|
||||
const scalar p,
|
||||
const scalar T
|
||||
) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// template<class EquationOfState>
|
||||
// inline Foam::scalar Foam::hTabulatedThermo<EquationOfState>::Gstd
|
||||
// (
|
||||
// const scalar T
|
||||
// ) const
|
||||
// {
|
||||
// return Cp_.intfdT(Pstd, T) + Hf_ - (Cp_.intfByTdT(Pstd, T) + Sf_)*T;
|
||||
// }
|
||||
|
||||
|
||||
template<class EquationOfState>
|
||||
inline Foam::scalar Foam::hTabulatedThermo<EquationOfState>::dCpdT
|
||||
(
|
||||
const scalar p,
|
||||
const scalar T
|
||||
) const
|
||||
{
|
||||
return Cp_.dfdT(p, T);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,80 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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 "tabulatedTransport.H"
|
||||
#include "IOstreams.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Thermo>
|
||||
Foam::tabulatedTransport<Thermo>::tabulatedTransport
|
||||
(
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
Thermo(dict),
|
||||
mu_("mu", dict.subDict("transport")),
|
||||
kappa_("kappa", dict.subDict("transport"))
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Thermo>
|
||||
void Foam::tabulatedTransport<Thermo>::write(Ostream& os) const
|
||||
{
|
||||
os.beginBlock(this->name());
|
||||
|
||||
Thermo::write(os);
|
||||
|
||||
{
|
||||
os.beginBlock("transport");
|
||||
os.writeEntry("mu", mu_.values());
|
||||
os.writeEntry("kappa", kappa_.values());
|
||||
os.endBlock();
|
||||
}
|
||||
|
||||
os.endBlock();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
||||
|
||||
template<class Thermo>
|
||||
Foam::Ostream& Foam::operator<<
|
||||
(
|
||||
Ostream& os,
|
||||
const tabulatedTransport<Thermo>& pt
|
||||
)
|
||||
{
|
||||
pt.write(os);
|
||||
return os;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,183 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2020 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
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::tabulatedTransport
|
||||
|
||||
Description
|
||||
Transport properties package using non-uniform tabulated data for
|
||||
viscosity and thermal conductivity vs temperature.
|
||||
|
||||
Usage
|
||||
|
||||
\table
|
||||
Property | Description
|
||||
mu | Dynamic viscosity vs temperature table
|
||||
kappa | Thermal conductivity vs temperature table
|
||||
\endtable
|
||||
|
||||
Example of the specification of the transport properties:
|
||||
\verbatim
|
||||
transport
|
||||
{
|
||||
mu
|
||||
(
|
||||
(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)
|
||||
);
|
||||
}
|
||||
\endverbatim
|
||||
|
||||
SourceFiles
|
||||
tabulatedTransportI.H
|
||||
tabulatedTransport.C
|
||||
|
||||
See also
|
||||
Foam::thermophysicalFunctions::nonUniformTable
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef tabulatedTransport_H
|
||||
#define tabulatedTransport_H
|
||||
|
||||
#include "nonUniformTableThermophysicalFunction.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// Forward Declarations
|
||||
template<class Thermo> class tabulatedTransport;
|
||||
|
||||
template<class Thermo>
|
||||
Ostream& operator<<(Ostream&, const tabulatedTransport<Thermo>&);
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class tabulatedTransport Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class Thermo>
|
||||
class tabulatedTransport
|
||||
:
|
||||
public Thermo
|
||||
{
|
||||
// Private Data
|
||||
|
||||
//- Dynamic viscosity table [Pa.s]
|
||||
nonUniformTable mu_;
|
||||
|
||||
//- Thermal conductivity table [W/m/K]
|
||||
nonUniformTable kappa_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Construct from components
|
||||
inline tabulatedTransport
|
||||
(
|
||||
const Thermo& t,
|
||||
const nonUniformTable& muPoly,
|
||||
const nonUniformTable& kappaPoly
|
||||
);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct as named copy
|
||||
inline tabulatedTransport(const word&, const tabulatedTransport&);
|
||||
|
||||
//- Construct from dictionary
|
||||
explicit tabulatedTransport(const dictionary& dict);
|
||||
|
||||
//- Return a clone
|
||||
inline autoPtr<tabulatedTransport> clone() const;
|
||||
|
||||
// Selector from dictionary
|
||||
inline static autoPtr<tabulatedTransport> New(const dictionary& dict);
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- The instantiated type name
|
||||
static word typeName()
|
||||
{
|
||||
return "tabulated<" + Thermo::typeName() + '>';
|
||||
}
|
||||
|
||||
//- 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 diffusivity of enthalpy [kg/m/s]
|
||||
inline scalar alphah(const scalar p, const scalar T) const;
|
||||
|
||||
// Species diffusivity
|
||||
// inline scalar D(const scalar p, const scalar T) const;
|
||||
|
||||
//- Write to Ostream
|
||||
void write(Ostream& os) const;
|
||||
|
||||
|
||||
// Ostream Operator
|
||||
|
||||
friend Ostream& operator<< <Thermo>
|
||||
(
|
||||
Ostream&,
|
||||
const tabulatedTransport&
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "tabulatedTransportI.H"
|
||||
|
||||
#ifdef NoRepository
|
||||
#include "tabulatedTransport.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,111 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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::tabulatedTransport<Thermo>::tabulatedTransport
|
||||
(
|
||||
const Thermo& t,
|
||||
const nonUniformTable& mu,
|
||||
const nonUniformTable& kappa
|
||||
)
|
||||
:
|
||||
Thermo(t),
|
||||
mu_(mu),
|
||||
kappa_(kappa)
|
||||
{}
|
||||
|
||||
|
||||
template<class Thermo>
|
||||
inline Foam::tabulatedTransport<Thermo>::tabulatedTransport
|
||||
(
|
||||
const word& name,
|
||||
const tabulatedTransport& pt
|
||||
)
|
||||
:
|
||||
Thermo(name, pt),
|
||||
mu_(pt.mu_),
|
||||
kappa_(pt.kappa_)
|
||||
{}
|
||||
|
||||
|
||||
template<class Thermo>
|
||||
inline Foam::autoPtr<Foam::tabulatedTransport<Thermo>>
|
||||
Foam::tabulatedTransport<Thermo>::clone() const
|
||||
{
|
||||
return autoPtr<tabulatedTransport<Thermo>>::New(*this);
|
||||
}
|
||||
|
||||
|
||||
template<class Thermo>
|
||||
inline Foam::autoPtr<Foam::tabulatedTransport<Thermo>>
|
||||
Foam::tabulatedTransport<Thermo>::New(const dictionary& dict)
|
||||
{
|
||||
return autoPtr<tabulatedTransport<Thermo>>::New(dict);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Thermo>
|
||||
inline Foam::scalar Foam::tabulatedTransport<Thermo>::mu
|
||||
(
|
||||
const scalar p,
|
||||
const scalar T
|
||||
) const
|
||||
{
|
||||
return mu_.f(p, T);
|
||||
}
|
||||
|
||||
|
||||
template<class Thermo>
|
||||
inline Foam::scalar Foam::tabulatedTransport<Thermo>::kappa
|
||||
(
|
||||
const scalar p,
|
||||
const scalar T
|
||||
) const
|
||||
{
|
||||
return kappa_.f(p, T);
|
||||
}
|
||||
|
||||
|
||||
template<class Thermo>
|
||||
inline Foam::scalar Foam::tabulatedTransport<Thermo>::alphah
|
||||
(
|
||||
const scalar p,
|
||||
const scalar T
|
||||
) const
|
||||
{
|
||||
return kappa(p, T)/this->Cp(p, T);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -11,10 +11,11 @@ $(NSRDSfunctions)/NSRDSfunc6/NSRDSfunc6.C
|
||||
$(NSRDSfunctions)/NSRDSfunc7/NSRDSfunc7.C
|
||||
$(NSRDSfunctions)/NSRDSfunc14/NSRDSfunc14.C
|
||||
|
||||
APIfunctions = thermophysicalFunctions/APIfunctions
|
||||
APIfunctions = thermophysicalFunctions/APIfunctions
|
||||
$(APIfunctions)/APIdiffCoefFunc/APIdiffCoefFunc.C
|
||||
|
||||
thermophysicalFunctions/nonUniformTable/nonUniformTableThermophysicalFunction.C
|
||||
thermophysicalFunctions/integratedNonUniformTable/integratedNonUniformTableThermophysicalFunction.C
|
||||
|
||||
thermophysicalProperties/thermophysicalProperties.C
|
||||
|
||||
|
||||
@ -0,0 +1,140 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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 "integratedNonUniformTableThermophysicalFunction.H"
|
||||
#include "specie.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace thermophysicalFunctions
|
||||
{
|
||||
defineTypeNameAndDebug(integratedNonUniformTable, 0);
|
||||
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
thermophysicalFunction,
|
||||
integratedNonUniformTable,
|
||||
dictionary
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::thermophysicalFunctions::integratedNonUniformTable::
|
||||
integratedNonUniformTable
|
||||
(
|
||||
const word& name,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
nonUniformTable(name, dict),
|
||||
intf_(values().size()),
|
||||
intfByT_(values().size())
|
||||
{
|
||||
intf_[0] = 0;
|
||||
intfByT_[0] = 0;
|
||||
|
||||
for (label i = 1; i < intf_.size(); ++i)
|
||||
{
|
||||
intf_[i] = intf_[i-1] + intfdT(0, values()[i].first());
|
||||
intfByT_[i] = intfByT_[i-1] + intfByTdT(0, values()[i].first());
|
||||
}
|
||||
|
||||
const scalar intfStd = intfdT(Pstd, Tstd);
|
||||
const scalar intfByTStd = intfByTdT(Pstd, Tstd);
|
||||
|
||||
forAll(intf_, i)
|
||||
{
|
||||
intf_[i] -= intfStd;
|
||||
intfByT_[i] -= intfByTStd;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Foam::thermophysicalFunctions::integratedNonUniformTable::
|
||||
integratedNonUniformTable
|
||||
(
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
integratedNonUniformTable("values", dict)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::scalar Foam::thermophysicalFunctions::integratedNonUniformTable::intfdT
|
||||
(
|
||||
scalar p,
|
||||
scalar T
|
||||
) const
|
||||
{
|
||||
const label i = index(p, T);
|
||||
const scalar Ti = values()[i].first();
|
||||
const scalar fi = values()[i].second();
|
||||
const scalar dT = T - Ti;
|
||||
const scalar lambda = dT/(values()[i + 1].first() - Ti);
|
||||
|
||||
return
|
||||
intf_[i]
|
||||
+ (fi + 0.5*lambda*(values()[i + 1].second() - fi))*dT;
|
||||
}
|
||||
|
||||
|
||||
Foam::scalar Foam::thermophysicalFunctions::integratedNonUniformTable::intfByTdT
|
||||
(
|
||||
scalar p,
|
||||
scalar T
|
||||
) const
|
||||
{
|
||||
const label i = index(p, T);
|
||||
const scalar Ti = values()[i].first();
|
||||
const scalar fi = values()[i].second();
|
||||
const scalar gradf =
|
||||
(values()[i + 1].second() - fi)/(values()[i + 1].first() - Ti);
|
||||
|
||||
return
|
||||
intfByT_[i] + ((fi - gradf*Ti)*log(T/Ti) + gradf*(T - Ti));
|
||||
}
|
||||
|
||||
|
||||
void Foam::thermophysicalFunctions::integratedNonUniformTable::writeData
|
||||
(
|
||||
Ostream& os
|
||||
) const
|
||||
{
|
||||
nonUniformTable::writeData(os);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,124 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2020 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
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::thermophysicalFunctions::integratedNonUniformTable
|
||||
|
||||
Description
|
||||
Non-uniform tabulated property function that linearly interpolates between
|
||||
the values.
|
||||
|
||||
To speed-up the search of the non-uniform table a uniform jump-table is
|
||||
created on construction which is used for fast indirect addressing into
|
||||
the table.
|
||||
|
||||
Usage
|
||||
\integratedNonUniformTable
|
||||
Property | Description
|
||||
values | List of (temperature property) value pairs
|
||||
\endintegratedNonUniformTable
|
||||
|
||||
Example for the density of water between 280 and 350K
|
||||
\verbatim
|
||||
rho
|
||||
{
|
||||
type integratedNonUniformTable;
|
||||
|
||||
values
|
||||
(
|
||||
(280 999.87)
|
||||
(300 995.1)
|
||||
(350 973.7)
|
||||
);
|
||||
}
|
||||
\endverbatim
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef integratedNonUniformTableThermophysicalFunction_H
|
||||
#define integratedNonUniformTableThermophysicalFunction_H
|
||||
|
||||
#include "nonUniformTableThermophysicalFunction.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace thermophysicalFunctions
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class integratedNonUniformTable Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class integratedNonUniformTable
|
||||
:
|
||||
public nonUniformTable
|
||||
{
|
||||
// Private Data
|
||||
|
||||
List<scalar> intf_;
|
||||
|
||||
List<scalar> intfByT_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("integratedNonUniformTable");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from entry name and dictionary
|
||||
integratedNonUniformTable(const word& name, const dictionary& dict);
|
||||
|
||||
//- Construct from dictionary, using "values" for the lookup
|
||||
explicit integratedNonUniformTable(const dictionary& dict);
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Integrate the function and return the result
|
||||
scalar intfdT(scalar p, scalar T) const;
|
||||
|
||||
//- Integrate the function divided by T and return the result
|
||||
scalar intfByTdT(scalar p, scalar T) const;
|
||||
|
||||
//- Write the function coefficients
|
||||
void writeData(Ostream& os) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace thermophysicalFunctions
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -18,8 +18,8 @@ thermoType
|
||||
{
|
||||
type heRhoThermo;
|
||||
mixture pureMixture;
|
||||
transport const;
|
||||
thermo hConst;
|
||||
transport tabulated;
|
||||
thermo hTabulated;
|
||||
equationOfState icoTabulated;
|
||||
specie specie;
|
||||
energy sensibleEnthalpy;
|
||||
@ -43,13 +43,31 @@ mixture
|
||||
}
|
||||
thermodynamics
|
||||
{
|
||||
Cp 139;
|
||||
Hf 0.0;
|
||||
Hf 0;
|
||||
Sf 0;
|
||||
Cp
|
||||
(
|
||||
(200 139)
|
||||
(350 140)
|
||||
(400 145)
|
||||
);
|
||||
}
|
||||
|
||||
transport
|
||||
{
|
||||
mu 0.0015;
|
||||
Pr 0.8;
|
||||
mu
|
||||
(
|
||||
(200 0.0015)
|
||||
(350 0.002)
|
||||
(400 0.0025)
|
||||
);
|
||||
|
||||
kappa
|
||||
(
|
||||
(200 2.56e-2)
|
||||
(350 3.33e-2)
|
||||
(400 4.72e-2)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user