LESfilter.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) 2011-2016 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::LESfilter
26 
27 Description
28  Abstract class for LES filters
29 
30 SourceFiles
31  LESfilter.C
32  newFilter.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef LESfilter_H
37 #define LESfilter_H
38 
39 #include "volFields.H"
40 #include "typeInfo.H"
41 #include "autoPtr.H"
42 #include "runTimeSelectionTables.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 class fvMesh;
50 
51 /*---------------------------------------------------------------------------*\
52  Class LESfilter Declaration
53 \*---------------------------------------------------------------------------*/
54 
55 class LESfilter
56 {
57  // Private data
58 
59  const fvMesh& mesh_;
60 
61 
62  // Private Member Functions
63 
64  // Disallow default bitwise copy construct and assignment
65  LESfilter(const LESfilter&);
66  void operator=(const LESfilter&);
67 
68 
69 protected:
70 
71  //- Temporary function to ensure the coupled boundary conditions of the
72  // field are correct for filtering.
73  //
74  // Following the rewrite of the turbulence models to use
75  // GeometricField::InternalField for sources etc. delta() will return a
76  // GeometricField::InternalField and filters will take a
77  // tmp<GeometricField::InternalField> argument and handle the coupled BCs
78  // appropriately
79  template<class GeoFieldType>
80  void correctBoundaryConditions(const tmp<GeoFieldType>& tgf) const
81  {
82  const_cast<GeoFieldType&>(tgf()).correctBoundaryConditions();
83  }
84 
85 
86 public:
87 
88  //- Runtime type information
89  TypeName("LESfilter");
90 
91 
92  // Declare run-time constructor selection table
93 
95  (
96  autoPtr,
97  LESfilter,
98  dictionary,
99  (
100  const fvMesh& mesh,
101  const dictionary& LESfilterDict
102  ),
103  (mesh, LESfilterDict)
104  );
105 
106 
107  // Constructors
108 
109  //- Construct from components
110  LESfilter(const fvMesh& mesh)
111  :
112  mesh_(mesh)
113  {}
114 
115 
116  // Selectors
117 
118  //- Return a reference to the selected LES filter
119  static autoPtr<LESfilter> New
120  (
121  const fvMesh&,
122  const dictionary&,
123  const word& filterDictName="filter"
124  );
125 
126 
127  //- Destructor
128  virtual ~LESfilter()
129  {}
130 
131 
132  // Member Functions
133 
134  //- Return mesh reference
135  const fvMesh& mesh() const
136  {
137  return mesh_;
138  }
139 
140  //- Read the LESfilter dictionary
141  virtual void read(const dictionary&) = 0;
142 
143 
144  // Member Operators
145 
146  virtual tmp<volScalarField> operator()
147  (
148  const tmp<volScalarField>&
149  ) const = 0;
150 
151  virtual tmp<volVectorField> operator()
152  (
153  const tmp<volVectorField>&
154  ) const = 0;
155 
156  virtual tmp<volSymmTensorField> operator()
157  (
159  ) const = 0;
160 
161  virtual tmp<volTensorField> operator()
162  (
163  const tmp<volTensorField>&
164  ) const = 0;
165 };
166 
167 
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 
170 } // End namespace Foam
171 
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 
174 #endif
175 
176 // ************************************************************************* //
Abstract class for LES filters.
Definition: LESfilter.H:54
void correctBoundaryConditions(const tmp< GeoFieldType > &tgf) const
Temporary function to ensure the coupled boundary conditions of the.
Definition: LESfilter.H:79
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
declareRunTimeSelectionTable(autoPtr, LESfilter, dictionary,(const fvMesh &mesh, const dictionary &LESfilterDict),(mesh, LESfilterDict))
const fvMesh & mesh() const
Return mesh reference.
Definition: LESfilter.H:134
TypeName("LESfilter")
Runtime type information.
virtual void read(const dictionary &)=0
Read the LESfilter dictionary.
A class for handling words, derived from string.
Definition: word.H:59
virtual ~LESfilter()
Destructor.
Definition: LESfilter.H:127
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:53
Macros to ease declaration of run-time selection tables.
A class for managing temporary objects.
Definition: PtrList.H:54
static autoPtr< LESfilter > New(const fvMesh &, const dictionary &, const word &filterDictName="filter")
Return a reference to the selected LES filter.
Definition: LESfilter.C:41
Namespace for OpenFOAM.