Loading...
Searching...
No Matches
gaussFaGrad.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) 2016-2017 Wikki Ltd
9 Copyright (C) 2023 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::fa::gaussGrad
29
30Description
31 Basic second-order gradient scheme using face-interpolation
32 and Gauss' theorem.
33
34SourceFiles
35 gaussFaGrad.C
36 gaussFaGrads.C
37
38\*---------------------------------------------------------------------------*/
39
40#ifndef Foam_gaussFaGrad_H
41#define Foam_gaussFaGrad_H
42
43#include "faGradScheme.H"
46
47// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48
49namespace Foam
50{
51
52// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53
54namespace fa
55{
56
57/*---------------------------------------------------------------------------*\
58 Class gaussGrad Declaration
59\*---------------------------------------------------------------------------*/
60
61template<class Type>
62class gaussGrad
63:
64 public fa::gradScheme<Type>
65{
66 // Private Data
67
68 //- Interpolation scheme
70
71
72public:
73
74 //- Runtime type information
75 TypeName("Gauss");
76
77
78 // Generated Methods
79
80 //- No copy construct
81 gaussGrad(const gaussGrad&) = delete;
83 //- No copy assignment
84 void operator=(const gaussGrad&) = delete;
85
86
87 // Constructors
88
89 //- Construct from mesh
90 gaussGrad(const faMesh& mesh)
91 :
92 gradScheme<Type>(mesh),
93 tinterpScheme_(new linearEdgeInterpolation<Type>(mesh))
94 {}
96 //- Construct from Istream
97 gaussGrad(const faMesh& mesh, Istream& is)
98 :
99 gradScheme<Type>(mesh)
100 {
101 if (is.eof())
102 {
103 tinterpScheme_.reset
105 new linearEdgeInterpolation<Type>(mesh)
106 );
107 }
108 else
109 {
110 tinterpScheme_.reset
111 (
112 edgeInterpolationScheme<Type>::New(mesh, is)
113 );
114 }
115 }
116
117
118 // Member Functions
119
120 //- Return the gradient of the given field
121 //- calculated using Gauss' theorem on the given surface field
122 static
123 tmp
124 <
127 > gradf
128 (
130 const word& name
131 );
132
133 //- Return the gradient of the given field to the
134 //- gradScheme::grad for optional caching
135 virtual tmp
136 <
139 > calcGrad
140 (
142 const word& name
143 ) const;
144
145
146 //- Correct the boundary values of the gradient using the patchField
147 // snGrad functions
148 static void correctBoundaryConditions
149 (
153 );
154};
155
156
157// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158
159} // End namespace fa
160
161// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162
163} // End namespace Foam
164
165// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166
167#ifdef NoRepository
168 #include "gaussFaGrad.C"
169#endif
170
171// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172
173#endif
174
175// ************************************************************************* //
Generic GeometricField class.
bool eof() const noexcept
True if end of input seen.
Definition IOstream.H:289
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition Istream.H:60
Mesh data needed to do the Finite Area discretisation.
Definition areaFaMesh.H:50
Finite area mesh (used for 2-D non-Euclidian finite area method) defined using a patch of faces on a ...
Definition faMesh.H:140
faPatchField<Type> abstract base class. This class gives a fat-interface to all derived classes cover...
gaussGrad(const gaussGrad &)=delete
No copy construct.
static tmp< GeometricField< typename outerProduct< vector, Type >::type, faPatchField, areaMesh > > gradf(const GeometricField< Type, faePatchField, edgeMesh > &, const word &name)
Return the gradient of the given field calculated using Gauss' theorem on the given surface field.
Definition gaussFaGrad.C:48
void operator=(const gaussGrad &)=delete
No copy assignment.
gaussGrad(const faMesh &mesh)
Construct from mesh.
Definition gaussFaGrad.H:95
TypeName("Gauss")
Runtime type information.
gaussGrad(const faMesh &mesh, Istream &is)
Construct from Istream.
virtual tmp< GeometricField< typename outerProduct< vector, Type >::type, faPatchField, areaMesh > > calcGrad(const GeometricField< Type, faPatchField, areaMesh > &vsf, const word &name) const
Return the gradient of the given field to the gradScheme::grad for optional caching.
Definition gaussFaGrad.C:79
Abstract base class for finite area calculus gradient schemes.
const faMesh & mesh() const noexcept
Return mesh reference.
gradScheme(const gradScheme &)=delete
No copy construct.
Central-differencing interpolation scheme class.
typeOfRank< typenamepTraits< arg1 >::cmptType, direction(pTraits< arg1 >::rank)+direction(pTraits< arg2 >::rank)>::type type
Definition products.H:118
A class for managing temporary objects.
Definition tmp.H:75
A class for handling words, derived from Foam::string.
Definition word.H:66
Namespace for finite-area.
Definition limitHeight.C:30
Namespace for OpenFOAM.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition exprTraits.C:127
cellMask correctBoundaryConditions()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68