thermophysicalModels: Added new tabulated equation of state, thermo and transport models

using the new nonUniformTable to interpolate between the values vs temperature
provided.  All properties (density, heat capacity, viscosity and thermal
conductivite) are considered functions of temperature only and the equation of
state is thus incompressible.  Built-in mixing rules corresponding to those in
the other thermo and transport models are not efficient or practical for
tabulated data and so these models are currently only instantiated for the pure
specie/mixture rhoThermo package but a general external mixing method will be
added in the future.

To handle reactions the Jacobian function dKcdTbyKc has been rewritten to use
the Gstd and S functions directly removing the need for the miss-named dGdT
function and hence removing the bugs in the implementation of that function for
some of the thermo models.  Additionally the Hc() function has been renamed
Hf() (heat of formation) which is more commonly used terminology and consistent
with the internals of the thermo models.
This commit is contained in:
Henry Weller
2020-05-05 20:33:45 +01:00
parent 1382ffae01
commit 4c2fae3d06
82 changed files with 1794 additions and 242 deletions

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2013-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -189,7 +189,7 @@ public:
const label patchi const label patchi
) const; ) const;
//- Chemical enthalpy [J/kg] //- Enthalpy of formation [J/kg]
virtual tmp<volScalarField> hc() const; virtual tmp<volScalarField> hc() const;
//- Temperature from enthalpy/internal energy for cell-set //- Temperature from enthalpy/internal energy for cell-set

View File

@ -311,7 +311,7 @@ public:
const label patchi const label patchi
) const; ) const;
//- Chemical enthalpy [J/kg] //- Enthalpy of formation [J/kg]
virtual tmp<volScalarField> hc() const; virtual tmp<volScalarField> hc() const;
//- Temperature from enthalpy/internal energy for cell-set //- Temperature from enthalpy/internal energy for cell-set

View File

@ -198,7 +198,7 @@ void Foam::TwoResistanceHeatTransferPhaseSystem<BasePhaseSystem>::addDmidtHef
dimensionedScalar dimensionedScalar
( (
dimEnergy/dimMass, dimEnergy/dimMass,
composition1.Hc(composition1.species()[member]) composition1.Hf(composition1.species()[member])
); );
} }
volScalarField hefi2(hef2), hci2(hc2); volScalarField hefi2(hef2), hci2(hc2);
@ -217,7 +217,7 @@ void Foam::TwoResistanceHeatTransferPhaseSystem<BasePhaseSystem>::addDmidtHef
dimensionedScalar dimensionedScalar
( (
dimEnergy/dimMass, dimEnergy/dimMass,
composition2.Hc(composition2.species()[member]) composition2.Hf(composition2.species()[member])
); );
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2019-2020 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -217,7 +217,7 @@ public:
const labelList& cells const labelList& cells
) const; ) const;
//- Chemical enthalpy [J/kg] //- Enthalpy of formation [J/kg]
virtual tmp<volScalarField> hc() const; virtual tmp<volScalarField> hc() const;
//- Temperature from enthalpy/internal energy for cell-set //- Temperature from enthalpy/internal energy for cell-set

View File

@ -4,6 +4,4 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude
EXE_LIBS = \ EXE_LIBS = \
-lreactionThermophysicalModels \
-lfluidThermophysicalModels \
-lchemistryModel -lchemistryModel

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -56,7 +56,7 @@ Foam::COxidationDiffusionLimitedRate<CloudType>::COxidationDiffusionLimitedRate
const scalar WCO2 = owner.thermo().carrier().Wi(CO2GlobalId_); const scalar WCO2 = owner.thermo().carrier().Wi(CO2GlobalId_);
WC_ = WCO2 - WO2_; WC_ = WCO2 - WO2_;
HcCO2_ = owner.thermo().carrier().Hc(CO2GlobalId_); HcCO2_ = owner.thermo().carrier().Hf(CO2GlobalId_);
if (Sb_ < 0) if (Sb_ < 0)
{ {

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2012-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2020 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -56,7 +56,7 @@ Foam::COxidationHurtMitchell<CloudType>::COxidationHurtMitchell
const scalar WCO2 = owner.thermo().carrier().Wi(CO2GlobalId_); const scalar WCO2 = owner.thermo().carrier().Wi(CO2GlobalId_);
WC_ = WCO2 - WO2_; WC_ = WCO2 - WO2_;
HcCO2_ = owner.thermo().carrier().Hc(CO2GlobalId_); HcCO2_ = owner.thermo().carrier().Hf(CO2GlobalId_);
const scalar YCloc = owner.composition().Y0(idSolid)[CsLocalId_]; const scalar YCloc = owner.composition().Y0(idSolid)[CsLocalId_];
const scalar YSolidTot = owner.composition().YMixture0()[idSolid]; const scalar YSolidTot = owner.composition().YMixture0()[idSolid];

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2014-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -62,7 +62,7 @@ Foam::COxidationIntrinsicRate<CloudType>::COxidationIntrinsicRate
const scalar WCO2 = owner.thermo().carrier().Wi(CO2GlobalId_); const scalar WCO2 = owner.thermo().carrier().Wi(CO2GlobalId_);
WC_ = WCO2 - WO2_; WC_ = WCO2 - WO2_;
HcCO2_ = owner.thermo().carrier().Hc(CO2GlobalId_); HcCO2_ = owner.thermo().carrier().Hf(CO2GlobalId_);
if (Sb_ < 0) if (Sb_ < 0)
{ {

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -57,7 +57,7 @@ COxidationKineticDiffusionLimitedRate
const scalar WCO2 = owner.thermo().carrier().Wi(CO2GlobalId_); const scalar WCO2 = owner.thermo().carrier().Wi(CO2GlobalId_);
WC_ = WCO2 - WO2_; WC_ = WCO2 - WO2_;
HcCO2_ = owner.thermo().carrier().Hc(CO2GlobalId_); HcCO2_ = owner.thermo().carrier().Hf(CO2GlobalId_);
const scalar YCloc = owner.composition().Y0(idSolid)[CsLocalId_]; const scalar YCloc = owner.composition().Y0(idSolid)[CsLocalId_];
const scalar YSolidTot = owner.composition().YMixture0()[idSolid]; const scalar YSolidTot = owner.composition().YMixture0()[idSolid];

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -69,7 +69,7 @@ Foam::COxidationMurphyShaddix<CloudType>::COxidationMurphyShaddix
const scalar WCO2 = owner.thermo().carrier().Wi(CO2GlobalId_); const scalar WCO2 = owner.thermo().carrier().Wi(CO2GlobalId_);
WC_ = WCO2 - WO2_; WC_ = WCO2 - WO2_;
HcCO2_ = owner.thermo().carrier().Hc(CO2GlobalId_); HcCO2_ = owner.thermo().carrier().Hf(CO2GlobalId_);
const scalar YCloc = owner.composition().Y0(idSolid)[CsLocalId_]; const scalar YCloc = owner.composition().Y0(idSolid)[CsLocalId_];
const scalar YSolidTot = owner.composition().YMixture0()[idSolid]; const scalar YSolidTot = owner.composition().YMixture0()[idSolid];

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -400,7 +400,7 @@ Foam::scalar Foam::CompositionModel<CloudType>::Hc
forAll(Y, i) forAll(Y, i)
{ {
label cid = props.carrierIds()[i]; label cid = props.carrierIds()[i];
HcMixture += Y[i]*thermo_.carrier().Hc(cid); HcMixture += Y[i]*thermo_.carrier().Hf(cid);
} }
break; break;
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -329,7 +329,7 @@ public:
const label patchi const label patchi
) const = 0; ) const = 0;
//- Chemical enthalpy [J/kg] //- Enthalpy of formation [J/kg]
virtual tmp<volScalarField> hc() const = 0; virtual tmp<volScalarField> hc() const = 0;
//- Temperature from enthalpy/internal energy for cell-set //- Temperature from enthalpy/internal energy for cell-set

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -379,7 +379,7 @@ Foam::heThermo<BasicThermo, MixtureType>::hc() const
dimEnergy/dimMass, dimEnergy/dimMass,
&MixtureType::cellMixture, &MixtureType::cellMixture,
&MixtureType::patchFaceMixture, &MixtureType::patchFaceMixture,
&MixtureType::thermoType::Hc &MixtureType::thermoType::Hf
); );
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -233,7 +233,7 @@ public:
const labelList& cells const labelList& cells
) const; ) const;
//- Chemical enthalpy [J/kg] //- Enthalpy of formation [J/kg]
virtual tmp<volScalarField> hc() const; virtual tmp<volScalarField> hc() const;
//- Temperature from enthalpy/internal energy for cell-set //- Temperature from enthalpy/internal energy for cell-set

View File

@ -30,6 +30,7 @@ License
#include "forGases.H" #include "forGases.H"
#include "forLiquids.H" #include "forLiquids.H"
#include "forPolynomials.H" #include "forPolynomials.H"
#include "forTabulated.H"
#include "makeThermo.H" #include "makeThermo.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -39,6 +40,7 @@ namespace Foam
forGases(makeThermos, rhoThermo, heRhoThermo, pureMixture); forGases(makeThermos, rhoThermo, heRhoThermo, pureMixture);
forLiquids(makeThermos, rhoThermo, heRhoThermo, pureMixture); forLiquids(makeThermos, rhoThermo, heRhoThermo, pureMixture);
forPolynomials(makeThermos, rhoThermo, heRhoThermo, pureMixture); forPolynomials(makeThermos, rhoThermo, heRhoThermo, pureMixture);
forTabulated(makeThermos, rhoThermo, heRhoThermo, pureMixture);
} }
// ************************************************************************* // // ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -368,7 +368,7 @@ Foam::StandardChemistryModel<ReactionThermo, ThermoType>::Qdot() const
{ {
forAll(Qdot, celli) forAll(Qdot, celli)
{ {
const scalar hi = specieThermo_[i].Hc(); const scalar hi = specieThermo_[i].Hf();
Qdot[celli] -= hi*RR_[i][celli]; Qdot[celli] -= hi*RR_[i][celli];
} }
} }

View File

@ -135,9 +135,9 @@ Foam::scalar Foam::SpecieMixture<MixtureType>::Wi(const label speciei) const
template<class MixtureType> template<class MixtureType>
Foam::scalar Foam::SpecieMixture<MixtureType>::Hc(const label speciei) const Foam::scalar Foam::SpecieMixture<MixtureType>::Hf(const label speciei) const
{ {
return this->getLocalThermo(speciei).Hc(); return this->getLocalThermo(speciei).Hf();
} }

View File

@ -109,8 +109,8 @@ public:
//- Molecular weight of the given specie [kg/kmol] //- Molecular weight of the given specie [kg/kmol]
virtual scalar Wi(const label speciei) const; virtual scalar Wi(const label speciei) const;
//- Chemical enthalpy [J/kg] //- Enthalpy of formation [J/kg]
virtual scalar Hc(const label speciei) const; virtual scalar Hf(const label speciei) const;
// Per specie thermo properties // Per specie thermo properties

View File

@ -85,8 +85,8 @@ public:
//- Molecular weight of the given specie [kg/kmol] //- Molecular weight of the given specie [kg/kmol]
virtual scalar Wi(const label speciei) const = 0; virtual scalar Wi(const label speciei) const = 0;
//- Chemical enthalpy [J/kg] //- Enthalpy of formation [J/kg]
virtual scalar Hc(const label speciei) const = 0; virtual scalar Hf(const label speciei) const = 0;
// Per specie thermo properties // Per specie thermo properties

View File

@ -2,4 +2,24 @@ atomicWeights/atomicWeights.C
specie/specie.C specie/specie.C
reaction/specieCoeffs/specieCoeffs.C reaction/specieCoeffs/specieCoeffs.C
thermophysicalFunctions/thermophysicalFunction/thermophysicalFunction.C
thermophysicalFunctions/none/noneThermophysicalFunction.C
thermophysicalFunctions/constant/constantThermophysicalFunction.C
thermophysicalFunctions/table/tableThermophysicalFunction.C
thermophysicalFunctions/nonUniformTable/nonUniformTableThermophysicalFunction.C
thermophysicalFunctions/integratedNonUniformTable/integratedNonUniformTableThermophysicalFunction.C
thermophysicalFunctions/APIfunctions/APIdiffCoef/APIdiffCoefThermophysicalFunction.C
NSRDS = thermophysicalFunctions/NSRDS
$(NSRDS)/NSRDS0/NSRDS0ThermophysicalFunction.C
$(NSRDS)/NSRDS1/NSRDS1ThermophysicalFunction.C
$(NSRDS)/NSRDS2/NSRDS2ThermophysicalFunction.C
$(NSRDS)/NSRDS3/NSRDS3ThermophysicalFunction.C
$(NSRDS)/NSRDS4/NSRDS4ThermophysicalFunction.C
$(NSRDS)/NSRDS5/NSRDS5ThermophysicalFunction.C
$(NSRDS)/NSRDS6/NSRDS6ThermophysicalFunction.C
$(NSRDS)/NSRDS7/NSRDS7ThermophysicalFunction.C
$(NSRDS)/NSRDS14/NSRDS14ThermophysicalFunction.C
LIB = $(FOAM_LIBBIN)/libspecie LIB = $(FOAM_LIBBIN)/libspecie

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -238,17 +238,6 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define makeIcoPolynomial(PolySize) \
\
defineTemplateTypeNameAndDebugWithName \
( \
icoPolynomial<Specie, PolySize>, \
"icoPolynomial<"#PolySize">", \
0 \
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "icoPolynomialI.H" #include "icoPolynomialI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -0,0 +1,72 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2020 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 "icoTabulated.H"
#include "IOstreams.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Specie>
icoTabulated<Specie>::icoTabulated(const dictionary& dict)
:
Specie(dict),
rho_("rho", dict.subDict("equationOfState"))
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Specie>
void icoTabulated<Specie>::write(Ostream& os) const
{
Specie::write(os);
dictionary dict("equationOfState");
dict.add("rho", rho_.values());
os << indent << dict.dictName() << dict;
}
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
template<class Specie>
Ostream& operator<<(Ostream& os, const icoTabulated<Specie>& ip)
{
ip.write(os);
return os;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,203 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2020 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::icoTabulated
Description
Incompressible of equation of state using non-uniform tabulated
density vs temperature.
Usage
\table
Property | Description
rho | Density vs temperature table
\endtable
Example of the specification of the equation of state:
\verbatim
equationOfState
{
rho
(
(200 1010)
(350 1000)
(400 980)
);
}
\endverbatim
SourceFiles
icoTabulatedI.H
icoTabulated.C
See also
Foam::thermophysicalFunctions::nonUniformTable
\*---------------------------------------------------------------------------*/
#ifndef icoTabulated_H
#define icoTabulated_H
#include "nonUniformTableThermophysicalFunction.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward declaration of friend functions and operators
template<class Specie>
class icoTabulated;
template<class Specie>
Ostream& operator<<
(
Ostream&,
const icoTabulated<Specie>&
);
/*---------------------------------------------------------------------------*\
Class icoTabulated Declaration
\*---------------------------------------------------------------------------*/
template<class Specie>
class icoTabulated
:
public Specie
{
typedef thermophysicalFunctions::nonUniformTable nonUniformTable;
// Private Data
//- Density table [kg/m^3]
nonUniformTable rho_;
public:
// Constructors
//- Construct from components
inline icoTabulated
(
const Specie& sp,
const nonUniformTable& rho
);
//- Construct from dictionary
icoTabulated(const dictionary& dict);
//- Construct as named copy
inline icoTabulated(const word& name, const icoTabulated&);
//- Construct and return a clone
inline autoPtr<icoTabulated> clone() const;
// Selector from dictionary
inline static autoPtr<icoTabulated> New(const dictionary& dict);
// Member Functions
//- Return the instantiated type name
static word typeName()
{
return "icoTabulated<" + word(Specie::typeName_()) + '>';
}
// Fundamental properties
//- Is the equation of state is incompressible i.e. rho != f(p)
static const bool incompressible = true;
//- Is the equation of state is isochoric i.e. rho = const
static const bool isochoric = false;
//- Return density [kg/m^3]
inline scalar rho(scalar p, scalar T) const;
//- Return enthalpy departure [J/kg]
inline scalar H(const scalar p, const scalar T) const;
//- Return Cp departure [J/(kg K]
inline scalar Cp(scalar p, scalar T) const;
//- Return internal energy departure [J/kg]
inline scalar E(const scalar p, const scalar T) const;
//- Return Cv departure [J/(kg K]
inline scalar Cv(scalar p, scalar T) const;
//- Return entropy [J/kg/K]
inline scalar S(const scalar p, const scalar T) const;
//- Return compressibility [s^2/m^2]
inline scalar psi(scalar p, scalar T) const;
//- Return compression factor []
inline scalar Z(scalar p, scalar T) const;
//- Return (Cp - Cv) [J/(kg K]
inline scalar CpMCv(scalar p, scalar T) const;
// IO
//- Write to Ostream
void write(Ostream& os) const;
// Ostream Operator
friend Ostream& operator<< <Specie>
(
Ostream&,
const icoTabulated&
);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "icoTabulatedI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "icoTabulated.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,179 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2020 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 "icoTabulated.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class Specie>
inline Foam::icoTabulated<Specie>::icoTabulated
(
const Specie& sp,
const nonUniformTable& rho
)
:
Specie(sp),
rho_(rho)
{}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Specie>
inline Foam::icoTabulated<Specie>::icoTabulated
(
const word& name,
const icoTabulated<Specie>& ip
)
:
Specie(name, ip),
rho_(ip.rho_)
{}
template<class Specie>
inline Foam::autoPtr<Foam::icoTabulated<Specie>>
Foam::icoTabulated<Specie>::clone() const
{
return autoPtr<icoTabulated<Specie>>
(
new icoTabulated<Specie>(*this)
);
}
template<class Specie>
inline Foam::autoPtr<Foam::icoTabulated<Specie>>
Foam::icoTabulated<Specie>::New(const dictionary& dict)
{
return autoPtr<icoTabulated<Specie>>
(
new icoTabulated<Specie>(dict)
);
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Specie>
inline Foam::scalar Foam::icoTabulated<Specie>::rho
(
scalar p,
scalar T
) const
{
return rho_.f(p, T);
}
template<class Specie>
inline Foam::scalar Foam::icoTabulated<Specie>::H
(
scalar p,
scalar T
) const
{
return p/this->rho(p, T);
}
template<class Specie>
inline Foam::scalar Foam::icoTabulated<Specie>::Cp
(
scalar p,
scalar T
) const
{
return 0;
}
template<class Specie>
inline Foam::scalar Foam::icoTabulated<Specie>::E
(
scalar p,
scalar T
) const
{
return 0;
}
template<class Specie>
inline Foam::scalar Foam::icoTabulated<Specie>::Cv
(
scalar p,
scalar T
) const
{
return 0;
}
template<class Specie>
inline Foam::scalar Foam::icoTabulated<Specie>::S
(
scalar p,
scalar T
) const
{
return 0;
}
template<class Specie>
inline Foam::scalar Foam::icoTabulated<Specie>::psi
(
scalar p,
scalar T
) const
{
return 0;
}
template<class Specie>
inline Foam::scalar Foam::icoTabulated<Specie>::Z
(
scalar p,
scalar T
) const
{
return 0;
}
template<class Specie>
inline Foam::scalar Foam::icoTabulated<Specie>::CpMCv
(
scalar p,
scalar T
) const
{
return 0;
}
// ************************************************************************* //

View File

@ -0,0 +1,61 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2020 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/>.
\*---------------------------------------------------------------------------*/
#ifndef forTabulated_H
#define forTabulated_H
#include "specie.H"
#include "icoTabulated.H"
#include "hTabulatedThermo.H"
#include "sensibleEnthalpy.H"
#include "sensibleInternalEnergy.H"
#include "tabulatedTransport.H"
#include "thermo.H"
#include "forThermo.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define forTabulatedEqns(Mu, He, Cp, Macro, Args...) \
forThermo(Mu, He, Cp, icoTabulated, specie, Macro, Args);
#define forTabulatedEnergiesAndThermos(Mu, Macro, Args...) \
forTabulatedEqns(Mu, sensibleEnthalpy, hTabulatedThermo, Macro, Args); \
forTabulatedEqns(Mu, sensibleInternalEnergy, hTabulatedThermo, Macro, Args);
#define forTabulatedTransport(Macro, Args...) \
forTabulatedEnergiesAndThermos(tabulatedTransport, Macro, Args);
#define forTabulated(Macro, Args...) \
forTabulatedTransport(Macro, Args)
#endif
// ************************************************************************* //

View File

@ -152,8 +152,8 @@ public:
//- Absolute internal energy [J/kg] //- Absolute internal energy [J/kg]
inline scalar Ea(const scalar p, const scalar T) const; inline scalar Ea(const scalar p, const scalar T) const;
//- Chemical enthalpy [J/kg] //- Enthalpy of formation [J/kg]
inline scalar Hc() const; inline scalar Hf() const;
//- Entropy [J/kg/K] //- Entropy [J/kg/K]
inline scalar S(const scalar p, const scalar T) const; inline scalar S(const scalar p, const scalar T) const;
@ -166,9 +166,6 @@ public:
// Derivative term used for Jacobian // 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 //- Temperature derivative of heat capacity at constant pressure
inline scalar dCpdT(const scalar p, const scalar T) const; inline scalar dCpdT(const scalar p, const scalar T) const;

View File

@ -117,7 +117,7 @@ inline Foam::scalar Foam::eConstThermo<EquationOfState>::Es
template<class EquationOfState> template<class EquationOfState>
inline Foam::scalar Foam::eConstThermo<EquationOfState>::Hc() const inline Foam::scalar Foam::eConstThermo<EquationOfState>::Hf() const
{ {
return Hf_; return Hf_;
} }
@ -130,7 +130,7 @@ inline Foam::scalar Foam::eConstThermo<EquationOfState>::Ea
const scalar T const scalar T
) const ) const
{ {
return Es(p, T) + Hc(); return Es(p, T) + Hf();
} }
@ -152,22 +152,11 @@ inline Foam::scalar Foam::eConstThermo<EquationOfState>::Gstd
) const ) const
{ {
return return
Cv_*(T - Tref_) + Esref_ + Hc() + Pstd/EquationOfState::rho(Pstd, T) Cv_*(T - Tref_) + Esref_ + Hf() + Pstd/EquationOfState::rho(Pstd, T)
- Cp(Pstd, T)*T*log(T/Tstd); - Cp(Pstd, T)*T*log(T/Tstd);
} }
template<class EquationOfState>
inline Foam::scalar Foam::eConstThermo<EquationOfState>::dGdT
(
const scalar p,
const scalar T
) const
{
return 0;
}
template<class EquationOfState> template<class EquationOfState>
inline Foam::scalar Foam::eConstThermo<EquationOfState>::dCpdT inline Foam::scalar Foam::eConstThermo<EquationOfState>::dCpdT
( (

View File

@ -152,8 +152,8 @@ public:
//- Sensible enthalpy [J/kg] //- Sensible enthalpy [J/kg]
inline scalar Hs(const scalar p, const scalar T) const; inline scalar Hs(const scalar p, const scalar T) const;
//- Chemical enthalpy [J/kg] //- Enthalpy of formation [J/kg]
inline scalar Hc() const; inline scalar Hf() const;
//- Entropy [J/kg/K] //- Entropy [J/kg/K]
inline scalar S(const scalar p, const scalar T) const; inline scalar S(const scalar p, const scalar T) const;
@ -166,9 +166,6 @@ public:
// Derivative term used for Jacobian // 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 //- Temperature derivative of heat capacity at constant pressure
inline scalar dCpdT(const scalar p, const scalar T) const; inline scalar dCpdT(const scalar p, const scalar T) const;

View File

@ -117,7 +117,7 @@ inline Foam::scalar Foam::hConstThermo<EquationOfState>::Hs
template<class EquationOfState> template<class EquationOfState>
inline Foam::scalar Foam::hConstThermo<EquationOfState>::Hc() const inline Foam::scalar Foam::hConstThermo<EquationOfState>::Hf() const
{ {
return Hf_; return Hf_;
} }
@ -130,7 +130,7 @@ inline Foam::scalar Foam::hConstThermo<EquationOfState>::Ha
const scalar T const scalar T
) const ) const
{ {
return Hs(p, T) + Hc(); return Hs(p, T) + Hf();
} }
@ -151,18 +151,7 @@ inline Foam::scalar Foam::hConstThermo<EquationOfState>::Gstd
const scalar T const scalar T
) const ) const
{ {
return Cp_*(T - Tref_) + Hsref_ + Hc() - Cp_*T*log(T/Tstd); return Cp_*(T - Tref_) + Hsref_ + Hf() - Cp_*T*log(T/Tstd);
}
template<class EquationOfState>
inline Foam::scalar Foam::hConstThermo<EquationOfState>::dGdT
(
const scalar p,
const scalar T
) const
{
return 0;
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -190,8 +190,8 @@ public:
//- Sensible enthalpy [J/kg] //- Sensible enthalpy [J/kg]
inline scalar Hs(const scalar p, const scalar T) const; inline scalar Hs(const scalar p, const scalar T) const;
//- Chemical enthalpy [J/kg] //- Enthalpy of formation [J/kg]
inline scalar Hc() const; inline scalar Hf() const;
//- Entropy [J/kg/K] //- Entropy [J/kg/K]
inline scalar S(const scalar p, const scalar T) const; inline scalar S(const scalar p, const scalar T) const;
@ -204,9 +204,6 @@ public:
// Derivative term used for Jacobian // 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 //- Temperature derivative of heat capacity at constant pressure
inline scalar dCpdT(const scalar p, const scalar T) const; inline scalar dCpdT(const scalar p, const scalar T) const;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -106,12 +106,12 @@ inline Foam::scalar Foam::hPolynomialThermo<EquationOfState, PolySize>::Hs
const scalar T const scalar T
) const ) const
{ {
return Ha(p, T) - Hc(); return Ha(p, T) - Hf();
} }
template<class EquationOfState, int PolySize> template<class EquationOfState, int PolySize>
inline Foam::scalar Foam::hPolynomialThermo<EquationOfState, PolySize>::Hc() inline Foam::scalar Foam::hPolynomialThermo<EquationOfState, PolySize>::Hf()
const const
{ {
return Hf_; return Hf_;
@ -139,22 +139,6 @@ inline Foam::scalar Foam::hPolynomialThermo<EquationOfState, PolySize>::Gstd
} }
template<class EquationOfState, int PolySize>
inline Foam::scalar Foam::hPolynomialThermo<EquationOfState, PolySize>::dGdT
(
const scalar p,
const scalar T
) const
{
return
(
hCoeffs_.derivative(T)
- T*sCoeffs_.derivative(T)
- sCoeffs_.value(T)
);
}
template<class EquationOfState, int PolySize> template<class EquationOfState, int PolySize>
inline Foam::scalar Foam::hPolynomialThermo<EquationOfState, PolySize>::dCpdT inline Foam::scalar Foam::hPolynomialThermo<EquationOfState, PolySize>::dCpdT
( (

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2012-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2020 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -162,8 +162,8 @@ public:
//- Sensible enthalpy [J/kg] //- Sensible enthalpy [J/kg]
inline scalar Hs(const scalar p, const scalar T) const; inline scalar Hs(const scalar p, const scalar T) const;
//- Chemical enthalpy [J/kg] //- Enthalpy of formation [J/kg]
inline scalar Hc() const; inline scalar Hf() const;
//- Entropy [J/kg/K] //- Entropy [J/kg/K]
inline scalar S(const scalar p, const scalar T) const; inline scalar S(const scalar p, const scalar T) const;
@ -176,9 +176,6 @@ public:
// Derivative term used for Jacobian // 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 //- Temperature derivative of heat capacity at constant pressure
inline scalar dCpdT(const scalar p, const scalar T) const; inline scalar dCpdT(const scalar p, const scalar T) const;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2012-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2020 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -131,7 +131,7 @@ inline Foam::scalar Foam::hPowerThermo<EquationOfState>::Ha
const scalar T const scalar T
) const ) const
{ {
return Hs(p, T) + Hc(); return Hs(p, T) + Hf();
} }
@ -149,7 +149,7 @@ inline Foam::scalar Foam::hPowerThermo<EquationOfState>::Hs
template<class EquationOfState> template<class EquationOfState>
inline Foam::scalar Foam::hPowerThermo<EquationOfState>::Hc() const inline Foam::scalar Foam::hPowerThermo<EquationOfState>::Hf() const
{ {
return Hf_; return Hf_;
} }
@ -176,24 +176,11 @@ inline Foam::scalar Foam::hPowerThermo<EquationOfState>::Gstd
{ {
return return
c0_*(pow(T, n0_ + 1) - pow(Tstd, n0_ + 1))/(pow(Tref_, n0_)*(n0_ + 1)) c0_*(pow(T, n0_ + 1) - pow(Tstd, n0_ + 1))/(pow(Tref_, n0_)*(n0_ + 1))
+ Hc() + Hf()
- c0_*(pow(T, n0_) - pow(Tstd, n0_))*T/(pow(Tref_, n0_)*n0_); - c0_*(pow(T, n0_) - pow(Tstd, n0_))*T/(pow(Tref_, n0_)*n0_);
} }
template<class EquationOfState>
inline Foam::scalar Foam::hPowerThermo<EquationOfState>::dGdT
(
const scalar p,
const scalar T
) const
{
// To be implemented
NotImplemented;
return 0;
}
template<class EquationOfState> template<class EquationOfState>
inline Foam::scalar Foam::hPowerThermo<EquationOfState>::dCpdT inline Foam::scalar Foam::hPowerThermo<EquationOfState>::dCpdT
( (

View File

@ -0,0 +1,76 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2020 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 "hTabulatedThermo.H"
#include "IOstreams.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class EquationOfState>
Foam::hTabulatedThermo<EquationOfState>::hTabulatedThermo
(
const dictionary& dict
)
:
EquationOfState(dict),
Hf_(dict.subDict("thermodynamics").lookup<scalar>("Hf")),
Sf_(dict.subDict("thermodynamics").lookup<scalar>("Sf")),
Cp_("Cp", dict.subDict("thermodynamics"))
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class EquationOfState>
void Foam::hTabulatedThermo<EquationOfState>::write
(
Ostream& os
) const
{
EquationOfState::write(os);
dictionary dict("thermodynamics");
dict.add("Hf", Hf_);
dict.add("Sf", Sf_);
dict.add("Cp", Cp_.values());
os << indent << dict.dictName() << dict;
}
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
template<class EquationOfState>
Foam::Ostream& Foam::operator<<
(
Ostream& os,
const hTabulatedThermo<EquationOfState>& pt
)
{
pt.write(os);
return os;
}
// ************************************************************************* //

View File

@ -0,0 +1,196 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2020 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::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 declaration of friend functions and operators
template<class EquationOfState>
class hTabulatedThermo;
template<class EquationOfState>
Ostream& operator<<
(
Ostream&,
const hTabulatedThermo<EquationOfState>&
);
/*---------------------------------------------------------------------------*\
Class hTabulatedThermo Declaration
\*---------------------------------------------------------------------------*/
template<class EquationOfState>
class hTabulatedThermo
:
public EquationOfState
{
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_;
public:
// Constructors
//- Construct from dictionary
hTabulatedThermo(const dictionary& dict);
//- Construct as a named copy
inline hTabulatedThermo(const word&, const hTabulatedThermo&);
// Member Functions
//- Return the instantiated type name
static word typeName()
{
return "hTabulated<" + EquationOfState::typeName() + '>';
}
//- Limit the temperature to be in the range Tlow_ to Thigh_
inline scalar limit(const scalar) 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;
//- Enthalpy of formation [J/kg]
inline scalar Hf() const;
//- Entropy [J/kg/K]
inline scalar S(const scalar p, const scalar T) const;
//- Gibbs free energy of the mixture in the standard state [J/kg]
inline scalar Gstd(const scalar T) const;
#include "HtoEthermo.H"
// Derivative term used for Jacobian
//- 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
// ************************************************************************* //

View File

@ -0,0 +1,129 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2020 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 "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>::Hf()
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::S(p, T) + Sf_;
}
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);
}
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -180,8 +180,8 @@ public:
//- Sensible enthalpy [J/kg] //- Sensible enthalpy [J/kg]
inline scalar Hs(const scalar p, const scalar T) const; inline scalar Hs(const scalar p, const scalar T) const;
//- Chemical enthalpy [J/kg] //- Enthalpy of formation [J/kg]
inline scalar Hc() const; inline scalar Hf() const;
//- Entropy [J/kg/K] //- Entropy [J/kg/K]
inline scalar S(const scalar p, const scalar T) const; inline scalar S(const scalar p, const scalar T) const;
@ -194,9 +194,6 @@ public:
// Derivative term used for Jacobian // 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 //- Temperature derivative of heat capacity at constant pressure
inline scalar dCpdT(const scalar p, const scalar T) const; inline scalar dCpdT(const scalar p, const scalar T) const;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -203,12 +203,12 @@ inline Foam::scalar Foam::janafThermo<EquationOfState>::Hs
const scalar T const scalar T
) const ) const
{ {
return Ha(p, T) - Hc(); return Ha(p, T) - Hf();
} }
template<class EquationOfState> template<class EquationOfState>
inline Foam::scalar Foam::janafThermo<EquationOfState>::Hc() const inline Foam::scalar Foam::janafThermo<EquationOfState>::Hf() const
{ {
const coeffArray& a = lowCpCoeffs_; const coeffArray& a = lowCpCoeffs_;
return return
@ -256,18 +256,6 @@ inline Foam::scalar Foam::janafThermo<EquationOfState>::Gstd
} }
template<class EquationOfState>
inline Foam::scalar Foam::janafThermo<EquationOfState>::dGdT
(
const scalar p,
const scalar T
) const
{
const coeffArray& a = coeffs(T);
return -((a[0] + a[5]/T)/T + a[1]/2 + T*(a[2]/3 + T*(a[3]/4 + T*a[4]/5)));
}
template<class EquationOfState> template<class EquationOfState>
inline Foam::scalar Foam::janafThermo<EquationOfState>::dCpdT inline Foam::scalar Foam::janafThermo<EquationOfState>::dCpdT
( (

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -158,8 +158,8 @@ public:
// Sensible enthalpy [J/kg] // Sensible enthalpy [J/kg]
// inline scalar Hs(const scalar p, const scalar T) const; // inline scalar Hs(const scalar p, const scalar T) const;
// Chemical enthalpy [J/kg] // Enthalpy of formation [J/kg]
// inline scalar Hc() const; // inline scalar Hf() const;
// Absolute enthalpy [J/kg] // Absolute enthalpy [J/kg]
// inline scalar Ha(const scalar p, const scalar T) const; // inline scalar Ha(const scalar p, const scalar T) const;
@ -210,7 +210,7 @@ public:
//- Sensible enthalpy [J/kmol] //- Sensible enthalpy [J/kmol]
inline scalar hs(const scalar p, const scalar T) const; inline scalar hs(const scalar p, const scalar T) const;
//- Chemical enthalpy [J/kmol] //- Enthalpy of formation [J/kmol]
inline scalar hc() const; inline scalar hc() const;
//- Entropy [J/kmol/K] //- Entropy [J/kmol/K]

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -218,7 +218,7 @@ template<class Thermo, template<class> class Type>
inline Foam::scalar inline Foam::scalar
Foam::species::thermo<Thermo, Type>::hc() const Foam::species::thermo<Thermo, Type>::hc() const
{ {
return this->Hc()*this->W(); return this->Hf()*this->W();
} }
@ -461,15 +461,17 @@ Foam::species::thermo<Thermo, Type>::dKcdTbyKc
const scalar T const scalar T
) const ) const
{ {
const scalar nm = this->Y()/this->W(); const scalar dKcdTbyKc =
(this->S(Pstd, T) + this->Gstd(T)/T)*this->Y()/(RR*T);
const scalar nm = this->Y()/this->W();
if (equal(nm, small)) if (equal(nm, small))
{ {
return -this->dGdT(Pstd, T)*this->Y()/RR; return dKcdTbyKc;
} }
else else
{ {
return -(nm/T + this->dGdT(Pstd, T)*this->Y()/RR); return dKcdTbyKc - nm/T;
} }
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2019-2020 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2019-2020 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -0,0 +1,137 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2020 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 "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 = 0; i<intf_.size() - 1; i++)
{
intf_[i + 1] = intf_[i] + intfdT(0, values()[i + 1].first());
intfByT_[i + 1] = intfByT_[i] + intfByTdT(0, values()[i + 1].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::write
(
Ostream& os
) const
{
nonUniformTable::write(os);
}
// ************************************************************************* //

View File

@ -0,0 +1,122 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2020 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::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 member 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
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 write(Ostream& os) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace thermophysicalFunctions
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -54,22 +54,23 @@ const char* const Foam::Tuple2<Foam::scalar, Foam::scalar>::typeName
Foam::thermophysicalFunctions::nonUniformTable::nonUniformTable Foam::thermophysicalFunctions::nonUniformTable::nonUniformTable
( (
const word& name,
const dictionary& dict const dictionary& dict
) )
: :
dictName_(dict.name()), name_(name),
Tlow_(great), Tlow_(great),
Thigh_(-great), Thigh_(-great),
values_(dict.lookup("values")), values_(dict.lookup(name)),
deltaT_(great) deltaT_(great)
{ {
if (values_.size() < 2) if (values_.size() < 2)
{ {
FatalErrorInFunction FatalIOErrorInFunction(dict)
<< "Table " << nl << "Table " << nl
<< " " << dictName_ << nl << " " << name_ << nl
<< " has less than 2 entries." << " has less than 2 entries."
<< exit(FatalError); << exit(FatalIOError);
} }
else else
{ {
@ -101,6 +102,15 @@ Foam::thermophysicalFunctions::nonUniformTable::nonUniformTable
} }
Foam::thermophysicalFunctions::nonUniformTable::nonUniformTable
(
const dictionary& dict
)
:
nonUniformTable("values", dict)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::scalar Foam::thermophysicalFunctions::nonUniformTable::f Foam::scalar Foam::thermophysicalFunctions::nonUniformTable::f
@ -109,19 +119,7 @@ Foam::scalar Foam::thermophysicalFunctions::nonUniformTable::f
scalar T scalar T
) const ) const
{ {
if (T < Tlow_ || T > Thigh_) const label i = index(p, T);
{
FatalErrorInFunction
<< "Temperature " << T << " out of range "
<< Tlow_ << " to " << Thigh_ << nl
<< " of nonUniformTable " << dictName_
<< exit(FatalError);
}
const scalar nd = (T - Tlow_)/deltaT_;
const label j = nd;
const label i = jumpTable_[j];
const scalar Ti = values_[i].first(); const scalar Ti = values_[i].first();
const scalar lambda = (T - Ti)/(values_[i + 1].first() - Ti); const scalar lambda = (T - Ti)/(values_[i + 1].first() - Ti);
@ -131,6 +129,20 @@ Foam::scalar Foam::thermophysicalFunctions::nonUniformTable::f
} }
Foam::scalar Foam::thermophysicalFunctions::nonUniformTable::dfdT
(
scalar p,
scalar T
) const
{
const label i = index(p, T);
return
(values_[i + 1].second() - values_[i].second())
/(values_[i + 1].first() - values_[i].first());
}
void Foam::thermophysicalFunctions::nonUniformTable::write(Ostream& os) const void Foam::thermophysicalFunctions::nonUniformTable::write(Ostream& os) const
{ {
writeEntry(os, "values", values_); writeEntry(os, "values", values_);

View File

@ -79,7 +79,7 @@ class nonUniformTable
// Private member data // Private member data
//- Name of dictionary from which this function is instantiated //- Name of dictionary from which this function is instantiated
fileName dictName_; word name_;
//- Lowest temperature in the nonUniformTable //- Lowest temperature in the nonUniformTable
scalar Tlow_; scalar Tlow_;
@ -96,6 +96,13 @@ class nonUniformTable
List<label> jumpTable_; List<label> jumpTable_;
protected:
//- Return the lower index of the interval in the table
// corresponding to the given temperature
inline label index(scalar p, scalar T) const;
public: public:
//- Runtime type information //- Runtime type information
@ -104,6 +111,9 @@ public:
// Constructors // Constructors
//- Construct from entry name and dictionary
nonUniformTable(const word& name, const dictionary& dict);
//- Construct from dictionary //- Construct from dictionary
nonUniformTable(const dictionary& dict); nonUniformTable(const dictionary& dict);
@ -119,6 +129,9 @@ public:
//- Evaluate the function and return the result //- Evaluate the function and return the result
scalar f(scalar p, scalar T) const; scalar f(scalar p, scalar T) const;
//- Evaluate the derivative of the function and return the result
scalar dfdT(scalar p, scalar T) const;
//- Write the function coefficients //- Write the function coefficients
void write(Ostream& os) const; void write(Ostream& os) const;
}; };
@ -131,6 +144,10 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "nonUniformTableThermophysicalFunctionI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif #endif
// ************************************************************************* // // ************************************************************************* //

View File

@ -0,0 +1,59 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2020 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 "nonUniformTableThermophysicalFunction.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
inline Foam::label Foam::thermophysicalFunctions::nonUniformTable::index
(
scalar p,
scalar T
) const
{
if (T < Tlow_ || T > Thigh_)
{
FatalErrorInFunction
<< "Temperature " << T << " out of range "
<< Tlow_ << " to " << Thigh_ << nl
<< " of nonUniformTable " << name_
<< exit(FatalError);
}
const scalar nd = (T - Tlow_)/deltaT_;
const label j = nd;
label i = jumpTable_[j];
if (i < values_.size() - 1 && T > values_[i + 1].first())
{
i++;
}
return i;
}
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2019-2020 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2019-2020 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2019-2020 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -0,0 +1,76 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2020 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 "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 << this->name() << endl;
os << token::BEGIN_BLOCK << incrIndent << nl;
Thermo::write(os);
dictionary dict("transport");
dict.add("mu", mu_.values());
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 tabulatedTransport<Thermo>& pt
)
{
pt.write(os);
return os;
}
// ************************************************************************* //

View File

@ -0,0 +1,185 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2020 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::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 declaration of friend functions and operators
template<class Thermo> class tabulatedTransport;
template<class Thermo>
Ostream& operator<<(Ostream&, const tabulatedTransport<Thermo>&);
/*---------------------------------------------------------------------------*\
Class tabulatedTransport Declaration
\*---------------------------------------------------------------------------*/
template<class Thermo>
class tabulatedTransport
:
public Thermo
{
typedef thermophysicalFunctions::nonUniformTable nonUniformTable;
// 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
tabulatedTransport(const dictionary& dict);
//- Construct and return a clone
inline autoPtr<tabulatedTransport> clone() const;
// Selector from dictionary
inline static autoPtr<tabulatedTransport> New(const dictionary& dict);
// Member Functions
//- Return 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
// ************************************************************************* //

View File

@ -0,0 +1,114 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2020 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 "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 tabulatedTransport<Thermo>(*this)
);
}
template<class Thermo>
inline Foam::autoPtr<Foam::tabulatedTransport<Thermo>>
Foam::tabulatedTransport<Thermo>::New(const dictionary& dict)
{
return autoPtr<tabulatedTransport<Thermo>>
(
new tabulatedTransport<Thermo>(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);
}
// ************************************************************************* //

View File

@ -1,22 +1,3 @@
thermophysicalFunctions/thermophysicalFunction/thermophysicalFunction.C
thermophysicalFunctions/none/noneThermophysicalFunction.C
thermophysicalFunctions/constant/constantThermophysicalFunction.C
thermophysicalFunctions/table/tableThermophysicalFunction.C
thermophysicalFunctions/nonUniformTable/nonUniformTableThermophysicalFunction.C
thermophysicalFunctions/APIfunctions/APIdiffCoef/APIdiffCoefThermophysicalFunction.C
NSRDS = thermophysicalFunctions/NSRDS
$(NSRDS)/NSRDS0/NSRDS0ThermophysicalFunction.C
$(NSRDS)/NSRDS1/NSRDS1ThermophysicalFunction.C
$(NSRDS)/NSRDS2/NSRDS2ThermophysicalFunction.C
$(NSRDS)/NSRDS3/NSRDS3ThermophysicalFunction.C
$(NSRDS)/NSRDS4/NSRDS4ThermophysicalFunction.C
$(NSRDS)/NSRDS5/NSRDS5ThermophysicalFunction.C
$(NSRDS)/NSRDS6/NSRDS6ThermophysicalFunction.C
$(NSRDS)/NSRDS7/NSRDS7ThermophysicalFunction.C
$(NSRDS)/NSRDS14/NSRDS14ThermophysicalFunction.C
thermophysicalProperties/thermophysicalProperties.C thermophysicalProperties/thermophysicalProperties.C

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -221,8 +221,8 @@ public:
//- Sensible enthalpy [J/kg] //- Sensible enthalpy [J/kg]
inline scalar Hs(const scalar p, const scalar T) const; inline scalar Hs(const scalar p, const scalar T) const;
//- Chemical enthalpy [J/kg] //- Enthalpy of formation [J/kg]
inline scalar Hc() const; inline scalar Hf() const;
//- Absolute enthalpy [J/kg] //- Absolute enthalpy [J/kg]
inline scalar Ha(const scalar p, const scalar T) const; inline scalar Ha(const scalar p, const scalar T) const;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -123,7 +123,7 @@ inline Foam::scalar Foam::liquidProperties::Hs(scalar p, scalar T) const
} }
inline Foam::scalar Foam::liquidProperties::Hc() const inline Foam::scalar Foam::liquidProperties::Hf() const
{ {
return 0; return 0;
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2017-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2017-2020 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -146,8 +146,8 @@ public:
//- Sensible enthalpy [J/kg] //- Sensible enthalpy [J/kg]
virtual scalar Hs(const scalar p, const scalar T) const = 0; virtual scalar Hs(const scalar p, const scalar T) const = 0;
//- Chemical enthalpy [J/kg] //- Enthalpy of formation [J/kg]
virtual scalar Hc() const = 0; virtual scalar Hf() const = 0;
//- Absolute enthalpy [J/kg] //- Absolute enthalpy [J/kg]
virtual scalar Ha(const scalar p, const scalar T) const = 0; virtual scalar Ha(const scalar p, const scalar T) const = 0;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2017-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2017-2020 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -125,8 +125,8 @@ public:
//- Sensible enthalpy [J/kg] //- Sensible enthalpy [J/kg]
inline scalar Hs(const scalar p, const scalar T) const; inline scalar Hs(const scalar p, const scalar T) const;
//- Chemical enthalpy [J/kg] //- Enthalpy of formation [J/kg]
inline scalar Hc() const; inline scalar Hf() const;
//- Absolute enthalpy [J/kg] //- Absolute enthalpy [J/kg]
inline scalar Ha(const scalar p, const scalar T) const; inline scalar Ha(const scalar p, const scalar T) const;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2017-2020 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -114,9 +114,9 @@ Foam::thermophysicalPropertiesSelector<ThermophysicalProperties>::Hs
template<class ThermophysicalProperties> template<class ThermophysicalProperties>
inline Foam::scalar inline Foam::scalar
Foam::thermophysicalPropertiesSelector<ThermophysicalProperties>::Hc() const Foam::thermophysicalPropertiesSelector<ThermophysicalProperties>::Hf() const
{ {
return propertiesPtr_->Hc(); return propertiesPtr_->Hf();
} }