1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by
13 the Free Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
26 #include "perfectGas.H"
28 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
30 inline Foam::perfectGas::perfectGas(const specie& sp)
36 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
38 inline Foam::perfectGas::perfectGas(const word& name, const perfectGas& pg)
44 inline Foam::autoPtr<Foam::perfectGas> Foam::perfectGas::clone() const
46 return autoPtr<perfectGas>(new perfectGas(*this));
50 inline Foam::autoPtr<Foam::perfectGas> Foam::perfectGas::New(Istream& is)
52 return autoPtr<perfectGas>(new perfectGas(is));
56 inline Foam::autoPtr<Foam::perfectGas> Foam::perfectGas::New
58 const dictionary& dict
61 return autoPtr<perfectGas>(new perfectGas(dict));
65 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
67 inline Foam::scalar Foam::perfectGas::rho(scalar p, scalar T) const
73 inline Foam::scalar Foam::perfectGas::psi(scalar, scalar T) const
79 inline Foam::scalar Foam::perfectGas::Z(scalar, scalar) const
85 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
87 inline void Foam::perfectGas::operator+=(const perfectGas& pg)
89 specie::operator+=(pg);
93 inline void Foam::perfectGas::operator-=(const perfectGas& pg)
95 specie::operator-=(pg);
99 inline void Foam::perfectGas::operator*=(const scalar s)
101 specie::operator*=(s);
105 // * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
107 inline Foam::perfectGas Foam::operator+
109 const perfectGas& pg1,
110 const perfectGas& pg2
115 static_cast<const specie&>(pg1)
116 + static_cast<const specie&>(pg2)
121 inline Foam::perfectGas Foam::operator-
123 const perfectGas& pg1,
124 const perfectGas& pg2
129 static_cast<const specie&>(pg1)
130 - static_cast<const specie&>(pg2)
135 inline Foam::perfectGas Foam::operator*
141 return perfectGas(s*static_cast<const specie&>(pg));
145 inline Foam::perfectGas Foam::operator==
147 const perfectGas& pg1,
148 const perfectGas& pg2
155 // ************************************************************************* //