UpwindFitData.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::UpwindFitData
26 
27 Description
28  Data for the quadratic fit correction interpolation scheme to be used with
29  upwind biased stencil.
30  - linearCorrection = true : fit calculated for corrected linear scheme
31  - linearCorrection = false : fit calculated for corrected upwind scheme
32 
33 SourceFiles
34  UpwindFitData.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef UpwindFitData_H
39 #define UpwindFitData_H
40 
41 #include "FitData.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 class extendedUpwindCellToFaceStencil;
49 
50 /*---------------------------------------------------------------------------*\
51  Class UpwindFitData Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 template<class Polynomial>
55 class UpwindFitData
56 :
57  public FitData
58  <
59  UpwindFitData<Polynomial>,
60  extendedUpwindCellToFaceStencil,
61  Polynomial
62  >
63 {
64  // Private Data
65 
66  //- For each face of the mesh store the coefficients to multiply the
67  // stencil cell values by if the flow is from the owner
68  List<scalarList> owncoeffs_;
69 
70  //- For each face of the mesh store the coefficients to multiply the
71  // stencil cell values by if the flow is from the neighbour
72  List<scalarList> neicoeffs_;
73 
74 
75  // Private Member Functions
76 
77  //- Calculate the fit for the all the mesh faces
78  // and set the coefficients
79  void calcFit();
80 
81 
82 public:
83 
84  TypeName("UpwindFitData");
85 
86 
87  // Constructors
88 
89  //- Construct from components
91  (
92  const fvMesh& mesh,
94  const bool linearCorrection,
95  const scalar linearLimitFactor,
96  const scalar centralWeight
97  );
98 
99 
100  //- Destructor
101  virtual ~UpwindFitData()
102  {}
103 
104 
105  // Member Functions
106 
107  //- Return reference to owner fit coefficients
108  const List<scalarList>& owncoeffs() const
109  {
110  return owncoeffs_;
111  }
112 
113  //- Return reference to neighbour fit coefficients
114  const List<scalarList>& neicoeffs() const
115  {
116  return neicoeffs_;
117  }
118 };
119 
120 
121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 
123 } // End namespace Foam
124 
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126 
127 #ifdef NoRepository
128  #include "UpwindFitData.C"
129 #endif
130 
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 
133 #endif
134 
135 // ************************************************************************* //
const extendedUpwindCellToFaceStencil & stencil() const
Return reference to the stencil.
Definition: FitData.H:116
const List< scalarList > & neicoeffs() const
Return reference to neighbour fit coefficients.
TypeName("UpwindFitData")
UpwindFitData(const fvMesh &mesh, const extendedUpwindCellToFaceStencil &stencil, const bool linearCorrection, const scalar linearLimitFactor, const scalar centralWeight)
Construct from components.
Definition: UpwindFitData.C:36
const List< scalarList > & owncoeffs() const
Return reference to owner fit coefficients.
scalar linearLimitFactor() const
Factor the fit is allowed to deviate from the base scheme.
Definition: FitData.H:122
Data for the quadratic fit correction interpolation scheme to be used with upwind biased stencil...
Definition: UpwindFitData.H:54
Creates upwind stencil by shifting a centred stencil to upwind and downwind faces and optionally remo...
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Data for the upwinded and centred polynomial fit interpolation schemes. The linearCorrection_ determi...
Definition: FitData.H:54
virtual ~UpwindFitData()
Destructor.
Namespace for OpenFOAM.