1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 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, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 \*---------------------------------------------------------------------------*/
27 #include "perfectGas.H"
29 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
34 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
36 // Construct from components
37 inline perfectGas::perfectGas
46 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
48 // Construct as named copy
49 inline perfectGas::perfectGas(const word& name, const perfectGas& pg)
55 // Construct and return a clone
56 inline autoPtr<perfectGas> perfectGas::clone() const
58 return autoPtr<perfectGas>(new perfectGas(*this));
62 // Selector from Istream
63 inline autoPtr<perfectGas> perfectGas::New(Istream& is)
65 return autoPtr<perfectGas>(new perfectGas(is));
69 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
71 //- Return density [kg/m^3]
72 inline scalar perfectGas::rho(scalar p, scalar T) const
77 //- Return compressibility rho/p [s^2/m^2]
78 inline scalar perfectGas::psi(scalar, scalar T) const
83 //- Return compression factor []
84 inline scalar perfectGas::Z(scalar, scalar) const
90 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
92 inline void perfectGas::operator+=(const perfectGas& pg)
94 specie::operator+=(pg);
97 inline void perfectGas::operator-=(const perfectGas& pg)
99 specie::operator-=(pg);
102 inline void perfectGas::operator*=(const scalar s)
104 specie::operator*=(s);
108 // * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
110 inline perfectGas operator+
112 const perfectGas& pg1,
113 const perfectGas& pg2
118 static_cast<const specie&>(pg1)
119 + static_cast<const specie&>(pg2)
124 inline perfectGas operator-
126 const perfectGas& pg1,
127 const perfectGas& pg2
132 static_cast<const specie&>(pg1)
133 - static_cast<const specie&>(pg2)
138 inline perfectGas operator*
144 return perfectGas(s*static_cast<const specie&>(pg));
148 inline perfectGas operator==
150 const perfectGas& pg1,
151 const perfectGas& pg2
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 } // End namespace Foam
162 // ************************************************************************* //