![]() |
|
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 upwindEdgeInterpolation 00027 00028 Description 00029 Upwind differencing scheme class. 00030 00031 SourceFiles 00032 upwindEdgeInterpolation.C 00033 00034 \*---------------------------------------------------------------------------*/ 00035 00036 #ifndef upwindEdgeInterpolation_H 00037 #define upwindEdgeInterpolation_H 00038 00039 #include "edgeInterpolationScheme.H" 00040 #include "areaFields.H" 00041 #include "edgeFields.H" 00042 00043 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00044 00045 namespace Foam 00046 { 00047 00048 /*---------------------------------------------------------------------------*\ 00049 Class upwind Declaration 00050 \*---------------------------------------------------------------------------*/ 00051 00052 template<class Type> 00053 class upwindEdgeInterpolation 00054 : 00055 virtual public edgeInterpolationScheme<Type> 00056 { 00057 // Private data 00058 00059 const edgeScalarField& faceFlux_; 00060 00061 00062 // Private Member Functions 00063 00064 //- Disallow default bitwise assignment 00065 void operator=(const upwindEdgeInterpolation&); 00066 00067 00068 public: 00069 00070 //- Runtime type information 00071 TypeName("upwind"); 00072 00073 00074 // Constructors 00075 00076 //- Construct from faceFlux 00077 upwindEdgeInterpolation 00078 ( 00079 const faMesh& mesh, 00080 const edgeScalarField& faceFlux 00081 ) 00082 : 00083 edgeInterpolationScheme<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 database 00090 upwindEdgeInterpolation 00091 ( 00092 const faMesh& mesh, 00093 Istream& is 00094 ) 00095 : 00096 edgeInterpolationScheme<Type>(mesh), 00097 faceFlux_ 00098 ( 00099 mesh().objectRegistry::lookupObject<edgeScalarField> 00100 ( 00101 word(is) 00102 ) 00103 ) 00104 {} 00105 00106 //- Construct from faceFlux and Istream 00107 upwindEdgeInterpolation 00108 ( 00109 const faMesh& mesh, 00110 const edgeScalarField& faceFlux, 00111 Istream& 00112 ) 00113 : 00114 edgeInterpolationScheme<Type>(mesh), 00115 faceFlux_(faceFlux) 00116 {} 00117 00118 00119 // Member Functions 00120 00121 //- Return the interpolation weighting factors 00122 virtual tmp<edgeScalarField> weights 00123 ( 00124 const GeometricField<Type, faPatchField, areaMesh>& 00125 ) const 00126 { 00127 return pos(faceFlux_); 00128 } 00129 }; 00130 00131 00132 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00133 00134 } // End namespace Foam 00135 00136 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00137 00138 #endif 00139 00140 // ************************************************************************* //