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 "tmp.H"
41 #include "areaFieldsFwd.H"
42 #include "edgeFieldsFwd.H"
43 #include "typeInfo.H"
44 #include "runTimeSelectionTables.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 template<class Type>
52 class faMatrix;
53 
54 class faMesh;
55 
56 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
57 
58 namespace fa
59 {
60 
61 /*---------------------------------------------------------------------------*\
62  Class convectionScheme Declaration
63 \*---------------------------------------------------------------------------*/
64 
65 template<class Type>
66 class convectionScheme
67 :
68  public refCount
69 {
70  // Private data
71 
72  const faMesh& mesh_;
73 
74 
75  // Private Member Functions
76 
77  //- No copy construct
78  convectionScheme(const convectionScheme&) = delete;
79 
80  //- No copy assignment
81  void operator=(const convectionScheme&) = delete;
82 
83 
84 public:
85 
86  // Declare run-time constructor selection tables
87 
89  (
90  tmp,
92  Istream,
93  (
94  const faMesh& mesh,
95  const edgeScalarField& faceFlux,
96  Istream& schemeData
97  ),
98  (mesh, faceFlux, schemeData)
99  );
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
134  {
135  return mesh_;
136  }
137 
139  (
140  const edgeScalarField&,
142  ) const = 0;
143 
144  virtual tmp<faMatrix<Type>> famDiv
145  (
146  const edgeScalarField&,
148  ) const = 0;
149 
151  (
152  const edgeScalarField&,
154  ) const = 0;
155 };
156 
157 
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 
160 } // End namespace fa
161 
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 
164 } // End namespace Foam
165 
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 
168 // Add the patch constructor functions to the hash tables
169 
170 #define makeFaConvectionTypeScheme(SS, Type) \
171  \
172  defineNamedTemplateTypeNameAndDebug(Foam::fa::SS<Foam::Type>, 0); \
173  \
174  namespace Foam \
175  { \
176  namespace fa \
177  { \
178  convectionScheme<Type>::addIstreamConstructorToTable<SS<Type>> \
179  add##SS##Type##IstreamConstructorToTable_; \
180  } \
181  }
182 
183 
184 #define makeFaConvectionScheme(SS) \
185  \
186 makeFaConvectionTypeScheme(SS, scalar) \
187 makeFaConvectionTypeScheme(SS, vector) \
188 makeFaConvectionTypeScheme(SS, tensor)
189 
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191 
192 #ifdef NoRepository
193  #include "faConvectionScheme.C"
194 #endif
195 
196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 
198 #endif
199 
200 // ************************************************************************* //
typeInfo.H
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::refCount
Reference counter for various OpenFOAM components.
Definition: refCount.H:50
Foam::fa::convectionScheme::flux
virtual tmp< GeometricField< Type, faePatchField, edgeMesh > > flux(const edgeScalarField &, const GeometricField< Type, faPatchField, areaMesh > &) const =0
Foam::fa::convectionScheme::facDiv
virtual tmp< GeometricField< Type, faPatchField, areaMesh > > facDiv(const edgeScalarField &, const GeometricField< Type, faPatchField, areaMesh > &) const =0
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
areaFieldsFwd.H
Forwards and collection of common area field types.
Foam::fa::convectionScheme::famDiv
virtual tmp< faMatrix< Type > > famDiv(const edgeScalarField &, const GeometricField< Type, faPatchField, areaMesh > &) const =0
Foam::fa::convectionScheme::~convectionScheme
virtual ~convectionScheme()
Destructor.
Definition: faConvectionScheme.C:81
Foam::fa::convectionScheme
Abstract base class for finite area calculus convection schemes.
Definition: faConvectionScheme.H:65
faConvectionScheme.C
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::fa::convectionScheme::New
static tmp< convectionScheme< Type > > New(const faMesh &mesh, const edgeScalarField &faceFlux, Istream &schemeData)
Return a pointer to a new convectionScheme created on freestore.
Definition: faConvectionScheme.C:37
tmp.H
runTimeSelectionTables.H
Macros to ease declaration of run-time selection tables.
Foam::fa::convectionScheme::declareRunTimeSelectionTable
declareRunTimeSelectionTable(tmp, convectionScheme, Istream,(const faMesh &mesh, const edgeScalarField &faceFlux, Istream &schemeData),(mesh, faceFlux, schemeData))
Foam::faMesh
Finite area mesh. Used for 2-D non-Euclidian finite area method.
Definition: faMesh.H:82
Foam::GeometricField< scalar, faePatchField, edgeMesh >
edgeFieldsFwd.H
Forwards for edge field types.
Foam::fa::convectionScheme::mesh
const faMesh & mesh() const
Return mesh reference.
Definition: faConvectionScheme.H:132