CentredFitData.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) 2011-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::CentredFitData
29 
30 Description
31  Data for the quadratic fit correction interpolation scheme
32 
33 SourceFiles
34  CentredFitData.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef CentredFitData_H
39 #define CentredFitData_H
40 
41 #include "FitData.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 class extendedCentredCellToFaceStencil;
49 
50 /*---------------------------------------------------------------------------*\
51  Class CentredFitData Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 template<class Polynomial>
55 class CentredFitData
56 :
57  public FitData
58  <
59  CentredFitData<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  // Private Member Functions
72 
73  //- Calculate the fit for the all the mesh faces
74  // and set the coefficients
75  void calcFit();
76 
77 
78 public:
79 
80  TypeName("CentredFitData");
81 
82 
83  // Constructors
84 
85  //- Construct from components
87  (
88  const fvMesh& mesh,
90  const scalar linearLimitFactor,
91  const scalar centralWeight
92  );
93 
94 
95  //- Destructor
96  virtual ~CentredFitData() = default;
97 
98 
99  // Member functions
100 
101  //- Return reference to fit coefficients
102  const List<scalarList>& coeffs() const
103  {
104  return coeffs_;
105  }
106 };
107 
108 
109 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
110 
111 } // End namespace Foam
112 
113 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
114 
115 #ifdef NoRepository
116  #include "CentredFitData.C"
117 #endif
118 
119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120 
121 #endif
122 
123 // ************************************************************************* //
Foam::CentredFitData::coeffs
const List< scalarList > & coeffs() const
Return reference to fit coefficients.
Definition: CentredFitData.H:101
Foam::CentredFitData::~CentredFitData
virtual ~CentredFitData()=default
Destructor.
Foam::FitData
Data for the upwinded and centred polynomial fit interpolation schemes. The linearCorrection_ determi...
Definition: FitData.H:57
Foam::FitData< CentredFitData< Polynomial >, extendedCentredCellToFaceStencil, Polynomial >::stencil
const extendedCentredCellToFaceStencil & stencil() const
Return reference to the stencil.
Definition: FitData.H:118
Foam::FitData< CentredFitData< 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::CentredFitData
Data for the quadratic fit correction interpolation scheme.
Definition: CentredFitData.H:54
Foam::MeshObject< fvMesh, MoveableMeshObject, CentredFitData< Polynomial > >::mesh
const fvMesh & mesh() const
Definition: MeshObject.H:122
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::FitData< CentredFitData< Polynomial >, extendedCentredCellToFaceStencil, Polynomial >::centralWeight
scalar centralWeight() const
Return weight for central stencil.
Definition: FitData.H:130
FitData.H
Foam::List< scalarList >
CentredFitData.C
Foam::CentredFitData::CentredFitData
CentredFitData(const fvMesh &mesh, const extendedCentredCellToFaceStencil &stencil, const scalar linearLimitFactor, const scalar centralWeight)
Construct from components.
Definition: CentredFitData.C:40
Foam::CentredFitData::TypeName
TypeName("CentredFitData")