|
|
|
PhiScheme.HGo 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 Class 00026 Foam::PhiScheme 00027 00028 Description 00029 Class to create the weighting-factors based on the face-flux. 00030 00031 The particular differencing scheme class is supplied as a template 00032 argument, the weight function of which is called by the weight function 00033 of this class for the internal faces as well as faces of coupled 00034 patches (e.g. processor-processor patches). The weight function is 00035 supplied with the central-differencing weighting factor, the face-flux, 00036 the face neighbour cell values and the face area. 00037 00038 This code organisation is both neat and efficient, allowing for 00039 convenient implementation of new schemes to run on parallelised cases. 00040 00041 SourceFiles 00042 PhiScheme.C 00043 00044 \*---------------------------------------------------------------------------*/ 00045 00046 #ifndef PhiScheme_H 00047 #define PhiScheme_H 00048 00049 #include "limitedSurfaceInterpolationScheme.H" 00050 00051 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00052 00053 namespace Foam 00054 { 00055 00056 /*---------------------------------------------------------------------------*\ 00057 Class PhiScheme Declaration 00058 \*---------------------------------------------------------------------------*/ 00059 00060 template<class Type, class PhiLimiter> 00061 class PhiScheme 00062 : 00063 public limitedSurfaceInterpolationScheme<Type>, 00064 public PhiLimiter 00065 { 00066 // Private Member Functions 00067 00068 //- Disallow default bitwise copy construct 00069 PhiScheme(const PhiScheme&); 00070 00071 //- Disallow default bitwise assignment 00072 void operator=(const PhiScheme&); 00073 00074 00075 public: 00076 00077 //- Runtime type information 00078 TypeName("PhiScheme"); 00079 00080 00081 // Constructors 00082 00083 //- Construct from mesh, faceFlux and blendingFactor 00084 PhiScheme 00085 ( 00086 const fvMesh& mesh, 00087 const surfaceScalarField& faceFlux, 00088 const PhiLimiter& weight 00089 ) 00090 : 00091 limitedSurfaceInterpolationScheme<Type>(mesh, faceFlux), 00092 PhiLimiter(weight) 00093 {} 00094 00095 //- Construct from mesh and Istream. 00096 // The name of the flux field is read from the Istream and looked-up 00097 // from the mesh objectRegistry 00098 PhiScheme 00099 ( 00100 const fvMesh& mesh, 00101 Istream& is 00102 ) 00103 : 00104 limitedSurfaceInterpolationScheme<Type>(mesh, is), 00105 PhiLimiter(is) 00106 {} 00107 00108 //- Construct from mesh, faceFlux and Istream 00109 PhiScheme 00110 ( 00111 const fvMesh& mesh, 00112 const surfaceScalarField& faceFlux, 00113 Istream& is 00114 ) 00115 : 00116 limitedSurfaceInterpolationScheme<Type>(mesh, faceFlux), 00117 PhiLimiter(is) 00118 {} 00119 00120 00121 // Member Functions 00122 00123 //- Return the interpolation weighting factors 00124 virtual tmp<surfaceScalarField> limiter 00125 ( 00126 const GeometricField<Type, fvPatchField, volMesh>& 00127 ) const; 00128 }; 00129 00130 00131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00132 00133 } // End namespace Foam 00134 00135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00136 00137 // Add the patch constructor functions to the hash tables 00138 00139 #define makePhiSurfaceInterpolationScheme(SS, WEIGHT, TYPE) \ 00140 \ 00141 typedef PhiScheme<TYPE, WEIGHT> Phischeme##WEIGHT_; \ 00142 defineTemplateTypeNameAndDebugWithName(Phischeme##WEIGHT_, #SS, 0); \ 00143 \ 00144 surfaceInterpolationScheme<TYPE>::addMeshConstructorToTable \ 00145 <PhiScheme<TYPE, WEIGHT> > add##SS##TYPE##MeshConstructorToTable_; \ 00146 \ 00147 surfaceInterpolationScheme<TYPE>::addMeshFluxConstructorToTable \ 00148 <PhiScheme<TYPE, WEIGHT> > add##SS##TYPE##MeshFluxConstructorToTable_; \ 00149 \ 00150 limitedSurfaceInterpolationScheme<TYPE>::addMeshConstructorToTable \ 00151 <PhiScheme<TYPE, WEIGHT> > add##SS##TYPE##MeshConstructorToLimitedTable_; \ 00152 \ 00153 limitedSurfaceInterpolationScheme<TYPE>::addMeshFluxConstructorToTable \ 00154 <PhiScheme<TYPE, WEIGHT> > add##SS##TYPE##MeshFluxConstructorToLimitedTable_; 00155 00156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00157 00158 #ifdef NoRepository 00159 # include "PhiScheme.C" 00160 #endif 00161 00162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00163 00164 #endif 00165 00166 // ************************************************************************* // |