DESModelRegions.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-2015 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::DESModelRegions
26 
27 Group
28  grpUtilitiesFunctionObjects
29 
30 Description
31  This function object writes out an indicator field for DES turbulence
32  calculations, that is:
33  - 0 for RAS regions
34  - 1 for LES regions
35 
36  The field is stored on the mesh database so that it can be retrieved and
37  used for other applications.
38 
39  Example of function object specification to generate DES indicator field:
40  \verbatim
41  DESModelRegions1
42  {
43  type DESModelRegions;
44  functionObjectLibs ("libutilityFunctionObjects.so");
45  ...
46  }
47  \endverbatim
48 
49  \heading Function object usage
50  \table
51  Property | Description | Required | Default value
52  type | type name: DESModelRegions| yes |
53  resultName | Name of DES indicator field | no | <function name>
54  log | log to standard output | no | yes
55  \endtable
56 
57 SourceFiles
58  DESModelRegions.C
59  IODESModelRegions.H
60 
61 \*---------------------------------------------------------------------------*/
62 
63 #ifndef DESModelRegions_H
64 #define DESModelRegions_H
65 
66 #include "functionObjectFile.H"
67 #include "volFieldsFwd.H"
68 #include "Switch.H"
69 #include "OFstream.H"
70 
71 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
72 
73 namespace Foam
74 {
75 
76 // Forward declaration of classes
77 class objectRegistry;
78 class dictionary;
79 class polyMesh;
80 class mapPolyMesh;
81 class fvMesh;
82 
83 /*---------------------------------------------------------------------------*\
84  Class DESModelRegions Declaration
85 \*---------------------------------------------------------------------------*/
86 
87 class DESModelRegions
88 :
89  public functionObjectFile
90 {
91 protected:
92 
93  // Protected data
94 
95  //- Name of this set of DESModelRegions object
96  word name_;
97 
98  const objectRegistry& obr_;
99 
100  //- on/off switch
101  bool active_;
102 
103  //- Result name
104  word resultName_;
105 
106  //- Switch to send output to Info as well as to file
107  Switch log_;
108 
109 
110  // Protected Member Functions
111 
112  //- File header information
113  virtual void writeFileHeader(Ostream& os) const;
114 
115  //- Disallow default bitwise copy construct
117 
118  //- Disallow default bitwise assignment
119  void operator=(const DESModelRegions&);
120 
121 
122 public:
123 
124  //- Runtime type information
125  TypeName("DESModelRegions");
126 
127 
128  // Constructors
129 
130  //- Construct for given objectRegistry and dictionary.
131  // Allow the possibility to load fields from files
133  (
134  const word& name,
135  const objectRegistry&,
136  const dictionary&,
137  const bool loadFromFiles = false
138  );
139 
140 
141  //- Destructor
142  virtual ~DESModelRegions();
143 
144 
145  // Member Functions
146 
147  //- Return name of the set of DESModelRegions
148  virtual const word& name() const
149  {
150  return name_;
151  }
152 
153  //- Read the DESModelRegions data
154  virtual void read(const dictionary&);
155 
156  //- Execute, currently does nothing
157  virtual void execute();
158 
159  //- Execute at the final time-loop, currently does nothing
160  virtual void end();
161 
162  //- Called when time was set at the end of the Time::operator++
163  virtual void timeSet();
164 
165  //- Calculate the DESModelRegions and write
166  virtual void write();
167 
168  //- Update for changes of mesh
169  virtual void updateMesh(const mapPolyMesh&)
170  {}
171 
172  //- Update for changes of mesh
173  virtual void movePoints(const polyMesh&)
174  {}
175 };
176 
177 
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 
180 } // End namespace Foam
181 
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 
184 #endif
185 
186 // ************************************************************************* //
Foam::DESModelRegions::timeSet
virtual void timeSet()
Called when time was set at the end of the Time::operator++.
Definition: DESModelRegions.C:183
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::DESModelRegions::obr_
const objectRegistry & obr_
Definition: DESModelRegions.H:117
Foam::DESModelRegions::resultName_
word resultName_
Result name.
Definition: DESModelRegions.H:123
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::DESModelRegions::execute
virtual void execute()
Execute, currently does nothing.
Definition: DESModelRegions.C:128
Foam::DESModelRegions::writeFileHeader
virtual void writeFileHeader(Ostream &os) const
File header information.
Definition: DESModelRegions.C:41
Foam::DESModelRegions::movePoints
virtual void movePoints(const polyMesh &)
Update for changes of mesh.
Definition: DESModelRegions.H:192
Foam::DESModelRegions::read
virtual void read(const dictionary &)
Read the DESModelRegions data.
Definition: DESModelRegions.C:116
Foam::DESModelRegions::~DESModelRegions
virtual ~DESModelRegions()
Destructor.
Definition: DESModelRegions.C:110
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
OFstream.H
Foam::objectRegistry
Registry of regIOobjects.
Definition: objectRegistry.H:50
Foam::DESModelRegions::operator=
void operator=(const DESModelRegions &)
Disallow default bitwise assignment.
Foam::DESModelRegions::TypeName
TypeName("DESModelRegions")
Runtime type information.
Switch.H
Foam::DESModelRegions::name_
word name_
Name of this set of DESModelRegions object.
Definition: DESModelRegions.H:115
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::DESModelRegions::DESModelRegions
DESModelRegions(const DESModelRegions &)
Disallow default bitwise copy construct.
Foam::DESModelRegions::write
virtual void write()
Calculate the DESModelRegions and write.
Definition: DESModelRegions.C:189
functionObjectFile.H
Foam::DESModelRegions::log_
Switch log_
Switch to send output to Info as well as to file.
Definition: DESModelRegions.H:126
Foam::DESModelRegions
This function object writes out an indicator field for DES turbulence calculations,...
Definition: DESModelRegions.H:106
Foam::DESModelRegions::end
virtual void end()
Execute at the final time-loop, currently does nothing.
Definition: DESModelRegions.C:177
Foam::functionObjectFile
Base class for output file data handling.
Definition: functionObjectFile.H:57
Foam::DESModelRegions::updateMesh
virtual void updateMesh(const mapPolyMesh &)
Update for changes of mesh.
Definition: DESModelRegions.H:188
Foam::mapPolyMesh
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:158
Foam::DESModelRegions::name
virtual const word & name() const
Return name of the set of DESModelRegions.
Definition: DESModelRegions.H:167
Foam::DESModelRegions::active_
bool active_
on/off switch
Definition: DESModelRegions.H:120
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53