OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

LimitFuncs.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-2009 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 Namespace
00026     Foam::limitFuncs
00027 
00028 Description
00029     Namespace for limiting functions
00030 
00031 
00032 Class
00033     Foam::limitFuncs::LimitFuncs
00034 
00035 Description
00036     Class to create NVD/TVD limited weighting-factors.
00037 
00038     The particular differencing scheme class is supplied as a template
00039     argument, the weight function of which is called by the weight function
00040     of this class for the internal faces as well as faces of coupled
00041     patches (e.g. processor-processor patches). The weight function is
00042     supplied the central-differencing weighting factor, the face-flux, the
00043     cell and face gradients (from which the normalised variable
00044     distribution may be created) and the cell centre distance.
00045 
00046     This code organisation is both neat and efficient, allowing for
00047     convenient implementation of new schemes to run on parallelised cases.
00048 
00049 SourceFiles
00050     LimitFuncs.C
00051 
00052 \*---------------------------------------------------------------------------*/
00053 
00054 #ifndef LimitFuncs_H
00055 #define LimitFuncs_H
00056 
00057 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00058 
00059 namespace Foam
00060 {
00061 
00062 namespace limitFuncs
00063 {
00064 
00065 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00066 
00067 template<class Type>
00068 class null
00069 {
00070 public:
00071 
00072     null()
00073     {}
00074 
00075     inline tmp<GeometricField<Type, fvPatchField, volMesh> > operator()
00076     (
00077         const GeometricField<Type, fvPatchField, volMesh>& phi
00078     ) const
00079     {
00080         return phi;
00081     }
00082 };
00083 
00084 
00085 template<class Type>
00086 class magSqr
00087 {
00088 public:
00089 
00090     magSqr()
00091     {}
00092 
00093     inline tmp<volScalarField> operator()
00094     (
00095         const GeometricField<Type, fvPatchField, volMesh>&
00096     ) const;
00097 };
00098 
00099 
00100 template<class Type>
00101 class rhoMagSqr
00102 {
00103 public:
00104 
00105     rhoMagSqr()
00106     {}
00107 
00108     inline tmp<volScalarField> operator()
00109     (
00110         const GeometricField<Type, fvPatchField, volMesh>&
00111     ) const;
00112 };
00113 
00114 
00115 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00116 
00117 } // End namespace limitFuncs
00118 } // End namespace Foam
00119 
00120 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00121 
00122 #ifdef NoRepository
00123 #   include "LimitFuncs.C"
00124 #endif
00125 
00126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00127 
00128 #endif
00129 
00130 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd