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

downwind.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::downwind
00026 
00027 Description
00028     Downwind differencing scheme class.
00029 
00030 SourceFiles
00031     downwind.C
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef downwind_H
00036 #define downwind_H
00037 
00038 #include <finiteVolume/surfaceInterpolationScheme.H>
00039 #include <finiteVolume/volFields.H>
00040 #include <finiteVolume/surfaceFields.H>
00041 
00042 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00043 
00044 namespace Foam
00045 {
00046 
00047 /*---------------------------------------------------------------------------*\
00048                            Class downwind Declaration
00049 \*---------------------------------------------------------------------------*/
00050 
00051 template<class Type>
00052 class downwind
00053 :
00054     public surfaceInterpolationScheme<Type>
00055 {
00056     // Private data
00057 
00058         const surfaceScalarField& faceFlux_;
00059 
00060 
00061     // Private Member Functions
00062 
00063         //- Disallow default bitwise assignment
00064         void operator=(const downwind&);
00065 
00066 
00067 public:
00068 
00069     //- Runtime type information
00070     TypeName("downwind");
00071 
00072 
00073     // Constructors
00074 
00075         //- Construct from faceFlux
00076         downwind
00077         (
00078             const fvMesh& mesh,
00079             const surfaceScalarField& faceFlux
00080         )
00081         :
00082             surfaceInterpolationScheme<Type>(mesh),
00083             faceFlux_(faceFlux)
00084         {}
00085 
00086         //- Construct from Istream. 
00087         //  The name of the flux field is read from the Istream and looked-up
00088         //  from the mesh objectRegistry
00089         downwind
00090         (
00091             const fvMesh& mesh,
00092             Istream& is
00093         )
00094         :
00095             surfaceInterpolationScheme<Type>(mesh),
00096             faceFlux_
00097             (
00098                 mesh.lookupObject<surfaceScalarField>
00099                 (
00100                     word(is)
00101                 )
00102             )
00103         {}
00104 
00105         //- Construct from faceFlux and Istream
00106         downwind
00107         (
00108             const fvMesh& mesh,
00109             const surfaceScalarField& faceFlux,
00110             Istream&
00111         )
00112         :
00113             surfaceInterpolationScheme<Type>(mesh),
00114             faceFlux_(faceFlux)
00115         {}
00116 
00117 
00118     // Member Functions
00119 
00120         //- Return the interpolation weighting factors
00121         virtual tmp<surfaceScalarField> weights
00122         (
00123             const GeometricField<Type, fvPatchField, volMesh>&
00124         ) const
00125         {
00126             return neg(faceFlux_);
00127         }
00128 };
00129 
00130 
00131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00132 
00133 } // End namespace Foam
00134 
00135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00136 
00137 #endif
00138 
00139 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines