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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2017 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::specie
28 
29 Description
30  Base class of the thermophysical property types.
31 
32 SourceFiles
33  specieI.H
34  specie.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef specie_H
39 #define specie_H
40 
41 #include "word.H"
42 #include "scalar.H"
43 #include "dictionary.H"
44 
45 #include "thermodynamicConstants.H"
46 using namespace Foam::constant::thermodynamic;
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 
53 // Forward declaration of friend functions and operators
54 
55 class specie;
56 
57 inline specie operator+(const specie&, const specie&);
58 inline specie operator*(const scalar, const specie&);
59 inline specie operator==(const specie&, const specie&);
60 
61 Ostream& operator<<(Ostream&, const specie&);
62 
63 
64 /*---------------------------------------------------------------------------*\
65  Class specie Declaration
66 \*---------------------------------------------------------------------------*/
67 
68 class specie
69 {
70  // Private data
71 
72  //- Name of specie
73  word name_;
74 
75  //- Number of moles of this component in the mixture
76  scalar Y_;
77 
78  //- Molecular weight of specie [kg/kmol]
79  scalar molWeight_;
80 
81 
82 public:
83 
84  //- Runtime type information
85  ClassName("specie");
86 
87 
88  // Constructors
89 
90  //- Construct from components without name
91  inline specie(const scalar Y, const scalar molWeight);
92 
93  //- Construct from components with name
94  inline specie
95  (
96  const word& name,
97  const scalar Y,
98  const scalar molWeight
99  );
100 
101  //- Construct as named copy
102  inline specie(const word& name, const specie&);
103 
104  //- Construct from dictionary
105  specie(const dictionary& dict);
106 
107 
108  // Member Functions
109 
110  // Access
111 
112  //- Name
113  inline const word& name() const;
114 
115  //- Molecular weight [kg/kmol]
116  inline scalar W() const;
117 
118  //- No of moles of this species in mixture
119  inline scalar Y() const;
120 
121  //- Gas constant [J/(kg K)]
122  inline scalar R() const;
123 
124 
125  // I-O
126 
127  //- Write to Ostream
128  void write(Ostream& os) const;
129 
130 
131  // Member operators
132 
133  inline void operator=(const specie&);
134  inline void operator+=(const specie&);
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 scalar, const specie&);
142  inline friend specie operator==(const specie&, const specie&);
143 
144 
145  // Ostream Operator
146 
147  friend Ostream& operator<<(Ostream&, const specie&);
148 };
149 
150 
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 
153 } // End namespace Foam
154 
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 
157 #include "specieI.H"
158 
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 
161 #endif
162 
163 // ************************************************************************* //
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
R
#define R(A, B, C, D, E, F, K, M)
Foam::operator==
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
Foam::constant::thermodynamic
Thermodynamic scalar constants.
Definition: thermodynamicConstants.C:37
Foam::name
word name(const complex &c)
Return string representation of complex.
Definition: complex.C:76
specieI.H
Foam::specie
Base class of the thermophysical property types.
Definition: specie.H:67
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
scalar.H
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Y
PtrList< volScalarField > & Y
Definition: createFieldRefs.H:7
thermodynamicConstants.H
ClassName
#define ClassName(TypeNameString)
Add typeName information from argument TypeNameString to a class.
Definition: className.H:67
Foam::operator+
tmp< faMatrix< Type > > operator+(const faMatrix< Type > &, const faMatrix< Type > &)
Foam::operator*
tmp< faMatrix< Type > > operator*(const areaScalarField &, const faMatrix< Type > &)
dictionary.H
Foam::vtk::write
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
Definition: foamVtkOutputTemplates.C:35
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
word.H
Foam::operator<<
Ostream & operator<<(Ostream &, const boundaryPatch &)
Definition: boundaryPatch.C:102