moleFractions.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) 2016 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::moleFractions
26 
27 Description
28  This function object calculates mole-fraction fields from the mass-fraction
29  fields of the psi/rhoReactionThermo and caches them for output and further
30  post-processing.
31 
32  The names of the mole-fraction fields are obtained from the corresponding
33  mass-fraction fields prepended by "X_"
34 
35  Example of function object specification:
36  \verbatim
37  moleFractions
38  {
39  type psiReactionThermoMoleFractions;
40  }
41  \endverbatim
42  or
43  \verbatim
44  moleFractions
45  {
46  type rhoReactionThermoMoleFractions;
47  }
48  \endverbatim
49  depending on the thermodynamics package used in the solver.
50 
51 See also
52  Foam::functionObjects::fvMeshFunctionObject
53 
54 SourceFiles
55  moleFractions.C
56 
57 \*---------------------------------------------------------------------------*/
58 
59 #ifndef moleFractions_H
60 #define moleFractions_H
61 
62 #include "fvMeshFunctionObject.H"
63 #include "volFieldsFwd.H"
64 
65 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
66 
67 namespace Foam
68 {
69 
70 /*---------------------------------------------------------------------------*\
71  Class moleFractions Declaration
72 \*---------------------------------------------------------------------------*/
73 
74 template<class ThermoType>
75 class moleFractions
76 :
78 {
79  // Private data
80 
81  //- Species mole fractions
83 
84 
85  // Private Member Functions
86 
87  //- Calculate the mole fraction fields
88  virtual void calculateMoleFractions();
89 
90  //- Disallow default bitwise copy construct
92 
93  //- Disallow default bitwise assignment
94  void operator=(const moleFractions&);
95 
96 
97 public:
98 
99  //- Runtime type information
100  TypeName("moleFractions");
101 
102 
103  // Constructors
104 
105  //- Construct from Time and dictionary
107  (
108  const word& name,
109  const Time& t,
110  const dictionary& dict
111  );
112 
113 
114  //- Destructor
115  virtual ~moleFractions();
116 
117 
118  // Member Functions
119 
120  //- Read the moleFractions data
121  virtual bool read(const dictionary&);
122 
123  //- Calculate the mole-fraction fields
124  virtual bool execute();
125 
126  //- The mole-fraction fields auto-write
127  virtual bool write();
128 };
129 
130 
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 
133 } // End namespace Foam
134 
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 
137 #ifdef NoRepository
138  #include "moleFractions.C"
139 #endif
140 
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142 
143 #endif
144 
145 // ************************************************************************* //
dictionary dict
virtual ~moleFractions()
Destructor.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:68
const word & name() const
Return the name of this functionObject.
A class for handling words, derived from string.
Definition: word.H:59
virtual bool write()
The mole-fraction fields auto-write.
This function object calculates mole-fraction fields from the mass-fraction fields of the psi/rhoReac...
Definition: moleFractions.H:74
virtual bool execute()
Calculate the mole-fraction fields.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:62
TypeName("moleFractions")
Runtime type information.
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
virtual bool read(const dictionary &)
Read the moleFractions data.
Namespace for OpenFOAM.