initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / thermophysicalModels / specie / specie / specie.H
blob10238c220cd617dc51d0b4a365fdd8ec5ae451dc
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::specie
28 Description
29     Base class of the thermophysical property types.
31 SourceFiles
32     specieI.H
33     specie.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef specie_H
38 #define specie_H
40 #include "word.H"
41 #include "scalar.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 namespace Foam
48 class Istream;
49 class Ostream;
51 /*---------------------------------------------------------------------------*\
52                            Class specie Declaration
53 \*---------------------------------------------------------------------------*/
55 class specie
57     // Private data
59         //- Name of specie
60         word name_;
62         //- Number of moles of this component in the mixture
63         scalar nMoles_;
65         //- Molecular weight of specie [kg/kmol]
66         scalar molWeight_;
69     // Private member functions
71         //- Construct from components without name
72         inline specie
73         (
74             const scalar nMoles,
75             const scalar molWeight
76         );
79 public:
81     // Public constants
83         // Thermodynamic constants
85             //- Universal gas constant [J/(kmol K)]
86             static const scalar RR;
88             //- Standard pressure [Pa]
89             static const scalar Pstd;
91             //- Standard temperature [K]
92             static const scalar Tstd;
95     // Constructors
97         //- Construct from components with name
98         inline specie
99         (
100             const word& name,
101             const scalar nMoles,
102             const scalar molWeight
103         );
105         //- Construct as copy
106         inline specie(const specie&);
108         //- Construct as named copy
109         inline specie(const word& name, const specie&);
111         //- Construct from Istream
112         specie(Istream&);
115     // Member Functions
117         // Access
119             //- Molecular weight [kg/kmol]
120             inline scalar W() const;
122             //- No of moles of this species in mixture
123             inline scalar nMoles() const;
125             //- Gas constant [J/(kg K)]
126             inline scalar R() const;
129     // Member operators
131         inline void operator=(const specie&);
133         inline void operator+=(const specie&);
134         inline void operator-=(const specie&);
136         inline void operator*=(const scalar);
139     // Friend operators
141         inline friend specie operator+(const specie&, const specie&);
142         inline friend specie operator-(const specie&, const specie&);
144         inline friend specie operator*(const scalar, const specie&);
146         inline friend specie operator==(const specie&, const specie&);
149     // Ostream Operator
151         friend Ostream& operator<<(Ostream&, const specie&);
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 } // End namespace Foam
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 #include "specieI.H"
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 #endif
167 // ************************************************************************* //