FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

harmonic.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software: you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
00023 
00024 Class
00025     Foam::harmonic
00026 
00027 Description
00028     Harmonic-mean differencing scheme class.
00029 
00030     This scheme interpolates 1/field using a scheme specified at run-time
00031     and return the reciprocal of the interpolate.
00032 
00033 SourceFiles
00034     harmonic.C
00035 
00036 \*---------------------------------------------------------------------------*/
00037 
00038 #ifndef harmonic_H
00039 #define harmonic_H
00040 
00041 #include <finiteVolume/surfaceInterpolationScheme.H>
00042 #include <finiteVolume/volFields.H>
00043 #include <finiteVolume/surfaceFields.H>
00044 #include <finiteVolume/reverseLinear.H>
00045 
00046 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00047 
00048 namespace Foam
00049 {
00050 
00051 /*---------------------------------------------------------------------------*\
00052                            Class harmonic Declaration
00053 \*---------------------------------------------------------------------------*/
00054 
00055 class harmonic
00056 :
00057     public surfaceInterpolationScheme<scalar>
00058 {
00059     // Private Member Functions
00060 
00061         //- Disallow default bitwise assignment
00062         void operator=(const harmonic&);
00063 
00064 
00065 public:
00066 
00067     //- Runtime type information
00068     TypeName("harmonic");
00069 
00070 
00071     // Constructors
00072 
00073         //- Construct from mesh
00074         harmonic(const fvMesh& mesh)
00075         :
00076             surfaceInterpolationScheme<scalar>(mesh)
00077         {}
00078 
00079         //- Construct from Istream.
00080         //  The name of the flux field is read from the Istream and looked-up
00081         //  from the mesh objectRegistry
00082         harmonic
00083         (
00084             const fvMesh& mesh,
00085             Istream& is
00086         )
00087         :
00088             surfaceInterpolationScheme<scalar>(mesh)
00089         {}
00090 
00091         //- Construct from faceFlux and Istream
00092         harmonic
00093         (
00094             const fvMesh& mesh,
00095             const surfaceScalarField& faceFlux,
00096             Istream& is
00097         )
00098         :
00099             surfaceInterpolationScheme<scalar>(mesh)
00100         {}
00101 
00102 
00103     // Member Functions
00104 
00105         //- Return the interpolation weighting factors
00106         virtual tmp<surfaceScalarField> weights
00107         (
00108             const GeometricField<scalar, fvPatchField, volMesh>&
00109         ) const
00110         {
00111             notImplemented
00112             (
00113                 "harmonic::weights"
00114                 "(const GeometricField<scalar, fvPatchField, volMesh>&)"
00115             );
00116 
00117             return tmp<surfaceScalarField>(NULL);
00118         }
00119 
00120         //- Return the face-interpolate of the given cell field
00121         virtual tmp<GeometricField<scalar, fvsPatchField, surfaceMesh> >
00122         interpolate
00123         (
00124             const GeometricField<scalar, fvPatchField, volMesh>& vf
00125         ) const
00126         {
00127             return 1.0/(reverseLinear<scalar>(vf.mesh()).interpolate(1.0/vf));
00128         }
00129 };
00130 
00131 
00132 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00133 
00134 } // End namespace Foam
00135 
00136 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00137 
00138 #endif
00139 
00140 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines