OpenFOAM logo
Open Source CFD Toolkit

specie.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2005 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     specie
00027 
00028 Description
00029     Base class of the thermophysical property types.
00030 
00031 SourceFiles
00032     specieI.H
00033     specie.C
00034 
00035 \*---------------------------------------------------------------------------*/
00036 
00037 #ifndef specie_H
00038 #define specie_H
00039 
00040 #include "word.H"
00041 #include "scalar.H"
00042 
00043 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00044 
00045 namespace Foam
00046 {
00047 
00048 class Istream;
00049 class Ostream;
00050 
00051 /*---------------------------------------------------------------------------*\
00052                            Class specie Declaration
00053 \*---------------------------------------------------------------------------*/
00054 
00055 class specie
00056 {
00057     // Private data
00058 
00059         //- Name of specie
00060         word name_;
00061 
00062         //- Number of moles of this component in the mixture
00063         scalar nMoles_;
00064 
00065         //- Molecular weight of specie
00066         scalar molWeight_;
00067 
00068 
00069     // Private member functions
00070 
00071         //- Construct from components without name
00072         inline specie
00073         (
00074             const scalar nMoles,
00075             const scalar molWeight
00076         );
00077 
00078 
00079 public:
00080 
00081     // Public constants
00082 
00083         // Thermodynamic constants
00084 
00085             //- Universal gas constant [J/(kmol K)]
00086             static const scalar RR;
00087 
00088             //- Standard pressure [Pa]
00089             static const scalar Pstd;
00090 
00091             //- Standard temperature [K]
00092             static const scalar Tstd;
00093 
00094 
00095     // Constructors
00096 
00097         //- Construct from components with name
00098         inline specie
00099         (
00100             const word& name,
00101             const scalar nMoles,
00102             const scalar molWeight
00103         );
00104 
00105         //- Construct as copy
00106         inline specie(const specie&);
00107 
00108         //- Construct as named copy
00109         inline specie(const word& name, const specie&);
00110 
00111         //- Construct from Istream
00112         specie(Istream&);
00113 
00114 
00115     // Member Functions
00116 
00117         // Access
00118 
00119             //- Molecular weight [kg/kmol]
00120             inline scalar W() const;
00121 
00122             //- No of moles of this species in mixture
00123             inline scalar nMoles() const;
00124 
00125             //- Gas constant [J/(kg K)]
00126             inline scalar R() const;
00127 
00128 
00129     // Member operators
00130 
00131         inline void operator=(const specie&);
00132 
00133         inline void operator+=(const specie&);
00134         inline void operator-=(const specie&);
00135 
00136         inline void operator*=(const scalar);
00137 
00138 
00139     // Friend operators
00140 
00141         inline friend specie operator+(const specie&, const specie&);
00142         inline friend specie operator-(const specie&, const specie&);
00143 
00144         inline friend specie operator*(const scalar, const specie&);
00145 
00146         inline friend specie operator==(const specie&, const specie&);
00147 
00148 
00149     // Ostream Operator
00150 
00151         friend Ostream& operator<<(Ostream&, const specie&);
00152 };
00153 
00154 
00155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00156 
00157 } // End namespace Foam
00158 
00159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00160 
00161 #include "specieI.H"
00162 
00163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00164 
00165 #endif
00166 
00167 // ************************************************************************* //
For further information go to www.openfoam.org