Skip to content
Permalink
Browse files

thermophysicalModels::eRefConstThermo: New thermodynamics to be used …

…with internal energy

in preference hRefConstThermo.
  • Loading branch information...
Henry Weller
Henry Weller committed Oct 26, 2018
1 parent 2cc3cb1 commit 80cc9603a1727afec4ada960f44d78e502f07f82
Showing with 633 additions and 62 deletions.
  1. +7 −6 applications/solvers/multiphase/reactingEulerFoam/phaseSystems/reactionThermo/hRefConstThermos.C
  2. +0 −1 src/thermophysicalModels/specie/thermo/eConst/eConstThermo.H
  3. +72 −0 src/thermophysicalModels/specie/thermo/eRefConst/eRefConstThermo.C
  4. +224 −0 src/thermophysicalModels/specie/thermo/eRefConst/eRefConstThermo.H
  5. +274 −0 src/thermophysicalModels/specie/thermo/eRefConst/eRefConstThermoI.H
  6. +9 −9 src/thermophysicalModels/specie/thermo/hRefConst/hRefConstThermoI.H
  7. +4 −4 ...iphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/constant/thermophysicalProperties.gas
  8. +3 −3 ...ase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_2phase/constant/thermophysicalProperties.liquid
  9. +4 −4 ...iphase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/constant/thermophysicalProperties.gas
  10. +4 −4 ...phase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/constant/thermophysicalProperties.gas2
  11. +3 −3 ...ase/reactingMultiphaseEulerFoam/RAS/wallBoiling1D_3phase/constant/thermophysicalProperties.liquid
  12. +3 −3 tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/constant/thermophysicalProperties.gas
  13. +3 −3 ...als/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/constant/thermophysicalProperties.liquid
  14. +4 −4 ...ials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/constant/thermophysicalProperties.gas
  15. +3 −3 ...s/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling1D/constant/thermophysicalProperties.liquid
  16. +3 −2 ...ls/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingIATE/constant/thermophysicalProperties.gas
  17. +4 −4 ...multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingIATE/constant/thermophysicalProperties.liquid
  18. +3 −3 ...phase/reactingTwoPhaseEulerFoam/RAS/wallBoilingPolyDisperse/constant/thermophysicalProperties.gas
  19. +3 −3 ...se/reactingTwoPhaseEulerFoam/RAS/wallBoilingPolyDisperse/constant/thermophysicalProperties.liquid
  20. +3 −3 ...ltiphase/reactingTwoPhaseEulerFoam/laminar/steamInjection/constant/thermophysicalProperties.water
@@ -37,6 +37,7 @@ License
#include "sensibleEnthalpy.H"

#include "hRefConstThermo.H"
#include "eRefConstThermo.H"

#include "constTransport.H"

@@ -86,7 +87,7 @@ constTransport
<
species::thermo
<
hRefConstThermo
eRefConstThermo
<
perfectGas<specie>
>,
@@ -99,7 +100,7 @@ constTransport
<
species::thermo
<
hRefConstThermo
eRefConstThermo
<
perfectFluid<specie>
>,
@@ -112,7 +113,7 @@ constTransport
<
species::thermo
<
hRefConstThermo
eRefConstThermo
<
rhoConst<specie>
>,
@@ -182,7 +183,7 @@ makeThermos
pureMixture,
constTransport,
sensibleInternalEnergy,
hRefConstThermo,
eRefConstThermo,
perfectGas,
specie
);
@@ -194,7 +195,7 @@ makeThermos
pureMixture,
constTransport,
sensibleInternalEnergy,
hRefConstThermo,
eRefConstThermo,
perfectFluid,
specie
);
@@ -206,7 +207,7 @@ makeThermos
pureMixture,
constTransport,
sensibleInternalEnergy,
hRefConstThermo,
eRefConstThermo,
rhoConst,
specie
);
@@ -166,7 +166,6 @@ public:
inline scalar dCpdT(const scalar p, const scalar T) const;



// I-O

//- Write to Ostream
@@ -0,0 +1,72 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2018 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 "eRefConstThermo.H"
#include "IOstreams.H"

// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

template<class EquationOfState>
Foam::eRefConstThermo<EquationOfState>::eRefConstThermo(const dictionary& dict)
:
EquationOfState(dict),
Cv_(readScalar(dict.subDict("thermodynamics").lookup("Cv"))),
Hf_(readScalar(dict.subDict("thermodynamics").lookup("Hf"))),
Tref_(readScalar(dict.subDict("thermodynamics").lookup("Tref"))),
Eref_(readScalar(dict.subDict("thermodynamics").lookup("Eref")))
{}


// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //

template<class EquationOfState>
void Foam::eRefConstThermo<EquationOfState>::write(Ostream& os) const
{
EquationOfState::write(os);

dictionary dict("thermodynamics");
dict.add("Cv", Cv_);
dict.add("Hf", Hf_);
dict.add("Tref", Tref_);
dict.add("Eref", Eref_);
os << indent << dict.dictName() << dict;
}


// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //

template<class EquationOfState>
Foam::Ostream& Foam::operator<<
(
Ostream& os,
const eRefConstThermo<EquationOfState>& ct
)
{
ct.write(os);
return os;
}


// ************************************************************************* //
@@ -0,0 +1,224 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2018 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::eRefConstThermo
Description
Constant properties thermodynamics package
templated into the EquationOfState.
SourceFiles
eRefConstThermoI.H
eRefConstThermo.C
\*---------------------------------------------------------------------------*/

#ifndef eRefConstThermo_H
#define eRefConstThermo_H

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

namespace Foam
{

// Forward declaration of friend functions and operators

template<class EquationOfState> class eRefConstThermo;

template<class EquationOfState>
inline eRefConstThermo<EquationOfState> operator+
(
const eRefConstThermo<EquationOfState>&,
const eRefConstThermo<EquationOfState>&
);

template<class EquationOfState>
inline eRefConstThermo<EquationOfState> operator*
(
const scalar,
const eRefConstThermo<EquationOfState>&
);

template<class EquationOfState>
inline eRefConstThermo<EquationOfState> operator==
(
const eRefConstThermo<EquationOfState>&,
const eRefConstThermo<EquationOfState>&
);

template<class EquationOfState>
Ostream& operator<<
(
Ostream&,
const eRefConstThermo<EquationOfState>&
);


/*---------------------------------------------------------------------------*\
Class eRefConstThermo Declaration
\*---------------------------------------------------------------------------*/

template<class EquationOfState>
class eRefConstThermo
:
public EquationOfState
{
// Private data

scalar Cv_;
scalar Hf_;
scalar Tref_;
scalar Eref_;


// Private Member Functions

//- Construct from components
inline eRefConstThermo
(
const EquationOfState& st,
const scalar cv,
const scalar hf,
const scalar tref,
const scalar eref
);


public:

// Constructors

//- Construct from dictionary
eRefConstThermo(const dictionary& dict);

//- Construct as named copy
inline eRefConstThermo(const word&, const eRefConstThermo&);

//- Construct and return a clone
inline autoPtr<eRefConstThermo> clone() const;

//- Selector from dictionary
inline static autoPtr<eRefConstThermo> New(const dictionary& dict);


// Member Functions

//- Return the instantiated type name
static word typeName()
{
return "eRefConst<" + EquationOfState::typeName() + '>';
}

//- Limit the temperature to be in the range Tlow_ to Thigh_
inline scalar limit(const scalar T) const;


// Fundamental properties

//- Heat capacity at constant volume [J/(kg K)]
inline scalar Cv(const scalar p, const scalar T) const;

//- Sensible internal energy [J/kg]
inline scalar Es(const scalar p, const scalar T) const;

//- Absolute internal energy [J/kg]
inline scalar Ea(const scalar p, const scalar T) const;

//- Chemical enthalpy [J/kg]
inline scalar Hc() const;

//- Entropy [J/(kg K)]
inline scalar S(const scalar p, const scalar T) const;

#include "EtoHthermo.H"


// Derivative term used for Jacobian

//- Derivative of Gibbs free energy w.r.t. temperature
inline scalar dGdT(const scalar p, const scalar T) const;

//- Temperature derivative of heat capacity at constant pressure
inline scalar dCpdT(const scalar p, const scalar T) const;


// I-O

//- Write to Ostream
void write(Ostream& os) const;


// Member operators

inline void operator+=(const eRefConstThermo&);


// Friend operators

friend eRefConstThermo operator+ <EquationOfState>
(
const eRefConstThermo&,
const eRefConstThermo&
);

friend eRefConstThermo operator* <EquationOfState>
(
const scalar,
const eRefConstThermo&
);

friend eRefConstThermo operator== <EquationOfState>
(
const eRefConstThermo&,
const eRefConstThermo&
);


// IOstream Operators

friend Ostream& operator<< <EquationOfState>
(
Ostream&,
const eRefConstThermo&
);
};


// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

} // End namespace Foam

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

#include "eRefConstThermoI.H"

#ifdef NoRepository
#include "eRefConstThermo.C"
#endif

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

#endif

// ************************************************************************* //

0 comments on commit 80cc960

Please sign in to comment.
You can’t perform that action at this time.