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 | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2016 OpenFOAM Foundation
9 Copyright (C) 2019 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::LESfilter
29
30Description
31 Abstract class for LES filters
32
33SourceFiles
34 LESfilter.C
35 newFilter.C
36
37\*---------------------------------------------------------------------------*/
38
39#ifndef LESfilter_H
40#define LESfilter_H
41
42#include "volFields.H"
43#include "typeInfo.H"
44#include "autoPtr.H"
46
47// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48
49namespace Foam
50{
51
52class fvMesh;
53
54/*---------------------------------------------------------------------------*\
55 Class LESfilter Declaration
56\*---------------------------------------------------------------------------*/
58class LESfilter
59{
60 // Private data
61
62 const fvMesh& mesh_;
63
64
65 // Private Member Functions
66
67 //- No copy construct
68 LESfilter(const LESfilter&) = delete;
69
70 //- No copy assignment
71 void operator=(const LESfilter&) = delete;
72
73
74protected:
75
76 //- Temporary function to ensure the coupled boundary conditions of the
77 // field are correct for filtering.
78 //
79 // Following the rewrite of the turbulence models to use
80 // GeometricField::InternalField for sources etc. delta() will return a
81 // GeometricField::InternalField and filters will take a
82 // tmp<GeometricField::InternalField> argument and handle the coupled BCs
83 // appropriately
84 template<class GeoFieldType>
85 void correctBoundaryConditions(const tmp<GeoFieldType>& tgf) const
86 {
87 tgf.constCast().correctBoundaryConditions();
88 }
89
90
91public:
92
93 //- Runtime type information
94 TypeName("LESfilter");
95
96
97 // Declare run-time constructor selection table
100 (
101 autoPtr,
102 LESfilter,
104 (
105 const fvMesh& mesh,
106 const dictionary& LESfilterDict
107 ),
108 (mesh, LESfilterDict)
109 );
110
111
112 // Constructors
113
114 //- Construct from components
115 LESfilter(const fvMesh& mesh)
116 :
117 mesh_(mesh)
118 {}
119
120
121 // Selectors
122
123 //- Return a reference to the selected LES filter
125 (
126 const fvMesh&,
127 const dictionary&,
128 const word& filterDictName="filter"
129 );
130
131
132 //- Destructor
133 virtual ~LESfilter() = default;
134
135
136 // Member Functions
137
138 //- Return mesh reference
139 const fvMesh& mesh() const
140 {
141 return mesh_;
142 }
143
144 //- Read the LESfilter dictionary
145 virtual void read(const dictionary&) = 0;
146
147
148 // Member Operators
150 virtual tmp<volScalarField> operator()
151 (
153 ) const = 0;
155 virtual tmp<volVectorField> operator()
156 (
158 ) const = 0;
160 virtual tmp<volSymmTensorField> operator()
161 (
163 ) const = 0;
165 virtual tmp<volTensorField> operator()
166 (
168 ) const = 0;
169};
170
171
172// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173
174} // End namespace Foam
175
176// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177
178#endif
179
180// ************************************************************************* //
Abstract class for LES filters.
Definition: LESfilter.H:58
LESfilter(const fvMesh &mesh)
Construct from components.
Definition: LESfilter.H:114
TypeName("LESfilter")
Runtime type information.
virtual void read(const dictionary &)=0
Read the LESfilter dictionary.
void correctBoundaryConditions(const tmp< GeoFieldType > &tgf) const
Temporary function to ensure the coupled boundary conditions of the.
Definition: LESfilter.H:84
virtual ~LESfilter()=default
Destructor.
const fvMesh & mesh() const
Return mesh reference.
Definition: LESfilter.H:138
static autoPtr< LESfilter > New(const fvMesh &, const dictionary &, const word &filterDictName="filter")
Return a reference to the selected LES filter.
Definition: LESfilter.C:44
declareRunTimeSelectionTable(autoPtr, LESfilter, dictionary,(const fvMesh &mesh, const dictionary &LESfilterDict),(mesh, LESfilterDict))
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
A class for managing temporary objects.
Definition: tmp.H:65
T & constCast() const
Definition: tmpI.H:248
A class for handling words, derived from Foam::string.
Definition: word.H:68
Namespace for OpenFOAM.
Macros to ease declaration of run-time selection tables.
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes)
cellMask correctBoundaryConditions()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73