OpenFOAM logo
Open Source CFD Toolkit

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