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>
46tmp
47<
48 GeometricField
49 <
50 typename outerProduct<vector, Type>::type, fvPatchField, volMesh
51 >
52>
54(
56)
57{
58 return fv::gaussGrad<Type>::gradf(ssf, "grad(" + ssf.name() + ')');
59}
60
61
62template<class Type>
63tmp
64<
66 <
68 >
69>
71(
73)
74{
75 typedef typename outerProduct<vector, Type>::type GradType;
77 (
78 fvc::grad(tssf())
79 );
80 tssf.clear();
81 return Grad;
82}
83
84
85template<class Type>
86tmp
87<
89 <
91 >
92>
94(
96 const word& name
97)
98{
100 (
101 vf.mesh(),
102 vf.mesh().gradScheme(name)
103 )().grad(vf, name);
104}
105
106
107template<class Type>
108tmp
109<
111 <
113 >
114>
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>
137tmp
138<
140 <
142 >
143>
145(
147)
148{
149 return fvc::grad(vf, "grad(" + vf.name() + ')');
150}
151
152
153template<class Type>
154tmp
155<
157 <
159 >
160>
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
Return mesh.
Generic GeometricField class.
const word & name() const noexcept
Return the object name.
Definition: IOobjectI.H:65
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
Definition: Time.C:717
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:82
static tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh > > gradf(const GeometricField< Type, fvsPatchField, surfaceMesh > &, const word &name)
Definition: gaussGrad.C:45
typeOfRank< typenamepTraits< arg1 >::cmptType, direction(pTraits< arg1 >::rank)+direction(pTraits< arg2 >::rank)>::type type
Definition: products.H:114
A class for managing temporary objects.
Definition: tmp.H:65
Mesh data needed to do the Finite Volume discretisation.
Definition: volMesh.H:54
type
Volume classification types.
Definition: volumeType.H:66
A class for handling words, derived from Foam::string.
Definition: word.H:68
Calculate the gradient of the given field.
Surface integrate surfaceField creating a volField. Surface sum a surfaceField creating a volField.
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh > > grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcGrad.C:54
Namespace for OpenFOAM.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59