Commit 19705736 authored by Andrew Heather's avatar Andrew Heather
Browse files

STYLE: Misc coding cosmetics

parent 81a651d9
......@@ -26,14 +26,9 @@ License
#include "perfectGas.H"
#include "IOstreams.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
perfectGas::perfectGas(Istream& is)
Foam::perfectGas::perfectGas(Istream& is)
:
specie(is)
{
......@@ -41,7 +36,7 @@ perfectGas::perfectGas(Istream& is)
}
perfectGas::perfectGas(const dictionary& dict)
Foam::perfectGas::perfectGas(const dictionary& dict)
:
specie(dict)
{}
......@@ -49,7 +44,7 @@ perfectGas::perfectGas(const dictionary& dict)
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void perfectGas::write(Ostream& os) const
void Foam::perfectGas::write(Ostream& os) const
{
specie::write(os);
}
......@@ -57,7 +52,7 @@ void perfectGas::write(Ostream& os) const
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
Ostream& operator<<(Ostream& os, const perfectGas& pg)
Foam::Ostream& Foam::operator<<(Ostream& os, const perfectGas& pg)
{
os << static_cast<const specie&>(pg);
......@@ -66,8 +61,4 @@ Ostream& operator<<(Ostream& os, const perfectGas& pg)
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //
......@@ -25,17 +25,9 @@ License
#include "perfectGas.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
inline perfectGas::perfectGas
(
const specie& sp
)
inline Foam::perfectGas::perfectGas(const specie& sp)
:
specie(sp)
{}
......@@ -43,25 +35,28 @@ inline perfectGas::perfectGas
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
inline perfectGas::perfectGas(const word& name, const perfectGas& pg)
inline Foam::perfectGas::perfectGas(const word& name, const perfectGas& pg)
:
specie(name, pg)
{}
inline autoPtr<perfectGas> perfectGas::clone() const
inline Foam::autoPtr<Foam::perfectGas> Foam::perfectGas::clone() const
{
return autoPtr<perfectGas>(new perfectGas(*this));
}
inline autoPtr<perfectGas> perfectGas::New(Istream& is)
inline Foam::autoPtr<Foam::perfectGas> Foam::perfectGas::New(Istream& is)
{
return autoPtr<perfectGas>(new perfectGas(is));
}
inline autoPtr<perfectGas> perfectGas::New(const dictionary& dict)
inline Foam::autoPtr<Foam::perfectGas> Foam::perfectGas::New
(
const dictionary& dict
)
{
return autoPtr<perfectGas>(new perfectGas(dict));
}
......@@ -69,19 +64,19 @@ inline autoPtr<perfectGas> perfectGas::New(const dictionary& dict)
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
inline scalar perfectGas::rho(scalar p, scalar T) const
inline Foam::scalar Foam::perfectGas::rho(scalar p, scalar T) const
{
return p/(R()*T);
}
inline scalar perfectGas::psi(scalar, scalar T) const
inline Foam::scalar Foam::perfectGas::psi(scalar, scalar T) const
{
return 1.0/(R()*T);
}
inline scalar perfectGas::Z(scalar, scalar) const
inline Foam::scalar Foam::perfectGas::Z(scalar, scalar) const
{
return 1.0;
}
......@@ -89,19 +84,19 @@ inline scalar perfectGas::Z(scalar, scalar) const
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
inline void perfectGas::operator+=(const perfectGas& pg)
inline void Foam::perfectGas::operator+=(const perfectGas& pg)
{
specie::operator+=(pg);
}
inline void perfectGas::operator-=(const perfectGas& pg)
inline void Foam::perfectGas::operator-=(const perfectGas& pg)
{
specie::operator-=(pg);
}
inline void perfectGas::operator*=(const scalar s)
inline void Foam::perfectGas::operator*=(const scalar s)
{
specie::operator*=(s);
}
......@@ -109,7 +104,7 @@ inline void perfectGas::operator*=(const scalar s)
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
inline perfectGas operator+
inline Foam::perfectGas Foam::operator+
(
const perfectGas& pg1,
const perfectGas& pg2
......@@ -123,7 +118,7 @@ inline perfectGas operator+
}
inline perfectGas operator-
inline Foam::perfectGas Foam::operator-
(
const perfectGas& pg1,
const perfectGas& pg2
......@@ -137,7 +132,7 @@ inline perfectGas operator-
}
inline perfectGas operator*
inline Foam::perfectGas Foam::operator*
(
const scalar s,
const perfectGas& pg
......@@ -147,7 +142,7 @@ inline perfectGas operator*
}
inline perfectGas operator==
inline Foam::perfectGas Foam::operator==
(
const perfectGas& pg1,
const perfectGas& pg2
......@@ -157,8 +152,4 @@ inline perfectGas operator==
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //
......@@ -380,6 +380,7 @@ Foam::scalar Foam::Reaction<ReactionThermo>::kr
return 0.0;
}
template<class ReactionThermo>
Foam::scalar Foam::Reaction<ReactionThermo>::kr
(
......
......@@ -56,8 +56,8 @@ class powerSeriesReactionRate
scalar beta_;
scalar Ta_;
static const label nb_ = 4;
FixedList<scalar, nb_> b_;
static const label nCoeff_ = 4;
FixedList<scalar, nCoeff_> coeffs_;
public:
......@@ -70,7 +70,7 @@ public:
const scalar A,
const scalar beta,
const scalar Ta,
const FixedList<scalar, nb_> b
const FixedList<scalar, nCoeff_> coeffs
);
//- Construct from Istream
......
......@@ -30,13 +30,13 @@ inline Foam::powerSeriesReactionRate::powerSeriesReactionRate
const scalar A,
const scalar beta,
const scalar Ta,
const FixedList<scalar, nb_> b
const FixedList<scalar, nCoeff_> coeffs
)
:
A_(A),
beta_(beta),
Ta_(Ta),
b_(b)
coeffs_(coeffs)
{}
......@@ -49,7 +49,7 @@ inline Foam::powerSeriesReactionRate::powerSeriesReactionRate
A_(readScalar(is.readBegin("powerSeriesReactionRate(Istream&)"))),
beta_(readScalar(is)),
Ta_(readScalar(is)),
b_(is)
coeffs_(is)
{
is.readEnd("powerSeriesReactionRate(Istream&)");
}
......@@ -64,7 +64,7 @@ inline Foam::powerSeriesReactionRate::powerSeriesReactionRate
A_(readScalar(dict.lookup("A"))),
beta_(readScalar(dict.lookup("beta"))),
Ta_(readScalar(dict.lookup("Ta"))),
b_(dict.lookup("coeffs"))
coeffs_(dict.lookup("coeffs"))
{}
......@@ -86,9 +86,9 @@ inline Foam::scalar Foam::powerSeriesReactionRate::operator()
scalar expArg = 0.0;
for (int n=0; n<nb_; n++)
forAll(coeffs_, n)
{
expArg += b_[n]/pow(T, n);
expArg += coeffs_[n]/pow(T, n);
}
lta *= exp(expArg);
......@@ -102,7 +102,7 @@ inline void Foam::powerSeriesReactionRate::write(Ostream& os) const
os.writeKeyword("A") << A_ << token::END_STATEMENT << nl;
os.writeKeyword("beta") << beta_ << token::END_STATEMENT << nl;
os.writeKeyword("Ta") << Ta_ << token::END_STATEMENT << nl;
os.writeKeyword("b") << b_ << token::END_STATEMENT << nl;
os.writeKeyword("coeffs") << coeffs_ << token::END_STATEMENT << nl;
}
......@@ -115,9 +115,9 @@ inline Foam::Ostream& Foam::operator<<
os << token::BEGIN_LIST
<< psrr.A_ << token::SPACE << psrr.beta_ << token::SPACE << psrr.Ta_;
for (int n=0; n<powerSeriesReactionRate::nb_; n++)
for (int n=0; n<powerSeriesReactionRate::nCoeff_; n++)
{
os << token::SPACE << psrr.b_[n];
os << token::SPACE << psrr.coeffs_[n];
}
os << token::END_LIST;
......
......@@ -28,21 +28,21 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class equationOfState>
Foam::eConstThermo<equationOfState>::eConstThermo(Istream& is)
template<class EquationOfState>
Foam::eConstThermo<EquationOfState>::eConstThermo(Istream& is)
:
equationOfState(is),
EquationOfState(is),
Cv_(readScalar(is)),
Hf_(readScalar(is))
{
is.check("eConstThermo::eConstThermo(Istream& is)");
is.check("eConstThermo<EquationOfState>::eConstThermo(Istream&)");
}
template<class equationOfState>
Foam::eConstThermo<equationOfState>::eConstThermo(const dictionary& dict)
template<class EquationOfState>
Foam::eConstThermo<EquationOfState>::eConstThermo(const dictionary& dict)
:
equationOfState(dict),
EquationOfState(dict),
Cv_(readScalar(dict.lookup("Cv"))),
Hf_(readScalar(dict.lookup("Hf")))
{}
......@@ -50,10 +50,10 @@ Foam::eConstThermo<equationOfState>::eConstThermo(const dictionary& dict)
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class equationOfState>
void Foam::eConstThermo<equationOfState>::write(Ostream& os) const
template<class EquationOfState>
void Foam::eConstThermo<EquationOfState>::write(Ostream& os) const
{
equationOfState::write(os);
EquationOfState::write(os);
os.writeKeyword("Cv") << Cv_ << token::END_STATEMENT << nl;
os.writeKeyword("Hf") << Hf_ << token::END_STATEMENT << nl;
}
......@@ -61,17 +61,17 @@ void Foam::eConstThermo<equationOfState>::write(Ostream& os) const
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
template<class equationOfState>
template<class EquationOfState>
Foam::Ostream& Foam::operator<<
(
Ostream& os,
const eConstThermo<equationOfState>& ct
const eConstThermo<EquationOfState>& ct
)
{
os << static_cast<const equationOfState&>(ct) << tab
os << static_cast<const EquationOfState&>(ct) << tab
<< ct.Cv_ << tab << ct.Hf_;
os.check("Ostream& operator<<(Ostream& os, const eConstThermo& ct)");
os.check("Ostream& operator<<(Ostream&, const eConstThermo&)");
return os;
}
......
......@@ -46,41 +46,41 @@ namespace Foam
// Forward declaration of friend functions and operators
template<class equationOfState> class eConstThermo;
template<class EquationOfState> class eConstThermo;
template<class equationOfState>
inline eConstThermo<equationOfState> operator+
template<class EquationOfState>
inline eConstThermo<EquationOfState> operator+
(
const eConstThermo<equationOfState>&,
const eConstThermo<equationOfState>&
const eConstThermo<EquationOfState>&,
const eConstThermo<EquationOfState>&
);
template<class equationOfState>
inline eConstThermo<equationOfState> operator-
template<class EquationOfState>
inline eConstThermo<EquationOfState> operator-
(
const eConstThermo<equationOfState>&,
const eConstThermo<equationOfState>&
const eConstThermo<EquationOfState>&,
const eConstThermo<EquationOfState>&
);
template<class equationOfState>
inline eConstThermo<equationOfState> operator*
template<class EquationOfState>
inline eConstThermo<EquationOfState> operator*
(
const scalar,
const eConstThermo<equationOfState>&
const eConstThermo<EquationOfState>&
);
template<class equationOfState>
inline eConstThermo<equationOfState> operator==
template<class EquationOfState>
inline eConstThermo<EquationOfState> operator==
(
const eConstThermo<equationOfState>&,
const eConstThermo<equationOfState>&
const eConstThermo<EquationOfState>&,
const eConstThermo<EquationOfState>&
);
template<class equationOfState>
template<class EquationOfState>
Ostream& operator<<
(
Ostream&,
const eConstThermo<equationOfState>&
const eConstThermo<EquationOfState>&
);
......@@ -88,10 +88,10 @@ Ostream& operator<<
Class eConstThermo Declaration
\*---------------------------------------------------------------------------*/
template<class equationOfState>
template<class EquationOfState>
class eConstThermo
:
public equationOfState
public EquationOfState
{
// Private data
......@@ -104,7 +104,7 @@ class eConstThermo
//- Construct from components
inline eConstThermo
(
const equationOfState& st,
const EquationOfState& st,
const scalar cv,
const scalar hf
);
......@@ -167,25 +167,25 @@ public:
// Friend operators
friend eConstThermo operator+ <equationOfState>
friend eConstThermo operator+ <EquationOfState>
(
const eConstThermo&,
const eConstThermo&
);
friend eConstThermo operator- <equationOfState>
friend eConstThermo operator- <EquationOfState>
(
const eConstThermo&,
const eConstThermo&
);
friend eConstThermo operator* <equationOfState>
friend eConstThermo operator* <EquationOfState>
(
const scalar,
const eConstThermo&
);
friend eConstThermo operator== <equationOfState>
friend eConstThermo operator== <EquationOfState>
(
const eConstThermo&,
const eConstThermo&
......@@ -194,7 +194,7 @@ public:
// IOstream Operators
friend Ostream& operator<< <equationOfState>
friend Ostream& operator<< <EquationOfState>
(
Ostream&,
const eConstThermo&
......
......@@ -25,15 +25,15 @@ License
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class equationOfState>
inline Foam::eConstThermo<equationOfState>::eConstThermo
template<class EquationOfState>
inline Foam::eConstThermo<EquationOfState>::eConstThermo
(
const equationOfState& st,
const EquationOfState& st,
const scalar cv,
const scalar hf
)
:
equationOfState(st),
EquationOfState(st),
Cv_(cv),
Hf_(hf)
{}
......@@ -41,56 +41,56 @@ inline Foam::eConstThermo<equationOfState>::eConstThermo
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class equationOfState>
inline Foam::eConstThermo<equationOfState>::eConstThermo
template<class EquationOfState>
inline Foam::eConstThermo<EquationOfState>::eConstThermo
(
const word& name,
const eConstThermo<equationOfState>& ct
const eConstThermo<EquationOfState>& ct
)
:
equationOfState(name, ct),
EquationOfState(name, ct),
Cv_(ct.Cv_),
Hf_(ct.Hf_)
{}
template<class equationOfState>
inline Foam::autoPtr<Foam::eConstThermo<equationOfState> >
Foam::eConstThermo<equationOfState>::clone() const
template<class EquationOfState>
inline Foam::autoPtr<Foam::eConstThermo<EquationOfState> >
Foam::eConstThermo<EquationOfState>::clone() const
{
return autoPtr<eConstThermo<equationOfState> >
return autoPtr<eConstThermo<EquationOfState> >
(
new eConstThermo<equationOfState>(*this)
new eConstThermo<EquationOfState>(*this)
);
}
template<class equationOfState>
inline Foam::autoPtr<Foam::eConstThermo<equationOfState> >
Foam::eConstThermo<equationOfState>::New(Istream& is)
template<class EquationOfState>
inline Foam::autoPtr<Foam::eConstThermo<EquationOfState> >
Foam::eConstThermo<EquationOfState>::New(Istream& is)
{
return autoPtr<eConstThermo<equationOfState> >
return autoPtr<eConstThermo<EquationOfState> >
(
new eConstThermo<equationOfState>(is)
new eConstThermo<EquationOfState>(is)
);
}
template<class equationOfState>
inline Foam::autoPtr<Foam::eConstThermo<equationOfState> >
Foam::eConstThermo<equationOfState>::New(const dictionary& dict)
template<class EquationOfState>
inline Foam::autoPtr<Foam::eConstThermo<EquationOfState> >
Foam::eConstThermo<EquationOfState>::New(const dictionary& dict)
{
return autoPtr<eConstThermo<equationOfState> >
return autoPtr<eConstThermo<EquationOfState> >
(
new eConstThermo<equationOfState>(dict)
new eConstThermo<EquationOfState>(dict)
);
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class equationOfState>
inline Foam::scalar Foam::eConstThermo<equationOfState>::cp
template<class EquationOfState>
inline Foam::scalar Foam::eConstThermo<EquationOfState>::cp
(
const scalar
) const
......@@ -99,8 +99,8 @@ inline Foam::scalar Foam::eConstThermo<equationOfState>::cp
}
template<class equationOfState>
inline Foam::scalar Foam::eConstThermo<equationOfState>::h
template<class EquationOfState>
inline Foam::scalar Foam::eConstThermo<EquationOfState>::h
(
const scalar T
) const
......@@ -109,8 +109,8 @@ inline Foam::scalar Foam::eConstThermo<equationOfState>::h
}
template<class equationOfState>
inline Foam::scalar Foam::eConstThermo<equationOfState>::hs
template<class EquationOfState>
inline Foam::scalar Foam::eConstThermo<EquationOfState>::hs
(
const scalar T
) const
......@@ -119,35 +119,38 @@ inline Foam::scalar Foam::eConstThermo<equationOfState>::hs
}
template<class equationOfState>