initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / thermophysicalModels / specie / equationOfState / perfectGas / perfectGas.H
blobad1a8fc27082d53b7aaa1a2079bc3c05d1daf7c9
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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 Class
26     Foam::perfectGas
28 Description
29     Perfect gas equation of state.
31 SourceFiles
32     perfectGasI.H
33     perfectGas.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef perfectGas_H
38 #define perfectGas_H
40 #include "specie.H"
41 #include "autoPtr.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 namespace Foam
48 /*---------------------------------------------------------------------------*\
49                            Class perfectGas Declaration
50 \*---------------------------------------------------------------------------*/
52 class perfectGas
54     public specie
57 public:
59     // Constructors
61         //- Construct from components
62         inline perfectGas(const specie& sp);
64         //- Construct from Istream
65         perfectGas(Istream&);
67         //- Construct as named copy
68         inline perfectGas(const word& name, const perfectGas&);
70         //- Construct and return a clone
71         inline autoPtr<perfectGas> clone() const;
73         // Selector from Istream
74         inline static autoPtr<perfectGas> New(Istream& is);
77     // Member functions
79         //- Return density [kg/m^3]
80         inline scalar rho(scalar p, scalar T) const;
82         //- Return compressibility rho/p [s^2/m^2]
83         inline scalar psi(scalar p, scalar T) const;
85         //- Return compression factor []
86         inline scalar Z(scalar p, scalar T) const;
89     // Member operators
91         inline void operator+=(const perfectGas&);
92         inline void operator-=(const perfectGas&);
94         inline void operator*=(const scalar);
97     // Friend operators
99         inline friend perfectGas operator+
100         (
101             const perfectGas&,
102             const perfectGas&
103         );
105         inline friend perfectGas operator-
106         (
107             const perfectGas&,
108             const perfectGas&
109         );
111         inline friend perfectGas operator*
112         (
113             const scalar s,
114             const perfectGas&
115         );
117         inline friend perfectGas operator==
118         (
119             const perfectGas&,
120             const perfectGas&
121         );
124     // Ostream Operator
126         friend Ostream& operator<<(Ostream&, const perfectGas&);
130 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 } // End namespace Foam
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 #include "perfectGasI.H"
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 #endif
142 // ************************************************************************* //