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