fvcReconstruct.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 "fvcReconstruct.H"
29#include "fvMesh.H"
30#include "volFields.H"
31#include "surfaceFields.H"
32#include "fvcSurfaceIntegrate.H"
34
35// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
36
37namespace Foam
38{
39
40// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41
42namespace fvc
43{
44
45// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46
47template<class Type>
48tmp
49<
50 GeometricField
51 <
52 typename outerProduct<vector,Type>::type, fvPatchField, volMesh
53 >
54>
56(
58)
59{
60 typedef typename outerProduct<vector, Type>::type GradType;
61
62 const fvMesh& mesh = ssf.mesh();
63
64 surfaceVectorField SfHat(mesh.Sf()/mesh.magSf());
65
67 (
69 (
71 (
72 "volIntegrate("+ssf.name()+')',
73 ssf.instance(),
74 mesh,
77 ),
78 inv(surfaceSum(SfHat*mesh.Sf()))&surfaceSum(SfHat*ssf),
80 )
81 );
82
83 treconField.ref().correctBoundaryConditions();
84
85 return treconField;
86}
87
88
89template<class Type>
90tmp
91<
93 <
95 >
96>
98(
100)
101{
102 typedef typename outerProduct<vector, Type>::type GradType;
104 (
105 fvc::reconstruct(tssf())
106 );
107 tssf.clear();
108 return tvf;
109}
110
111
112// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
113
114} // End namespace fvc
115
116// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
117
118} // End namespace Foam
119
120// ************************************************************************* //
const Mesh & mesh() const
Return mesh.
Generic GeometricField class.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:170
const word & name() const noexcept
Return the object name.
Definition: IOobjectI.H:65
const fileName & instance() const noexcept
Read access to instance path component.
Definition: IOobjectI.H:196
This boundary condition applies a zero-gradient condition from the patch internal field onto the patc...
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:82
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
T & ref() const
Definition: tmpI.H:227
Mesh data needed to do the Finite Volume discretisation.
Definition: volMesh.H:54
type
Volume classification types.
Definition: volumeType.H:66
dynamicFvMesh & mesh
Reconstruct volField from a face flux field.
Surface integrate surfaceField creating a volField. Surface sum a surfaceField creating a volField.
tmp< GeometricField< Type, fvPatchField, volMesh > > surfaceSum(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh > > reconstruct(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Namespace for OpenFOAM.
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
Foam::surfaceFields.