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

multivariateUpwind.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::multivariateUpwind
00026 
00027 Description
00028     Upwind-difference form of the multivariate surfaceInterpolationScheme.
00029 
00030 SourceFiles
00031     multivariateUpwindmake.C
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef multivariateUpwind_H
00036 #define multivariateUpwind_H
00037 
00038 #include <finiteVolume/multivariateSurfaceInterpolationScheme.H>
00039 #include <finiteVolume/surfaceFields.H>
00040 
00041 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00042 
00043 namespace Foam
00044 {
00045 
00046 /*---------------------------------------------------------------------------*\
00047                            Class multivariateUpwind Declaration
00048 \*---------------------------------------------------------------------------*/
00049 
00050 template<class Type>
00051 class multivariateUpwind
00052 :
00053     public multivariateSurfaceInterpolationScheme<Type>
00054 {
00055     // Private data
00056 
00057         const surfaceScalarField& faceFlux_;
00058 
00059 
00060     // Private Member Functions
00061 
00062         //- Disallow default bitwise copy construct
00063         multivariateUpwind(const multivariateUpwind&);
00064 
00065         //- Disallow default bitwise assignment
00066         void operator=(const multivariateUpwind&);
00067 
00068 
00069 public:
00070 
00071     //- Runtime type information
00072     TypeName("upwind");
00073 
00074 
00075     // Constructors
00076 
00077         //- Construct for field, faceFlux and Istream
00078         multivariateUpwind
00079         (
00080             const fvMesh& mesh,
00081             const typename multivariateSurfaceInterpolationScheme<Type>::
00082                 fieldTable& fields,
00083             const surfaceScalarField& faceFlux,
00084             Istream& schemeData
00085         )
00086         :
00087             multivariateSurfaceInterpolationScheme<Type>
00088             (
00089                 mesh,
00090                 fields,
00091                 faceFlux,
00092                 schemeData
00093             ),
00094             faceFlux_(faceFlux)
00095         {}
00096 
00097 
00098     // Member Operators
00099 
00100         //- surfaceInterpolationScheme sub-class returned by operator(field)
00101         //  which is used as the interpolation scheme for the field
00102         class fieldScheme
00103         :
00104             public multivariateSurfaceInterpolationScheme<Type>::fieldScheme
00105         {
00106             // Private data
00107 
00108                 const surfaceScalarField& faceFlux_;
00109 
00110         public:
00111 
00112             // Constructors
00113             
00114                 fieldScheme
00115                 (
00116                     const GeometricField<Type, fvPatchField, volMesh>& field,
00117                     const surfaceScalarField& faceFlux
00118                 )
00119                 :
00120                     multivariateSurfaceInterpolationScheme<Type>::
00121                         fieldScheme(field),
00122                     faceFlux_(faceFlux)
00123                 {}
00124 
00125 
00126             // Member Functions
00127 
00128                 //- Return the interpolation weighting factors
00129                 tmp<surfaceScalarField> weights
00130                 (
00131                     const GeometricField<Type, fvPatchField, volMesh>&
00132                 ) const
00133                 {
00134                     return pos(faceFlux_);
00135                 }
00136         };
00137 
00138         tmp<surfaceInterpolationScheme<Type> > operator()
00139         (
00140             const GeometricField<Type, fvPatchField, volMesh>& field
00141         ) const
00142         {
00143             return tmp<surfaceInterpolationScheme<Type> >
00144             (
00145                 new fieldScheme(field, faceFlux_)
00146             );
00147         }
00148 };
00149 
00150 
00151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00152 
00153 } // End namespace Foam
00154 
00155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00156 
00157 #endif
00158 
00159 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines