specie.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
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.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::specie
26 
27 Description
28  Base class of the thermophysical property types.
29 
30 SourceFiles
31  specieI.H
32  specie.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef specie_H
37 #define specie_H
38 
39 #include "word.H"
40 #include "scalar.H"
41 #include "dictionary.H"
42 
43 #include "thermodynamicConstants.H"
44 using namespace Foam::constant::thermodynamic;
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 class Istream;
52 class Ostream;
53 
54 /*---------------------------------------------------------------------------*\
55  Class specie Declaration
56 \*---------------------------------------------------------------------------*/
57 
58 class specie
59 {
60  // Private data
61 
62  //- Name of specie
63  word name_;
64 
65  //- Number of moles of this component in the mixture
66  scalar nMoles_;
67 
68  //- Molecular weight of specie [kg/kmol]
69  scalar molWeight_;
70 
71 
72 public:
73 
74  //- Runtime type information
75  ClassName("specie");
76 
77 
78  // Constructors
79 
80 
81  //- Construct from components without name
82  inline specie(const scalar nMoles, const scalar molWeight);
83 
84  //- Construct from components with name
85  inline specie
86  (
87  const word& name,
88  const scalar nMoles,
89  const scalar molWeight
90  );
91 
92  //- Construct as copy
93  inline specie(const specie&);
94 
95  //- Construct as named copy
96  inline specie(const word& name, const specie&);
97 
98  //- Construct from Istream
99  specie(Istream&);
100 
101  //- Construct from dictionary
102  specie(const dictionary& dict);
103 
104 
105  // Member Functions
106 
107  // Access
108 
109  //- Name
110  inline const word& name() const;
111 
112  //- Molecular weight [kg/kmol]
113  inline scalar W() const;
114 
115  //- No of moles of this species in mixture
116  inline scalar nMoles() const;
117 
118  //- Gas constant [J/(kg K)]
119  inline scalar R() const;
120 
121 
122  // I-O
123 
124  //- Write to Ostream
125  void write(Ostream& os) const;
126 
127 
128  // Member operators
129 
130  inline void operator=(const specie&);
131 
132  inline void operator+=(const specie&);
133  inline void operator-=(const specie&);
134 
135  inline void operator*=(const scalar);
136 
137 
138  // Friend operators
139 
140  inline friend specie operator+(const specie&, const specie&);
141  inline friend specie operator-(const specie&, const specie&);
142 
143  inline friend specie operator*(const scalar, const specie&);
144 
145  inline friend specie operator==(const specie&, const specie&);
146 
147 
148  // Ostream Operator
149 
150  friend Ostream& operator<<(Ostream&, const specie&);
151 };
152 
153 
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 
156 } // End namespace Foam
157 
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 
160 #include "specieI.H"
161 
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 
164 #endif
165 
166 // ************************************************************************* //
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::specie::molWeight_
scalar molWeight_
Molecular weight of specie [kg/kmol].
Definition: specie.H:68
Foam::operator==
tmp< fvMatrix< Type > > operator==(const fvMatrix< Type > &, const fvMatrix< Type > &)
R
#define R(A, B, C, D, E, F, K, M)
Foam::operator-
tmp< fvMatrix< Type > > operator-(const fvMatrix< Type > &)
Foam::constant::thermodynamic
Thermodynamic scalar constants.
Definition: thermodynamicConstants.C:35
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:57
specieI.H
Foam::specie::nMoles_
scalar nMoles_
Number of moles of this component in the mixture.
Definition: specie.H:65
Foam::operator<<
Ostream & operator<<(Ostream &, const edgeMesh &)
Definition: edgeMeshIO.C:130
Foam::specie
Base class of the thermophysical property types.
Definition: specie.H:57
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
scalar.H
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::operator*
tmp< fvMatrix< Type > > operator*(const DimensionedField< scalar, volMesh > &, const fvMatrix< Type > &)
thermodynamicConstants.H
ClassName
#define ClassName(TypeNameString)
Add typeName information from argument TypeNameString to a class.
Definition: className.H:69
dictionary.H
Foam::specie::name_
word name_
Name of specie.
Definition: specie.H:62
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
word.H
Foam::operator+
tmp< fvMatrix< Type > > operator+(const fvMatrix< Type > &, const fvMatrix< Type > &)
write
Tcoeff write()
Foam::name
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47