Peclet.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) 2013-2014 OpenFOAM Foundation
6  \\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
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::Peclet
26 
27 Group
28  grpUtilitiesFunctionObjects
29 
30 Description
31  This function object calculates and outputs the Peclet number as a
32  surfaceScalarField.
33 
34  Example of function object specification to calculate the Peclet number:
35  \verbatim
36  Peclet1
37  {
38  type Peclet;
39  functionObjectLibs ("libutilityFunctionObjects.so");
40  ...
41  }
42  \endverbatim
43 
44  \heading Function object usage
45  \table
46  Property | Description | Required | Default value
47  type | type name: Peclet | yes |
48  phiName | Name of flux field | no | phi
49  resultName | Name of Peclet field | no | <function name>
50  log | Log to standard output | no | yes
51  \endtable
52 
53 SourceFiles
54  Peclet.C
55  IOPeclet.H
56 
57 \*---------------------------------------------------------------------------*/
58 
59 #ifndef Peclet_H
60 #define Peclet_H
61 
62 #include "volFieldsFwd.H"
63 #include "surfaceFieldsFwd.H"
64 #include "OFstream.H"
65 #include "Switch.H"
66 
67 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
68 
69 namespace Foam
70 {
71 
72 // Forward declaration of classes
73 class objectRegistry;
74 class dictionary;
75 class polyMesh;
76 class mapPolyMesh;
77 
78 /*---------------------------------------------------------------------------*\
79  Class Peclet Declaration
80 \*---------------------------------------------------------------------------*/
81 
82 class Peclet
83 {
84  // Private data
85 
86  //- Name of this set of Peclet objects
87  word name_;
88 
89  //- Reference to the database
90  const objectRegistry& obr_;
91 
92  //- On/off switch
93  bool active_;
94 
95  //- Name of flux field, default is "phi"
96  word phiName_;
97 
98  //- Result name
99  word resultName_;
100 
101  //- Switch to send output to Info as well as to file
102  Switch log_;
103 
104 
105  // Private Member Functions
106 
107  //- Disallow default bitwise copy construct
108  Peclet(const Peclet&);
109 
110  //- Disallow default bitwise assignment
111  void operator=(const Peclet&);
112 
113 
114 public:
115 
116  //- Runtime type information
117  TypeName("Peclet");
118 
119 
120  // Constructors
121 
122  //- Construct for given objectRegistry and dictionary.
123  // Allow the possibility to load fields from files
124  Peclet
125  (
126  const word& name,
127  const objectRegistry&,
128  const dictionary&,
129  const bool loadFromFiles = false
130  );
131 
132 
133  //- Destructor
134  virtual ~Peclet();
135 
136 
137  // Member Functions
138 
139  //- Return name of the set of Peclet
140  virtual const word& name() const
141  {
142  return name_;
143  }
144 
145  //- Read the Peclet data
146  virtual void read(const dictionary&);
147 
148  //- Execute, currently does nothing
149  virtual void execute();
150 
151  //- Execute at the final time-loop, currently does nothing
152  virtual void end();
153 
154  //- Called when time was set at the end of the Time::operator++
155  virtual void timeSet();
156 
157  //- Calculate the Peclet and write
158  virtual void write();
159 
160  //- Update for changes of mesh
161  virtual void updateMesh(const mapPolyMesh&)
162  {}
163 
164  //- Update for changes of mesh
165  virtual void movePoints(const polyMesh&)
166  {}
167 };
168 
169 
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 
172 } // End namespace Foam
173 
174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 
176 #endif
177 
178 // ************************************************************************* //
Foam::Peclet
This function object calculates and outputs the Peclet number as a surfaceScalarField.
Definition: Peclet.H:106
volFieldsFwd.H
Foam::Peclet::execute
virtual void execute()
Execute, currently does nothing.
Definition: Peclet.C:115
Foam::Peclet::read
virtual void read(const dictionary &)
Read the Peclet data.
Definition: Peclet.C:104
Foam::Switch
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:60
Foam::Peclet::timeSet
virtual void timeSet()
Called when time was set at the end of the Time::operator++.
Definition: Peclet.C:209
Foam::Peclet::movePoints
virtual void movePoints(const polyMesh &)
Update for changes of mesh.
Definition: Peclet.H:189
Foam::Peclet::log_
Switch log_
Switch to send output to Info as well as to file.
Definition: Peclet.H:126
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::Peclet::operator=
void operator=(const Peclet &)
Disallow default bitwise assignment.
Foam::Peclet::~Peclet
virtual ~Peclet()
Destructor.
Definition: Peclet.C:98
Foam::Peclet::active_
bool active_
On/off switch.
Definition: Peclet.H:117
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
OFstream.H
Foam::objectRegistry
Registry of regIOobjects.
Definition: objectRegistry.H:50
Foam::Peclet::resultName_
word resultName_
Result name.
Definition: Peclet.H:123
Foam::Peclet::Peclet
Peclet(const Peclet &)
Disallow default bitwise copy construct.
Foam::Peclet::end
virtual void end()
Execute at the final time-loop, currently does nothing.
Definition: Peclet.C:203
Foam::Peclet::TypeName
TypeName("Peclet")
Runtime type information.
Foam::Peclet::obr_
const objectRegistry & obr_
Reference to the database.
Definition: Peclet.H:114
Switch.H
Foam::Peclet::name
virtual const word & name() const
Return name of the set of Peclet.
Definition: Peclet.H:164
Foam::Peclet::name_
word name_
Name of this set of Peclet objects.
Definition: Peclet.H:111
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::Peclet::write
virtual void write()
Calculate the Peclet and write.
Definition: Peclet.C:215
Foam::Peclet::phiName_
word phiName_
Name of flux field, default is "phi".
Definition: Peclet.H:120
Foam::Peclet::updateMesh
virtual void updateMesh(const mapPolyMesh &)
Update for changes of mesh.
Definition: Peclet.H:185
surfaceFieldsFwd.H
Foam::mapPolyMesh
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:158