OpenFOAM logo
Open Source CFD Toolkit

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