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-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::fa::convectionScheme
28
29Description
30 Abstract base class for finite area calculus convection schemes.
31
32SourceFiles
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"
45
46// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47
48namespace Foam
49{
50
51template<class Type>
52class faMatrix;
53
54class faMesh;
55
56// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
57
58namespace fa
59{
60
61/*---------------------------------------------------------------------------*\
62 Class convectionScheme Declaration
63\*---------------------------------------------------------------------------*/
64
65template<class Type>
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
84public:
85
86 // Declare run-time constructor selection tables
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 }
139 (
140 const edgeScalarField&,
142 ) const = 0;
145 (
146 const edgeScalarField&,
148 ) const = 0;
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
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
184#define makeFaConvectionScheme(SS) \
185 \
186makeFaConvectionTypeScheme(SS, scalar) \
187makeFaConvectionTypeScheme(SS, vector) \
188makeFaConvectionTypeScheme(SS, tensor)
189
190// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191
192#ifdef NoRepository
193 #include "faConvectionScheme.C"
194#endif
195
196// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197
198#endif
199
200// ************************************************************************* //
Forwards and collection of common area field types.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
Finite area mesh (used for 2-D non-Euclidian finite area method) defined using a patch of faces on a ...
Definition: faMesh.H:100
Abstract base class for finite area calculus convection schemes.
virtual tmp< GeometricField< Type, faPatchField, areaMesh > > facDiv(const edgeScalarField &, const GeometricField< Type, faPatchField, areaMesh > &) const =0
convectionScheme(const faMesh &mesh, const edgeScalarField &faceFlux)
Construct from mesh, flux and Istream.
virtual tmp< faMatrix< Type > > famDiv(const edgeScalarField &, const GeometricField< Type, faPatchField, areaMesh > &) const =0
virtual ~convectionScheme()
Destructor.
static tmp< convectionScheme< Type > > New(const faMesh &mesh, const edgeScalarField &faceFlux, Istream &schemeData)
Return a pointer to a new convectionScheme created on freestore.
virtual tmp< GeometricField< Type, faePatchField, edgeMesh > > flux(const edgeScalarField &, const GeometricField< Type, faPatchField, areaMesh > &) const =0
const faMesh & mesh() const
Return mesh reference.
declareRunTimeSelectionTable(tmp, convectionScheme, Istream,(const faMesh &mesh, const edgeScalarField &faceFlux, Istream &schemeData),(mesh, faceFlux, schemeData))
Reference counter for various OpenFOAM components.
Definition: refCount.H:51
A class for managing temporary objects.
Definition: tmp.H:65
Forwards for edge field types.
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)