00001 /*---------------------------------------------------------------------------*\ 00002 ========= | 00003 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 00004 \\ / O peration | 00005 \\ / A nd | Copyright (C) 1991-2010 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 00013 the Free Software Foundation, either version 3 of the License, or 00014 (at your 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, see <http://www.gnu.org/licenses/>. 00023 00024 Class 00025 Foam::specie 00026 00027 Description 00028 Base class of the thermophysical property types. 00029 00030 SourceFiles 00031 specieI.H 00032 specie.C 00033 00034 \*---------------------------------------------------------------------------*/ 00035 00036 #ifndef specie_H 00037 #define specie_H 00038 00039 #include <OpenFOAM/word.H> 00040 #include <OpenFOAM/scalar.H> 00041 00042 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00043 00044 namespace Foam 00045 { 00046 00047 class Istream; 00048 class Ostream; 00049 00050 /*---------------------------------------------------------------------------*\ 00051 Class specie Declaration 00052 \*---------------------------------------------------------------------------*/ 00053 00054 class specie 00055 { 00056 // Private data 00057 00058 //- Name of specie 00059 word name_; 00060 00061 //- Number of moles of this component in the mixture 00062 scalar nMoles_; 00063 00064 //- Molecular weight of specie [kg/kmol] 00065 scalar molWeight_; 00066 00067 00068 // Private member functions 00069 00070 //- Construct from components without name 00071 inline specie 00072 ( 00073 const scalar nMoles, 00074 const scalar molWeight 00075 ); 00076 00077 00078 public: 00079 00080 // Public constants 00081 00082 // Thermodynamic constants 00083 00084 //- Universal gas constant [J/(kmol K)] 00085 static const scalar RR; 00086 00087 //- Standard pressure [Pa] 00088 static const scalar Pstd; 00089 00090 //- Standard temperature [K] 00091 static const scalar Tstd; 00092 00093 00094 // Constructors 00095 00096 //- Construct from components with name 00097 inline specie 00098 ( 00099 const word& name, 00100 const scalar nMoles, 00101 const scalar molWeight 00102 ); 00103 00104 //- Construct as copy 00105 inline specie(const specie&); 00106 00107 //- Construct as named copy 00108 inline specie(const word& name, const specie&); 00109 00110 //- Construct from Istream 00111 specie(Istream&); 00112 00113 00114 // Member Functions 00115 00116 // Access 00117 00118 //- Molecular weight [kg/kmol] 00119 inline scalar W() const; 00120 00121 //- No of moles of this species in mixture 00122 inline scalar nMoles() const; 00123 00124 //- Gas constant [J/(kg K)] 00125 inline scalar R() const; 00126 00127 00128 // Member operators 00129 00130 inline void operator=(const specie&); 00131 00132 inline void operator+=(const specie&); 00133 inline void operator-=(const specie&); 00134 00135 inline void operator*=(const scalar); 00136 00137 00138 // Friend operators 00139 00140 inline friend specie operator+(const specie&, const specie&); 00141 inline friend specie operator-(const specie&, const specie&); 00142 00143 inline friend specie operator*(const scalar, const specie&); 00144 00145 inline friend specie operator==(const specie&, const specie&); 00146 00147 00148 // Ostream Operator 00149 00150 friend Ostream& operator<<(Ostream&, const specie&); 00151 }; 00152 00153 00154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00155 00156 } // End namespace Foam 00157 00158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00159 00160 #include <specie/specieI.H> 00161 00162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00163 00164 #endif 00165 00166 // ************************ vim: set sw=4 sts=4 et: ************************ //