thermophysicalModels/specie: Added entropy function to equations of state

Added the pressure dependent part of the entropy from the equation of
state to that returned by the thermo entropy function.

TODO: Add entropy defect to the PengRobinsonGas::s(p, T) function.

Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=1411
This commit is contained in:
Henry
2015-03-07 21:47:04 +00:00
parent ed9f9e04d4
commit 72f5598049
36 changed files with 639 additions and 567 deletions

View File

@ -39,7 +39,7 @@ defineTemplateTypeNameAndDebugWithName
defineTemplateTypeNameAndDebugWithName defineTemplateTypeNameAndDebugWithName
( (
Foam::compressible::expoSolid_thermalBaffle1DFvPatchScalarField, Foam::compressible::expoSolid_thermalBaffle1DFvPatchScalarField,
"compressible::thermalBaffle1D<hExponentialSolidThermoPhysics>", "compressible::thermalBaffle1D<hPowerSolidThermoPhysics>",
0 0
); );

View File

@ -45,7 +45,7 @@ namespace compressible
typedef thermalBaffle1DFvPatchScalarField typedef thermalBaffle1DFvPatchScalarField
< <
hExponentialSolidThermoPhysics hPowerSolidThermoPhysics
>expoSolid_thermalBaffle1DFvPatchScalarField; >expoSolid_thermalBaffle1DFvPatchScalarField;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -79,11 +79,11 @@ makeChemistryReaderType(foamChemistryReader, icoPoly8EThermoPhysics);
// Solid chemistry readers for solids based on sensibleInternalEnergy // Solid chemistry readers for solids based on sensibleInternalEnergy
makeChemistryReader(hConstSolidThermoPhysics); makeChemistryReader(hConstSolidThermoPhysics);
makeChemistryReader(hExponentialSolidThermoPhysics); makeChemistryReader(hPowerSolidThermoPhysics);
makeChemistryReader(hExpKappaConstSolidThermoPhysics); makeChemistryReader(hExpKappaConstSolidThermoPhysics);
makeChemistryReaderType(foamChemistryReader, hConstSolidThermoPhysics); makeChemistryReaderType(foamChemistryReader, hConstSolidThermoPhysics);
makeChemistryReaderType(foamChemistryReader, hExponentialSolidThermoPhysics); makeChemistryReaderType(foamChemistryReader, hPowerSolidThermoPhysics);
makeChemistryReaderType(foamChemistryReader, hExpKappaConstSolidThermoPhysics); makeChemistryReaderType(foamChemistryReader, hExpKappaConstSolidThermoPhysics);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -54,7 +54,7 @@ makeSolidChemistryModel
solidChemistryModel, solidChemistryModel,
pyrolysisChemistryModel, pyrolysisChemistryModel,
basicSolidChemistryModel, basicSolidChemistryModel,
hExponentialSolidThermoPhysics, hPowerSolidThermoPhysics,
gasHThermoPhysics gasHThermoPhysics
); );

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -46,7 +46,7 @@ namespace Foam
( (
pyrolysisChemistryModel, pyrolysisChemistryModel,
basicSolidChemistryModel, basicSolidChemistryModel,
hExponentialSolidThermoPhysics, hPowerSolidThermoPhysics,
gasHThermoPhysics gasHThermoPhysics
) )

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -36,7 +36,7 @@ Description
#include "rhoConst.H" #include "rhoConst.H"
#include "hConstThermo.H" #include "hConstThermo.H"
#include "hPolynomialThermo.H" #include "hPolynomialThermo.H"
#include "hExponentialThermo.H" #include "hPowerThermo.H"
#include "constIsoSolidTransport.H" #include "constIsoSolidTransport.H"
#include "constAnIsoSolidTransport.H" #include "constAnIsoSolidTransport.H"
#include "exponentialSolidTransport.H" #include "exponentialSolidTransport.H"
@ -68,13 +68,13 @@ namespace Foam
< <
species::thermo species::thermo
< <
hExponentialThermo hPowerThermo
< <
rhoConst<specie> rhoConst<specie>
>, >,
sensibleEnthalpy sensibleEnthalpy
> >
> hExponentialSolidThermoPhysics; > hPowerSolidThermoPhysics;
typedef typedef
polynomialSolidTransport polynomialSolidTransport
@ -96,7 +96,7 @@ namespace Foam
< <
species::thermo species::thermo
< <
hExponentialThermo hPowerThermo
< <
rhoConst<specie> rhoConst<specie>
>, >,

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -38,7 +38,7 @@ makeSolidIRReactions(hConstSolidThermoPhysics, solidArrheniusReactionRate)
makeSolidIRReactions makeSolidIRReactions
( (
hExponentialSolidThermoPhysics, hPowerSolidThermoPhysics,
solidArrheniusReactionRate solidArrheniusReactionRate
) )

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -30,7 +30,7 @@ License
#include "specie.H" #include "specie.H"
#include "rhoConst.H" #include "rhoConst.H"
#include "hConstThermo.H" #include "hConstThermo.H"
#include "hExponentialThermo.H" #include "hPowerThermo.H"
#include "constIsoSolidTransport.H" #include "constIsoSolidTransport.H"
#include "constAnIsoSolidTransport.H" #include "constAnIsoSolidTransport.H"
#include "exponentialSolidTransport.H" #include "exponentialSolidTransport.H"
@ -69,7 +69,7 @@ makeReactingSolidThermo
reactingMixture, reactingMixture,
constIsoSolidTransport, constIsoSolidTransport,
sensibleEnthalpy, sensibleEnthalpy,
hExponentialThermo, hPowerThermo,
rhoConst, rhoConst,
specie specie
); );

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -30,7 +30,7 @@ License
#include "specie.H" #include "specie.H"
#include "rhoConst.H" #include "rhoConst.H"
#include "hConstThermo.H" #include "hConstThermo.H"
#include "hExponentialThermo.H" #include "hPowerThermo.H"
#include "hPolynomialThermo.H" #include "hPolynomialThermo.H"
#include "constIsoSolidTransport.H" #include "constIsoSolidTransport.H"
#include "constAnIsoSolidTransport.H" #include "constAnIsoSolidTransport.H"
@ -81,7 +81,7 @@ makeSolidThermo
pureMixture, pureMixture,
exponentialSolidTransport, exponentialSolidTransport,
sensibleEnthalpy, sensibleEnthalpy,
hExponentialThermo, hPowerThermo,
rhoConst, rhoConst,
specie specie
); );

View File

@ -168,6 +168,9 @@ public:
//- Return density [kg/m^3] //- Return density [kg/m^3]
inline scalar rho(scalar p, scalar T) const; inline scalar rho(scalar p, scalar T) const;
//- Return entropy [J/(kmol K)]
inline scalar s(const scalar p, const scalar T) const;
//- Return compressibility rho/p [s^2/m^2] //- Return compressibility rho/p [s^2/m^2]
inline scalar psi(scalar p, scalar T) const; inline scalar psi(scalar p, scalar T) const;

View File

@ -116,6 +116,19 @@ inline Foam::scalar Foam::PengRobinsonGas<Specie>::rho
} }
template<class Specie>
inline Foam::scalar Foam::PengRobinsonGas<Specie>::s
(
scalar p,
scalar T
) const
{
//***HGW This is the expression for a perfect gas
// Need to add the entropy defect for Peng-Robinson
return -RR*log(p/Pstd);
}
template<class Specie> template<class Specie>
inline Foam::scalar Foam::PengRobinsonGas<Specie>::psi inline Foam::scalar Foam::PengRobinsonGas<Specie>::psi
( (

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -167,6 +167,9 @@ public:
//- Return density [kg/m^3] //- Return density [kg/m^3]
inline scalar rho(scalar p, scalar T) const; inline scalar rho(scalar p, scalar T) const;
//- Return entropy [J/(kmol K)]
inline scalar s(const scalar p, const scalar T) const;
//- Return compressibility rho/p [s^2/m^2] //- Return compressibility rho/p [s^2/m^2]
inline scalar psi(scalar p, scalar T) const; inline scalar psi(scalar p, 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 | \\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -104,18 +104,32 @@ template<class Specie>
inline Foam::scalar Foam::adiabaticPerfectFluid<Specie>::rho inline Foam::scalar Foam::adiabaticPerfectFluid<Specie>::rho
( (
scalar p, scalar p,
scalar scalar T
) const ) const
{ {
return rho0_*pow((p + B_)/(p0_ + B_), 1.0/gamma_); return rho0_*pow((p + B_)/(p0_ + B_), 1.0/gamma_);
} }
template<class Specie>
inline Foam::scalar Foam::adiabaticPerfectFluid<Specie>::s
(
scalar p,
scalar T
) const
{
scalar n = 1 - 1.0/gamma_;
return
-pow(p0_ + B_, 1.0/gamma_)*(pow((p + B_), n) - pow((Pstd + B_), n))
/(rho0_*T*n);
}
template<class Specie> template<class Specie>
inline Foam::scalar Foam::adiabaticPerfectFluid<Specie>::psi inline Foam::scalar Foam::adiabaticPerfectFluid<Specie>::psi
( (
scalar p, scalar p,
scalar scalar T
) const ) const
{ {
return return
@ -127,15 +141,15 @@ inline Foam::scalar Foam::adiabaticPerfectFluid<Specie>::psi
template<class Specie> template<class Specie>
inline Foam::scalar Foam::adiabaticPerfectFluid<Specie>::Z(scalar, scalar) const inline Foam::scalar Foam::adiabaticPerfectFluid<Specie>::Z(scalar, scalar) const
{ {
return 1.0; return 1;
} }
template<class Specie> template<class Specie>
inline Foam::scalar Foam::adiabaticPerfectFluid<Specie>::cpMcv inline Foam::scalar Foam::adiabaticPerfectFluid<Specie>::cpMcv
( (
scalar, scalar p,
scalar scalar T
) const ) 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 | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -155,6 +155,9 @@ public:
//- Return density [kg/m^3] //- Return density [kg/m^3]
inline scalar rho(scalar p, scalar T) const; inline scalar rho(scalar p, scalar T) const;
//- Return entropy [J/(kmol K)]
inline scalar s(const scalar p, const scalar T) const;
//- Return compressibility rho/p [s^2/m^2] //- Return compressibility rho/p [s^2/m^2]
inline scalar psi(scalar p, scalar T) const; inline scalar psi(scalar p, 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 | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -102,7 +102,7 @@ Foam::icoPolynomial<Specie, PolySize>::New(const dictionary& dict)
template<class Specie, int PolySize> template<class Specie, int PolySize>
inline Foam::scalar Foam::icoPolynomial<Specie, PolySize>::rho inline Foam::scalar Foam::icoPolynomial<Specie, PolySize>::rho
( (
scalar, scalar p,
scalar T scalar T
) const ) const
{ {
@ -111,24 +111,35 @@ inline Foam::scalar Foam::icoPolynomial<Specie, PolySize>::rho
template<class Specie, int PolySize> template<class Specie, int PolySize>
inline Foam::scalar Foam::icoPolynomial<Specie, PolySize>::psi inline Foam::scalar Foam::icoPolynomial<Specie, PolySize>::s
( (
scalar, scalar p,
scalar scalar T
) const ) const
{ {
return 0.0; return 0;
}
template<class Specie, int PolySize>
inline Foam::scalar Foam::icoPolynomial<Specie, PolySize>::psi
(
scalar p,
scalar T
) const
{
return 0;
} }
template<class Specie, int PolySize> template<class Specie, int PolySize>
inline Foam::scalar Foam::icoPolynomial<Specie, PolySize>::Z inline Foam::scalar Foam::icoPolynomial<Specie, PolySize>::Z
( (
scalar, scalar p,
scalar scalar T
) const ) const
{ {
return 0.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 | \\ / O peration |
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -158,6 +158,9 @@ public:
//- Return density [kg/m^3] //- Return density [kg/m^3]
inline scalar rho(scalar p, scalar T) const; inline scalar rho(scalar p, scalar T) const;
//- Return entropy [J/(kmol K)]
inline scalar s(const scalar p, const scalar T) const;
//- Return compressibility rho/p [s^2/m^2] //- Return compressibility rho/p [s^2/m^2]
inline scalar psi(scalar p, scalar T) const; inline scalar psi(scalar p, scalar T) const;

View File

@ -115,39 +115,49 @@ inline Foam::scalar Foam::incompressiblePerfectGas<Specie>::rho
template<class Specie> template<class Specie>
inline Foam::scalar Foam::incompressiblePerfectGas<Specie>::psi inline Foam::scalar Foam::incompressiblePerfectGas<Specie>::s
( (
scalar, scalar p,
scalar T scalar T
) const ) const
{ {
return 0.0; return 0;
}
template<class Specie>
inline Foam::scalar Foam::incompressiblePerfectGas<Specie>::psi
(
scalar p,
scalar T
) const
{
return 0;
} }
template<class Specie> template<class Specie>
inline Foam::scalar Foam::incompressiblePerfectGas<Specie>::Z inline Foam::scalar Foam::incompressiblePerfectGas<Specie>::Z
( (
scalar, scalar p,
scalar scalar T
) const ) const
{ {
return 0.0; return 0;
} }
template<class Specie> template<class Specie>
inline Foam::scalar Foam::incompressiblePerfectGas<Specie>::cpMcv inline Foam::scalar Foam::incompressiblePerfectGas<Specie>::cpMcv
( (
scalar, scalar p,
scalar scalar T
) const ) const
{ {
return RR; return RR;
} }
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template<class Specie> template<class Specie>

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -156,6 +156,9 @@ public:
//- Return density [kg/m^3] //- Return density [kg/m^3]
inline scalar rho(scalar p, scalar T) const; inline scalar rho(scalar p, scalar T) const;
//- Return entropy [J/(kmol K)]
inline scalar s(const scalar p, const scalar T) const;
//- Return compressibility rho/p [s^2/m^2] //- Return compressibility rho/p [s^2/m^2]
inline scalar psi(scalar p, scalar T) const; inline scalar psi(scalar p, 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 | \\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -93,21 +93,28 @@ inline Foam::scalar Foam::linear<Specie>::rho(scalar p, scalar T) const
template<class Specie> template<class Specie>
inline Foam::scalar Foam::linear<Specie>::psi(scalar, scalar T) const inline Foam::scalar Foam::linear<Specie>::s(scalar p, scalar T) const
{
return -log((rho0_ + psi_*p)/(rho0_ + psi_*Pstd))/(T*psi_);
}
template<class Specie>
inline Foam::scalar Foam::linear<Specie>::psi(scalar p, scalar T) const
{ {
return psi_; return psi_;
} }
template<class Specie> template<class Specie>
inline Foam::scalar Foam::linear<Specie>::Z(scalar, scalar) const inline Foam::scalar Foam::linear<Specie>::Z(scalar p, scalar T) const
{ {
return 1.0; return 1;
} }
template<class Specie> template<class Specie>
inline Foam::scalar Foam::linear<Specie>::cpMcv(scalar, scalar) const inline Foam::scalar Foam::linear<Specie>::cpMcv(scalar p, scalar T) 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 | \\ / O peration |
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -155,6 +155,9 @@ public:
//- Return density [kg/m^3] //- Return density [kg/m^3]
inline scalar rho(scalar p, scalar T) const; inline scalar rho(scalar p, scalar T) const;
//- Return entropy [J/(kmol K)]
inline scalar s(const scalar p, const scalar T) const;
//- Return compressibility rho/p [s^2/m^2] //- Return compressibility rho/p [s^2/m^2]
inline scalar psi(scalar p, scalar T) const; inline scalar psi(scalar p, 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 | \\ / O peration |
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -100,21 +100,28 @@ inline Foam::scalar Foam::perfectFluid<Specie>::rho(scalar p, scalar T) const
template<class Specie> template<class Specie>
inline Foam::scalar Foam::perfectFluid<Specie>::psi(scalar, scalar T) const inline Foam::scalar Foam::perfectFluid<Specie>::s(scalar p, scalar T) const
{
return -RR*log(p/Pstd);
}
template<class Specie>
inline Foam::scalar Foam::perfectFluid<Specie>::psi(scalar p, scalar T) const
{ {
return 1.0/(this->R()*T); return 1.0/(this->R()*T);
} }
template<class Specie> template<class Specie>
inline Foam::scalar Foam::perfectFluid<Specie>::Z(scalar, scalar) const inline Foam::scalar Foam::perfectFluid<Specie>::Z(scalar p, scalar T) const
{ {
return 1.0; return 1;
} }
template<class Specie> template<class Specie>
inline Foam::scalar Foam::perfectFluid<Specie>::cpMcv(scalar, scalar) const inline Foam::scalar Foam::perfectFluid<Specie>::cpMcv(scalar p, scalar T) 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 | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -139,6 +139,9 @@ public:
//- Return density [kg/m^3] //- Return density [kg/m^3]
inline scalar rho(scalar p, scalar T) const; inline scalar rho(scalar p, scalar T) const;
//- Return entropy [J/(kmol K)]
inline scalar s(const scalar p, const scalar T) const;
//- Return compressibility rho/p [s^2/m^2] //- Return compressibility rho/p [s^2/m^2]
inline scalar psi(scalar p, scalar T) const; inline scalar psi(scalar p, scalar T) const;

View File

@ -83,21 +83,28 @@ inline Foam::scalar Foam::perfectGas<Specie>::rho(scalar p, scalar T) const
template<class Specie> template<class Specie>
inline Foam::scalar Foam::perfectGas<Specie>::psi(scalar, scalar T) const inline Foam::scalar Foam::perfectGas<Specie>::s(scalar p, scalar T) const
{
return -RR*log(p/Pstd);
}
template<class Specie>
inline Foam::scalar Foam::perfectGas<Specie>::psi(scalar p, scalar T) const
{ {
return 1.0/(this->R()*T); return 1.0/(this->R()*T);
} }
template<class Specie> template<class Specie>
inline Foam::scalar Foam::perfectGas<Specie>::Z(scalar, scalar) const inline Foam::scalar Foam::perfectGas<Specie>::Z(scalar p, scalar T) const
{ {
return 1.0; return 1;
} }
template<class Specie> template<class Specie>
inline Foam::scalar Foam::perfectGas<Specie>::cpMcv(scalar, scalar) const inline Foam::scalar Foam::perfectGas<Specie>::cpMcv(scalar p, scalar T) const
{ {
return RR; return RR;
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -141,6 +141,9 @@ public:
//- Return density [kg/m^3] //- Return density [kg/m^3]
inline scalar rho(scalar p, scalar T) const; inline scalar rho(scalar p, scalar T) const;
//- Return entropy [J/(kmol K)]
inline scalar s(const scalar p, const scalar T) const;
//- Return compressibility rho/p [s^2/m^2] //- Return compressibility rho/p [s^2/m^2]
inline scalar psi(scalar p, scalar T) const; inline scalar psi(scalar p, 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 | \\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -79,23 +79,30 @@ inline Foam::scalar Foam::rhoConst<Specie>::rho(scalar p, scalar T) const
template<class Specie> template<class Specie>
inline Foam::scalar Foam::rhoConst<Specie>::psi(scalar, scalar T) const inline Foam::scalar Foam::rhoConst<Specie>::s(scalar p, scalar T) const
{ {
return 0.0; return 0;
} }
template<class Specie> template<class Specie>
inline Foam::scalar Foam::rhoConst<Specie>::Z(scalar, scalar) const inline Foam::scalar Foam::rhoConst<Specie>::psi(scalar p, scalar T) const
{ {
return 0.0; return 0;
} }
template<class Specie> template<class Specie>
inline Foam::scalar Foam::rhoConst<Specie>::cpMcv(scalar, scalar) const inline Foam::scalar Foam::rhoConst<Specie>::Z(scalar p, scalar T) const
{ {
return 0.0; return 0;
}
template<class Specie>
inline Foam::scalar Foam::rhoConst<Specie>::cpMcv(scalar p, 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 | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -146,12 +146,7 @@ inline Foam::scalar Foam::eConstThermo<EquationOfState>::s
const scalar T const scalar T
) const ) const
{ {
notImplemented return cp()*log(T/Tstd) + EquationOfState::s(p, T);
(
"scalar eConstThermo<EquationOfState>::"
"s(const scalar p, const scalar) const"
);
return 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 | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -28,10 +28,10 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class equationOfState> template<class EquationOfState>
Foam::hConstThermo<equationOfState>::hConstThermo(Istream& is) Foam::hConstThermo<EquationOfState>::hConstThermo(Istream& is)
: :
equationOfState(is), EquationOfState(is),
Cp_(readScalar(is)), Cp_(readScalar(is)),
Hf_(readScalar(is)) Hf_(readScalar(is))
{ {
@ -42,10 +42,10 @@ Foam::hConstThermo<equationOfState>::hConstThermo(Istream& is)
} }
template<class equationOfState> template<class EquationOfState>
Foam::hConstThermo<equationOfState>::hConstThermo(const dictionary& dict) Foam::hConstThermo<EquationOfState>::hConstThermo(const dictionary& dict)
: :
equationOfState(dict), EquationOfState(dict),
Cp_(readScalar(dict.subDict("thermodynamics").lookup("Cp"))), Cp_(readScalar(dict.subDict("thermodynamics").lookup("Cp"))),
Hf_(readScalar(dict.subDict("thermodynamics").lookup("Hf"))) Hf_(readScalar(dict.subDict("thermodynamics").lookup("Hf")))
{ {
@ -56,10 +56,10 @@ Foam::hConstThermo<equationOfState>::hConstThermo(const dictionary& dict)
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class equationOfState> template<class EquationOfState>
void Foam::hConstThermo<equationOfState>::write(Ostream& os) const void Foam::hConstThermo<EquationOfState>::write(Ostream& os) const
{ {
equationOfState::write(os); EquationOfState::write(os);
dictionary dict("thermodynamics"); dictionary dict("thermodynamics");
dict.add("Cp", Cp_/this->W()); dict.add("Cp", Cp_/this->W());
@ -70,14 +70,14 @@ void Foam::hConstThermo<equationOfState>::write(Ostream& os) const
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
template<class equationOfState> template<class EquationOfState>
Foam::Ostream& Foam::operator<< Foam::Ostream& Foam::operator<<
( (
Ostream& os, Ostream& os,
const hConstThermo<equationOfState>& ct const hConstThermo<EquationOfState>& ct
) )
{ {
os << static_cast<const equationOfState&>(ct) << tab os << static_cast<const EquationOfState&>(ct) << tab
<< ct.Cp_/ct.W() << tab << ct.Hf_/ct.W(); << ct.Cp_/ct.W() << tab << ct.Hf_/ct.W();
os.check("Ostream& operator<<(Ostream& os, const hConstThermo& ct)"); os.check("Ostream& operator<<(Ostream& os, const hConstThermo& ct)");

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -26,7 +26,7 @@ Class
Description Description
Constant properties thermodynamics package Constant properties thermodynamics package
templated into the equationOfState. templated into the EquationOfState.
SourceFiles SourceFiles
hConstThermoI.H hConstThermoI.H

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -25,15 +25,15 @@ License
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class equationOfState> template<class EquationOfState>
inline Foam::hConstThermo<equationOfState>::hConstThermo inline Foam::hConstThermo<EquationOfState>::hConstThermo
( (
const equationOfState& st, const EquationOfState& st,
const scalar cp, const scalar cp,
const scalar hf const scalar hf
) )
: :
equationOfState(st), EquationOfState(st),
Cp_(cp), Cp_(cp),
Hf_(hf) Hf_(hf)
{} {}
@ -41,48 +41,48 @@ inline Foam::hConstThermo<equationOfState>::hConstThermo
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class equationOfState> template<class EquationOfState>
inline Foam::hConstThermo<equationOfState>::hConstThermo inline Foam::hConstThermo<EquationOfState>::hConstThermo
( (
const word& name, const word& name,
const hConstThermo& ct const hConstThermo& ct
) )
: :
equationOfState(name, ct), EquationOfState(name, ct),
Cp_(ct.Cp_), Cp_(ct.Cp_),
Hf_(ct.Hf_) Hf_(ct.Hf_)
{} {}
template<class equationOfState> template<class EquationOfState>
inline Foam::autoPtr<Foam::hConstThermo<equationOfState> > inline Foam::autoPtr<Foam::hConstThermo<EquationOfState> >
Foam::hConstThermo<equationOfState>::clone() const Foam::hConstThermo<EquationOfState>::clone() const
{ {
return autoPtr<hConstThermo<equationOfState> > return autoPtr<hConstThermo<EquationOfState> >
( (
new hConstThermo<equationOfState>(*this) new hConstThermo<EquationOfState>(*this)
); );
} }
template<class equationOfState> template<class EquationOfState>
inline Foam::autoPtr<Foam::hConstThermo<equationOfState> > inline Foam::autoPtr<Foam::hConstThermo<EquationOfState> >
Foam::hConstThermo<equationOfState>::New(Istream& is) Foam::hConstThermo<EquationOfState>::New(Istream& is)
{ {
return autoPtr<hConstThermo<equationOfState> > return autoPtr<hConstThermo<EquationOfState> >
( (
new hConstThermo<equationOfState>(is) new hConstThermo<EquationOfState>(is)
); );
} }
template<class equationOfState> template<class EquationOfState>
inline Foam::autoPtr<Foam::hConstThermo<equationOfState> > inline Foam::autoPtr<Foam::hConstThermo<EquationOfState> >
Foam::hConstThermo<equationOfState>::New(const dictionary& dict) Foam::hConstThermo<EquationOfState>::New(const dictionary& dict)
{ {
return autoPtr<hConstThermo<equationOfState> > return autoPtr<hConstThermo<EquationOfState> >
( (
new hConstThermo<equationOfState>(dict) new hConstThermo<EquationOfState>(dict)
); );
} }
@ -99,8 +99,8 @@ inline Foam::scalar Foam::hConstThermo<EquationOfState>::limit
} }
template<class equationOfState> template<class EquationOfState>
inline Foam::scalar Foam::hConstThermo<equationOfState>::cp inline Foam::scalar Foam::hConstThermo<EquationOfState>::cp
( (
const scalar p, const scalar p,
const scalar T const scalar T
@ -110,8 +110,8 @@ inline Foam::scalar Foam::hConstThermo<equationOfState>::cp
} }
template<class equationOfState> template<class EquationOfState>
inline Foam::scalar Foam::hConstThermo<equationOfState>::ha inline Foam::scalar Foam::hConstThermo<EquationOfState>::ha
( (
const scalar p, const scalar T const scalar p, const scalar T
) const ) const
@ -120,8 +120,8 @@ inline Foam::scalar Foam::hConstThermo<equationOfState>::ha
} }
template<class equationOfState> template<class EquationOfState>
inline Foam::scalar Foam::hConstThermo<equationOfState>::hs inline Foam::scalar Foam::hConstThermo<EquationOfState>::hs
( (
const scalar p, const scalar T const scalar p, const scalar T
) const ) const
@ -130,39 +130,34 @@ 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>::hc() const
{ {
return Hf_; return Hf_;
} }
template<class equationOfState> template<class EquationOfState>
inline Foam::scalar Foam::hConstThermo<equationOfState>::s inline Foam::scalar Foam::hConstThermo<EquationOfState>::s
( (
const scalar p, const scalar T const scalar p, const scalar T
) const ) const
{ {
notImplemented return Cp_*log(T/Tstd) + EquationOfState::s(p, T);
(
"scalar hConstThermo<equationOfState>::"
"s(const scalar p, const scalar T) const"
);
return T;
} }
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template<class equationOfState> template<class EquationOfState>
inline void Foam::hConstThermo<equationOfState>::operator+= inline void Foam::hConstThermo<EquationOfState>::operator+=
( (
const hConstThermo<equationOfState>& ct const hConstThermo<EquationOfState>& ct
) )
{ {
scalar molr1 = this->nMoles(); scalar molr1 = this->nMoles();
equationOfState::operator+=(ct); EquationOfState::operator+=(ct);
molr1 /= this->nMoles(); molr1 /= this->nMoles();
scalar molr2 = ct.nMoles()/this->nMoles(); scalar molr2 = ct.nMoles()/this->nMoles();
@ -172,15 +167,15 @@ inline void Foam::hConstThermo<equationOfState>::operator+=
} }
template<class equationOfState> template<class EquationOfState>
inline void Foam::hConstThermo<equationOfState>::operator-= inline void Foam::hConstThermo<EquationOfState>::operator-=
( (
const hConstThermo<equationOfState>& ct const hConstThermo<EquationOfState>& ct
) )
{ {
scalar molr1 = this->nMoles(); scalar molr1 = this->nMoles();
equationOfState::operator-=(ct); EquationOfState::operator-=(ct);
molr1 /= this->nMoles(); molr1 /= this->nMoles();
scalar molr2 = ct.nMoles()/this->nMoles(); scalar molr2 = ct.nMoles()/this->nMoles();
@ -192,20 +187,20 @@ inline void Foam::hConstThermo<equationOfState>::operator-=
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
template<class equationOfState> template<class EquationOfState>
inline Foam::hConstThermo<equationOfState> Foam::operator+ inline Foam::hConstThermo<EquationOfState> Foam::operator+
( (
const hConstThermo<equationOfState>& ct1, const hConstThermo<EquationOfState>& ct1,
const hConstThermo<equationOfState>& ct2 const hConstThermo<EquationOfState>& ct2
) )
{ {
equationOfState eofs EquationOfState eofs
( (
static_cast<const equationOfState&>(ct1) static_cast<const EquationOfState&>(ct1)
+ static_cast<const equationOfState&>(ct2) + static_cast<const EquationOfState&>(ct2)
); );
return hConstThermo<equationOfState> return hConstThermo<EquationOfState>
( (
eofs, eofs,
ct1.nMoles()/eofs.nMoles()*ct1.Cp_ ct1.nMoles()/eofs.nMoles()*ct1.Cp_
@ -216,20 +211,20 @@ inline Foam::hConstThermo<equationOfState> Foam::operator+
} }
template<class equationOfState> template<class EquationOfState>
inline Foam::hConstThermo<equationOfState> Foam::operator- inline Foam::hConstThermo<EquationOfState> Foam::operator-
( (
const hConstThermo<equationOfState>& ct1, const hConstThermo<EquationOfState>& ct1,
const hConstThermo<equationOfState>& ct2 const hConstThermo<EquationOfState>& ct2
) )
{ {
equationOfState eofs EquationOfState eofs
( (
static_cast<const equationOfState&>(ct1) static_cast<const EquationOfState&>(ct1)
- static_cast<const equationOfState&>(ct2) - static_cast<const EquationOfState&>(ct2)
); );
return hConstThermo<equationOfState> return hConstThermo<EquationOfState>
( (
eofs, eofs,
ct1.nMoles()/eofs.nMoles()*ct1.Cp_ ct1.nMoles()/eofs.nMoles()*ct1.Cp_
@ -240,27 +235,27 @@ inline Foam::hConstThermo<equationOfState> Foam::operator-
} }
template<class equationOfState> template<class EquationOfState>
inline Foam::hConstThermo<equationOfState> Foam::operator* inline Foam::hConstThermo<EquationOfState> Foam::operator*
( (
const scalar s, const scalar s,
const hConstThermo<equationOfState>& ct const hConstThermo<EquationOfState>& ct
) )
{ {
return hConstThermo<equationOfState> return hConstThermo<EquationOfState>
( (
s*static_cast<const equationOfState&>(ct), s*static_cast<const EquationOfState&>(ct),
ct.Cp_, ct.Cp_,
ct.Hf_ ct.Hf_
); );
} }
template<class equationOfState> template<class EquationOfState>
inline Foam::hConstThermo<equationOfState> Foam::operator== inline Foam::hConstThermo<EquationOfState> Foam::operator==
( (
const hConstThermo<equationOfState>& ct1, const hConstThermo<EquationOfState>& ct1,
const hConstThermo<equationOfState>& ct2 const hConstThermo<EquationOfState>& ct2
) )
{ {
return ct2 - ct1; return ct2 - ct1;

View File

@ -1,328 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2015 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 "hExponentialThermo.H"
#include "specie.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class equationOfState>
inline void Foam::hExponentialThermo<equationOfState>::checkT
(
const scalar T
) const
{
if (T < 0.0)
{
FatalErrorIn
(
"hExponentialThermo<equationOfState>::checkT(const scalar T) const"
) << "attempt to use hExponentialThermo<equationOfState>"
" out of temperature range "
<< T
<< abort(FatalError);
}
}
template<class equationOfState>
inline Foam::scalar Foam::hExponentialThermo<equationOfState>::integrateCp
(
const scalar T
) const
{
return
(
c0_*pow(T, n0_ + 1.0)/(pow(Tref_, n0_)*(n0_ + 1.0))
);
}
template<class equationOfState>
inline Foam::hExponentialThermo<equationOfState>::hExponentialThermo
(
const word& name,
const hExponentialThermo& jt
)
:
equationOfState(name, jt),
c0_(jt.c0_),
n0_(jt.n0_),
Tref_(jt.Tref_),
Hf_(jt.Hf_)
{}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class equationOfState>
inline Foam::hExponentialThermo<equationOfState>::hExponentialThermo
(
const equationOfState& st,
const scalar c0,
const scalar n0,
const scalar Tref,
const scalar Hf
)
:
equationOfState(st),
c0_(c0),
n0_(n0),
Tref_(Tref),
Hf_(Hf)
{}
template<class equationOfState>
inline Foam::autoPtr<Foam::hExponentialThermo<equationOfState> >
Foam::hExponentialThermo<equationOfState>::clone() const
{
return autoPtr<hExponentialThermo<equationOfState> >
(
new hExponentialThermo<equationOfState>(*this)
);
}
template<class equationOfState>
inline Foam::autoPtr<Foam::hExponentialThermo<equationOfState> >
Foam::hExponentialThermo<equationOfState>::New(Istream& is)
{
return autoPtr<hExponentialThermo<equationOfState> >
(
new hExponentialThermo<equationOfState>(is)
);
}
template<class equationOfState>
inline Foam::autoPtr<Foam::hExponentialThermo<equationOfState> >
Foam::hExponentialThermo<equationOfState>::New(const dictionary& dict)
{
return autoPtr<hExponentialThermo<equationOfState> >
(
new hExponentialThermo<equationOfState>(dict)
);
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class equationOfState>
inline Foam::scalar Foam::hExponentialThermo<equationOfState>::limit
(
const scalar T
) const
{
return T;
}
template<class equationOfState>
inline Foam::scalar Foam::hExponentialThermo<equationOfState>::cp
(
const scalar p, const scalar T
) const
{
return c0_*pow(T/Tref_, n0_);
}
template<class equationOfState>
inline Foam::scalar Foam::hExponentialThermo<equationOfState>::ha
(
const scalar p, const scalar T
) const
{
scalar hOffset = integrateCp(Tstd);
return
(
(integrateCp(T) + Hf_ - hOffset)
);
}
template<class equationOfState>
inline Foam::scalar Foam::hExponentialThermo<equationOfState>::hs
(
const scalar p, const scalar T
) const
{
scalar hOffset = integrateCp(Tstd);
return (integrateCp(T) - hOffset);
}
template<class equationOfState>
inline Foam::scalar Foam::hExponentialThermo<equationOfState>::hc() const
{
return Hf_;
}
template<class equationOfState>
inline Foam::scalar Foam::hExponentialThermo<equationOfState>::s
(
const scalar p, const scalar T
) const
{
notImplemented
(
"scalar hExponentialThermo<equationOfState>::"
"s(const scalar p, const scalar T) const"
);
return T;
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template<class equationOfState>
inline void Foam::hExponentialThermo<equationOfState>::operator+=
(
const hExponentialThermo<equationOfState>& ct
)
{
scalar molr1 = this->nMoles();
equationOfState::operator+=(ct);
molr1 /= this->nMoles();
scalar molr2 = ct.nMoles()/this->nMoles();
Hf_ = molr1*Hf_ + molr2*ct.Hf_;
c0_ = molr1*c0_ + molr2*ct.c0_;
n0_ = molr1*n0_ + molr2*ct.n0_;
Tref_ = molr1*Tref_ + molr2*ct.Tref_;
}
template<class equationOfState>
inline void Foam::hExponentialThermo<equationOfState>::operator-=
(
const hExponentialThermo<equationOfState>& ct
)
{
scalar molr1 = this->nMoles();
equationOfState::operator-=(ct);
molr1 /= this->nMoles();
scalar molr2 = ct.nMoles()/this->nMoles();
Hf_ = molr1*Hf_ - molr2*ct.Hf_;
c0_ = (molr1*c0_ - molr2*ct.c0_);
n0_ = (molr1*n0_ - molr2*ct.n0_);
Tref_ = (molr1*Tref_ - molr2*ct.Tref_);
}
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
template<class equationOfState>
inline Foam::hExponentialThermo<equationOfState> Foam::operator+
(
const hExponentialThermo<equationOfState>& ct1,
const hExponentialThermo<equationOfState>& ct2
)
{
equationOfState eofs
(
static_cast<const equationOfState&>(ct1)
+ static_cast<const equationOfState&>(ct2)
);
return hExponentialThermo<equationOfState>
(
eofs,
ct1.nMoles()/eofs.nMoles()*ct1.c0_
+ ct2.nMoles()/eofs.nMoles()*ct2.c0_,
ct1.nMoles()/eofs.nMoles()*ct1.n0_
+ ct2.nMoles()/eofs.nMoles()*ct2.n0_,
ct1.nMoles()/eofs.nMoles()*ct1.Tref_
+ ct2.nMoles()/eofs.nMoles()*ct2.Tref_,
ct1.nMoles()/eofs.nMoles()*ct1.Hf_
+ ct2.nMoles()/eofs.nMoles()*ct2.Hf_
);
}
template<class equationOfState>
inline Foam::hExponentialThermo<equationOfState> Foam::operator-
(
const hExponentialThermo<equationOfState>& ct1,
const hExponentialThermo<equationOfState>& ct2
)
{
equationOfState eofs
(
static_cast<const equationOfState&>(ct1)
+ static_cast<const equationOfState&>(ct2)
);
return hExponentialThermo<equationOfState>
(
eofs,
ct1.nMoles()/eofs.nMoles()*ct1.c0_
- ct2.nMoles()/eofs.nMoles()*ct2.c0_,
ct1.nMoles()/eofs.nMoles()*ct1.n0_
- ct2.nMoles()/eofs.nMoles()*ct2.n0_,
ct1.nMoles()/eofs.nMoles()*ct1.Tref_
- ct2.nMoles()/eofs.nMoles()*ct2.Tref_,
ct1.nMoles()/eofs.nMoles()*ct1.Hf_
- ct2.nMoles()/eofs.nMoles()*ct2.Hf_
);
}
template<class equationOfState>
inline Foam::hExponentialThermo<equationOfState> Foam::operator*
(
const scalar s,
const hExponentialThermo<equationOfState>& ct
)
{
return hExponentialThermo<equationOfState>
(
s*static_cast<const equationOfState&>(ct),
ct.c0_,
ct.n0_,
ct.Tref_,
ct.Hf_
);
}
template<class equationOfState>
inline Foam::hExponentialThermo<equationOfState> Foam::operator==
(
const hExponentialThermo<equationOfState>& ct1,
const hExponentialThermo<equationOfState>& ct2
)
{
return ct2 - ct1;
}
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -137,7 +137,7 @@ inline Foam::scalar Foam::hPolynomialThermo<EquationOfState, PolySize>::s
const scalar T const scalar T
) const ) const
{ {
return sCoeffs_.value(T); return sCoeffs_.value(T) + EquationOfState::s(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 | \\ / O peration |
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -23,33 +23,33 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "hExponentialThermo.H" #include "hPowerThermo.H"
#include "IOstreams.H" #include "IOstreams.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class equationOfState> template<class EquationOfState>
Foam::hExponentialThermo<equationOfState>::hExponentialThermo(Istream& is) Foam::hPowerThermo<EquationOfState>::hPowerThermo(Istream& is)
: :
equationOfState(is), EquationOfState(is),
n0_(readScalar(is)), n0_(readScalar(is)),
Tref_(readScalar(is)), Tref_(readScalar(is)),
Hf_(readScalar(is)) Hf_(readScalar(is))
{ {
is.check("hExponentialThermo::hExponentialThermo(Istream& is)"); is.check("hPowerThermo::hPowerThermo(Istream& is)");
c0_ *= this->W(); c0_ *= this->W();
Hf_ *= this->W(); Hf_ *= this->W();
} }
template<class equationOfState> template<class EquationOfState>
Foam::hExponentialThermo<equationOfState>::hExponentialThermo Foam::hPowerThermo<EquationOfState>::hPowerThermo
( (
const dictionary& dict const dictionary& dict
) )
: :
equationOfState(dict), EquationOfState(dict),
c0_(readScalar(dict.subDict("thermodynamics").lookup("C0"))), c0_(readScalar(dict.subDict("thermodynamics").lookup("C0"))),
n0_(readScalar(dict.subDict("thermodynamics").lookup("n0"))), n0_(readScalar(dict.subDict("thermodynamics").lookup("n0"))),
Tref_(readScalar(dict.subDict("thermodynamics").lookup("Tref"))), Tref_(readScalar(dict.subDict("thermodynamics").lookup("Tref"))),
@ -62,14 +62,14 @@ Foam::hExponentialThermo<equationOfState>::hExponentialThermo
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
template<class equationOfState> template<class EquationOfState>
Foam::Ostream& Foam::operator<< Foam::Ostream& Foam::operator<<
( (
Ostream& os, Ostream& os,
const hExponentialThermo<equationOfState>& et const hPowerThermo<EquationOfState>& et
) )
{ {
os << static_cast<const equationOfState&>(et) << nl os << static_cast<const EquationOfState&>(et) << nl
<< " " << et.c0_ << " " << et.c0_
<< tab << et.n0_ << tab << et.n0_
<< tab << et.Tref_ << tab << et.Tref_
@ -81,7 +81,7 @@ Foam::Ostream& Foam::operator<<
os.check os.check
( (
"operator<<(Ostream& os, const hExponentialThermo<equationOfState>& et)" "operator<<(Ostream& os, const hPowerThermo<EquationOfState>& et)"
); );
return os; return os;

View File

@ -22,59 +22,65 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class Class
Foam::hExponentialThermo Foam::hPowerThermo
Description Description
Exponential properties thermodynamics package Power-function based thermodynamics package templated on EquationOfState.
templated into the equationOfState.
In this thermodynamics package the heat capacity is a simple power of
temperature:
Cp(T) = c0*(T/Tref)^n0;
which is particularly suitable for solids.
SourceFiles SourceFiles
hExponentialThermoI.H hPowerThermoI.H
hExponentialThermo.C hPowerThermo.C
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef hExponentialThermo_H #ifndef hPowerThermo_H
#define hExponentialThermo_H #define hPowerThermo_H
#include "scalar.H" #include "scalar.H"
#include "dictionary.H"
#include "specie.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam namespace Foam
{ {
template<class EquationOfState> class hExponentialThermo; // Forward declaration of friend functions and operators
template<class EquationOfState> class hPowerThermo;
template<class EquationOfState> template<class EquationOfState>
inline hExponentialThermo<EquationOfState> operator+ inline hPowerThermo<EquationOfState> operator+
( (
const hExponentialThermo<EquationOfState>&, const hPowerThermo<EquationOfState>&,
const hExponentialThermo<EquationOfState>& const hPowerThermo<EquationOfState>&
); );
template<class EquationOfState> template<class EquationOfState>
inline hExponentialThermo<EquationOfState> operator- inline hPowerThermo<EquationOfState> operator-
( (
const hExponentialThermo<EquationOfState>&, const hPowerThermo<EquationOfState>&,
const hExponentialThermo<EquationOfState>& const hPowerThermo<EquationOfState>&
); );
template<class EquationOfState> template<class EquationOfState>
inline hExponentialThermo<EquationOfState> operator* inline hPowerThermo<EquationOfState> operator*
( (
const scalar, const scalar,
const hExponentialThermo<EquationOfState>& const hPowerThermo<EquationOfState>&
); );
template<class EquationOfState> template<class EquationOfState>
inline hExponentialThermo<EquationOfState> operator== inline hPowerThermo<EquationOfState> operator==
( (
const hExponentialThermo<EquationOfState>&, const hPowerThermo<EquationOfState>&,
const hExponentialThermo<EquationOfState>& const hPowerThermo<EquationOfState>&
); );
@ -82,20 +88,19 @@ template<class EquationOfState>
Ostream& operator<< Ostream& operator<<
( (
Ostream&, Ostream&,
const hExponentialThermo<EquationOfState>& const hPowerThermo<EquationOfState>&
); );
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class hExponentialThermo Declaration Class hPowerThermo Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
template<class EquationOfState> template<class EquationOfState>
class hExponentialThermo class hPowerThermo
: :
public EquationOfState public EquationOfState
{ {
// Private data // Private data
scalar c0_; scalar c0_;
@ -109,11 +114,8 @@ class hExponentialThermo
//- Check given temperature is within the range of the fitted coeffs //- Check given temperature is within the range of the fitted coeffs
inline void checkT(const scalar T) const; inline void checkT(const scalar T) const;
//- Integrate Cp expression
inline scalar integrateCp(const scalar T) const;
//- Construct from components //- Construct from components
inline hExponentialThermo inline hPowerThermo
( (
const EquationOfState& st, const EquationOfState& st,
const scalar c0, const scalar c0,
@ -122,31 +124,32 @@ class hExponentialThermo
const scalar Hf const scalar Hf
); );
public: public:
// Constructors // Constructors
//- Construct from Istream //- Construct from Istream
hExponentialThermo(Istream&); hPowerThermo(Istream&);
//- Construct from dictionary //- Construct from dictionary
hExponentialThermo(const dictionary&); hPowerThermo(const dictionary&);
//- Construct as a named copy //- Construct as a named copy
inline hExponentialThermo inline hPowerThermo
( (
const word&, const word&,
const hExponentialThermo& const hPowerThermo&
); );
//- Construct and return a clone //- Construct and return a clone
inline autoPtr<hExponentialThermo> clone() const; inline autoPtr<hPowerThermo> clone() const;
//- Selector from Istream //- Selector from Istream
inline static autoPtr<hExponentialThermo> New(Istream& is); inline static autoPtr<hPowerThermo> New(Istream& is);
//- Selector from dictionary //- Selector from dictionary
inline static autoPtr<hExponentialThermo> New(const dictionary& dict); inline static autoPtr<hPowerThermo> New(const dictionary& dict);
// Member Functions // Member Functions
@ -154,7 +157,7 @@ public:
//- Return the instantiated type name //- Return the instantiated type name
static word typeName() static word typeName()
{ {
return "hExponential<" + EquationOfState::typeName() + '>'; return "hPower<" + EquationOfState::typeName() + '>';
} }
//- Limit the temperature to be in the range Tlow_ to Thigh_ //- Limit the temperature to be in the range Tlow_ to Thigh_
@ -181,35 +184,35 @@ public:
// Member operators // Member operators
inline void operator+=(const hExponentialThermo&); inline void operator+=(const hPowerThermo&);
inline void operator-=(const hExponentialThermo&); inline void operator-=(const hPowerThermo&);
// Friend operators // Friend operators
friend hExponentialThermo operator+ <EquationOfState> friend hPowerThermo operator+ <EquationOfState>
( (
const hExponentialThermo&, const hPowerThermo&,
const hExponentialThermo& const hPowerThermo&
); );
friend hExponentialThermo operator- <EquationOfState> friend hPowerThermo operator- <EquationOfState>
( (
const hExponentialThermo&, const hPowerThermo&,
const hExponentialThermo& const hPowerThermo&
); );
friend hExponentialThermo operator* <EquationOfState> friend hPowerThermo operator* <EquationOfState>
( (
const scalar, const scalar,
const hExponentialThermo& const hPowerThermo&
); );
friend hExponentialThermo operator== <EquationOfState> friend hPowerThermo operator== <EquationOfState>
( (
const hExponentialThermo&, const hPowerThermo&,
const hExponentialThermo& const hPowerThermo&
); );
@ -218,7 +221,7 @@ public:
friend Ostream& operator<< <EquationOfState> friend Ostream& operator<< <EquationOfState>
( (
Ostream&, Ostream&,
const hExponentialThermo& const hPowerThermo&
); );
}; };
@ -229,10 +232,9 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository #ifdef NoRepository
# include "hExponentialThermoI.H" # include "hPowerThermoI.H"
# include "hExponentialThermo.C" # include "hPowerThermo.C"
#endif #endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -0,0 +1,307 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2015 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 "hPowerThermo.H"
#include "specie.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class EquationOfState>
inline void Foam::hPowerThermo<EquationOfState>::checkT
(
const scalar T
) const
{
if (T < 0)
{
FatalErrorIn
(
"hPowerThermo<EquationOfState>::checkT(const scalar T) const"
) << "attempt to evaluate hPowerThermo<EquationOfState>"
" for negative temperature " << T
<< abort(FatalError);
}
}
template<class EquationOfState>
inline Foam::hPowerThermo<EquationOfState>::hPowerThermo
(
const word& name,
const hPowerThermo& jt
)
:
EquationOfState(name, jt),
c0_(jt.c0_),
n0_(jt.n0_),
Tref_(jt.Tref_),
Hf_(jt.Hf_)
{}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class EquationOfState>
inline Foam::hPowerThermo<EquationOfState>::hPowerThermo
(
const EquationOfState& st,
const scalar c0,
const scalar n0,
const scalar Tref,
const scalar Hf
)
:
EquationOfState(st),
c0_(c0),
n0_(n0),
Tref_(Tref),
Hf_(Hf)
{}
template<class EquationOfState>
inline Foam::autoPtr<Foam::hPowerThermo<EquationOfState> >
Foam::hPowerThermo<EquationOfState>::clone() const
{
return autoPtr<hPowerThermo<EquationOfState> >
(
new hPowerThermo<EquationOfState>(*this)
);
}
template<class EquationOfState>
inline Foam::autoPtr<Foam::hPowerThermo<EquationOfState> >
Foam::hPowerThermo<EquationOfState>::New(Istream& is)
{
return autoPtr<hPowerThermo<EquationOfState> >
(
new hPowerThermo<EquationOfState>(is)
);
}
template<class EquationOfState>
inline Foam::autoPtr<Foam::hPowerThermo<EquationOfState> >
Foam::hPowerThermo<EquationOfState>::New(const dictionary& dict)
{
return autoPtr<hPowerThermo<EquationOfState> >
(
new hPowerThermo<EquationOfState>(dict)
);
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class EquationOfState>
inline Foam::scalar Foam::hPowerThermo<EquationOfState>::limit
(
const scalar T
) const
{
return T;
}
template<class EquationOfState>
inline Foam::scalar Foam::hPowerThermo<EquationOfState>::cp
(
const scalar p, const scalar T
) const
{
return c0_*pow(T/Tref_, n0_);
}
template<class EquationOfState>
inline Foam::scalar Foam::hPowerThermo<EquationOfState>::ha
(
const scalar p, const scalar T
) const
{
return hs(p, T) + hc();
}
template<class EquationOfState>
inline Foam::scalar Foam::hPowerThermo<EquationOfState>::hs
(
const scalar p, const scalar T
) const
{
return
c0_*(pow(T, n0_ + 1) - pow(Tstd, n0_ + 1))/(pow(Tref_, n0_)*(n0_ + 1));
}
template<class EquationOfState>
inline Foam::scalar Foam::hPowerThermo<EquationOfState>::hc() const
{
return Hf_;
}
template<class EquationOfState>
inline Foam::scalar Foam::hPowerThermo<EquationOfState>::s
(
const scalar p, const scalar T
) const
{
return
c0_*(pow(T, n0_) - pow(Tstd, n0_))/(pow(Tref_, n0_)*n0_)
+ EquationOfState::s(p, T);
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template<class EquationOfState>
inline void Foam::hPowerThermo<EquationOfState>::operator+=
(
const hPowerThermo<EquationOfState>& ct
)
{
scalar molr1 = this->nMoles();
EquationOfState::operator+=(ct);
molr1 /= this->nMoles();
scalar molr2 = ct.nMoles()/this->nMoles();
Hf_ = molr1*Hf_ + molr2*ct.Hf_;
c0_ = molr1*c0_ + molr2*ct.c0_;
n0_ = molr1*n0_ + molr2*ct.n0_;
Tref_ = molr1*Tref_ + molr2*ct.Tref_;
}
template<class EquationOfState>
inline void Foam::hPowerThermo<EquationOfState>::operator-=
(
const hPowerThermo<EquationOfState>& ct
)
{
scalar molr1 = this->nMoles();
EquationOfState::operator-=(ct);
molr1 /= this->nMoles();
scalar molr2 = ct.nMoles()/this->nMoles();
Hf_ = molr1*Hf_ - molr2*ct.Hf_;
c0_ = (molr1*c0_ - molr2*ct.c0_);
n0_ = (molr1*n0_ - molr2*ct.n0_);
Tref_ = (molr1*Tref_ - molr2*ct.Tref_);
}
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
template<class EquationOfState>
inline Foam::hPowerThermo<EquationOfState> Foam::operator+
(
const hPowerThermo<EquationOfState>& ct1,
const hPowerThermo<EquationOfState>& ct2
)
{
EquationOfState eofs
(
static_cast<const EquationOfState&>(ct1)
+ static_cast<const EquationOfState&>(ct2)
);
return hPowerThermo<EquationOfState>
(
eofs,
ct1.nMoles()/eofs.nMoles()*ct1.c0_
+ ct2.nMoles()/eofs.nMoles()*ct2.c0_,
ct1.nMoles()/eofs.nMoles()*ct1.n0_
+ ct2.nMoles()/eofs.nMoles()*ct2.n0_,
ct1.nMoles()/eofs.nMoles()*ct1.Tref_
+ ct2.nMoles()/eofs.nMoles()*ct2.Tref_,
ct1.nMoles()/eofs.nMoles()*ct1.Hf_
+ ct2.nMoles()/eofs.nMoles()*ct2.Hf_
);
}
template<class EquationOfState>
inline Foam::hPowerThermo<EquationOfState> Foam::operator-
(
const hPowerThermo<EquationOfState>& ct1,
const hPowerThermo<EquationOfState>& ct2
)
{
EquationOfState eofs
(
static_cast<const EquationOfState&>(ct1)
+ static_cast<const EquationOfState&>(ct2)
);
return hPowerThermo<EquationOfState>
(
eofs,
ct1.nMoles()/eofs.nMoles()*ct1.c0_
- ct2.nMoles()/eofs.nMoles()*ct2.c0_,
ct1.nMoles()/eofs.nMoles()*ct1.n0_
- ct2.nMoles()/eofs.nMoles()*ct2.n0_,
ct1.nMoles()/eofs.nMoles()*ct1.Tref_
- ct2.nMoles()/eofs.nMoles()*ct2.Tref_,
ct1.nMoles()/eofs.nMoles()*ct1.Hf_
- ct2.nMoles()/eofs.nMoles()*ct2.Hf_
);
}
template<class EquationOfState>
inline Foam::hPowerThermo<EquationOfState> Foam::operator*
(
const scalar s,
const hPowerThermo<EquationOfState>& ct
)
{
return hPowerThermo<EquationOfState>
(
s*static_cast<const EquationOfState&>(ct),
ct.c0_,
ct.n0_,
ct.Tref_,
ct.Hf_
);
}
template<class EquationOfState>
inline Foam::hPowerThermo<EquationOfState> Foam::operator==
(
const hPowerThermo<EquationOfState>& ct1,
const hPowerThermo<EquationOfState>& ct2
)
{
return ct2 - ct1;
}
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -220,9 +220,10 @@ inline Foam::scalar Foam::janafThermo<EquationOfState>::s
return return
RR* RR*
( (
(((a[4]/4.0*T + a[3]/3.0)*T + a[2]/2.0)*T + a[1])*T + a[0]*::log(T) (((a[4]/4.0*T + a[3]/3.0)*T + a[2]/2.0)*T + a[1])*T + a[0]*log(T)
+ a[6] + a[6]
); )
+ EquationOfState::s(p, T);
} }