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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2013-2015 OpenFOAM Foundation
9  Copyright (C) 2016-2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::functionObjects::DESModelRegions
29 
30 Group
31  grpFieldFunctionObjects
32 
33 Description
34  Computes an indicator field for detached eddy simulation (DES) turbulence
35  calculations, where the values of the indicator mean:
36 
37  \verbatim
38  0 = Reynolds-averaged Navier-Stokes (RAS) regions
39  1 = Large eddy simulation (LES) regions
40  \endverbatim
41 
42  Operands:
43  \table
44  Operand | Type | Location
45  input | - | -
46  output file | dat | $FOAM_CASE/postProcessing/<FO>/<time>/<file>
47  output field | volScalarField | $FOAM_CASE/<time>/<outField>
48  \endtable
49 
50 Usage
51  Minimal example by using \c system/controlDict.functions:
52  \verbatim
53  DESModelRegions1
54  {
55  // Mandatory entries (unmodifiable)
56  type DESModelRegions;
57  libs (fieldFunctionObjects);
58 
59  // Optional entries (runtime modifiable)
60  result DESField;
61 
62  // Optional (inherited) entries
63  ...
64  }
65  \endverbatim
66 
67  where the entries mean:
68  \table
69  Property | Description | Type | Req'd | Dflt
70  type | Type name: DESModelRegions | word | yes | -
71  libs | Library name: fieldFunctionObjects | word | yes | -
72  result | Name of DES indicator field | word | no | <FO>
73  \endtable
74 
75  The inherited entries are elaborated in:
76  - \link functionObject.H \endlink
77  - \link writeFile.H \endlink
78 
79  Usage by the \c postProcess utility is not available.
80 
81 Note
82  \c DESModelRegions function object can only be executed for DES simulations.
83 
84 See also
85  - Foam::functionObject
86  - Foam::functionObjects::fvMeshFunctionObject
87  - Foam::functionObjects::writeFile
88  - ExtendedCodeGuide::functionObjects::field::DESModelRegions
89 
90 SourceFiles
91  DESModelRegions.C
92 
93 \*---------------------------------------------------------------------------*/
94 
95 #ifndef functionObjects_DESModelRegions_H
96 #define functionObjects_DESModelRegions_H
97 
98 #include "fvMeshFunctionObject.H"
99 #include "writeFile.H"
100 #include "volFieldsFwd.H"
101 #include "OFstream.H"
102 
103 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
104 
105 namespace Foam
106 {
107 namespace functionObjects
108 {
109 
110 /*---------------------------------------------------------------------------*\
111  Class DESModelRegions Declaration
112 \*---------------------------------------------------------------------------*/
113 
114 class DESModelRegions
115 :
116  public fvMeshFunctionObject,
117  public writeFile
118 {
119 protected:
120 
121  // Protected Data
122 
123  //- Name of DES indicator field
124  word resultName_;
125 
126 
127  // Protected Member Functions
128 
129  //- File header information
130  virtual void writeFileHeader(Ostream& os) const;
131 
132 
133 public:
134 
135  //- Runtime type information
136  TypeName("DESModelRegions");
137 
138 
139  // Constructors
140 
141  //- Construct from Time and dictionary
143  (
144  const word& name,
145  const Time& runTime,
146  const dictionary& dict
147  );
148 
149  //- No copy construct
150  DESModelRegions(const DESModelRegions&) = delete;
151 
152  //- No copy assignment
153  void operator=(const DESModelRegions&) = delete;
154 
155 
156  //- Destructor
157  virtual ~DESModelRegions() = default;
158 
159 
160  // Member Functions
161 
162  //- Read the DESModelRegions data
163  virtual bool read(const dictionary&);
164 
165  //- Execute
166  virtual bool execute();
167 
168  //- Calculate the DESModelRegions and write
169  virtual bool write();
170 };
171 
172 
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 
175 } // End namespace functionObjects
176 } // End namespace Foam
177 
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 
180 #endif
181 
182 // ************************************************************************* //
runTime
engineTime & runTime
Definition: createEngineTime.H:13
volFieldsFwd.H
writeFile.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:65
Foam::functionObjects::DESModelRegions::resultName_
word resultName_
Name of DES indicator field.
Definition: DESModelRegions.H:163
fvMeshFunctionObject.H
Foam::functionObjects::DESModelRegions
Computes an indicator field for detached eddy simulation (DES) turbulence calculations,...
Definition: DESModelRegions.H:153
Foam::functionObjects::fvMeshFunctionObject
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
Definition: fvMeshFunctionObject.H:64
OFstream.H
Foam::functionObjects::DESModelRegions::execute
virtual bool execute()
Execute.
Definition: DESModelRegions.C:108
Foam::functionObjects::DESModelRegions::read
virtual bool read(const dictionary &)
Read the DESModelRegions data.
Definition: DESModelRegions.C:97
Foam::functionObjects::DESModelRegions::write
virtual bool write()
Calculate the DESModelRegions and write.
Definition: DESModelRegions.C:149
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:123
Foam::functionObjects::DESModelRegions::writeFileHeader
virtual void writeFileHeader(Ostream &os) const
File header information.
Definition: DESModelRegions.C:49
os
OBJstream os(runTime.globalPath()/outputName)
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::functionObjects::DESModelRegions::DESModelRegions
DESModelRegions(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
Definition: DESModelRegions.C:63
Foam::functionObject::name
const word & name() const noexcept
Return the name of this functionObject.
Definition: functionObject.C:143
Foam::functionObjects::DESModelRegions::TypeName
TypeName("DESModelRegions")
Runtime type information.
Foam::functionObjects::writeFile
Base class for writing single files from the function objects.
Definition: writeFile.H:119
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::functionObjects::DESModelRegions::operator=
void operator=(const DESModelRegions &)=delete
No copy assignment.
Foam::functionObjects::DESModelRegions::~DESModelRegions
virtual ~DESModelRegions()=default
Destructor.