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-2023 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::functionObjects::moleFractions
26 
27 Description
28  This function object calculates mole-fraction fields from the mass-fraction
29  fields of the multicomponent thermo. The names of the mole-fraction fields
30  are obtained from the corresponding mass-fraction fields prepended by "X_".
31 
32  Example of function object specification:
33  \verbatim
34  moleFractions
35  {
36  type moleFractions;
37  }
38  \endverbatim
39 
40  Optionally, the name of the phase can be specified for multiphase cases.
41 
42 See also
43  Foam::functionObjects::fvMeshFunctionObject
44 
45 SourceFiles
46  moleFractions.C
47 
48 \*---------------------------------------------------------------------------*/
49 
50 #ifndef functionObjects_moleFractions_H
51 #define functionObjects_moleFractions_H
52 
53 #include "fvMeshFunctionObject.H"
54 #include "volFieldsFwd.H"
55 
56 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
57 
58 namespace Foam
59 {
60 namespace functionObjects
61 {
62 
63 /*---------------------------------------------------------------------------*\
64  Class moleFractions Declaration
65 \*---------------------------------------------------------------------------*/
66 
67 class moleFractions
68 :
70 {
71  // Private Data
72 
73  //- Optional phase name
74  word phaseName_;
75 
76  //- Species mole fractions
78 
79 
80 public:
81 
82  //- Runtime type information
83  TypeName("moleFractions");
84 
85 
86  // Constructors
87 
88  //- Construct from Time and dictionary
89  moleFractions(const word& name, const Time& t, const dictionary& dict);
90 
91  //- Disallow default bitwise copy construction
92  moleFractions(const moleFractions&) = delete;
93 
94 
95  //- Destructor
96  virtual ~moleFractions();
97 
98 
99  // Member Functions
100 
101  //- Read the moleFractions data
102  virtual bool read(const dictionary&);
103 
104  //- Return the list of fields required
105  virtual wordList fields() const
106  {
107  return wordList::null();
108  }
109 
110  //- Calculate the mole-fraction fields
111  virtual bool execute();
112 
113  //- The mole-fraction fields auto-write
114  virtual bool write();
115 
116 
117  // Member Operators
118 
119  //- Disallow default bitwise assignment
120  void operator=(const moleFractions&) = delete;
121 };
122 
123 
124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125 
126 } // End namespace functionObjects
127 } // End namespace Foam
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 #endif
132 
133 // ************************************************************************* //
static const List< word > & null()
Return a null List.
Definition: ListI.H:118
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: PtrList.H:75
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:76
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
const word & name() const
Return the name of this functionObject.
Specialisation of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
This function object calculates mole-fraction fields from the mass-fraction fields of the multicompon...
Definition: moleFractions.H:69
virtual wordList fields() const
Return the list of fields required.
void operator=(const moleFractions &)=delete
Disallow default bitwise assignment.
TypeName("moleFractions")
Runtime type information.
virtual ~moleFractions()
Destructor.
Definition: moleFractions.C:59
moleFractions(const word &name, const Time &t, const dictionary &dict)
Construct from Time and dictionary.
Definition: moleFractions.C:45
virtual bool execute()
Calculate the mole-fraction fields.
Definition: moleFractions.C:71
virtual bool write()
The mole-fraction fields auto-write.
virtual bool read(const dictionary &)
Read the moleFractions data.
Definition: moleFractions.C:65
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
dictionary dict