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 -------------------------------------------------------------------------------
11 License
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 
27 Class
28  Foam::CentredFitSnGradData
29 
30 Description
31  Data for centred fit snGrad schemes
32 
33 SourceFiles
34  CentredFitSnGradData.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef CentredFitSnGradData_H
39 #define CentredFitSnGradData_H
40 
41 #include "FitData.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 class extendedCentredCellToFaceStencil;
49 
50 /*---------------------------------------------------------------------------*\
51  Class CentredFitSnGradData Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 template<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 
71 public:
72 
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 // ************************************************************************* //
Foam::FitData
Data for the upwinded and centred polynomial fit interpolation schemes. The linearCorrection_ determi...
Definition: FitData.H:57
Foam::FitData< CentredFitSnGradData< Polynomial >, extendedCentredCellToFaceStencil, Polynomial >::stencil
const extendedCentredCellToFaceStencil & stencil() const
Return reference to the stencil.
Definition: FitData.H:118
Foam::FitData< CentredFitSnGradData< Polynomial >, extendedCentredCellToFaceStencil, Polynomial >::linearLimitFactor
scalar linearLimitFactor() const
Factor the fit is allowed to deviate from the base scheme.
Definition: FitData.H:124
Foam::extendedCentredCellToFaceStencil
Definition: extendedCentredCellToFaceStencil.H:51
Foam::CentredFitSnGradData::~CentredFitSnGradData
virtual ~CentredFitSnGradData()=default
Destructor.
Foam::CentredFitSnGradData::CentredFitSnGradData
CentredFitSnGradData(const fvMesh &mesh, const extendedCentredCellToFaceStencil &stencil, const scalar linearLimitFactor, const scalar centralWeight)
Construct from components.
Definition: CentredFitSnGradData.C:38
Foam::CentredFitSnGradData::TypeName
TypeName("CentredFitSnGradData")
CentredFitSnGradData.C
Foam::MeshObject< fvMesh, MoveableMeshObject, CentredFitSnGradData< Polynomial > >::mesh
const fvMesh & mesh() const
Definition: MeshObject.H:122
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:84
Foam::CentredFitSnGradData
Data for centred fit snGrad schemes.
Definition: CentredFitSnGradData.H:54
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::FitData< CentredFitSnGradData< Polynomial >, extendedCentredCellToFaceStencil, Polynomial >::centralWeight
scalar centralWeight() const
Return weight for central stencil.
Definition: FitData.H:130
FitData.H
Foam::List< scalarList >
Foam::CentredFitSnGradData::calcFit
void calcFit()
Calculate the fit for all the faces.
Definition: CentredFitSnGradData.C:206
Foam::CentredFitSnGradData::coeffs
const List< scalarList > & coeffs() const
Return reference to fit coefficients.
Definition: CentredFitSnGradData.H:94