mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Propagated dictionary constructors through lib specie
This commit is contained in:
@ -43,6 +43,16 @@ icoPolynomial<PolySize>::icoPolynomial(Istream& is)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<int PolySize>
|
||||||
|
icoPolynomial<PolySize>::icoPolynomial(const dictionary& dict)
|
||||||
|
:
|
||||||
|
specie(dict),
|
||||||
|
rhoPolynomial_(dict.lookup("rhoPolynomial"))
|
||||||
|
{
|
||||||
|
rhoPolynomial_ *= this->W();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<int PolySize>
|
template<int PolySize>
|
||||||
|
|||||||
@ -117,6 +117,9 @@ public:
|
|||||||
//- Construct from Istream
|
//- Construct from Istream
|
||||||
icoPolynomial(Istream&);
|
icoPolynomial(Istream&);
|
||||||
|
|
||||||
|
//- Construct from dictionary
|
||||||
|
icoPolynomial(const dictionary& dict);
|
||||||
|
|
||||||
//- Construct as copy
|
//- Construct as copy
|
||||||
inline icoPolynomial(const icoPolynomial&);
|
inline icoPolynomial(const icoPolynomial&);
|
||||||
|
|
||||||
@ -129,6 +132,9 @@ public:
|
|||||||
// Selector from Istream
|
// Selector from Istream
|
||||||
inline static autoPtr<icoPolynomial> New(Istream& is);
|
inline static autoPtr<icoPolynomial> New(Istream& is);
|
||||||
|
|
||||||
|
// Selector from dictionary
|
||||||
|
inline static autoPtr<icoPolynomial> New(const dictionary& dict);
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
// Member functions
|
||||||
|
|
||||||
|
|||||||
@ -83,6 +83,17 @@ Foam::icoPolynomial<PolySize>::New(Istream& is)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<int PolySize>
|
||||||
|
inline Foam::autoPtr<Foam::icoPolynomial<PolySize> >
|
||||||
|
Foam::icoPolynomial<PolySize>::New(const dictionary& dict)
|
||||||
|
{
|
||||||
|
return autoPtr<icoPolynomial<PolySize> >
|
||||||
|
(
|
||||||
|
new icoPolynomial<PolySize>(dict)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<int PolySize>
|
template<int PolySize>
|
||||||
|
|||||||
@ -41,6 +41,12 @@ perfectGas::perfectGas(Istream& is)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
perfectGas::perfectGas(const dictionary& dict)
|
||||||
|
:
|
||||||
|
specie(dict)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Ostream& operator<<(Ostream& os, const perfectGas& pg)
|
Ostream& operator<<(Ostream& os, const perfectGas& pg)
|
||||||
|
|||||||
@ -63,6 +63,9 @@ public:
|
|||||||
//- Construct from Istream
|
//- Construct from Istream
|
||||||
perfectGas(Istream&);
|
perfectGas(Istream&);
|
||||||
|
|
||||||
|
//- Construct from dictionary
|
||||||
|
perfectGas(const dictionary& dict);
|
||||||
|
|
||||||
//- Construct as named copy
|
//- Construct as named copy
|
||||||
inline perfectGas(const word& name, const perfectGas&);
|
inline perfectGas(const word& name, const perfectGas&);
|
||||||
|
|
||||||
@ -72,6 +75,9 @@ public:
|
|||||||
// Selector from Istream
|
// Selector from Istream
|
||||||
inline static autoPtr<perfectGas> New(Istream& is);
|
inline static autoPtr<perfectGas> New(Istream& is);
|
||||||
|
|
||||||
|
// Selector from dictionary
|
||||||
|
inline static autoPtr<perfectGas> New(const dictionary& dict);
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
// Member functions
|
||||||
|
|
||||||
|
|||||||
@ -32,7 +32,6 @@ namespace Foam
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
// Construct from components
|
|
||||||
inline perfectGas::perfectGas
|
inline perfectGas::perfectGas
|
||||||
(
|
(
|
||||||
const specie& sp
|
const specie& sp
|
||||||
@ -44,42 +43,44 @@ inline perfectGas::perfectGas
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// Construct as named copy
|
|
||||||
inline perfectGas::perfectGas(const word& name, const perfectGas& pg)
|
inline perfectGas::perfectGas(const word& name, const perfectGas& pg)
|
||||||
:
|
:
|
||||||
specie(name, pg)
|
specie(name, pg)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// Construct and return a clone
|
|
||||||
inline autoPtr<perfectGas> perfectGas::clone() const
|
inline autoPtr<perfectGas> perfectGas::clone() const
|
||||||
{
|
{
|
||||||
return autoPtr<perfectGas>(new perfectGas(*this));
|
return autoPtr<perfectGas>(new perfectGas(*this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Selector from Istream
|
|
||||||
inline autoPtr<perfectGas> perfectGas::New(Istream& is)
|
inline autoPtr<perfectGas> perfectGas::New(Istream& is)
|
||||||
{
|
{
|
||||||
return autoPtr<perfectGas>(new perfectGas(is));
|
return autoPtr<perfectGas>(new perfectGas(is));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline autoPtr<perfectGas> perfectGas::New(const dictionary& dict)
|
||||||
|
{
|
||||||
|
return autoPtr<perfectGas>(new perfectGas(dict));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
//- Return density [kg/m^3]
|
|
||||||
inline scalar perfectGas::rho(scalar p, scalar T) const
|
inline scalar perfectGas::rho(scalar p, scalar T) const
|
||||||
{
|
{
|
||||||
return p/(R()*T);
|
return p/(R()*T);
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Return compressibility rho/p [s^2/m^2]
|
|
||||||
inline scalar perfectGas::psi(scalar, scalar T) const
|
inline scalar perfectGas::psi(scalar, scalar T) const
|
||||||
{
|
{
|
||||||
return 1.0/(R()*T);
|
return 1.0/(R()*T);
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Return compression factor []
|
|
||||||
inline scalar perfectGas::Z(scalar, scalar) const
|
inline scalar perfectGas::Z(scalar, scalar) const
|
||||||
{
|
{
|
||||||
return 1.0;
|
return 1.0;
|
||||||
@ -93,11 +94,13 @@ inline void perfectGas::operator+=(const perfectGas& pg)
|
|||||||
specie::operator+=(pg);
|
specie::operator+=(pg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline void perfectGas::operator-=(const perfectGas& pg)
|
inline void perfectGas::operator-=(const perfectGas& pg)
|
||||||
{
|
{
|
||||||
specie::operator-=(pg);
|
specie::operator-=(pg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline void perfectGas::operator*=(const scalar s)
|
inline void perfectGas::operator*=(const scalar s)
|
||||||
{
|
{
|
||||||
specie::operator*=(s);
|
specie::operator*=(s);
|
||||||
|
|||||||
@ -25,16 +25,10 @@ License
|
|||||||
|
|
||||||
#include "IrreversibleReaction.H"
|
#include "IrreversibleReaction.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// Construct from components
|
|
||||||
template<class ReactionThermo, class ReactionRate>
|
template<class ReactionThermo, class ReactionRate>
|
||||||
IrreversibleReaction<ReactionThermo, ReactionRate>::IrreversibleReaction
|
Foam::IrreversibleReaction<ReactionThermo, ReactionRate>::IrreversibleReaction
|
||||||
(
|
(
|
||||||
const Reaction<ReactionThermo>& reaction,
|
const Reaction<ReactionThermo>& reaction,
|
||||||
const ReactionRate& k
|
const ReactionRate& k
|
||||||
@ -45,9 +39,8 @@ IrreversibleReaction<ReactionThermo, ReactionRate>::IrreversibleReaction
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// Construct from components
|
|
||||||
template<class ReactionThermo, class ReactionRate>
|
template<class ReactionThermo, class ReactionRate>
|
||||||
IrreversibleReaction<ReactionThermo, ReactionRate>::IrreversibleReaction
|
Foam::IrreversibleReaction<ReactionThermo, ReactionRate>::IrreversibleReaction
|
||||||
(
|
(
|
||||||
const speciesTable& species,
|
const speciesTable& species,
|
||||||
const HashPtrTable<ReactionThermo>& thermoDatabase,
|
const HashPtrTable<ReactionThermo>& thermoDatabase,
|
||||||
@ -59,9 +52,21 @@ IrreversibleReaction<ReactionThermo, ReactionRate>::IrreversibleReaction
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// Construct as copy given new speciesTable
|
|
||||||
template<class ReactionThermo, class ReactionRate>
|
template<class ReactionThermo, class ReactionRate>
|
||||||
IrreversibleReaction<ReactionThermo, ReactionRate>::IrreversibleReaction
|
Foam::IrreversibleReaction<ReactionThermo, ReactionRate>::IrreversibleReaction
|
||||||
|
(
|
||||||
|
const speciesTable& species,
|
||||||
|
const HashPtrTable<ReactionThermo>& thermoDatabase,
|
||||||
|
const dictionary& dict
|
||||||
|
)
|
||||||
|
:
|
||||||
|
Reaction<ReactionThermo>(species, thermoDatabase, dict),
|
||||||
|
k_(species, dict)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
template<class ReactionThermo, class ReactionRate>
|
||||||
|
Foam::IrreversibleReaction<ReactionThermo, ReactionRate>::IrreversibleReaction
|
||||||
(
|
(
|
||||||
const IrreversibleReaction<ReactionThermo, ReactionRate>& irr,
|
const IrreversibleReaction<ReactionThermo, ReactionRate>& irr,
|
||||||
const speciesTable& species
|
const speciesTable& species
|
||||||
@ -75,7 +80,7 @@ IrreversibleReaction<ReactionThermo, ReactionRate>::IrreversibleReaction
|
|||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class ReactionThermo, class ReactionRate>
|
template<class ReactionThermo, class ReactionRate>
|
||||||
scalar IrreversibleReaction<ReactionThermo, ReactionRate>::kf
|
Foam::scalar Foam::IrreversibleReaction<ReactionThermo, ReactionRate>::kf
|
||||||
(
|
(
|
||||||
const scalar T,
|
const scalar T,
|
||||||
const scalar p,
|
const scalar p,
|
||||||
@ -87,7 +92,7 @@ scalar IrreversibleReaction<ReactionThermo, ReactionRate>::kf
|
|||||||
|
|
||||||
|
|
||||||
template<class ReactionThermo, class ReactionRate>
|
template<class ReactionThermo, class ReactionRate>
|
||||||
void IrreversibleReaction<ReactionThermo, ReactionRate>::write
|
void Foam::IrreversibleReaction<ReactionThermo, ReactionRate>::write
|
||||||
(
|
(
|
||||||
Ostream& os
|
Ostream& os
|
||||||
) const
|
) const
|
||||||
@ -97,8 +102,4 @@ void IrreversibleReaction<ReactionThermo, ReactionRate>::write
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -44,7 +44,7 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class IrreversibleReaction Declaration
|
Class IrreversibleReaction Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
template<class ReactionThermo, class ReactionRate>
|
template<class ReactionThermo, class ReactionRate>
|
||||||
@ -96,6 +96,14 @@ public:
|
|||||||
Istream& is
|
Istream& is
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//- Construct from dictionary
|
||||||
|
IrreversibleReaction
|
||||||
|
(
|
||||||
|
const speciesTable& species,
|
||||||
|
const HashPtrTable<ReactionThermo>& thermoDatabase,
|
||||||
|
const dictionary& dict
|
||||||
|
);
|
||||||
|
|
||||||
//- Construct and return a clone
|
//- Construct and return a clone
|
||||||
virtual autoPtr<Reaction<ReactionThermo> > clone() const
|
virtual autoPtr<Reaction<ReactionThermo> > clone() const
|
||||||
{
|
{
|
||||||
|
|||||||
@ -25,16 +25,10 @@ License
|
|||||||
|
|
||||||
#include "NonEquilibriumReversibleReaction.H"
|
#include "NonEquilibriumReversibleReaction.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// Construct from components
|
|
||||||
template<class ReactionThermo, class ReactionRate>
|
template<class ReactionThermo, class ReactionRate>
|
||||||
NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>::
|
Foam::NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>::
|
||||||
NonEquilibriumReversibleReaction
|
NonEquilibriumReversibleReaction
|
||||||
(
|
(
|
||||||
const Reaction<ReactionThermo>& reaction,
|
const Reaction<ReactionThermo>& reaction,
|
||||||
@ -48,9 +42,9 @@ NonEquilibriumReversibleReaction
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// Construct from components
|
|
||||||
template<class ReactionThermo, class ReactionRate>
|
template<class ReactionThermo, class ReactionRate>
|
||||||
NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>::
|
Foam::NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>::
|
||||||
NonEquilibriumReversibleReaction
|
NonEquilibriumReversibleReaction
|
||||||
(
|
(
|
||||||
const speciesTable& species,
|
const speciesTable& species,
|
||||||
@ -63,9 +57,24 @@ NonEquilibriumReversibleReaction
|
|||||||
rk_(species, is)
|
rk_(species, is)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
// Construct as copy given new speciesTable
|
|
||||||
template<class ReactionThermo, class ReactionRate>
|
template<class ReactionThermo, class ReactionRate>
|
||||||
NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>::
|
Foam::NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>::
|
||||||
|
NonEquilibriumReversibleReaction
|
||||||
|
(
|
||||||
|
const speciesTable& species,
|
||||||
|
const HashPtrTable<ReactionThermo>& thermoDatabase,
|
||||||
|
const dictionary& dict
|
||||||
|
)
|
||||||
|
:
|
||||||
|
Reaction<ReactionThermo>(species, thermoDatabase, dict),
|
||||||
|
fk_(species, dict),
|
||||||
|
rk_(species, dict)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
template<class ReactionThermo, class ReactionRate>
|
||||||
|
Foam::NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>::
|
||||||
NonEquilibriumReversibleReaction
|
NonEquilibriumReversibleReaction
|
||||||
(
|
(
|
||||||
const NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>& nerr,
|
const NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>& nerr,
|
||||||
@ -81,7 +90,8 @@ NonEquilibriumReversibleReaction
|
|||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class ReactionThermo, class ReactionRate>
|
template<class ReactionThermo, class ReactionRate>
|
||||||
scalar NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>::kf
|
Foam::scalar
|
||||||
|
Foam::NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>::kf
|
||||||
(
|
(
|
||||||
const scalar T,
|
const scalar T,
|
||||||
const scalar p,
|
const scalar p,
|
||||||
@ -93,7 +103,8 @@ scalar NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>::kf
|
|||||||
|
|
||||||
|
|
||||||
template<class ReactionThermo, class ReactionRate>
|
template<class ReactionThermo, class ReactionRate>
|
||||||
scalar NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>::kr
|
Foam::scalar
|
||||||
|
Foam::NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>::kr
|
||||||
(
|
(
|
||||||
const scalar,
|
const scalar,
|
||||||
const scalar T,
|
const scalar T,
|
||||||
@ -106,7 +117,8 @@ scalar NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>::kr
|
|||||||
|
|
||||||
|
|
||||||
template<class ReactionThermo, class ReactionRate>
|
template<class ReactionThermo, class ReactionRate>
|
||||||
scalar NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>::kr
|
Foam::scalar
|
||||||
|
Foam::NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>::kr
|
||||||
(
|
(
|
||||||
const scalar T,
|
const scalar T,
|
||||||
const scalar p,
|
const scalar p,
|
||||||
@ -118,7 +130,7 @@ scalar NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>::kr
|
|||||||
|
|
||||||
|
|
||||||
template<class ReactionThermo, class ReactionRate>
|
template<class ReactionThermo, class ReactionRate>
|
||||||
void NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>::write
|
void Foam::NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>::write
|
||||||
(
|
(
|
||||||
Ostream& os
|
Ostream& os
|
||||||
) const
|
) const
|
||||||
@ -128,8 +140,4 @@ void NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>::write
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -44,7 +44,7 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class NonEquilibriumReversibleReaction Declaration
|
Class NonEquilibriumReversibleReaction Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
template<class ReactionThermo, class ReactionRate>
|
template<class ReactionThermo, class ReactionRate>
|
||||||
@ -100,6 +100,14 @@ public:
|
|||||||
Istream& is
|
Istream& is
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//- Construct from dictionary
|
||||||
|
NonEquilibriumReversibleReaction
|
||||||
|
(
|
||||||
|
const speciesTable& species,
|
||||||
|
const HashPtrTable<ReactionThermo>& thermoDatabase,
|
||||||
|
const dictionary& dict
|
||||||
|
);
|
||||||
|
|
||||||
//- Construct and return a clone
|
//- Construct and return a clone
|
||||||
virtual autoPtr<Reaction<ReactionThermo> > clone() const
|
virtual autoPtr<Reaction<ReactionThermo> > clone() const
|
||||||
{
|
{
|
||||||
|
|||||||
@ -196,6 +196,22 @@ Foam::Reaction<ReactionThermo>::Reaction
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class ReactionThermo>
|
||||||
|
Foam::Reaction<ReactionThermo>::Reaction
|
||||||
|
(
|
||||||
|
const speciesTable& species,
|
||||||
|
const HashPtrTable<ReactionThermo>& thermoDatabase,
|
||||||
|
const dictionary& dict
|
||||||
|
)
|
||||||
|
:
|
||||||
|
ReactionThermo(*thermoDatabase[species[0]]),
|
||||||
|
species_(species)
|
||||||
|
{
|
||||||
|
setLRhs(IStringStream(dict.lookup("reaction"))());
|
||||||
|
setThermo(thermoDatabase);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class ReactionThermo>
|
template<class ReactionThermo>
|
||||||
@ -211,11 +227,11 @@ Foam::Reaction<ReactionThermo>::New
|
|||||||
{
|
{
|
||||||
FatalIOErrorIn
|
FatalIOErrorIn
|
||||||
(
|
(
|
||||||
"Reaction<ReactionThermo>::New(const speciesTable& species,"
|
"Reaction<ReactionThermo>::New(const speciesTable&, "
|
||||||
" const HashPtrTable<ReactionThermo>& thermoDatabase, Istream&)",
|
" const HashPtrTable<ReactionThermo>&, Istream&)",
|
||||||
is
|
is
|
||||||
) << "Reaction type not specified" << nl << nl
|
) << "Reaction type not specified" << nl << nl
|
||||||
<< "Valid Reaction types are :" << endl
|
<< "Valid Reaction types are :" << nl
|
||||||
<< IstreamConstructorTablePtr_->sortedToc()
|
<< IstreamConstructorTablePtr_->sortedToc()
|
||||||
<< exit(FatalIOError);
|
<< exit(FatalIOError);
|
||||||
}
|
}
|
||||||
@ -229,12 +245,12 @@ Foam::Reaction<ReactionThermo>::New
|
|||||||
{
|
{
|
||||||
FatalIOErrorIn
|
FatalIOErrorIn
|
||||||
(
|
(
|
||||||
"Reaction<ReactionThermo>::New(const speciesTable& species,"
|
"Reaction<ReactionThermo>::New(const speciesTable&, "
|
||||||
" const HashPtrTable<ReactionThermo>& thermoDatabase, Istream&)",
|
" const HashPtrTable<ReactionThermo>&, Istream&)",
|
||||||
is
|
is
|
||||||
) << "Unknown reaction type "
|
) << "Unknown reaction type "
|
||||||
<< reactionTypeName << nl << nl
|
<< reactionTypeName << nl << nl
|
||||||
<< "Valid reaction types are :" << endl
|
<< "Valid reaction types are :" << nl
|
||||||
<< IstreamConstructorTablePtr_->sortedToc()
|
<< IstreamConstructorTablePtr_->sortedToc()
|
||||||
<< exit(FatalIOError);
|
<< exit(FatalIOError);
|
||||||
}
|
}
|
||||||
@ -246,6 +262,44 @@ Foam::Reaction<ReactionThermo>::New
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class ReactionThermo>
|
||||||
|
Foam::autoPtr<Foam::Reaction<ReactionThermo> >
|
||||||
|
Foam::Reaction<ReactionThermo>::New
|
||||||
|
(
|
||||||
|
const speciesTable& species,
|
||||||
|
const HashPtrTable<ReactionThermo>& thermoDatabase,
|
||||||
|
const dictionary& dict
|
||||||
|
)
|
||||||
|
{
|
||||||
|
const word& reactionTypeName = dict.dictName();
|
||||||
|
|
||||||
|
typename dictionaryConstructorTable::iterator cstrIter
|
||||||
|
= dictionaryConstructorTablePtr_->find(reactionTypeName);
|
||||||
|
|
||||||
|
if (cstrIter == dictionaryConstructorTablePtr_->end())
|
||||||
|
{
|
||||||
|
FatalErrorIn
|
||||||
|
(
|
||||||
|
"Reaction<ReactionThermo>::New"
|
||||||
|
"("
|
||||||
|
"const speciesTable&, "
|
||||||
|
"const HashPtrTable<ReactionThermo>&, "
|
||||||
|
"const dictionary&"
|
||||||
|
")"
|
||||||
|
) << "Unknown reaction type "
|
||||||
|
<< reactionTypeName << nl << nl
|
||||||
|
<< "Valid reaction types are :" << nl
|
||||||
|
<< dictionaryConstructorTablePtr_->sortedToc()
|
||||||
|
<< exit(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
|
return autoPtr<Reaction<ReactionThermo> >
|
||||||
|
(
|
||||||
|
cstrIter()(species, thermoDatabase, dict)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class ReactionThermo>
|
template<class ReactionThermo>
|
||||||
|
|||||||
@ -152,6 +152,19 @@ public:
|
|||||||
(species, thermoDatabase, is)
|
(species, thermoDatabase, is)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
declareRunTimeSelectionTable
|
||||||
|
(
|
||||||
|
autoPtr,
|
||||||
|
Reaction,
|
||||||
|
dictionary,
|
||||||
|
(
|
||||||
|
const speciesTable& species,
|
||||||
|
const HashPtrTable<ReactionThermo>& thermoDatabase,
|
||||||
|
const dictionary& dict
|
||||||
|
),
|
||||||
|
(species, thermoDatabase, dict)
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
// Public classes
|
// Public classes
|
||||||
|
|
||||||
@ -205,6 +218,14 @@ public:
|
|||||||
Istream& is
|
Istream& is
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//- Construct from dictionary
|
||||||
|
Reaction
|
||||||
|
(
|
||||||
|
const speciesTable& species,
|
||||||
|
const HashPtrTable<ReactionThermo>& thermoDatabase,
|
||||||
|
const dictionary& dict
|
||||||
|
);
|
||||||
|
|
||||||
//- Construct and return a clone
|
//- Construct and return a clone
|
||||||
virtual autoPtr<Reaction<ReactionThermo> > clone() const
|
virtual autoPtr<Reaction<ReactionThermo> > clone() const
|
||||||
{
|
{
|
||||||
@ -229,12 +250,20 @@ public:
|
|||||||
|
|
||||||
// Selectors
|
// Selectors
|
||||||
|
|
||||||
//- Return a pointer to a new patchField created on freestore from input
|
//- Return a pointer to new patchField created on freestore from input
|
||||||
static autoPtr<Reaction<ReactionThermo> > New
|
static autoPtr<Reaction<ReactionThermo> > New
|
||||||
(
|
(
|
||||||
const speciesTable& species,
|
const speciesTable& species,
|
||||||
const HashPtrTable<ReactionThermo>& thermoDatabase,
|
const HashPtrTable<ReactionThermo>& thermoDatabase,
|
||||||
Istream&
|
Istream& is
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Return a pointer to new patchField created on freestore from dict
|
||||||
|
static autoPtr<Reaction<ReactionThermo> > New
|
||||||
|
(
|
||||||
|
const speciesTable& species,
|
||||||
|
const HashPtrTable<ReactionThermo>& thermoDatabase,
|
||||||
|
const dictionary& dict
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,136 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
|
\\/ 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 "ReactionList.H"
|
||||||
|
#include "IFstream.H"
|
||||||
|
#include "SLPtrList.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class ThermoType>
|
||||||
|
Foam::ReactionList<ThermoType>::ReactionList
|
||||||
|
(
|
||||||
|
const speciesTable& species,
|
||||||
|
const HashPtrTable<ThermoType>& thermoDb
|
||||||
|
)
|
||||||
|
:
|
||||||
|
PtrList<Reaction<ThermoType> >(),
|
||||||
|
species_(species),
|
||||||
|
thermoDb_(thermoDb),
|
||||||
|
dict_(dictionary::null)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
template<class ThermoType>
|
||||||
|
Foam::ReactionList<ThermoType>::ReactionList
|
||||||
|
(
|
||||||
|
const speciesTable& species,
|
||||||
|
const HashPtrTable<ThermoType>& thermoDb,
|
||||||
|
const dictionary& dict
|
||||||
|
)
|
||||||
|
:
|
||||||
|
PtrList<Reaction<ThermoType> >(),
|
||||||
|
species_(species),
|
||||||
|
thermoDb_(thermoDb),
|
||||||
|
dict_(dict)
|
||||||
|
{
|
||||||
|
readReactionDict();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class ThermoType>
|
||||||
|
Foam::ReactionList<ThermoType>::ReactionList
|
||||||
|
(
|
||||||
|
const speciesTable& species,
|
||||||
|
const HashPtrTable<ThermoType>& thermoDb,
|
||||||
|
const fileName& fName
|
||||||
|
)
|
||||||
|
:
|
||||||
|
PtrList<Reaction<ThermoType> >
|
||||||
|
(
|
||||||
|
dictionary(IFstream(fName)()).lookup("reactions"),
|
||||||
|
Reaction<ThermoType>::iNew(species, thermoDb)
|
||||||
|
),
|
||||||
|
species_(species),
|
||||||
|
thermoDb_(thermoDb),
|
||||||
|
dict_(dictionary::null)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
template<class ThermoType>
|
||||||
|
Foam::ReactionList<ThermoType>::ReactionList(const ReactionList& reactions)
|
||||||
|
:
|
||||||
|
PtrList<Reaction<ThermoType> >(reactions),
|
||||||
|
species_(reactions.species_),
|
||||||
|
thermoDb_(reactions.thermoDb_),
|
||||||
|
dict_(reactions.dict_)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class ThermoType>
|
||||||
|
Foam::ReactionList<ThermoType>::~ReactionList()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class ThermoType>
|
||||||
|
bool Foam::ReactionList<ThermoType>::readReactionDict()
|
||||||
|
{
|
||||||
|
const dictionary& reactions(dict_.subDict("reactions"));
|
||||||
|
PtrList<Reaction<ThermoType> > newPtrs(reactions.size());
|
||||||
|
|
||||||
|
label i = 0;
|
||||||
|
forAllConstIter(dictionary, reactions, iter)
|
||||||
|
{
|
||||||
|
newPtrs.set
|
||||||
|
(
|
||||||
|
i++,
|
||||||
|
Reaction<ThermoType>::New
|
||||||
|
(
|
||||||
|
species_,
|
||||||
|
thermoDb_,
|
||||||
|
reactions.subDict(iter().keyword())
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
PtrList<Reaction<ThermoType> >::transfer(newPtrs);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class ThermoType>
|
||||||
|
const Foam::PtrList<Foam::Reaction<ThermoType> >&
|
||||||
|
Foam::ReactionList<ThermoType>::reactions() const
|
||||||
|
{
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,135 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
|
\\/ 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::ReactionList
|
||||||
|
|
||||||
|
Description
|
||||||
|
List of templated reactions
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
ReactionList.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef ReactionList_H
|
||||||
|
#define ReactionList_H
|
||||||
|
|
||||||
|
#include "PtrList.H"
|
||||||
|
#include "SLPtrList.H"
|
||||||
|
#include "speciesTable.H"
|
||||||
|
#include "HashPtrTable.H"
|
||||||
|
#include "Reaction.H"
|
||||||
|
#include "fileName.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class ReactionList Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
template<class ThermoType>
|
||||||
|
class ReactionList
|
||||||
|
:
|
||||||
|
private PtrList<Reaction<ThermoType> >
|
||||||
|
{
|
||||||
|
// Private data
|
||||||
|
|
||||||
|
//- Reference to the table of species
|
||||||
|
const speciesTable& species_;
|
||||||
|
|
||||||
|
//- Reference to the thermo database
|
||||||
|
const HashPtrTable<ThermoType>& thermoDb_;
|
||||||
|
|
||||||
|
//- The dictionary used for construction
|
||||||
|
const dictionary dict_;
|
||||||
|
|
||||||
|
|
||||||
|
// Private Member Functions
|
||||||
|
|
||||||
|
//- Disallow default bitwise assignment
|
||||||
|
void operator=(const ReactionList&);
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct null
|
||||||
|
ReactionList
|
||||||
|
(
|
||||||
|
const speciesTable& species,
|
||||||
|
const HashPtrTable<ThermoType>& thermoDatabase
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct from dictionary
|
||||||
|
ReactionList
|
||||||
|
(
|
||||||
|
const speciesTable& species,
|
||||||
|
const HashPtrTable<ThermoType>& thermoDatabase,
|
||||||
|
const dictionary& dict
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct from file using (Istream)
|
||||||
|
ReactionList
|
||||||
|
(
|
||||||
|
const speciesTable& species,
|
||||||
|
const HashPtrTable<ThermoType>& thermoDatabase,
|
||||||
|
const fileName& fName
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct copy
|
||||||
|
ReactionList(const ReactionList<ThermoType>& reactions);
|
||||||
|
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
~ReactionList();
|
||||||
|
|
||||||
|
|
||||||
|
// Public Member Functions
|
||||||
|
|
||||||
|
//- Read reactions from dictionary
|
||||||
|
bool readReactionDict();
|
||||||
|
|
||||||
|
//- Return the list of reactions
|
||||||
|
const PtrList<Reaction<ThermoType> >& reactions() const;
|
||||||
|
};
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#ifdef NoRepository
|
||||||
|
# include "ReactionList.C"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -25,16 +25,10 @@ License
|
|||||||
|
|
||||||
#include "ReversibleReaction.H"
|
#include "ReversibleReaction.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// Construct from components
|
|
||||||
template<class ReactionThermo, class ReactionRate>
|
template<class ReactionThermo, class ReactionRate>
|
||||||
ReversibleReaction<ReactionThermo, ReactionRate>::ReversibleReaction
|
Foam::ReversibleReaction<ReactionThermo, ReactionRate>::ReversibleReaction
|
||||||
(
|
(
|
||||||
const Reaction<ReactionThermo>& reaction,
|
const Reaction<ReactionThermo>& reaction,
|
||||||
const ReactionRate& k
|
const ReactionRate& k
|
||||||
@ -45,9 +39,8 @@ ReversibleReaction<ReactionThermo, ReactionRate>::ReversibleReaction
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// Construct from components
|
|
||||||
template<class ReactionThermo, class ReactionRate>
|
template<class ReactionThermo, class ReactionRate>
|
||||||
ReversibleReaction<ReactionThermo, ReactionRate>::ReversibleReaction
|
Foam::ReversibleReaction<ReactionThermo, ReactionRate>::ReversibleReaction
|
||||||
(
|
(
|
||||||
const speciesTable& species,
|
const speciesTable& species,
|
||||||
const HashPtrTable<ReactionThermo>& thermoDatabase,
|
const HashPtrTable<ReactionThermo>& thermoDatabase,
|
||||||
@ -59,9 +52,21 @@ ReversibleReaction<ReactionThermo, ReactionRate>::ReversibleReaction
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// Construct as copy given new speciesTable
|
|
||||||
template<class ReactionThermo, class ReactionRate>
|
template<class ReactionThermo, class ReactionRate>
|
||||||
ReversibleReaction<ReactionThermo, ReactionRate>::ReversibleReaction
|
Foam::ReversibleReaction<ReactionThermo, ReactionRate>::ReversibleReaction
|
||||||
|
(
|
||||||
|
const speciesTable& species,
|
||||||
|
const HashPtrTable<ReactionThermo>& thermoDatabase,
|
||||||
|
const dictionary& dict
|
||||||
|
)
|
||||||
|
:
|
||||||
|
Reaction<ReactionThermo>(species, thermoDatabase, dict),
|
||||||
|
k_(species, dict)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
template<class ReactionThermo, class ReactionRate>
|
||||||
|
Foam::ReversibleReaction<ReactionThermo, ReactionRate>::ReversibleReaction
|
||||||
(
|
(
|
||||||
const ReversibleReaction<ReactionThermo, ReactionRate>& rr,
|
const ReversibleReaction<ReactionThermo, ReactionRate>& rr,
|
||||||
const speciesTable& species
|
const speciesTable& species
|
||||||
@ -75,7 +80,7 @@ ReversibleReaction<ReactionThermo, ReactionRate>::ReversibleReaction
|
|||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class ReactionThermo, class ReactionRate>
|
template<class ReactionThermo, class ReactionRate>
|
||||||
scalar ReversibleReaction<ReactionThermo, ReactionRate>::kf
|
Foam::scalar Foam::ReversibleReaction<ReactionThermo, ReactionRate>::kf
|
||||||
(
|
(
|
||||||
const scalar T,
|
const scalar T,
|
||||||
const scalar p,
|
const scalar p,
|
||||||
@ -87,7 +92,7 @@ scalar ReversibleReaction<ReactionThermo, ReactionRate>::kf
|
|||||||
|
|
||||||
|
|
||||||
template<class ReactionThermo, class ReactionRate>
|
template<class ReactionThermo, class ReactionRate>
|
||||||
scalar ReversibleReaction<ReactionThermo, ReactionRate>::kr
|
Foam::scalar Foam::ReversibleReaction<ReactionThermo, ReactionRate>::kr
|
||||||
(
|
(
|
||||||
const scalar kfwd,
|
const scalar kfwd,
|
||||||
const scalar T,
|
const scalar T,
|
||||||
@ -100,7 +105,7 @@ scalar ReversibleReaction<ReactionThermo, ReactionRate>::kr
|
|||||||
|
|
||||||
|
|
||||||
template<class ReactionThermo, class ReactionRate>
|
template<class ReactionThermo, class ReactionRate>
|
||||||
scalar ReversibleReaction<ReactionThermo, ReactionRate>::kr
|
Foam::scalar Foam::ReversibleReaction<ReactionThermo, ReactionRate>::kr
|
||||||
(
|
(
|
||||||
const scalar T,
|
const scalar T,
|
||||||
const scalar p,
|
const scalar p,
|
||||||
@ -112,7 +117,7 @@ scalar ReversibleReaction<ReactionThermo, ReactionRate>::kr
|
|||||||
|
|
||||||
|
|
||||||
template<class ReactionThermo, class ReactionRate>
|
template<class ReactionThermo, class ReactionRate>
|
||||||
void ReversibleReaction<ReactionThermo, ReactionRate>::write
|
void Foam::ReversibleReaction<ReactionThermo, ReactionRate>::write
|
||||||
(
|
(
|
||||||
Ostream& os
|
Ostream& os
|
||||||
) const
|
) const
|
||||||
@ -122,8 +127,4 @@ void ReversibleReaction<ReactionThermo, ReactionRate>::write
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -44,7 +44,7 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class ReversibleReaction Declaration
|
Class ReversibleReaction Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
template<class ReactionThermo, class ReactionRate>
|
template<class ReactionThermo, class ReactionRate>
|
||||||
@ -93,6 +93,14 @@ public:
|
|||||||
Istream& is
|
Istream& is
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//- Construct from dictionary
|
||||||
|
ReversibleReaction
|
||||||
|
(
|
||||||
|
const speciesTable& species,
|
||||||
|
const HashPtrTable<ReactionThermo>& thermoDatabase,
|
||||||
|
const dictionary& dict
|
||||||
|
);
|
||||||
|
|
||||||
//- Construct and return a clone
|
//- Construct and return a clone
|
||||||
virtual autoPtr<Reaction<ReactionThermo> > clone() const
|
virtual autoPtr<Reaction<ReactionThermo> > clone() const
|
||||||
{
|
{
|
||||||
|
|||||||
@ -25,7 +25,9 @@ Class
|
|||||||
Foam::ArrheniusReactionRate
|
Foam::ArrheniusReactionRate
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Arrhenius reaction rate.
|
Arrhenius reaction rate given by:
|
||||||
|
|
||||||
|
k = A * T^beta * exp(-Ta/T)
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
ArrheniusReactionRateI.H
|
ArrheniusReactionRateI.H
|
||||||
@ -44,7 +46,7 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class ArrheniusReactionRate Declaration
|
Class ArrheniusReactionRate Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class ArrheniusReactionRate
|
class ArrheniusReactionRate
|
||||||
@ -75,6 +77,13 @@ public:
|
|||||||
Istream& is
|
Istream& is
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//- Construct from dictionary
|
||||||
|
inline ArrheniusReactionRate
|
||||||
|
(
|
||||||
|
const speciesTable& species,
|
||||||
|
const dictionary& dict
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
|
|||||||
@ -23,15 +23,9 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// Construct from components
|
inline Foam::ArrheniusReactionRate::ArrheniusReactionRate
|
||||||
inline ArrheniusReactionRate::ArrheniusReactionRate
|
|
||||||
(
|
(
|
||||||
const scalar A,
|
const scalar A,
|
||||||
const scalar beta,
|
const scalar beta,
|
||||||
@ -44,8 +38,7 @@ inline ArrheniusReactionRate::ArrheniusReactionRate
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
//- Construct from Istream
|
inline Foam::ArrheniusReactionRate::ArrheniusReactionRate
|
||||||
inline ArrheniusReactionRate::ArrheniusReactionRate
|
|
||||||
(
|
(
|
||||||
const speciesTable&,
|
const speciesTable&,
|
||||||
Istream& is
|
Istream& is
|
||||||
@ -59,9 +52,21 @@ inline ArrheniusReactionRate::ArrheniusReactionRate
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline Foam::ArrheniusReactionRate::ArrheniusReactionRate
|
||||||
|
(
|
||||||
|
const speciesTable&,
|
||||||
|
const dictionary& dict
|
||||||
|
)
|
||||||
|
:
|
||||||
|
A_(readScalar(dict.lookup("A"))),
|
||||||
|
beta_(readScalar(dict.lookup("beta"))),
|
||||||
|
Ta_(readScalar(dict.lookup("Ta")))
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
inline scalar ArrheniusReactionRate::operator()
|
inline Foam::scalar Foam::ArrheniusReactionRate::operator()
|
||||||
(
|
(
|
||||||
const scalar T,
|
const scalar T,
|
||||||
const scalar,
|
const scalar,
|
||||||
@ -84,7 +89,11 @@ inline scalar ArrheniusReactionRate::operator()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline Ostream& operator<<(Ostream& os, const ArrheniusReactionRate& arr)
|
inline Foam::Ostream& Foam::operator<<
|
||||||
|
(
|
||||||
|
Ostream& os,
|
||||||
|
const ArrheniusReactionRate& arr
|
||||||
|
)
|
||||||
{
|
{
|
||||||
os << token::BEGIN_LIST
|
os << token::BEGIN_LIST
|
||||||
<< arr.A_ << token::SPACE << arr.beta_ << token::SPACE << arr.Ta_
|
<< arr.A_ << token::SPACE << arr.beta_ << token::SPACE << arr.Ta_
|
||||||
@ -93,8 +102,4 @@ inline Ostream& operator<<(Ostream& os, const ArrheniusReactionRate& arr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -91,6 +91,13 @@ public:
|
|||||||
Istream& is
|
Istream& is
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//- Construct from dictionary
|
||||||
|
inline ChemicallyActivatedReactionRate
|
||||||
|
(
|
||||||
|
const speciesTable& species,
|
||||||
|
const dictionary& dict
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
|
|||||||
@ -25,16 +25,12 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
// Construct from components
|
|
||||||
template<class ReactionRate, class ChemicallyActivationFunction>
|
template<class ReactionRate, class ChemicallyActivationFunction>
|
||||||
inline
|
inline Foam::ChemicallyActivatedReactionRate
|
||||||
ChemicallyActivatedReactionRate<ReactionRate, ChemicallyActivationFunction>::
|
<
|
||||||
ChemicallyActivatedReactionRate
|
ReactionRate,
|
||||||
|
ChemicallyActivationFunction
|
||||||
|
>::ChemicallyActivatedReactionRate
|
||||||
(
|
(
|
||||||
const ReactionRate& k0,
|
const ReactionRate& k0,
|
||||||
const ReactionRate& kInf,
|
const ReactionRate& kInf,
|
||||||
@ -49,11 +45,12 @@ ChemicallyActivatedReactionRate
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
//- Construct from Istream
|
|
||||||
template<class ReactionRate, class ChemicallyActivationFunction>
|
template<class ReactionRate, class ChemicallyActivationFunction>
|
||||||
inline
|
inline Foam::ChemicallyActivatedReactionRate
|
||||||
ChemicallyActivatedReactionRate<ReactionRate, ChemicallyActivationFunction>::
|
<
|
||||||
ChemicallyActivatedReactionRate
|
ReactionRate,
|
||||||
|
ChemicallyActivationFunction
|
||||||
|
>::ChemicallyActivatedReactionRate
|
||||||
(
|
(
|
||||||
const speciesTable& species,
|
const speciesTable& species,
|
||||||
Istream& is
|
Istream& is
|
||||||
@ -68,11 +65,32 @@ ChemicallyActivatedReactionRate
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class ReactionRate, class ChemicallyActivationFunction>
|
||||||
|
inline Foam::ChemicallyActivatedReactionRate
|
||||||
|
<
|
||||||
|
ReactionRate,
|
||||||
|
ChemicallyActivationFunction
|
||||||
|
>::ChemicallyActivatedReactionRate
|
||||||
|
(
|
||||||
|
const speciesTable& species,
|
||||||
|
const dictionary& dict
|
||||||
|
)
|
||||||
|
:
|
||||||
|
k0_(species, dict),
|
||||||
|
kInf_(species, dict),
|
||||||
|
F_(dict),
|
||||||
|
thirdBodyEfficiencies_(species, dict)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class ReactionRate, class ChemicallyActivationFunction>
|
template<class ReactionRate, class ChemicallyActivationFunction>
|
||||||
inline scalar ChemicallyActivatedReactionRate
|
inline Foam::scalar Foam::ChemicallyActivatedReactionRate
|
||||||
<ReactionRate, ChemicallyActivationFunction>::operator()
|
<
|
||||||
|
ReactionRate,
|
||||||
|
ChemicallyActivationFunction
|
||||||
|
>::operator()
|
||||||
(
|
(
|
||||||
const scalar T,
|
const scalar T,
|
||||||
const scalar p,
|
const scalar p,
|
||||||
@ -89,7 +107,7 @@ inline scalar ChemicallyActivatedReactionRate
|
|||||||
|
|
||||||
|
|
||||||
template<class ReactionRate, class ChemicallyActivationFunction>
|
template<class ReactionRate, class ChemicallyActivationFunction>
|
||||||
inline Ostream& operator<<
|
inline Foam::Ostream& Foam::operator<<
|
||||||
(
|
(
|
||||||
Ostream& os,
|
Ostream& os,
|
||||||
const ChemicallyActivatedReactionRate
|
const ChemicallyActivatedReactionRate
|
||||||
@ -103,8 +121,4 @@ inline Ostream& operator<<
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -90,6 +90,13 @@ public:
|
|||||||
Istream& is
|
Istream& is
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//- Construct from dictionary
|
||||||
|
inline FallOffReactionRate
|
||||||
|
(
|
||||||
|
const speciesTable& species,
|
||||||
|
const dictionary& dict
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
|
|||||||
@ -23,16 +23,11 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// Construct from components
|
|
||||||
template<class ReactionRate, class FallOffFunction>
|
template<class ReactionRate, class FallOffFunction>
|
||||||
inline FallOffReactionRate<ReactionRate, FallOffFunction>::FallOffReactionRate
|
inline Foam::FallOffReactionRate<ReactionRate, FallOffFunction>::
|
||||||
|
FallOffReactionRate
|
||||||
(
|
(
|
||||||
const ReactionRate& k0,
|
const ReactionRate& k0,
|
||||||
const ReactionRate& kInf,
|
const ReactionRate& kInf,
|
||||||
@ -47,9 +42,9 @@ inline FallOffReactionRate<ReactionRate, FallOffFunction>::FallOffReactionRate
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
//- Construct from Istream
|
|
||||||
template<class ReactionRate, class FallOffFunction>
|
template<class ReactionRate, class FallOffFunction>
|
||||||
inline FallOffReactionRate<ReactionRate, FallOffFunction>::FallOffReactionRate
|
inline Foam::FallOffReactionRate<ReactionRate, FallOffFunction>::
|
||||||
|
FallOffReactionRate
|
||||||
(
|
(
|
||||||
const speciesTable& species,
|
const speciesTable& species,
|
||||||
Istream& is
|
Istream& is
|
||||||
@ -64,10 +59,26 @@ inline FallOffReactionRate<ReactionRate, FallOffFunction>::FallOffReactionRate
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class ReactionRate, class FallOffFunction>
|
||||||
|
inline Foam::FallOffReactionRate<ReactionRate, FallOffFunction>::
|
||||||
|
FallOffReactionRate
|
||||||
|
(
|
||||||
|
const speciesTable& species,
|
||||||
|
const dictionary& dict
|
||||||
|
)
|
||||||
|
:
|
||||||
|
k0_(species, dict),
|
||||||
|
kInf_(species, dict),
|
||||||
|
F_(dict),
|
||||||
|
thirdBodyEfficiencies_(species, dict)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class ReactionRate, class FallOffFunction>
|
template<class ReactionRate, class FallOffFunction>
|
||||||
inline scalar FallOffReactionRate<ReactionRate, FallOffFunction>::operator()
|
inline Foam::scalar
|
||||||
|
Foam::FallOffReactionRate<ReactionRate, FallOffFunction>::operator()
|
||||||
(
|
(
|
||||||
const scalar T,
|
const scalar T,
|
||||||
const scalar p,
|
const scalar p,
|
||||||
@ -84,7 +95,7 @@ inline scalar FallOffReactionRate<ReactionRate, FallOffFunction>::operator()
|
|||||||
|
|
||||||
|
|
||||||
template<class ReactionRate, class FallOffFunction>
|
template<class ReactionRate, class FallOffFunction>
|
||||||
inline Ostream& operator<<
|
inline Foam::Ostream& Foam::operator<<
|
||||||
(
|
(
|
||||||
Ostream& os,
|
Ostream& os,
|
||||||
const FallOffReactionRate<ReactionRate, FallOffFunction>& forr
|
const FallOffReactionRate<ReactionRate, FallOffFunction>& forr
|
||||||
@ -100,8 +111,4 @@ inline Ostream& operator<<
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -37,6 +37,7 @@ SourceFiles
|
|||||||
|
|
||||||
#include "scalarField.H"
|
#include "scalarField.H"
|
||||||
#include "typeInfo.H"
|
#include "typeInfo.H"
|
||||||
|
#include "FixedList.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -44,7 +45,7 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class JanevReactionRate Declaration
|
Class JanevReactionRate Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class JanevReactionRate
|
class JanevReactionRate
|
||||||
@ -56,7 +57,7 @@ class JanevReactionRate
|
|||||||
scalar Ta_;
|
scalar Ta_;
|
||||||
|
|
||||||
static const label nb_ = 9;
|
static const label nb_ = 9;
|
||||||
scalar b_[nb_];
|
FixedList<scalar, nb_> b_;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -69,7 +70,7 @@ public:
|
|||||||
const scalar A,
|
const scalar A,
|
||||||
const scalar beta,
|
const scalar beta,
|
||||||
const scalar Ta,
|
const scalar Ta,
|
||||||
const scalar b[]
|
const FixedList<scalar, nb_> b
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Construct from Istream
|
//- Construct from Istream
|
||||||
@ -79,6 +80,13 @@ public:
|
|||||||
Istream& is
|
Istream& is
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//- Construct from dictionary
|
||||||
|
inline JanevReactionRate
|
||||||
|
(
|
||||||
|
const speciesTable& species,
|
||||||
|
const dictionary& dict
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
|
|||||||
@ -23,35 +23,24 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// Construct from components
|
inline Foam::JanevReactionRate::JanevReactionRate
|
||||||
inline JanevReactionRate::JanevReactionRate
|
|
||||||
(
|
(
|
||||||
const scalar A,
|
const scalar A,
|
||||||
const scalar beta,
|
const scalar beta,
|
||||||
const scalar Ta,
|
const scalar Ta,
|
||||||
const scalar b[]
|
const FixedList<scalar, nb_> b
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
A_(A),
|
A_(A),
|
||||||
beta_(beta),
|
beta_(beta),
|
||||||
Ta_(Ta)
|
Ta_(Ta),
|
||||||
{
|
b_(b)
|
||||||
for (int n=0; n<nb_; n++)
|
{}
|
||||||
{
|
|
||||||
b_[n] = b[n];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//- Construct from Istream
|
inline Foam::JanevReactionRate::JanevReactionRate
|
||||||
inline JanevReactionRate::JanevReactionRate
|
|
||||||
(
|
(
|
||||||
const speciesTable&,
|
const speciesTable&,
|
||||||
Istream& is
|
Istream& is
|
||||||
@ -59,20 +48,29 @@ inline JanevReactionRate::JanevReactionRate
|
|||||||
:
|
:
|
||||||
A_(readScalar(is.readBegin("JanevReactionRate(Istream&)"))),
|
A_(readScalar(is.readBegin("JanevReactionRate(Istream&)"))),
|
||||||
beta_(readScalar(is)),
|
beta_(readScalar(is)),
|
||||||
Ta_(readScalar(is))
|
Ta_(readScalar(is)),
|
||||||
|
b_(is)
|
||||||
{
|
{
|
||||||
for (int n=0; n<nb_; n++)
|
|
||||||
{
|
|
||||||
is >> b_[n];
|
|
||||||
}
|
|
||||||
|
|
||||||
is.readEnd("JanevReactionRate(Istream&)");
|
is.readEnd("JanevReactionRate(Istream&)");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline Foam::JanevReactionRate::JanevReactionRate
|
||||||
|
(
|
||||||
|
const speciesTable&,
|
||||||
|
const dictionary& dict
|
||||||
|
)
|
||||||
|
:
|
||||||
|
A_(readScalar(dict.lookup("A"))),
|
||||||
|
beta_(readScalar(dict.lookup("beta"))),
|
||||||
|
Ta_(readScalar(dict.lookup("Ta"))),
|
||||||
|
b_(dict.lookup("b"))
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
inline scalar JanevReactionRate::operator()
|
inline Foam::scalar Foam::JanevReactionRate::operator()
|
||||||
(
|
(
|
||||||
const scalar T,
|
const scalar T,
|
||||||
const scalar,
|
const scalar,
|
||||||
@ -106,7 +104,11 @@ inline scalar JanevReactionRate::operator()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline Ostream& operator<<(Ostream& os, const JanevReactionRate& jrr)
|
inline Foam::Ostream& Foam::operator<<
|
||||||
|
(
|
||||||
|
Ostream& os,
|
||||||
|
const JanevReactionRate& jrr
|
||||||
|
)
|
||||||
{
|
{
|
||||||
os << token::BEGIN_LIST
|
os << token::BEGIN_LIST
|
||||||
<< jrr.A_ << token::SPACE << jrr.beta_ << token::SPACE << jrr.Ta_;
|
<< jrr.A_ << token::SPACE << jrr.beta_ << token::SPACE << jrr.Ta_;
|
||||||
@ -122,8 +124,4 @@ inline Ostream& operator<<(Ostream& os, const JanevReactionRate& jrr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -78,6 +78,13 @@ public:
|
|||||||
Istream& is
|
Istream& is
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//- Construct from dictionary
|
||||||
|
inline LandauTellerReactionRate
|
||||||
|
(
|
||||||
|
const speciesTable& species,
|
||||||
|
const dictionary& dict
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
|
|||||||
@ -23,15 +23,9 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// Construct from components
|
inline Foam::LandauTellerReactionRate::LandauTellerReactionRate
|
||||||
inline LandauTellerReactionRate::LandauTellerReactionRate
|
|
||||||
(
|
(
|
||||||
const scalar A,
|
const scalar A,
|
||||||
const scalar beta,
|
const scalar beta,
|
||||||
@ -48,8 +42,7 @@ inline LandauTellerReactionRate::LandauTellerReactionRate
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
//- Construct from Istream
|
inline Foam::LandauTellerReactionRate::LandauTellerReactionRate
|
||||||
inline LandauTellerReactionRate::LandauTellerReactionRate
|
|
||||||
(
|
(
|
||||||
const speciesTable&,
|
const speciesTable&,
|
||||||
Istream& is
|
Istream& is
|
||||||
@ -65,9 +58,23 @@ inline LandauTellerReactionRate::LandauTellerReactionRate
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline Foam::LandauTellerReactionRate::LandauTellerReactionRate
|
||||||
|
(
|
||||||
|
const speciesTable&,
|
||||||
|
const dictionary& dict
|
||||||
|
)
|
||||||
|
:
|
||||||
|
A_(readScalar(dict.lookup("A"))),
|
||||||
|
beta_(readScalar(dict.lookup("beta"))),
|
||||||
|
Ta_(readScalar(dict.lookup("Ta"))),
|
||||||
|
B_(readScalar(dict.lookup("B"))),
|
||||||
|
C_(readScalar(dict.lookup("C")))
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
inline scalar LandauTellerReactionRate::operator()
|
inline Foam::scalar Foam::LandauTellerReactionRate::operator()
|
||||||
(
|
(
|
||||||
const scalar T,
|
const scalar T,
|
||||||
const scalar,
|
const scalar,
|
||||||
@ -107,7 +114,11 @@ inline scalar LandauTellerReactionRate::operator()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline Ostream& operator<<(Ostream& os, const LandauTellerReactionRate& arr)
|
inline Foam::Ostream& Foam::operator<<
|
||||||
|
(
|
||||||
|
Ostream& os,
|
||||||
|
const LandauTellerReactionRate& arr
|
||||||
|
)
|
||||||
{
|
{
|
||||||
os << token::BEGIN_LIST
|
os << token::BEGIN_LIST
|
||||||
<< arr.A_ << token::SPACE << arr.beta_ << token::SPACE << arr.Ta_
|
<< arr.A_ << token::SPACE << arr.beta_ << token::SPACE << arr.Ta_
|
||||||
@ -117,8 +128,4 @@ inline Ostream& operator<<(Ostream& os, const LandauTellerReactionRate& arr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -81,6 +81,13 @@ public:
|
|||||||
Istream& is
|
Istream& is
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//- Construct from dictionary
|
||||||
|
inline LangmuirHinshelwoodReactionRate
|
||||||
|
(
|
||||||
|
const speciesTable& species,
|
||||||
|
const dictionary& dict
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
|
|||||||
@ -23,15 +23,12 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
#include "FixedList.H"
|
||||||
|
#include "Tuple2.H"
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// Construct from components
|
inline Foam::LangmuirHinshelwoodReactionRate::LangmuirHinshelwoodReactionRate
|
||||||
inline LangmuirHinshelwoodReactionRate::LangmuirHinshelwoodReactionRate
|
|
||||||
(
|
(
|
||||||
const scalar A[],
|
const scalar A[],
|
||||||
const scalar Ta[],
|
const scalar Ta[],
|
||||||
@ -52,8 +49,7 @@ inline LangmuirHinshelwoodReactionRate::LangmuirHinshelwoodReactionRate
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//- Construct from Istream
|
inline Foam::LangmuirHinshelwoodReactionRate::LangmuirHinshelwoodReactionRate
|
||||||
inline LangmuirHinshelwoodReactionRate::LangmuirHinshelwoodReactionRate
|
|
||||||
(
|
(
|
||||||
const speciesTable& st,
|
const speciesTable& st,
|
||||||
Istream& is
|
Istream& is
|
||||||
@ -74,9 +70,30 @@ inline LangmuirHinshelwoodReactionRate::LangmuirHinshelwoodReactionRate
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline Foam::LangmuirHinshelwoodReactionRate::LangmuirHinshelwoodReactionRate
|
||||||
|
(
|
||||||
|
const speciesTable& st,
|
||||||
|
const dictionary& dict
|
||||||
|
)
|
||||||
|
:
|
||||||
|
co_(st["CO"]),
|
||||||
|
c3h6_(st["C3H6"]),
|
||||||
|
no_(st["NO"])
|
||||||
|
{
|
||||||
|
// read (A, Ta) pairs
|
||||||
|
FixedList<Tuple2<scalar, scalar>, n_> coeffs(dict.lookup("coeffs"));
|
||||||
|
|
||||||
|
forAll(coeffs, i)
|
||||||
|
{
|
||||||
|
A_[i] = coeffs[i].first();
|
||||||
|
Ta_[i] = coeffs[i].second();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
inline scalar LangmuirHinshelwoodReactionRate::operator()
|
inline Foam::scalar Foam::LangmuirHinshelwoodReactionRate::operator()
|
||||||
(
|
(
|
||||||
const scalar T,
|
const scalar T,
|
||||||
const scalar,
|
const scalar,
|
||||||
@ -93,7 +110,7 @@ inline scalar LangmuirHinshelwoodReactionRate::operator()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline Ostream& operator<<
|
inline Foam::Ostream& Foam::operator<<
|
||||||
(
|
(
|
||||||
Ostream& os,
|
Ostream& os,
|
||||||
const LangmuirHinshelwoodReactionRate& lhrr
|
const LangmuirHinshelwoodReactionRate& lhrr
|
||||||
@ -103,7 +120,8 @@ inline Ostream& operator<<
|
|||||||
|
|
||||||
for (int i=0; i<LangmuirHinshelwoodReactionRate::n_; i++)
|
for (int i=0; i<LangmuirHinshelwoodReactionRate::n_; i++)
|
||||||
{
|
{
|
||||||
os << token::SPACE << lhrr.A_[i] << token::SPACE << lhrr.Ta_[i];
|
os << token::SPACE
|
||||||
|
<< '(' << lhrr.A_[i] << token::SPACE << lhrr.Ta_[i] << ')';
|
||||||
}
|
}
|
||||||
|
|
||||||
os << token::END_LIST;
|
os << token::END_LIST;
|
||||||
@ -112,8 +130,4 @@ inline Ostream& operator<<
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -65,6 +65,9 @@ public:
|
|||||||
//- Construct from Istream
|
//- Construct from Istream
|
||||||
inline LindemannFallOffFunction(Istream&);
|
inline LindemannFallOffFunction(Istream&);
|
||||||
|
|
||||||
|
//- Construct from dictionary
|
||||||
|
inline LindemannFallOffFunction(const dictionary& dict);
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
|
|||||||
@ -25,16 +25,21 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
//- Construct null
|
|
||||||
inline Foam::LindemannFallOffFunction::LindemannFallOffFunction()
|
inline Foam::LindemannFallOffFunction::LindemannFallOffFunction()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
//- Construct from Istream
|
|
||||||
inline Foam::LindemannFallOffFunction::LindemannFallOffFunction(Istream&)
|
inline Foam::LindemannFallOffFunction::LindemannFallOffFunction(Istream&)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
inline Foam::LindemannFallOffFunction::LindemannFallOffFunction
|
||||||
|
(
|
||||||
|
const dictionary& dict
|
||||||
|
)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
inline Foam::scalar Foam::LindemannFallOffFunction::operator()
|
inline Foam::scalar Foam::LindemannFallOffFunction::operator()
|
||||||
|
|||||||
@ -76,6 +76,9 @@ public:
|
|||||||
//- Construct from Istream
|
//- Construct from Istream
|
||||||
inline SRIFallOffFunction(Istream&);
|
inline SRIFallOffFunction(Istream&);
|
||||||
|
|
||||||
|
//- Construct from dictionary
|
||||||
|
inline SRIFallOffFunction(const dictionary& dict);
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
|
|||||||
@ -25,7 +25,6 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// Construct from components
|
|
||||||
inline Foam::SRIFallOffFunction::SRIFallOffFunction
|
inline Foam::SRIFallOffFunction::SRIFallOffFunction
|
||||||
(
|
(
|
||||||
const scalar a,
|
const scalar a,
|
||||||
@ -43,7 +42,6 @@ inline Foam::SRIFallOffFunction::SRIFallOffFunction
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// Construct from Istream
|
|
||||||
inline Foam::SRIFallOffFunction::SRIFallOffFunction(Istream& is)
|
inline Foam::SRIFallOffFunction::SRIFallOffFunction(Istream& is)
|
||||||
:
|
:
|
||||||
a_(readScalar(is.readBegin("SRIFallOffFunction(Istream&)"))),
|
a_(readScalar(is.readBegin("SRIFallOffFunction(Istream&)"))),
|
||||||
@ -56,6 +54,16 @@ inline Foam::SRIFallOffFunction::SRIFallOffFunction(Istream& is)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline Foam::SRIFallOffFunction::SRIFallOffFunction(const dictionary& dict)
|
||||||
|
:
|
||||||
|
a_(readScalar(dict.lookup("a"))),
|
||||||
|
b_(readScalar(dict.lookup("b"))),
|
||||||
|
c_(readScalar(dict.lookup("c"))),
|
||||||
|
d_(readScalar(dict.lookup("d"))),
|
||||||
|
e_(readScalar(dict.lookup("e")))
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
inline Foam::scalar Foam::SRIFallOffFunction::operator()
|
inline Foam::scalar Foam::SRIFallOffFunction::operator()
|
||||||
|
|||||||
@ -76,6 +76,9 @@ public:
|
|||||||
//- Construct from Istream
|
//- Construct from Istream
|
||||||
inline TroeFallOffFunction(Istream&);
|
inline TroeFallOffFunction(Istream&);
|
||||||
|
|
||||||
|
//- Construct from dictionary
|
||||||
|
inline TroeFallOffFunction(const dictionary& dict);
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
|
|||||||
@ -25,7 +25,6 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// Construct from components
|
|
||||||
inline Foam::TroeFallOffFunction::TroeFallOffFunction
|
inline Foam::TroeFallOffFunction::TroeFallOffFunction
|
||||||
(
|
(
|
||||||
const scalar alpha,
|
const scalar alpha,
|
||||||
@ -41,7 +40,6 @@ inline Foam::TroeFallOffFunction::TroeFallOffFunction
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// Construct from Istream
|
|
||||||
inline Foam::TroeFallOffFunction::TroeFallOffFunction(Istream& is)
|
inline Foam::TroeFallOffFunction::TroeFallOffFunction(Istream& is)
|
||||||
:
|
:
|
||||||
alpha_(readScalar(is.readBegin("TroeFallOffFunction(Istream&)"))),
|
alpha_(readScalar(is.readBegin("TroeFallOffFunction(Istream&)"))),
|
||||||
@ -53,6 +51,15 @@ inline Foam::TroeFallOffFunction::TroeFallOffFunction(Istream& is)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline Foam::TroeFallOffFunction::TroeFallOffFunction(const dictionary& dict)
|
||||||
|
:
|
||||||
|
alpha_(readScalar(dict.lookup("alpha"))),
|
||||||
|
Tsss_(readScalar(dict.lookup("Tsss"))),
|
||||||
|
Ts_(readScalar(dict.lookup("Ts"))),
|
||||||
|
Tss_(readScalar(dict.lookup("Tss")))
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
inline Foam::scalar Foam::TroeFallOffFunction::operator()
|
inline Foam::scalar Foam::TroeFallOffFunction::operator()
|
||||||
|
|||||||
@ -37,6 +37,7 @@ SourceFiles
|
|||||||
|
|
||||||
#include "scalarField.H"
|
#include "scalarField.H"
|
||||||
#include "typeInfo.H"
|
#include "typeInfo.H"
|
||||||
|
#include "FixedList.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -56,7 +57,7 @@ class powerSeriesReactionRate
|
|||||||
scalar Ta_;
|
scalar Ta_;
|
||||||
|
|
||||||
static const label nb_ = 4;
|
static const label nb_ = 4;
|
||||||
scalar b_[nb_];
|
FixedList<scalar, nb_> b_;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -69,7 +70,7 @@ public:
|
|||||||
const scalar A,
|
const scalar A,
|
||||||
const scalar beta,
|
const scalar beta,
|
||||||
const scalar Ta,
|
const scalar Ta,
|
||||||
const scalar b[]
|
const FixedList<scalar, nb_> b
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Construct from Istream
|
//- Construct from Istream
|
||||||
@ -79,6 +80,13 @@ public:
|
|||||||
Istream& is
|
Istream& is
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//- Construct from dictionary
|
||||||
|
inline powerSeriesReactionRate
|
||||||
|
(
|
||||||
|
const speciesTable& species,
|
||||||
|
const dictionary& dict
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
|
|||||||
@ -23,35 +23,24 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// Construct from components
|
inline Foam::powerSeriesReactionRate::powerSeriesReactionRate
|
||||||
inline powerSeriesReactionRate::powerSeriesReactionRate
|
|
||||||
(
|
(
|
||||||
const scalar A,
|
const scalar A,
|
||||||
const scalar beta,
|
const scalar beta,
|
||||||
const scalar Ta,
|
const scalar Ta,
|
||||||
const scalar b[]
|
const FixedList<scalar, nb_> b
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
A_(A),
|
A_(A),
|
||||||
beta_(beta),
|
beta_(beta),
|
||||||
Ta_(Ta)
|
Ta_(Ta),
|
||||||
{
|
b_(b)
|
||||||
for (int n=0; n<nb_; n++)
|
{}
|
||||||
{
|
|
||||||
b_[n] = b[n];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//- Construct from Istream
|
inline Foam::powerSeriesReactionRate::powerSeriesReactionRate
|
||||||
inline powerSeriesReactionRate::powerSeriesReactionRate
|
|
||||||
(
|
(
|
||||||
const speciesTable&,
|
const speciesTable&,
|
||||||
Istream& is
|
Istream& is
|
||||||
@ -59,20 +48,29 @@ inline powerSeriesReactionRate::powerSeriesReactionRate
|
|||||||
:
|
:
|
||||||
A_(readScalar(is.readBegin("powerSeriesReactionRate(Istream&)"))),
|
A_(readScalar(is.readBegin("powerSeriesReactionRate(Istream&)"))),
|
||||||
beta_(readScalar(is)),
|
beta_(readScalar(is)),
|
||||||
Ta_(readScalar(is))
|
Ta_(readScalar(is)),
|
||||||
|
b_(is)
|
||||||
{
|
{
|
||||||
for (int n=0; n<nb_; n++)
|
|
||||||
{
|
|
||||||
is >> b_[n];
|
|
||||||
}
|
|
||||||
|
|
||||||
is.readEnd("powerSeriesReactionRate(Istream&)");
|
is.readEnd("powerSeriesReactionRate(Istream&)");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline Foam::powerSeriesReactionRate::powerSeriesReactionRate
|
||||||
|
(
|
||||||
|
const speciesTable&,
|
||||||
|
const dictionary& dict
|
||||||
|
)
|
||||||
|
:
|
||||||
|
A_(readScalar(dict.lookup("A"))),
|
||||||
|
beta_(readScalar(dict.lookup("beta"))),
|
||||||
|
Ta_(readScalar(dict.lookup("Ta"))),
|
||||||
|
b_(dict.lookup("coeffs"))
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
inline scalar powerSeriesReactionRate::operator()
|
inline Foam::scalar Foam::powerSeriesReactionRate::operator()
|
||||||
(
|
(
|
||||||
const scalar T,
|
const scalar T,
|
||||||
const scalar,
|
const scalar,
|
||||||
@ -99,7 +97,11 @@ inline scalar powerSeriesReactionRate::operator()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline Ostream& operator<<(Ostream& os, const powerSeriesReactionRate& psrr)
|
inline Foam::Ostream& Foam::operator<<
|
||||||
|
(
|
||||||
|
Ostream& os,
|
||||||
|
const powerSeriesReactionRate& psrr
|
||||||
|
)
|
||||||
{
|
{
|
||||||
os << token::BEGIN_LIST
|
os << token::BEGIN_LIST
|
||||||
<< psrr.A_ << token::SPACE << psrr.beta_ << token::SPACE << psrr.Ta_;
|
<< psrr.A_ << token::SPACE << psrr.beta_ << token::SPACE << psrr.Ta_;
|
||||||
@ -115,8 +117,4 @@ inline Ostream& operator<<(Ostream& os, const powerSeriesReactionRate& psrr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -76,6 +76,13 @@ public:
|
|||||||
Istream& is
|
Istream& is
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//- Construct from dictionary
|
||||||
|
inline thirdBodyArrheniusReactionRate
|
||||||
|
(
|
||||||
|
const speciesTable& species,
|
||||||
|
const dictionary& dict
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
|
|||||||
@ -23,15 +23,9 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// Construct from components
|
inline Foam::thirdBodyArrheniusReactionRate::thirdBodyArrheniusReactionRate
|
||||||
inline thirdBodyArrheniusReactionRate::thirdBodyArrheniusReactionRate
|
|
||||||
(
|
(
|
||||||
const scalar A,
|
const scalar A,
|
||||||
const scalar beta,
|
const scalar beta,
|
||||||
@ -44,8 +38,7 @@ inline thirdBodyArrheniusReactionRate::thirdBodyArrheniusReactionRate
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
//- Construct from Istream
|
inline Foam::thirdBodyArrheniusReactionRate::thirdBodyArrheniusReactionRate
|
||||||
inline thirdBodyArrheniusReactionRate::thirdBodyArrheniusReactionRate
|
|
||||||
(
|
(
|
||||||
const speciesTable& species,
|
const speciesTable& species,
|
||||||
Istream& is
|
Istream& is
|
||||||
@ -62,9 +55,24 @@ inline thirdBodyArrheniusReactionRate::thirdBodyArrheniusReactionRate
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline Foam::thirdBodyArrheniusReactionRate::thirdBodyArrheniusReactionRate
|
||||||
|
(
|
||||||
|
const speciesTable& species,
|
||||||
|
const dictionary& dict
|
||||||
|
)
|
||||||
|
:
|
||||||
|
ArrheniusReactionRate
|
||||||
|
(
|
||||||
|
species,
|
||||||
|
dict
|
||||||
|
),
|
||||||
|
thirdBodyEfficiencies_(species, dict)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
inline scalar thirdBodyArrheniusReactionRate::operator()
|
inline Foam::scalar Foam::thirdBodyArrheniusReactionRate::operator()
|
||||||
(
|
(
|
||||||
const scalar T,
|
const scalar T,
|
||||||
const scalar p,
|
const scalar p,
|
||||||
@ -77,7 +85,7 @@ inline scalar thirdBodyArrheniusReactionRate::operator()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline Ostream& operator<<
|
inline Foam::Ostream& Foam::operator<<
|
||||||
(
|
(
|
||||||
Ostream& os,
|
Ostream& os,
|
||||||
const thirdBodyArrheniusReactionRate& arr
|
const thirdBodyArrheniusReactionRate& arr
|
||||||
@ -91,8 +99,4 @@ inline Ostream& operator<<
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -50,7 +50,7 @@ Ostream& operator<<(Ostream&, const thirdBodyEfficiencies&);
|
|||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class thirdBodyEfficiencies Declaration
|
Class thirdBodyEfficiencies Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class thirdBodyEfficiencies
|
class thirdBodyEfficiencies
|
||||||
@ -80,6 +80,13 @@ public:
|
|||||||
Istream& is
|
Istream& is
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//- Construct from dictionary
|
||||||
|
inline thirdBodyEfficiencies
|
||||||
|
(
|
||||||
|
const speciesTable& species,
|
||||||
|
const dictionary& dict
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
// Member functions
|
||||||
|
|
||||||
|
|||||||
@ -23,9 +23,10 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "Tuple2.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
//- Construct from components
|
|
||||||
inline Foam::thirdBodyEfficiencies::thirdBodyEfficiencies
|
inline Foam::thirdBodyEfficiencies::thirdBodyEfficiencies
|
||||||
(
|
(
|
||||||
const speciesTable& species,
|
const speciesTable& species,
|
||||||
@ -48,7 +49,6 @@ inline Foam::thirdBodyEfficiencies::thirdBodyEfficiencies
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//- Construct from Istream
|
|
||||||
inline Foam::thirdBodyEfficiencies::thirdBodyEfficiencies
|
inline Foam::thirdBodyEfficiencies::thirdBodyEfficiencies
|
||||||
(
|
(
|
||||||
const speciesTable& species,
|
const speciesTable& species,
|
||||||
@ -111,6 +111,42 @@ inline Foam::thirdBodyEfficiencies::thirdBodyEfficiencies
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline Foam::thirdBodyEfficiencies::thirdBodyEfficiencies
|
||||||
|
(
|
||||||
|
const speciesTable& species,
|
||||||
|
const dictionary& dict
|
||||||
|
)
|
||||||
|
:
|
||||||
|
scalarList(species.size()),
|
||||||
|
species_(species)
|
||||||
|
{
|
||||||
|
if (dict.found("coeffs"))
|
||||||
|
{
|
||||||
|
List<Tuple2<word, scalar> > coeffs(dict.lookup("coeffs"));
|
||||||
|
if (coeffs.size() != species_.size())
|
||||||
|
{
|
||||||
|
FatalErrorIn
|
||||||
|
(
|
||||||
|
"thirdBodyEfficiencies::thirdBodyEfficiencies"
|
||||||
|
"(const speciesTable&, const dictionary&)"
|
||||||
|
) << "number of efficiencies = " << coeffs.size()
|
||||||
|
<< " is not equat to the number of species " << species_.size()
|
||||||
|
<< exit(FatalIOError);
|
||||||
|
}
|
||||||
|
|
||||||
|
forAll(coeffs, i)
|
||||||
|
{
|
||||||
|
operator[](species[coeffs[i].first()]) = coeffs[i].second();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
scalar defaultEff = readScalar(dict.lookup("defaultEfficiency"));
|
||||||
|
scalarList::operator=(defaultEff);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
inline Foam::scalar Foam::thirdBodyEfficiencies::M(const scalarList& c) const
|
inline Foam::scalar Foam::thirdBodyEfficiencies::M(const scalarList& c) const
|
||||||
|
|||||||
@ -47,6 +47,7 @@ namespace Foam
|
|||||||
|
|
||||||
defineTemplateTypeNameAndDebug(gasReaction, 0);
|
defineTemplateTypeNameAndDebug(gasReaction, 0);
|
||||||
defineTemplateRunTimeSelectionTable(gasReaction, Istream);
|
defineTemplateRunTimeSelectionTable(gasReaction, Istream);
|
||||||
|
defineTemplateRunTimeSelectionTable(gasReaction, dictionary);
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Make CHEMKIN reactions * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Make CHEMKIN reactions * * * * * * * * * * * * //
|
||||||
|
|||||||
@ -77,8 +77,16 @@ namespace Foam
|
|||||||
Reaction##Thermo, \
|
Reaction##Thermo, \
|
||||||
ReactionType##Thermo##ReactionRate, \
|
ReactionType##Thermo##ReactionRate, \
|
||||||
Istream \
|
Istream \
|
||||||
|
); \
|
||||||
|
\
|
||||||
|
addToRunTimeSelectionTable \
|
||||||
|
( \
|
||||||
|
Reaction##Thermo, \
|
||||||
|
ReactionType##Thermo##ReactionRate, \
|
||||||
|
dictionary \
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
#define makePressureDependentReaction\
|
#define makePressureDependentReaction\
|
||||||
( \
|
( \
|
||||||
Thermo, \
|
Thermo, \
|
||||||
|
|||||||
@ -47,6 +47,7 @@ namespace Foam
|
|||||||
|
|
||||||
defineTemplateTypeNameAndDebug(icoPoly8Reaction, 0);
|
defineTemplateTypeNameAndDebug(icoPoly8Reaction, 0);
|
||||||
defineTemplateRunTimeSelectionTable(icoPoly8Reaction, Istream);
|
defineTemplateRunTimeSelectionTable(icoPoly8Reaction, Istream);
|
||||||
|
defineTemplateRunTimeSelectionTable(icoPoly8Reaction, dictionary);
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Make CHEMKIN reactions * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Make CHEMKIN reactions * * * * * * * * * * * * //
|
||||||
|
|||||||
@ -51,6 +51,14 @@ Foam::specie::specie(Istream& is)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::specie::specie(const dictionary& dict)
|
||||||
|
:
|
||||||
|
name_(dict.dictName()),
|
||||||
|
nMoles_(readScalar(dict.lookup("nMoles"))),
|
||||||
|
molWeight_(readScalar(dict.lookup("molWeight")))
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::Ostream& Foam::operator<<(Ostream& os, const specie& st)
|
Foam::Ostream& Foam::operator<<(Ostream& os, const specie& st)
|
||||||
|
|||||||
@ -38,6 +38,7 @@ SourceFiles
|
|||||||
|
|
||||||
#include "word.H"
|
#include "word.H"
|
||||||
#include "scalar.H"
|
#include "scalar.H"
|
||||||
|
#include "dictionary.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -68,11 +69,7 @@ class specie
|
|||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
//- Construct from components without name
|
//- Construct from components without name
|
||||||
inline specie
|
inline specie(const scalar nMoles, const scalar molWeight);
|
||||||
(
|
|
||||||
const scalar nMoles,
|
|
||||||
const scalar molWeight
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -110,6 +107,9 @@ public:
|
|||||||
//- Construct from Istream
|
//- Construct from Istream
|
||||||
specie(Istream&);
|
specie(Istream&);
|
||||||
|
|
||||||
|
//- Construct from dictionary
|
||||||
|
specie(const dictionary& dict);
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
|
|||||||
@ -39,6 +39,15 @@ Foam::eConstThermo<equationOfState>::eConstThermo(Istream& is)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class equationOfState>
|
||||||
|
Foam::eConstThermo<equationOfState>::eConstThermo(const dictionary& dict)
|
||||||
|
:
|
||||||
|
equationOfState(dict),
|
||||||
|
Cv_(readScalar(dict.lookup("Cv"))),
|
||||||
|
Hf_(readScalar(dict.lookup("Hf")))
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class equationOfState>
|
template<class equationOfState>
|
||||||
|
|||||||
@ -117,6 +117,9 @@ public:
|
|||||||
//- Construct from Istream
|
//- Construct from Istream
|
||||||
eConstThermo(Istream&);
|
eConstThermo(Istream&);
|
||||||
|
|
||||||
|
//- Construct from dictionary
|
||||||
|
eConstThermo(const dictionary& dict);
|
||||||
|
|
||||||
//- Construct as named copy
|
//- Construct as named copy
|
||||||
inline eConstThermo(const word&, const eConstThermo&);
|
inline eConstThermo(const word&, const eConstThermo&);
|
||||||
|
|
||||||
@ -126,6 +129,9 @@ public:
|
|||||||
// Selector from Istream
|
// Selector from Istream
|
||||||
inline static autoPtr<eConstThermo> New(Istream& is);
|
inline static autoPtr<eConstThermo> New(Istream& is);
|
||||||
|
|
||||||
|
// Selector from dictionary
|
||||||
|
inline static autoPtr<eConstThermo> New(const dictionary& dict);
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
|
|||||||
@ -76,6 +76,17 @@ Foam::eConstThermo<equationOfState>::New(Istream& is)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class equationOfState>
|
||||||
|
inline Foam::autoPtr<Foam::eConstThermo<equationOfState> >
|
||||||
|
Foam::eConstThermo<equationOfState>::New(const dictionary& dict)
|
||||||
|
{
|
||||||
|
return autoPtr<eConstThermo<equationOfState> >
|
||||||
|
(
|
||||||
|
new eConstThermo<equationOfState>(dict)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class equationOfState>
|
template<class equationOfState>
|
||||||
|
|||||||
@ -39,6 +39,15 @@ Foam::hConstThermo<equationOfState>::hConstThermo(Istream& is)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class equationOfState>
|
||||||
|
Foam::hConstThermo<equationOfState>::hConstThermo(const dictionary& dict)
|
||||||
|
:
|
||||||
|
equationOfState(dict),
|
||||||
|
Cp_(readScalar(dict.lookup("Cp"))),
|
||||||
|
Hf_(readScalar(dict.lookup("Hf")))
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class equationOfState>
|
template<class equationOfState>
|
||||||
|
|||||||
@ -115,6 +115,9 @@ public:
|
|||||||
//- Construct from Istream
|
//- Construct from Istream
|
||||||
hConstThermo(Istream&);
|
hConstThermo(Istream&);
|
||||||
|
|
||||||
|
//- Construct from dictionary
|
||||||
|
hConstThermo(const dictionary& dict);
|
||||||
|
|
||||||
//- Construct as named copy
|
//- Construct as named copy
|
||||||
inline hConstThermo(const word&, const hConstThermo&);
|
inline hConstThermo(const word&, const hConstThermo&);
|
||||||
|
|
||||||
@ -124,6 +127,9 @@ public:
|
|||||||
//- Selector from Istream
|
//- Selector from Istream
|
||||||
inline static autoPtr<hConstThermo> New(Istream& is);
|
inline static autoPtr<hConstThermo> New(Istream& is);
|
||||||
|
|
||||||
|
//- Selector from dictionary
|
||||||
|
inline static autoPtr<hConstThermo> New(const dictionary& dict);
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
|
|||||||
@ -76,6 +76,17 @@ Foam::hConstThermo<equationOfState>::New(Istream& is)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class equationOfState>
|
||||||
|
inline Foam::autoPtr<Foam::hConstThermo<equationOfState> >
|
||||||
|
Foam::hConstThermo<equationOfState>::New(const dictionary& dict)
|
||||||
|
{
|
||||||
|
return autoPtr<hConstThermo<equationOfState> >
|
||||||
|
(
|
||||||
|
new hConstThermo<equationOfState>(dict)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class equationOfState>
|
template<class equationOfState>
|
||||||
|
|||||||
@ -56,6 +56,34 @@ Foam::hPolynomialThermo<EquationOfState, PolySize>::hPolynomialThermo
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class EquationOfState, int PolySize>
|
||||||
|
Foam::hPolynomialThermo<EquationOfState, PolySize>::hPolynomialThermo
|
||||||
|
(
|
||||||
|
const dictionary& dict
|
||||||
|
)
|
||||||
|
:
|
||||||
|
EquationOfState(dict),
|
||||||
|
Hf_(readScalar(dict.lookup("Hf"))),
|
||||||
|
Sf_(readScalar(dict.lookup("Sf"))),
|
||||||
|
cpPolynomial_(dict.lookup("cpPolynomial")),
|
||||||
|
hPolynomial_(),
|
||||||
|
sPolynomial_()
|
||||||
|
{
|
||||||
|
Hf_ *= this->W();
|
||||||
|
Sf_ *= this->W();
|
||||||
|
cpPolynomial_ *= this->W();
|
||||||
|
|
||||||
|
hPolynomial_ = cpPolynomial_.integrate();
|
||||||
|
sPolynomial_ = cpPolynomial_.integrateMinus1();
|
||||||
|
|
||||||
|
// Offset h poly so that it is relative to the enthalpy at Tstd
|
||||||
|
hPolynomial_[0] += Hf_ - hPolynomial_.evaluate(specie::Tstd);
|
||||||
|
|
||||||
|
// Offset s poly so that it is relative to the entropy at Tstd
|
||||||
|
sPolynomial_[0] += Sf_ - sPolynomial_.evaluate(specie::Tstd);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class EquationOfState, int PolySize>
|
template<class EquationOfState, int PolySize>
|
||||||
|
|||||||
@ -135,9 +135,12 @@ public:
|
|||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from dictionary
|
//- Construct from Istream
|
||||||
hPolynomialThermo(Istream& is);
|
hPolynomialThermo(Istream& is);
|
||||||
|
|
||||||
|
//- Construct from dictionary
|
||||||
|
hPolynomialThermo(const dictionary& dict);
|
||||||
|
|
||||||
//- Construct as copy
|
//- Construct as copy
|
||||||
inline hPolynomialThermo(const hPolynomialThermo&);
|
inline hPolynomialThermo(const hPolynomialThermo&);
|
||||||
|
|
||||||
|
|||||||
@ -26,6 +26,34 @@ License
|
|||||||
#include "janafThermo.H"
|
#include "janafThermo.H"
|
||||||
#include "IOstreams.H"
|
#include "IOstreams.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class equationOfState>
|
||||||
|
void Foam::janafThermo<equationOfState>::checkInputData() const
|
||||||
|
{
|
||||||
|
if (Tlow_ >= Thigh_)
|
||||||
|
{
|
||||||
|
FatalErrorIn("janafThermo<equationOfState>::check()")
|
||||||
|
<< "Tlow(" << Tlow_ << ") >= Thigh(" << Thigh_ << ')'
|
||||||
|
<< exit(FatalIOError);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Tcommon_ <= Tlow_)
|
||||||
|
{
|
||||||
|
FatalErrorIn("janafThermo<equationOfState>::check()")
|
||||||
|
<< "Tcommon(" << Tcommon_ << ") <= Tlow(" << Tlow_ << ')'
|
||||||
|
<< exit(FatalIOError);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Tcommon_ > Thigh_)
|
||||||
|
{
|
||||||
|
FatalErrorIn("janafThermo<equationOfState>::check()")
|
||||||
|
<< "Tcommon(" << Tcommon_ << ") > Thigh(" << Thigh_ << ')'
|
||||||
|
<< exit(FatalIOError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class equationOfState>
|
template<class equationOfState>
|
||||||
@ -36,54 +64,16 @@ Foam::janafThermo<equationOfState>::janafThermo(Istream& is)
|
|||||||
Thigh_(readScalar(is)),
|
Thigh_(readScalar(is)),
|
||||||
Tcommon_(readScalar(is))
|
Tcommon_(readScalar(is))
|
||||||
{
|
{
|
||||||
if (Tlow_ >= Thigh_)
|
checkInputData();
|
||||||
|
|
||||||
|
forAll(highCpCoeffs_, i)
|
||||||
{
|
{
|
||||||
FatalIOErrorIn
|
is >> highCpCoeffs_[i];
|
||||||
(
|
|
||||||
"janafThermo<equationOfState>::janafThermo(Istream& is)",
|
|
||||||
is
|
|
||||||
) << "Tlow(" << Tlow_ << ") >= Thigh(" << Thigh_ << ')'
|
|
||||||
<< exit(FatalIOError);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Tcommon_ <= Tlow_)
|
forAll(lowCpCoeffs_, i)
|
||||||
{
|
{
|
||||||
FatalIOErrorIn
|
is >> lowCpCoeffs_[i];
|
||||||
(
|
|
||||||
"janafThermo<equationOfState>::janafThermo(Istream& is)",
|
|
||||||
is
|
|
||||||
) << "Tcommon(" << Tcommon_ << ") <= Tlow(" << Tlow_ << ')'
|
|
||||||
<< exit(FatalIOError);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Tcommon_ > Thigh_)
|
|
||||||
{
|
|
||||||
FatalIOErrorIn
|
|
||||||
(
|
|
||||||
"janafThermo<equationOfState>::janafThermo(Istream& is)",
|
|
||||||
is
|
|
||||||
) << "Tcommon(" << Tcommon_ << ") > Thigh(" << Thigh_ << ')'
|
|
||||||
<< exit(FatalIOError);
|
|
||||||
}
|
|
||||||
|
|
||||||
for
|
|
||||||
(
|
|
||||||
register label coefLabel=0;
|
|
||||||
coefLabel<janafThermo<equationOfState>::nCoeffs_;
|
|
||||||
coefLabel++
|
|
||||||
)
|
|
||||||
{
|
|
||||||
is >> highCpCoeffs_[coefLabel];
|
|
||||||
}
|
|
||||||
|
|
||||||
for
|
|
||||||
(
|
|
||||||
register label coefLabel=0;
|
|
||||||
coefLabel<janafThermo<equationOfState>::nCoeffs_;
|
|
||||||
coefLabel++
|
|
||||||
)
|
|
||||||
{
|
|
||||||
is >> lowCpCoeffs_[coefLabel];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check state of Istream
|
// Check state of Istream
|
||||||
@ -91,6 +81,20 @@ Foam::janafThermo<equationOfState>::janafThermo(Istream& is)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class equationOfState>
|
||||||
|
Foam::janafThermo<equationOfState>::janafThermo(const dictionary& dict)
|
||||||
|
:
|
||||||
|
equationOfState(dict),
|
||||||
|
Tlow_(readScalar(dict.lookup("Tlow"))),
|
||||||
|
Thigh_(readScalar(dict.lookup("Thigh"))),
|
||||||
|
Tcommon_(readScalar(dict.lookup("Tcommon"))),
|
||||||
|
highCpCoeffs_(dict.lookup("highCpCoeffs")),
|
||||||
|
lowCpCoeffs_(dict.lookup("lowCpCoeffs"))
|
||||||
|
{
|
||||||
|
checkInputData();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class equationOfState>
|
template<class equationOfState>
|
||||||
@ -107,26 +111,16 @@ Foam::Ostream& Foam::operator<<
|
|||||||
|
|
||||||
os << nl << " ";
|
os << nl << " ";
|
||||||
|
|
||||||
for
|
forAll(jt.highCpCoeffs_, i)
|
||||||
(
|
|
||||||
register label coefLabel=0;
|
|
||||||
coefLabel<janafThermo<equationOfState>::nCoeffs_;
|
|
||||||
coefLabel++
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
os << jt.highCpCoeffs_[coefLabel] << ' ';
|
os << jt.highCpCoeffs_[i] << ' ';
|
||||||
}
|
}
|
||||||
|
|
||||||
os << nl << " ";
|
os << nl << " ";
|
||||||
|
|
||||||
for
|
forAll(jt.lowCpCoeffs_, i)
|
||||||
(
|
|
||||||
register label coefLabel=0;
|
|
||||||
coefLabel<janafThermo<equationOfState>::nCoeffs_;
|
|
||||||
coefLabel++
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
os << jt.lowCpCoeffs_[coefLabel] << ' ';
|
os << jt.lowCpCoeffs_[i] << ' ';
|
||||||
}
|
}
|
||||||
|
|
||||||
os << endl;
|
os << endl;
|
||||||
|
|||||||
@ -38,6 +38,7 @@ SourceFiles
|
|||||||
#define janafThermo_H
|
#define janafThermo_H
|
||||||
|
|
||||||
#include "scalar.H"
|
#include "scalar.H"
|
||||||
|
#include "FixedList.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -96,8 +97,11 @@ class janafThermo
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
// Public data
|
||||||
|
|
||||||
static const int nCoeffs_ = 7;
|
static const int nCoeffs_ = 7;
|
||||||
typedef scalar coeffArray[7];
|
typedef FixedList<scalar, nCoeffs_> coeffArray;
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
@ -112,6 +116,9 @@ private:
|
|||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
|
//- Check that input data is valid
|
||||||
|
void checkInputData() const;
|
||||||
|
|
||||||
//- 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;
|
||||||
|
|
||||||
@ -137,6 +144,9 @@ public:
|
|||||||
//- Construct from Istream
|
//- Construct from Istream
|
||||||
janafThermo(Istream&);
|
janafThermo(Istream&);
|
||||||
|
|
||||||
|
//- Construct from dictionary
|
||||||
|
janafThermo(const dictionary& dict);
|
||||||
|
|
||||||
//- Construct as a named copy
|
//- Construct as a named copy
|
||||||
inline janafThermo(const word&, const janafThermo&);
|
inline janafThermo(const word&, const janafThermo&);
|
||||||
|
|
||||||
|
|||||||
@ -46,6 +46,13 @@ Foam::specieThermo<thermo>::specieThermo(Istream& is)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class thermo>
|
||||||
|
Foam::specieThermo<thermo>::specieThermo(const dictionary& dict)
|
||||||
|
:
|
||||||
|
thermo(dict)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class thermo>
|
template<class thermo>
|
||||||
|
|||||||
@ -124,6 +124,9 @@ public:
|
|||||||
//- Construct from Istream
|
//- Construct from Istream
|
||||||
specieThermo(Istream&);
|
specieThermo(Istream&);
|
||||||
|
|
||||||
|
//- Construct from dictionary
|
||||||
|
specieThermo(const dictionary& dict);
|
||||||
|
|
||||||
//- Construct as named copy
|
//- Construct as named copy
|
||||||
inline specieThermo(const word& name, const specieThermo&);
|
inline specieThermo(const word& name, const specieThermo&);
|
||||||
|
|
||||||
|
|||||||
@ -44,6 +44,15 @@ constTransport<thermo>::constTransport(Istream& is)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class thermo>
|
||||||
|
constTransport<thermo>::constTransport(const dictionary& dict)
|
||||||
|
:
|
||||||
|
thermo(dict),
|
||||||
|
Mu(readScalar(dict.lookup("Mu"))),
|
||||||
|
rPr(1.0/readScalar(dict.lookup("Pr")))
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class thermo>
|
template<class thermo>
|
||||||
|
|||||||
@ -119,6 +119,9 @@ public:
|
|||||||
//- Construct from Istream
|
//- Construct from Istream
|
||||||
constTransport(Istream&);
|
constTransport(Istream&);
|
||||||
|
|
||||||
|
//- Construct from dictionary
|
||||||
|
constTransport(const dictionary& dict);
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
// Member functions
|
||||||
|
|
||||||
|
|||||||
@ -40,6 +40,21 @@ Foam::polynomialTransport<Thermo, PolySize>::polynomialTransport(Istream& is)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Thermo, int PolySize>
|
||||||
|
Foam::polynomialTransport<Thermo, PolySize>::polynomialTransport
|
||||||
|
(
|
||||||
|
const dictionary& dict
|
||||||
|
)
|
||||||
|
:
|
||||||
|
Thermo(dict),
|
||||||
|
muPolynomial_(dict.lookup("muPolynomial")),
|
||||||
|
kappaPolynomial_(dict.lookup("kappaPolynomial"))
|
||||||
|
{
|
||||||
|
muPolynomial_ *= this->W();
|
||||||
|
kappaPolynomial_ *= this->W();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Thermo, int PolySize>
|
template<class Thermo, int PolySize>
|
||||||
|
|||||||
@ -127,12 +127,18 @@ public:
|
|||||||
//- Construct from Istream
|
//- Construct from Istream
|
||||||
polynomialTransport(Istream& is);
|
polynomialTransport(Istream& is);
|
||||||
|
|
||||||
|
//- Construct from dictionary
|
||||||
|
polynomialTransport(const dictionary& dict);
|
||||||
|
|
||||||
//- Construct and return a clone
|
//- Construct and return a clone
|
||||||
inline autoPtr<polynomialTransport> clone() const;
|
inline autoPtr<polynomialTransport> clone() const;
|
||||||
|
|
||||||
// Selector from Istream
|
// Selector from Istream
|
||||||
inline static autoPtr<polynomialTransport> New(Istream& is);
|
inline static autoPtr<polynomialTransport> New(Istream& is);
|
||||||
|
|
||||||
|
// Selector from dictionary
|
||||||
|
inline static autoPtr<polynomialTransport> New(const dictionary& dict);
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
// Member functions
|
||||||
|
|
||||||
|
|||||||
@ -88,6 +88,17 @@ Foam::polynomialTransport<Thermo, PolySize>::New(Istream& is)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Thermo, int PolySize>
|
||||||
|
inline Foam::autoPtr<Foam::polynomialTransport<Thermo, PolySize> >
|
||||||
|
Foam::polynomialTransport<Thermo, PolySize>::New(const dictionary& dict)
|
||||||
|
{
|
||||||
|
return autoPtr<polynomialTransport<Thermo, PolySize> >
|
||||||
|
(
|
||||||
|
new polynomialTransport<Thermo, PolySize>(dict)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Thermo, int PolySize>
|
template<class Thermo, int PolySize>
|
||||||
|
|||||||
@ -44,6 +44,12 @@ speciesTransport::speciesTransport(Istream& is)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
speciesTransport::speciesTransport(const dictionary& dict)
|
||||||
|
:
|
||||||
|
janafThermo(dict)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
||||||
|
|
||||||
Ostream& operator<<(Ostream& os, const speciesTransport& sTranport)
|
Ostream& operator<<(Ostream& os, const speciesTransport& sTranport)
|
||||||
|
|||||||
@ -64,14 +64,14 @@ public:
|
|||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from speciesThermo
|
//- Construct from speciesThermo
|
||||||
inline speciesTransport
|
inline speciesTransport(const janafThermo& sThermo);
|
||||||
(
|
|
||||||
const janafThermo& sThermo
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct from Istream
|
//- Construct from Istream
|
||||||
speciesTransport(Istream&);
|
speciesTransport(Istream&);
|
||||||
|
|
||||||
|
//- Construct from dictionary
|
||||||
|
speciesTransport(const dictionary& dict);
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
|
|||||||
@ -44,6 +44,15 @@ sutherlandTransport<thermo>::sutherlandTransport(Istream& is)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class thermo>
|
||||||
|
sutherlandTransport<thermo>::sutherlandTransport(const dictionary& dict)
|
||||||
|
:
|
||||||
|
thermo(dict),
|
||||||
|
As(readScalar(dict.lookup("As"))),
|
||||||
|
Ts(readScalar(dict.lookup("Ts")))
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class thermo>
|
template<class thermo>
|
||||||
|
|||||||
@ -141,12 +141,18 @@ public:
|
|||||||
//- Construct from Istream
|
//- Construct from Istream
|
||||||
sutherlandTransport(Istream&);
|
sutherlandTransport(Istream&);
|
||||||
|
|
||||||
|
//- Construct from dictionary
|
||||||
|
sutherlandTransport(const dictionary& dict);
|
||||||
|
|
||||||
//- Construct and return a clone
|
//- Construct and return a clone
|
||||||
inline autoPtr<sutherlandTransport> clone() const;
|
inline autoPtr<sutherlandTransport> clone() const;
|
||||||
|
|
||||||
// Selector from Istream
|
// Selector from Istream
|
||||||
inline static autoPtr<sutherlandTransport> New(Istream& is);
|
inline static autoPtr<sutherlandTransport> New(Istream& is);
|
||||||
|
|
||||||
|
// Selector from dictionary
|
||||||
|
inline static autoPtr<sutherlandTransport> New(const dictionary& dict);
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
// Member functions
|
||||||
|
|
||||||
|
|||||||
@ -51,7 +51,6 @@ inline void sutherlandTransport<thermo>::calcCoeffs
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// Construct from components
|
|
||||||
template<class thermo>
|
template<class thermo>
|
||||||
inline sutherlandTransport<thermo>::sutherlandTransport
|
inline sutherlandTransport<thermo>::sutherlandTransport
|
||||||
(
|
(
|
||||||
@ -66,7 +65,6 @@ inline sutherlandTransport<thermo>::sutherlandTransport
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// Construct from components
|
|
||||||
template<class thermo>
|
template<class thermo>
|
||||||
inline sutherlandTransport<thermo>::sutherlandTransport
|
inline sutherlandTransport<thermo>::sutherlandTransport
|
||||||
(
|
(
|
||||||
@ -81,7 +79,6 @@ inline sutherlandTransport<thermo>::sutherlandTransport
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//- Construct as named copy
|
|
||||||
template<class thermo>
|
template<class thermo>
|
||||||
inline sutherlandTransport<thermo>::sutherlandTransport
|
inline sutherlandTransport<thermo>::sutherlandTransport
|
||||||
(
|
(
|
||||||
@ -95,7 +92,6 @@ inline sutherlandTransport<thermo>::sutherlandTransport
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// Construct and return a clone
|
|
||||||
template<class thermo>
|
template<class thermo>
|
||||||
inline autoPtr<sutherlandTransport<thermo> > sutherlandTransport<thermo>::clone
|
inline autoPtr<sutherlandTransport<thermo> > sutherlandTransport<thermo>::clone
|
||||||
() const
|
() const
|
||||||
@ -107,7 +103,6 @@ inline autoPtr<sutherlandTransport<thermo> > sutherlandTransport<thermo>::clone
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Selector from Istream
|
|
||||||
template<class thermo>
|
template<class thermo>
|
||||||
inline autoPtr<sutherlandTransport<thermo> > sutherlandTransport<thermo>::New
|
inline autoPtr<sutherlandTransport<thermo> > sutherlandTransport<thermo>::New
|
||||||
(
|
(
|
||||||
@ -121,6 +116,19 @@ inline autoPtr<sutherlandTransport<thermo> > sutherlandTransport<thermo>::New
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class thermo>
|
||||||
|
inline autoPtr<sutherlandTransport<thermo> > sutherlandTransport<thermo>::New
|
||||||
|
(
|
||||||
|
const dictionary& dict
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return autoPtr<sutherlandTransport<thermo> >
|
||||||
|
(
|
||||||
|
new sutherlandTransport<thermo>(dict)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// Dynamic viscosity [kg/ms]
|
// Dynamic viscosity [kg/ms]
|
||||||
@ -131,7 +139,6 @@ inline scalar sutherlandTransport<thermo>::mu(const scalar T) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Thermal conductivity [W/mK]
|
|
||||||
template<class thermo>
|
template<class thermo>
|
||||||
inline scalar sutherlandTransport<thermo>::kappa(const scalar T) const
|
inline scalar sutherlandTransport<thermo>::kappa(const scalar T) const
|
||||||
{
|
{
|
||||||
@ -140,7 +147,6 @@ inline scalar sutherlandTransport<thermo>::kappa(const scalar T) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Thermal diffusivity for enthalpy [kg/ms]
|
|
||||||
template<class thermo>
|
template<class thermo>
|
||||||
inline scalar sutherlandTransport<thermo>::alpha(const scalar T) const
|
inline scalar sutherlandTransport<thermo>::alpha(const scalar T) const
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user