resolutionIndex.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) 2022 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::functionObjects::resolutionIndex
28 
29 Group
30  grpFieldFunctionObjects
31 
32 Description
33  Computes a single-mesh resolution index according to the specified model,
34  which is used as a LES/DES quality/post-verification metric that does
35  not require any experimental or DNS data.
36 
37  Operands:
38  \table
39  Operand | Type | Location
40  input | vol<Type>Field(s) | <time>/<inpField>
41  output file | - | -
42  output field | volScalarField | <time>/<outField>
43  \endtable
44 
45  References:
46  \verbatim
47  Governing equation (tag:P):
48  Pope, S. B. (2000).
49  Turbulent flows.
50  Cambridge, UK: Cambridge Univ. Press
51  DOI:10.1017/CBO9780511840531
52 
53  Governing equations (tag:CKJ):
54  Celik, I., Klein, M., & Janicka, J. (2009).
55  Assessment measures for engineering LES applications.
56  Journal of fluids engineering, 131(3).
57  DOI:10.1115/1.3059703
58  \endverbatim
59 
60 Usage
61  Minimal example by using \c system/controlDict.functions:
62  \verbatim
63  resolutionIndex1
64  {
65  // Mandatory entries
66  type resolutionIndex;
67  libs (fieldFunctionObjects);
68  model <word>;
69 
70  // Conditional entries
71 
72  // Option-1: when model == PopeIndex
73 
74  // Option-2: when model == CelikNuIndex
75 
76  // Option-3: when model == CelikEtaIndex
77 
78  // Inherited entries
79  ...
80  }
81  \endverbatim
82 
83  where the entries mean:
84  \table
85  Property | Description | Type | Reqd | Deflt
86  type | Type name: resolutionIndex | word | yes | -
87  libs | Library name: fieldFunctionObjects | word | yes | -
88  model | Name of the resolutionIndex model | word | yes | -
89  \endtable
90 
91  Options for the \c model entry:
92  \verbatim
93  PopeIndex | Resolution method proposed by Pope (2000)
94  CelikNuIndex | Resolution method proposed by Celik et al. (2009)
95  CelikEtaIndex | Resolution method proposed by Celik et al. (2009)
96  \endverbatim
97 
98  The inherited entries are elaborated in:
99  - \link functionObject.H \endlink
100 
101 Note
102  - The \c resolutionIndex throws runtime error
103  when the turbulence model is RANS based.
104  - Resolution-estimator models strictly assume that
105  the flow is in a fully turbulent regime.
106 
107 SourceFiles
108  resolutionIndex.C
109 
110 \*---------------------------------------------------------------------------*/
111 
112 #ifndef Foam_functionObjects_resolutionIndex_H
113 #define Foam_functionObjects_resolutionIndex_H
114 
115 #include "fvMeshFunctionObject.H"
116 
117 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
118 
119 namespace Foam
120 {
121 
122 // Forward Declarations
123 class resolutionIndexModel;
124 
125 namespace functionObjects
126 {
127 
128 /*---------------------------------------------------------------------------*\
129  Class resolutionIndex Declaration
130 \*---------------------------------------------------------------------------*/
131 
132 class resolutionIndex
133 :
134  public fvMeshFunctionObject
135 {
136  // Private Data
137 
138  //- Resolution index model
139  autoPtr<resolutionIndexModel> resolutionIndexModelPtr_;
140 
141 
142 public:
143 
144  //- Runtime type information
145  TypeName("resolutionIndex");
146 
147 
148  // Constructors
149 
150  //- Construct from Time and dictionary
152  (
153  const word& name,
154  const Time& runTime,
155  const dictionary& dict
156  );
157 
158  //- No copy construct
159  resolutionIndex(const resolutionIndex&) = delete;
160 
161  //- No copy assignment
162  void operator=(const resolutionIndex&) = delete;
163 
164 
165  // Destructor
166  virtual ~resolutionIndex();
168 
169  // Member Functions
170 
171  //- Read the resolutionIndex data
172  virtual bool read(const dictionary& dict);
173 
174  //- Calculate the result field
175  virtual bool execute();
176 
177  //- Write the result field
178  virtual bool write();
179 };
180 
181 
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 
184 } // End namespace functionObjects
185 } // End namespace Foam
186 
187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
188 
189 #endif
190 
191 // ************************************************************************* //
dictionary dict
virtual bool read(const dictionary &dict)
Read the resolutionIndex data.
void operator=(const resolutionIndex &)=delete
No copy assignment.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:120
engineTime & runTime
const word & name() const noexcept
Return the name of this functionObject.
resolutionIndex(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
TypeName("resolutionIndex")
Runtime type information.
virtual bool execute()
Calculate the result field.
virtual bool write()
Write the result field.
Namespace for OpenFOAM.