harmonic.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::harmonic
26 
27 Description
28  Harmonic-mean differencing scheme class.
29 
30  This scheme interpolates 1/field using a scheme specified at run-time
31  and return the reciprocal of the interpolate.
32 
33 SourceFiles
34  harmonic.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef harmonic_H
39 #define harmonic_H
40 
42 #include "volFields.H"
43 #include "surfaceFields.H"
44 #include "reverseLinear.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 /*---------------------------------------------------------------------------*\
52  Class harmonic Declaration
53 \*---------------------------------------------------------------------------*/
54 
55 class harmonic
56 :
57  public surfaceInterpolationScheme<scalar>
58 {
59 
60 public:
61 
62  //- Runtime type information
63  TypeName("harmonic");
64 
65 
66  // Constructors
67 
68  //- Construct from mesh
69  harmonic(const fvMesh& mesh)
70  :
71  surfaceInterpolationScheme<scalar>(mesh)
72  {}
73 
74  //- Construct from Istream.
75  // The name of the flux field is read from the Istream and looked-up
76  // from the mesh objectRegistry
78  (
79  const fvMesh& mesh,
80  Istream& is
81  )
82  :
83  surfaceInterpolationScheme<scalar>(mesh)
84  {}
85 
86  //- Construct from faceFlux and Istream
88  (
89  const fvMesh& mesh,
90  const surfaceScalarField& faceFlux,
91  Istream& is
92  )
93  :
94  surfaceInterpolationScheme<scalar>(mesh)
95  {}
96 
97 
98  // Member Functions
99 
100  //- Return the interpolation weighting factors
102  (
104  ) const
105  {
107 
108  return tmp<surfaceScalarField>(nullptr);
109  }
110 
111  //- Return the face-interpolate of the given cell field
114  (
116  ) const
117  {
118  return 1.0/(reverseLinear<scalar>(vf.mesh()).interpolate(1.0/vf));
119  }
120 
121 
122  // Member Operators
123 
124  //- Disallow default bitwise assignment
125  void operator=(const harmonic&) = delete;
126 };
127 
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 } // End namespace Foam
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
135 #endif
136 
137 // ************************************************************************* //
Foam::surfaceFields.
Inversed weight central-differencing interpolation scheme class.
Definition: reverseLinear.H:52
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
void operator=(const harmonic &)=delete
Disallow default bitwise assignment.
virtual tmp< surfaceScalarField > weights(const GeometricField< scalar, fvPatchField, volMesh > &) const
Return the interpolation weighting factors.
Definition: harmonic.H:101
const Mesh & mesh() const
Return mesh.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
harmonic(const fvMesh &mesh)
Construct from mesh.
Definition: harmonic.H:68
TypeName("harmonic")
Runtime type information.
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:113
A class for managing temporary objects.
Definition: PtrList.H:53
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:370
Abstract base class for surface interpolation schemes.
Namespace for OpenFOAM.
Harmonic-mean differencing scheme class.
Definition: harmonic.H:54