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