moleFractions.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2016-2019 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 
91 public:
92 
93  //- Runtime type information
94  TypeName("moleFractions");
95 
96 
97  // Constructors
98 
99  //- Construct from Time and dictionary
101  (
102  const word& name,
103  const Time& t,
104  const dictionary& dict
105  );
106 
107  //- Disallow default bitwise copy construction
108  moleFractions(const moleFractions&) = delete;
109 
110 
111  //- Destructor
112  virtual ~moleFractions();
113 
114 
115  // Member Functions
116 
117  //- Read the moleFractions data
118  virtual bool read(const dictionary&);
119 
120  //- Calculate the mole-fraction fields
121  virtual bool execute();
122 
123  //- The mole-fraction fields auto-write
124  virtual bool write();
125 
126 
127  // Member Operators
128 
129  //- Disallow default bitwise assignment
130  void operator=(const moleFractions&) = delete;
131 };
132 
133 
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 
136 } // End namespace Foam
137 
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 
140 #ifdef NoRepository
141  #include "moleFractions.C"
142 #endif
143 
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 
146 #endif
147 
148 // ************************************************************************* //
dictionary dict
const word & name() const
Return the name of this functionObject.
virtual ~moleFractions()
Destructor.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:68
moleFractions(const word &name, const Time &t, const dictionary &dict)
Construct from Time and dictionary.
Definition: moleFractions.C:59
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:70
void operator=(const moleFractions &)=delete
Disallow default bitwise assignment.
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.