faConvectionScheme.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) 2016-2017 Wikki 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::fa::convectionScheme
28 
29 Description
30  Abstract base class for finite area calculus convection schemes.
31 
32 SourceFiles
33  faConvectionScheme.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef faConvectionScheme_H
38 #define faConvectionScheme_H
39 
40 #include "areaFieldsFwd.H"
41 #include "edgeFieldsFwd.H"
42 #include "runTimeSelectionTables.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 // Forward Declarations
50 template<class Type>
51 class faMatrix;
52 
53 class faMesh;
54 
55 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56 
57 namespace fa
58 {
59 
60 /*---------------------------------------------------------------------------*\
61  Class convectionScheme Declaration
62 \*---------------------------------------------------------------------------*/
63 
64 template<class Type>
65 class convectionScheme
66 :
67  public refCount
68 {
69  // Private Data
70 
71  //- Reference to mesh
72  const faMesh& mesh_;
73 
74 
75 public:
76 
77  // Declare run-time constructor selection tables
78 
80  (
81  tmp,
83  Istream,
84  (
85  const faMesh& mesh,
86  const edgeScalarField& faceFlux,
87  Istream& schemeData
88  ),
89  (mesh, faceFlux, schemeData)
90  );
91 
92 
93  // Generated Methods
94 
95  //- No copy construct
96  convectionScheme(const convectionScheme&) = delete;
97 
98  //- No copy assignment
99  void operator=(const convectionScheme&) = delete;
100 
101 
102  // Constructors
103 
104  //- Construct from mesh, flux and Istream
106  (
107  const faMesh& mesh,
108  const edgeScalarField& faceFlux
109  )
110  :
111  mesh_(mesh)
112  {}
113 
114 
115  // Selectors
116 
117  //- Return a pointer to a new convectionScheme created on freestore
119  (
120  const faMesh& mesh,
121  const edgeScalarField& faceFlux,
122  Istream& schemeData
123  );
124 
125 
126  //- Destructor
127  virtual ~convectionScheme();
128 
129 
130  // Member Functions
131 
132  //- Return mesh reference
133  const faMesh& mesh() const noexcept { return mesh_; }
134 
136  (
137  const edgeScalarField&,
139  ) const = 0;
140 
141  virtual tmp<faMatrix<Type>> famDiv
142  (
143  const edgeScalarField&,
145  ) const = 0;
146 
148  (
149  const edgeScalarField&,
151  ) const = 0;
152 };
153 
154 
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 
157 } // End namespace fa
158 
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 
161 } // End namespace Foam
162 
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 
165 // Add the patch constructor functions to the hash tables
166 
167 #define makeFaConvectionTypeScheme(SS, Type) \
168  \
169  defineNamedTemplateTypeNameAndDebug(Foam::fa::SS<Foam::Type>, 0); \
170  \
171  namespace Foam \
172  { \
173  namespace fa \
174  { \
175  convectionScheme<Type>::addIstreamConstructorToTable<SS<Type>> \
176  add##SS##Type##IstreamConstructorToTable_; \
177  } \
178  }
179 
180 
181 #define makeFaConvectionScheme(SS) \
182  \
183 makeFaConvectionTypeScheme(SS, scalar) \
184 makeFaConvectionTypeScheme(SS, vector) \
185 makeFaConvectionTypeScheme(SS, tensor)
186 
187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
188 
189 #ifdef NoRepository
191 #endif
192 
193 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
194 
195 #endif
196 
197 // ************************************************************************* //
convectionScheme(const convectionScheme &)=delete
No copy construct.
Finite area mesh (used for 2-D non-Euclidian finite area method) defined using a patch of faces on a ...
Definition: faMesh.H:133
Reference counter for various OpenFOAM components.
Definition: refCount.H:44
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
virtual tmp< faMatrix< Type > > famDiv(const edgeScalarField &, const GeometricField< Type, faPatchField, areaMesh > &) const =0
Abstract base class for finite area calculus convection schemes.
virtual tmp< GeometricField< Type, faePatchField, edgeMesh > > flux(const edgeScalarField &, const GeometricField< Type, faPatchField, areaMesh > &) const =0
Forwards for edge field types.
declareRunTimeSelectionTable(tmp, convectionScheme, Istream,(const faMesh &mesh, const edgeScalarField &faceFlux, Istream &schemeData),(mesh, faceFlux, schemeData))
void operator=(const convectionScheme &)=delete
No copy assignment.
virtual ~convectionScheme()
Destructor.
const direction noexcept
Definition: scalarImpl.H:265
static tmp< convectionScheme< Type > > New(const faMesh &mesh, const edgeScalarField &faceFlux, Istream &schemeData)
Return a pointer to a new convectionScheme created on freestore.
Macros to ease declaration of run-time selection tables.
A class for managing temporary objects.
Definition: HashPtrTable.H:50
virtual tmp< GeometricField< Type, faPatchField, areaMesh > > facDiv(const edgeScalarField &, const GeometricField< Type, faPatchField, areaMesh > &) const =0
Forwards and collection of common area field types.
Namespace for OpenFOAM.
const faMesh & mesh() const noexcept
Return mesh reference.