harmonic.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 -------------------------------------------------------------------------------
10 License
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 Class
27  Foam::harmonic
28 
29 Group
30  grpFvSurfaceInterpolationSchemes
31 
32 Description
33  Harmonic-mean differencing scheme class.
34 
35  This scheme interpolates 1/field using a scheme specified at run-time
36  and return the reciprocal of the interpolate.
37 
38 SourceFiles
39  harmonic.C
40 
41 \*---------------------------------------------------------------------------*/
42 
43 #ifndef harmonic_H
44 #define harmonic_H
45 
47 #include "volFields.H"
48 #include "surfaceFields.H"
49 #include "reverseLinear.H"
50 
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 
53 namespace Foam
54 {
55 
56 /*---------------------------------------------------------------------------*\
57  Class harmonic Declaration
58 \*---------------------------------------------------------------------------*/
59 
60 class harmonic
61 :
62  public surfaceInterpolationScheme<scalar>
63 {
64  // Private Member Functions
65 
66  //- No copy assignment
67  void operator=(const harmonic&) = delete;
68 
69 
70 public:
71 
72  //- Runtime type information
73  TypeName("harmonic");
74 
75 
76  // Constructors
77 
78  //- Construct from mesh
79  harmonic(const fvMesh& mesh)
80  :
82  {}
83 
84  //- Construct from Istream.
85  // The name of the flux field is read from the Istream and looked-up
86  // from the mesh objectRegistry
88  (
89  const fvMesh& mesh,
90  Istream& is
91  )
92  :
94  {}
95 
96  //- Construct from faceFlux and Istream
98  (
99  const fvMesh& mesh,
100  const surfaceScalarField& faceFlux,
101  Istream& is
102  )
103  :
105  {}
106 
107 
108  // Member Functions
109 
110  //- Return the interpolation weighting factors
112  (
114  ) const
115  {
117 
118  return tmp<surfaceScalarField>(nullptr);
119  }
120 
121  //- Return the face-interpolate of the given cell field
124  (
126  ) const
127  {
128  return 1.0/(reverseLinear<scalar>(vf.mesh()).interpolate(1.0/vf));
129  }
130 };
131 
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
135 } // End namespace Foam
136 
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138 
139 #endif
140 
141 // ************************************************************************* //
volFields.H
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::harmonic::harmonic
harmonic(const fvMesh &mesh)
Construct from mesh.
Definition: harmonic.H:78
surfaceFields.H
Foam::surfaceFields.
Foam::harmonic::interpolate
virtual tmp< GeometricField< scalar, fvsPatchField, surfaceMesh > > interpolate(const GeometricField< scalar, fvPatchField, volMesh > &vf) const
Return the face-interpolate of the given cell field.
Definition: harmonic.H:123
Foam::reverseLinear
Inversed weight central-differencing interpolation scheme class.
Definition: reverseLinear.H:57
NotImplemented
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:517
Foam::harmonic::TypeName
TypeName("harmonic")
Runtime type information.
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
reverseLinear.H
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::surfaceInterpolationScheme
Abstract base class for surface interpolation schemes.
Definition: surfaceInterpolationScheme.H:57
Foam::surfaceInterpolationScheme< scalar >::mesh
const fvMesh & mesh() const
Return mesh reference.
Definition: surfaceInterpolationScheme.H:144
Foam::harmonic::weights
virtual tmp< surfaceScalarField > weights(const GeometricField< scalar, fvPatchField, volMesh > &) const
Return the interpolation weighting factors.
Definition: harmonic.H:111
Foam::harmonic
Harmonic-mean differencing scheme class.
Definition: harmonic.H:59
Foam::GeometricField< scalar, fvsPatchField, surfaceMesh >
surfaceInterpolationScheme.H