UpwindFitData.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::UpwindFitData
29 
30 Description
31  Data for the quadratic fit correction interpolation scheme to be used with
32  upwind biased stencil.
33  - linearCorrection = true : fit calculated for corrected linear scheme
34  - linearCorrection = false : fit calculated for corrected upwind scheme
35 
36 SourceFiles
37  UpwindFitData.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef UpwindFitData_H
42 #define UpwindFitData_H
43 
44 #include "FitData.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 class extendedUpwindCellToFaceStencil;
52 
53 /*---------------------------------------------------------------------------*\
54  Class UpwindFitData Declaration
55 \*---------------------------------------------------------------------------*/
56 
57 template<class Polynomial>
58 class UpwindFitData
59 :
60  public FitData
61  <
62  UpwindFitData<Polynomial>,
63  extendedUpwindCellToFaceStencil,
64  Polynomial
65  >
66 {
67  // Private data
68 
69  //- For each face of the mesh store the coefficients to multiply the
70  // stencil cell values by if the flow is from the owner
71  List<scalarList> owncoeffs_;
72 
73  //- For each face of the mesh store the coefficients to multiply the
74  // stencil cell values by if the flow is from the neighbour
75  List<scalarList> neicoeffs_;
76 
77 
78  // Private Member Functions
79 
80  //- Calculate the fit for the all the mesh faces
81  // and set the coefficients
82  void calcFit();
83 
84 
85 public:
86 
87  TypeName("UpwindFitData");
88 
89 
90  // Constructors
91 
92  //- Construct from components
94  (
95  const fvMesh& mesh,
97  const bool linearCorrection,
98  const scalar linearLimitFactor,
99  const scalar centralWeight
100  );
101 
102 
103  //- Destructor
104  virtual ~UpwindFitData() = default;
105 
106 
107  // Member functions
108 
109  //- Return reference to owner fit coefficients
110  const List<scalarList>& owncoeffs() const
111  {
112  return owncoeffs_;
113  }
114 
115  //- Return reference to neighbour fit coefficients
116  const List<scalarList>& neicoeffs() const
117  {
118  return neicoeffs_;
119  }
120 };
121 
122 
123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124 
125 } // End namespace Foam
126 
127 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 
129 #ifdef NoRepository
130  #include "UpwindFitData.C"
131 #endif
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
135 #endif
136 
137 // ************************************************************************* //
Foam::FitData
Data for the upwinded and centred polynomial fit interpolation schemes. The linearCorrection_ determi...
Definition: FitData.H:57
Foam::FitData< UpwindFitData< Polynomial >, extendedUpwindCellToFaceStencil, Polynomial >::stencil
const extendedUpwindCellToFaceStencil & stencil() const
Return reference to the stencil.
Definition: FitData.H:118
Foam::FitData< UpwindFitData< Polynomial >, extendedUpwindCellToFaceStencil, Polynomial >::linearLimitFactor
scalar linearLimitFactor() const
Factor the fit is allowed to deviate from the base scheme.
Definition: FitData.H:124
Foam::UpwindFitData::~UpwindFitData
virtual ~UpwindFitData()=default
Destructor.
Foam::UpwindFitData::neicoeffs
const List< scalarList > & neicoeffs() const
Return reference to neighbour fit coefficients.
Definition: UpwindFitData.H:115
Foam::UpwindFitData::TypeName
TypeName("UpwindFitData")
Foam::UpwindFitData::UpwindFitData
UpwindFitData(const fvMesh &mesh, const extendedUpwindCellToFaceStencil &stencil, const bool linearCorrection, const scalar linearLimitFactor, const scalar centralWeight)
Construct from components.
Definition: UpwindFitData.C:39
Foam::extendedUpwindCellToFaceStencil
Creates upwind stencil by shifting a centred stencil to upwind and downwind faces and optionally remo...
Definition: extendedUpwindCellToFaceStencil.H:61
Foam::FitData< UpwindFitData< Polynomial >, extendedUpwindCellToFaceStencil, Polynomial >::linearCorrection
bool linearCorrection() const
Definition: FitData.H:147
Foam::MeshObject< fvMesh, MoveableMeshObject, UpwindFitData< Polynomial > >::mesh
const fvMesh & mesh() const
Definition: MeshObject.H:122
Foam::UpwindFitData
Data for the quadratic fit correction interpolation scheme to be used with upwind biased stencil.
Definition: UpwindFitData.H:57
Foam::UpwindFitData::owncoeffs
const List< scalarList > & owncoeffs() const
Return reference to owner fit coefficients.
Definition: UpwindFitData.H:109
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< UpwindFitData< Polynomial >, extendedUpwindCellToFaceStencil, Polynomial >::centralWeight
scalar centralWeight() const
Return weight for central stencil.
Definition: FitData.H:130
UpwindFitData.C
FitData.H
Foam::List< scalarList >