CentredFitSnGradData.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) 2013-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::CentredFitSnGradData
29
30Description
31 Data for centred fit snGrad schemes
32
33SourceFiles
34 CentredFitSnGradData.C
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef CentredFitSnGradData_H
39#define CentredFitSnGradData_H
40
41#include "FitData.H"
42
43// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44
45namespace Foam
46{
47
48class extendedCentredCellToFaceStencil;
49
50/*---------------------------------------------------------------------------*\
51 Class CentredFitSnGradData Declaration
52\*---------------------------------------------------------------------------*/
53
54template<class Polynomial>
56:
57 public FitData
58 <
59 CentredFitSnGradData<Polynomial>,
60 extendedCentredCellToFaceStencil,
61 Polynomial
62 >
63{
64 // Private data
65
66 //- For each cell in the mesh store the values which multiply the
67 // values of the stencil to obtain the gradient for each direction
68 List<scalarList> coeffs_;
69
70
71public:
73 TypeName("CentredFitSnGradData");
74
75
76 // Constructors
77
78 //- Construct from components
80 (
81 const fvMesh& mesh,
83 const scalar linearLimitFactor,
84 const scalar centralWeight
85 );
86
87
88 //- Destructor
89 virtual ~CentredFitSnGradData() = default;
90
91
92 // Member functions
93
94 //- Return reference to fit coefficients
95 const List<scalarList>& coeffs() const
96 {
97 return coeffs_;
98 }
99
100 //- Calculate the fit for the specified face and set the coefficients
101 void calcFit
102 (
103 scalarList& coeffsi, // coefficients to be set
104 const List<point>&, // Stencil points
105 const scalar wLin, // Weight for linear approximation (weights
106 // nearest neighbours)
107 const scalar deltaCoeff, // uncorrected delta coefficient
108 const label faci // Current face index
109 );
110
111 void calcFit();
112};
113
114
115// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
116
117} // End namespace Foam
118
119// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120
121#ifdef NoRepository
122 #include "CentredFitSnGradData.C"
123#endif
124
125// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126
127#endif
128
129// ************************************************************************* //
Data for centred fit snGrad schemes.
void calcFit()
Calculate the fit for all the faces.
TypeName("CentredFitSnGradData")
virtual ~CentredFitSnGradData()=default
Destructor.
const List< scalarList > & coeffs() const
Return reference to fit coefficients.
Data for the upwinded and centred polynomial fit interpolation schemes. The linearCorrection_ determi...
Definition: FitData.H:60
scalar linearLimitFactor() const
Factor the fit is allowed to deviate from the base scheme.
Definition: FitData.H:124
const extendedCentredCellToFaceStencil & stencil() const
Return reference to the stencil.
Definition: FitData.H:118
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: List.H:77
const Mesh & mesh() const
Definition: MeshObject.H:122
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
Namespace for OpenFOAM.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73