Home
Downloads
Documentation
Installation
User Guide
man-pages
API Documentation
README
Release Notes
Changes
License
Support
SourceForge Project
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
src
finiteVolume
interpolation
surfaceInterpolation
schemes
harmonic
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 | Copyright (C) 1991-2010 OpenCFD Ltd.
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
41
#include <
finiteVolume/surfaceInterpolationScheme.H
>
42
#include <
finiteVolume/volFields.H
>
43
#include <
finiteVolume/surfaceFields.H
>
44
#include <
finiteVolume/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
// Private Member Functions
60
61
//- Disallow default bitwise assignment
62
void
operator=(
const
harmonic
&);
63
64
65
public
:
66
67
//- Runtime type information
68
TypeName
(
"harmonic"
);
69
70
71
// Constructors
72
73
//- Construct from mesh
74
harmonic
(
const
fvMesh
&
mesh
)
75
:
76
surfaceInterpolationScheme
<scalar>(mesh)
77
{}
78
79
//- Construct from Istream.
80
// The name of the flux field is read from the Istream and looked-up
81
// from the mesh objectRegistry
82
harmonic
83
(
84
const
fvMesh
&
mesh
,
85
Istream
& is
86
)
87
:
88
surfaceInterpolationScheme<scalar>
(
mesh
)
89
{}
90
91
//- Construct from faceFlux and Istream
92
harmonic
93
(
94
const
fvMesh
& mesh,
95
const
surfaceScalarField
& faceFlux,
96
Istream
& is
97
)
98
:
99
surfaceInterpolationScheme<scalar>
(
mesh
)
100
{}
101
102
103
// Member Functions
104
105
//- Return the interpolation weighting factors
106
virtual
tmp<surfaceScalarField>
weights
107
(
108
const
GeometricField<scalar, fvPatchField, volMesh>
&
109
)
const
110
{
111
notImplemented
112
(
113
"harmonic::weights"
114
"(const GeometricField<scalar, fvPatchField, volMesh>&)"
115
);
116
117
return
tmp<surfaceScalarField>
(NULL);
118
}
119
120
//- Return the face-interpolate of the given cell field
121
virtual
tmp<GeometricField<scalar, fvsPatchField, surfaceMesh>
>
122
interpolate
123
(
124
const
GeometricField<scalar, fvPatchField, volMesh>
& vf
125
)
const
126
{
127
return
1.0/(
reverseLinear<scalar>
(vf.
mesh
()).
interpolate
(1.0/vf));
128
}
129
};
130
131
132
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
133
134
}
// End namespace Foam
135
136
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137
138
#endif
139
140
// ************************ vim: set sw=4 sts=4 et: ************************ //