orthogonalSnGrad.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) 2021 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::fv::orthogonalSnGrad
29 
30 Group
31  grpFvSnGradSchemes
32 
33 Description
34  Surface gradient scheme with no non-orthogonal correction.
35 
36 Usage
37  Minimal example by using \c system/fvSchemes:
38  \verbatim
39  snGradSchemes
40  {
41  snGrad(<term>) orthogonal;
42  }
43  \endverbatim
44 
45 Note
46  - Interpolation weighting factors (i.e. delta coefficients) are based
47  on the \c deltaCoeffs function rather than the \c nonOrthDeltaCoeffs
48  function, which is used by the \c uncorrected scheme.
49 
50 SourceFiles
51  orthogonalSnGrad.C
52 
53 \*---------------------------------------------------------------------------*/
54 
55 #ifndef orthogonalSnGrad_H
56 #define orthogonalSnGrad_H
57 
58 #include "snGradScheme.H"
59 
60 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
61 
62 namespace Foam
63 {
64 
65 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
66 
67 namespace fv
68 {
69 
70 /*---------------------------------------------------------------------------*\
71  Class orthogonalSnGrad Declaration
72 \*---------------------------------------------------------------------------*/
73 
74 template<class Type>
75 class orthogonalSnGrad
76 :
77  public snGradScheme<Type>
78 {
79  // Private Member Functions
80 
81  //- No copy assignment
82  void operator=(const orthogonalSnGrad&) = delete;
83 
84 
85 public:
86 
87  //- Runtime type information
88  TypeName("orthogonal");
89 
90 
91  // Constructors
92 
93  //- Construct from mesh
95  :
96  snGradScheme<Type>(mesh)
97  {}
98 
99  //- Construct from mesh and data stream
101  :
102  snGradScheme<Type>(mesh)
103  {}
104 
105 
106  //- Destructor
107  virtual ~orthogonalSnGrad() = default;
108 
109 
110  // Member Functions
111 
112  //- Return the interpolation weighting factors for the given field
114  (
116  ) const
117  {
118  return this->mesh().deltaCoeffs();
119  }
120 
121  //- Return true if this scheme uses an explicit correction
122  virtual bool corrected() const noexcept
123  {
124  return false;
125  }
126 
127  //- Return the explicit correction to the orthogonalSnGrad
128  //- for the given field
131 };
132 
133 
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 
136 } // End namespace fv
137 
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 
140 } // End namespace Foam
141 
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143 
144 #ifdef NoRepository
145  #include "orthogonalSnGrad.C"
146 #endif
147 
148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149 
150 #endif
151 
152 // ************************************************************************* //
Foam::fv::orthogonalSnGrad::corrected
virtual bool corrected() const noexcept
Return true if this scheme uses an explicit correction.
Definition: orthogonalSnGrad.H:121
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::fv::orthogonalSnGrad::~orthogonalSnGrad
virtual ~orthogonalSnGrad()=default
Destructor.
orthogonalSnGrad.C
Foam::fv::orthogonalSnGrad
Surface gradient scheme with no non-orthogonal correction.
Definition: orthogonalSnGrad.H:74
Foam::surfaceInterpolation::deltaCoeffs
virtual const surfaceScalarField & deltaCoeffs() const
Return reference to cell-centre difference coefficients.
Definition: surfaceInterpolation.C:113
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::fv::orthogonalSnGrad::orthogonalSnGrad
orthogonalSnGrad(const fvMesh &mesh, Istream &)
Construct from mesh and data stream.
Definition: orthogonalSnGrad.H:99
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
fv
labelList fv(nPoints)
Foam::fv::snGradScheme::mesh
const fvMesh & mesh() const
Return const reference to mesh.
Definition: snGradScheme.H:139
Foam::fv::orthogonalSnGrad::correction
virtual tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > correction(const GeometricField< Type, fvPatchField, volMesh > &) const
Definition: orthogonalSnGrad.C:48
Foam::fv::orthogonalSnGrad::deltaCoeffs
virtual tmp< surfaceScalarField > deltaCoeffs(const GeometricField< Type, fvPatchField, volMesh > &) const
Return the interpolation weighting factors for the given field.
Definition: orthogonalSnGrad.H:113
Foam::fv::orthogonalSnGrad::TypeName
TypeName("orthogonal")
Runtime type information.
Foam::fv::orthogonalSnGrad::orthogonalSnGrad
orthogonalSnGrad(const fvMesh &mesh)
Construct from mesh.
Definition: orthogonalSnGrad.H:93
Foam::fv::snGradScheme
Abstract base class for runtime selected snGrad surface normal gradient schemes.
Definition: snGradScheme.H:76
snGradScheme.H
Foam::GeometricField< Type, fvPatchField, volMesh >