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

limitWith.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::limitWith
00026 
00027 Description
00028     limitWith differencing scheme limits the specified scheme with the
00029     specified limiter.
00030 
00031 SourceFiles
00032     limitWith.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef limitWith_H
00037 #define limitWith_H
00038 
00039 #include <finiteVolume/surfaceInterpolationScheme.H>
00040 #include <finiteVolume/limitedSurfaceInterpolationScheme.H>
00041 
00042 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00043 
00044 namespace Foam
00045 {
00046 
00047 /*---------------------------------------------------------------------------*\
00048                            Class limitWith Declaration
00049 \*---------------------------------------------------------------------------*/
00050 
00051 template<class Type>
00052 class limitWith
00053 :
00054     public surfaceInterpolationScheme<Type>
00055 {
00056     // Private Member Functions
00057 
00058         //- Interpolation scheme
00059         tmp<surfaceInterpolationScheme<Type> > tInterp_;
00060 
00061         //- Limiter
00062         tmp<limitedSurfaceInterpolationScheme<Type> > tLimiter_;
00063 
00064 
00065         //- Disallow default bitwise copy construct
00066         limitWith(const limitWith&);
00067 
00068         //- Disallow default bitwise assignment
00069         void operator=(const limitWith&);
00070 
00071 
00072 public:
00073 
00074     //- Runtime type information
00075     TypeName("limitWith");
00076 
00077 
00078     // Constructors
00079 
00080         //- Construct from mesh and Istream.
00081         //  The name of the flux field is read from the Istream and looked-up
00082         //  from the mesh objectRegistry
00083         limitWith
00084         (
00085             const fvMesh& mesh,
00086             Istream& is
00087         )
00088         :
00089             surfaceInterpolationScheme<Type>(mesh),
00090             tInterp_
00091             (
00092                 surfaceInterpolationScheme<Type>::New(mesh, is)
00093             ),
00094             tLimiter_
00095             (
00096                 limitedSurfaceInterpolationScheme<Type>::New(mesh, is)
00097             )
00098         {}
00099 
00100         //- Construct from mesh, faceFlux and Istream
00101         limitWith
00102         (
00103             const fvMesh& mesh,
00104             const surfaceScalarField& faceFlux,
00105             Istream& is
00106         )
00107         :
00108             surfaceInterpolationScheme<Type>(mesh),
00109             tInterp_
00110             (
00111                 surfaceInterpolationScheme<Type>::New(mesh, faceFlux, is)
00112             ),
00113             tLimiter_
00114             (
00115                 limitedSurfaceInterpolationScheme<Type>::New(mesh, faceFlux, is)
00116             )
00117         {}
00118 
00119 
00120     // Member Functions
00121 
00122         //- Return the interpolation weighting factors
00123         virtual tmp<surfaceScalarField> weights
00124         (
00125             const GeometricField<Type, fvPatchField, volMesh>& vf
00126         ) const
00127         {
00128             return tLimiter_().weights
00129             (
00130                 vf,
00131                 tInterp_().weights(vf),
00132                 tLimiter_().limiter(vf)
00133             );
00134         }
00135 
00136         //- Return true if this scheme uses an explicit correction
00137         virtual bool corrected() const
00138         {
00139             return tInterp_().corrected();
00140         }
00141 
00142         //- Return the explicit correction to the face-interpolate
00143         //  for the given field
00144         virtual tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
00145         correction(const GeometricField<Type, fvPatchField, volMesh>& vf) const
00146         {
00147             return tLimiter_().limiter(vf)*tInterp_().correction(vf);
00148         }
00149 };
00150 
00151 
00152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00153 
00154 } // End namespace Foam
00155 
00156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00157 
00158 #endif
00159 
00160 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines