skewCorrectedSnGrad.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) 2019 Zeljko Tukovic, FSB Zagreb.
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::fv::skewCorrectedSnGrad
28 
29 Group
30  grpFvSnGradSchemes
31 
32 Description
33  Simple central-difference snGrad scheme with non-orthogonal correction.
34 
35 SourceFiles
36  skewCorrectedSnGrad.C
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef skewCorrectedSnGrad_H
41 #define skewCorrectedSnGrad_H
42 
43 #include "snGradScheme.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 
52 namespace fv
53 {
54 
55 /*---------------------------------------------------------------------------*\
56  Class skewCorrectedSnGrad Declaration
57 \*---------------------------------------------------------------------------*/
58 
59 template<class Type>
61 :
62  public snGradScheme<Type>
63 {
64  // Private Member Functions
65 
66  //- No copy assignment
67  void operator=(const skewCorrectedSnGrad&) = delete;
68 
69 
70 public:
71 
72  //- Runtime type information
73  TypeName("skewCorrected");
74 
75 
76  // Constructors
77 
78  //- Construct from mesh
80  :
81  snGradScheme<Type>(mesh)
82  {}
83 
84 
85  //- Construct from mesh and data stream
87  :
88  snGradScheme<Type>(mesh)
89  {}
90 
91 
92  //- Destructor
93  virtual ~skewCorrectedSnGrad() = default;
94 
95 
96  // Member Functions
97 
98  //- Return the interpolation weighting factors for the given field
100  (
102  ) const
103  {
104  return this->mesh().nonOrthDeltaCoeffs();
105  }
106 
107  //- Return true if this scheme uses an explicit correction
108  virtual bool corrected() const
109  {
110  return true;
111  }
112 
113  //- Return the explicit correction to the skewCorrectedSnGrad
114  //- for the given field using the gradient of the field
117  (
119  ) const;
120 
121  //- Return the explicit correction to the skewCorrectedSnGrad
122  //- for the given field using the gradients of the field components
125 };
126 
127 
128 // * * * * * * * * Template Member Function Specialisations * * * * * * * * //
129 
130 template<>
132 (
133  const volScalarField& vsf
134 ) const;
135 
136 
137 template<>
139 (
140  const volVectorField& vvf
141 ) const;
142 
143 
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 
146 } // End namespace fv
147 
148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149 
150 } // End namespace Foam
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 #ifdef NoRepository
155  #include "skewCorrectedSnGrad.C"
156 #endif
157 
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 
160 #endif
161 
162 // ************************************************************************* //
Foam::fv::skewCorrectedSnGrad::TypeName
TypeName("skewCorrected")
Runtime type information.
Foam::fv::skewCorrectedSnGrad::skewCorrectedSnGrad
skewCorrectedSnGrad(const fvMesh &mesh)
Construct from mesh.
Definition: skewCorrectedSnGrad.H:78
Foam::surfaceInterpolation::nonOrthDeltaCoeffs
virtual const surfaceScalarField & nonOrthDeltaCoeffs() const
Return reference to non-orthogonal cell-centre difference.
Definition: surfaceInterpolation.C:125
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::fv::skewCorrectedSnGrad
Simple central-difference snGrad scheme with non-orthogonal correction.
Definition: skewCorrectedSnGrad.H:59
skewCorrectedSnGrad.C
Foam::fv::skewCorrectedSnGrad::correction
virtual tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > correction(const GeometricField< Type, fvPatchField, volMesh > &) const
Definition: skewCorrectedSnGrad.C:225
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::fv::skewCorrectedSnGrad::skewCorrectedSnGrad
skewCorrectedSnGrad(const fvMesh &mesh, Istream &)
Construct from mesh and data stream.
Definition: skewCorrectedSnGrad.H:85
Foam::fv::skewCorrectedSnGrad::~skewCorrectedSnGrad
virtual ~skewCorrectedSnGrad()=default
Destructor.
Foam::fv::skewCorrectedSnGrad::fullGradCorrection
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > fullGradCorrection(const GeometricField< Type, fvPatchField, volMesh > &) const
Definition: skewCorrectedSnGrad.C:40
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:83
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::fv::skewCorrectedSnGrad::deltaCoeffs
virtual tmp< surfaceScalarField > deltaCoeffs(const GeometricField< Type, fvPatchField, volMesh > &) const
Return the interpolation weighting factors for the given field.
Definition: skewCorrectedSnGrad.H:99
fv
labelList fv(nPoints)
Foam::fv::snGradScheme::mesh
const fvMesh & mesh() const
Return mesh reference.
Definition: snGradScheme.H:128
Foam::fv::snGradScheme
Abstract base class for snGrad schemes.
Definition: snGradScheme.H:65
Foam::fv::skewCorrectedSnGrad::corrected
virtual bool corrected() const
Return true if this scheme uses an explicit correction.
Definition: skewCorrectedSnGrad.H:107
snGradScheme.H
Foam::GeometricField< Type, fvPatchField, volMesh >