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-------------------------------------------------------------------------------
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::UpwindFitData
29
30Description
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
36SourceFiles
37 UpwindFitData.C
38
39\*---------------------------------------------------------------------------*/
40
41#ifndef UpwindFitData_H
42#define UpwindFitData_H
43
44#include "FitData.H"
45
46// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47
48namespace Foam
49{
50
51class extendedUpwindCellToFaceStencil;
52
53/*---------------------------------------------------------------------------*\
54 Class UpwindFitData Declaration
55\*---------------------------------------------------------------------------*/
56
57template<class Polynomial>
58class 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
85public:
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// ************************************************************************* //
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 extendedUpwindCellToFaceStencil & 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
Data for the quadratic fit correction interpolation scheme to be used with upwind biased stencil.
Definition: UpwindFitData.H:65
TypeName("UpwindFitData")
const List< scalarList > & owncoeffs() const
Return reference to owner fit coefficients.
virtual ~UpwindFitData()=default
Destructor.
const List< scalarList > & neicoeffs() const
Return reference to neighbour fit coefficients.
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:91
Namespace for OpenFOAM.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73