Loading...
Searching...
No Matches
faNVDscheme.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::faNVDscheme
28
29Description
30 Class to create the weighting-factors based on the NVD
31 (Normalised Variable Diagram).
32
33 The particular differencing scheme class is supplied as a template argument,
34 the weight function of which is called by the weight function of this class
35 for the internal edges as well as edges of coupled patches
36 (e.g. processor-processor patches). The weight function is supplied the
37 central-differencing weighting factor, the edge-flux, the cell and edge
38 gradients (from which the normalised variable distribution may be created)
39 and the cell centre distance.
40
41 This code organisation is both neat and efficient, allowing for convenient
42 implementation of new schemes to run on parallelised cases.
43
44SourceFiles
45 faNVDscheme.C
46
47\*---------------------------------------------------------------------------*/
48
49#ifndef Foam_faNVDscheme_H
50#define Foam_faNVDscheme_H
51
53
54// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
55
56namespace Foam
57{
58
59/*---------------------------------------------------------------------------*\
60 Class faNVDscheme Declaration
61\*---------------------------------------------------------------------------*/
62
63template<class Type, class NVDweight>
64class faNVDscheme
65:
66 public edgeInterpolationScheme<Type>,
67 public NVDweight
69protected:
70
71 // Protected Data
72
74
75
76public:
77
78 //- Define a typedef for the NVDweight
79 typedef NVDweight Weight;
80
81
82 //- Runtime type information
83 TypeName("faNVDscheme");
84
85
86 // Generated Methods
87
88 //- No copy construct
89 faNVDscheme(const faNVDscheme&) = delete;
91 //- No copy assignment
92 void operator=(const faNVDscheme&) = delete;
93
94
95 // Constructors
96
97 //- Construct from mesh and edgeFlux and blendingFactor
99 (
100 const faMesh& mesh,
101 const edgeScalarField& edgeFlux,
102 const NVDweight& weight
104 :
106 NVDweight(weight),
107 edgeFlux_(edgeFlux)
108 {}
109
110 //- Construct from mesh and Istream.
111 // The name of the flux field is read from the Istream and looked-up
112 // from the database
114 (
115 const faMesh& mesh,
116 Istream& is
117 )
118 :
120 NVDweight(is),
122 (
123 mesh.thisDb().lookupObject<edgeScalarField>
124 (
125 word(is)
126 )
127 )
128 {}
129
130 //- Construct from mesh, edgeFlux and Istream
132 (
133 const faMesh& mesh,
134 const edgeScalarField& edgeFlux,
135 Istream& is
136 )
137 :
139 NVDweight(is),
140 edgeFlux_(edgeFlux)
141 {}
142
143
144 // Member Functions
145
146 //- Return the interpolation weighting factors
148 (
150 ) const;
151};
152
153
154// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155
156} // End namespace Foam
157
158// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160// Add the patch constructor functions to the hash tables
161
162#define makeNVDedgeInterpolationTypeScheme(SS, WEIGHT, NAME, TYPE) \
163 \
164typedef faNVDscheme<TYPE, WEIGHT> faNVDscheme##TYPE##WEIGHT_; \
165defineTemplateTypeNameAndDebugWithName(faNVDscheme##TYPE##WEIGHT_, NAME, 0); \
166 \
167edgeInterpolationScheme<TYPE>::addMeshConstructorToTable \
168<faNVDscheme<TYPE, WEIGHT>> \
169 add##SS##TYPE##MeshConstructorToTable_; \
170 \
171edgeInterpolationScheme<TYPE>::addMeshFluxConstructorToTable \
172<faNVDscheme<TYPE, WEIGHT>> \
173 add##SS##TYPE##MeshFluxConstructorToTable_;
175
176#define makeNVDedgeInterpolationScheme(SS, WEIGHT, NAME) \
177 \
178makeNVDedgeInterpolationTypeScheme(SS, WEIGHT, NAME, scalar) \
179makeNVDedgeInterpolationTypeScheme(SS, WEIGHT, NAME, vector) \
180makeNVDedgeInterpolationTypeScheme(SS, WEIGHT, NAME, tensor)
181
182
183// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184
185#ifdef NoRepository
186 #include "faNVDscheme.C"
187#endif
189// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
190
191#endif
192
193// ************************************************************************* //
scalar weight(scalar cdWeight, scalar faceFlux, scalar phiP, scalar phiN, const vector &gradcP, const vector &gradcN, const vector &d) const
Definition Gamma.H:81
Generic GeometricField class.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition Istream.H:60
Abstract base class for edge interpolation schemes.
edgeInterpolationScheme(const edgeInterpolationScheme &)=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:140
virtual tmp< edgeScalarField > weights(const GeometricField< Type, faPatchField, areaMesh > &) const
Return the interpolation weighting factors.
Definition faNVDscheme.C:52
faNVDscheme(const faMesh &mesh, Istream &is)
Construct from mesh and Istream.
faNVDscheme(const faMesh &mesh, const edgeScalarField &edgeFlux, const NVDweight &weight)
Construct from mesh and edgeFlux and blendingFactor.
TypeName("faNVDscheme")
Runtime type information.
void operator=(const faNVDscheme &)=delete
No copy assignment.
faNVDscheme(const faMesh &mesh, const edgeScalarField &edgeFlux, Istream &is)
Construct from mesh, edgeFlux and Istream.
faNVDscheme(const faNVDscheme &)=delete
No copy construct.
A class for managing temporary objects.
Definition tmp.H:75
A class for handling words, derived from Foam::string.
Definition word.H:66
dynamicFvMesh & mesh
Namespace for OpenFOAM.
GeometricField< scalar, faePatchField, edgeMesh > edgeScalarField
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68