Loading...
Searching...
No Matches
fvcGrad.C
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-------------------------------------------------------------------------------
10License
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\*---------------------------------------------------------------------------*/
27
28#include "fvcGrad.H"
29#include "fvcSurfaceIntegrate.H"
30#include "fvMesh.H"
31#include "gaussGrad.H"
32
33// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
34
35namespace Foam
36{
37
38// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
39
40namespace fvc
41{
42
43// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44
45template<class Type>
53grad
54(
56)
57{
58 return fv::gaussGrad<Type>::gradf(ssf, "grad(" + ssf.name() + ')');
59}
60
61
62template<class Type>
77 (
78 fvc::grad(tssf())
79 );
80 tssf.clear();
81 return Grad;
82}
83
84
85template<class Type>
98{
100 (
101 vf.mesh(),
102 vf.mesh().gradScheme(name)
103 )().grad(vf, name);
104}
105
106
107template<class Type>
109<
111 <
113 >
114>
115grad
116(
118 const word& name
119)
120{
121 tmp
122 <
124 <
126 >
127 > tGrad
128 (
129 fvc::grad(tvf(), name)
130 );
131 tvf.clear();
132 return tGrad;
133}
134
135
136template<class Type>
144grad
145(
147)
148{
149 return fvc::grad(vf, "grad(" + vf.name() + ')');
150}
151
152
153template<class Type>
155<
157 <
159 >
160>
161grad
162(
164)
165{
166 typedef typename outerProduct<vector, Type>::type GradType;
168 (
169 fvc::grad(tvf())
170 );
171 tvf.clear();
172 return Grad;
173}
174
175
176// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177
178} // End namespace fvc
179
180// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181
182} // End namespace Foam
183
184// ************************************************************************* //
const Mesh & mesh() const noexcept
Return const reference to mesh.
Generic GeometricField class.
const word & name() const noexcept
Return the object name.
Definition IOobjectI.H:205
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
static tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh > > gradf(const GeometricField< Type, fvsPatchField, surfaceMesh > &, const word &name)
Return the gradient of the given field calculated using Gauss' theorem on the given surface field.
Definition gaussGrad.C:38
static tmp< gradScheme< Type > > New(const fvMesh &mesh, Istream &schemeData)
Return a pointer to a new gradScheme created on freestore.
Definition gradScheme.C:30
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
Mesh data needed to do the Finite Volume discretisation.
Definition volMesh.H:47
A class for handling words, derived from Foam::string.
Definition word.H:66
Calculate the gradient of the given field.
Surface integrate surfaceField creating a volField. Surface sum a surfaceField creating a volField.
Namespace of functions to calculate explicit derivatives.
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh > > grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition fvcGrad.C:47
Namespace for OpenFOAM.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition exprTraits.C:127