|
|
|
faceZonesIntegration.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) 2009-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::faceZonesIntegration 00027 00028 Description 00029 Integrates surfaceScalarFields on faceZones 00030 00031 SourceFiles 00032 faceZonesIntegration.C 00033 IOfaceZonesIntegration.H 00034 00035 \*---------------------------------------------------------------------------*/ 00036 00037 #ifndef faceZonesIntegration_H 00038 #define faceZonesIntegration_H 00039 00040 #include "fvCFD.H" 00041 #include "primitiveFieldsFwd.H" 00042 #include "volFieldsFwd.H" 00043 #include "HashPtrTable.H" 00044 #include "OFstream.H" 00045 #include "Switch.H" 00046 #include "pointFieldFwd.H" 00047 #include "polyMesh.H" 00048 00049 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00050 00051 namespace Foam 00052 { 00053 00054 // Forward declaration of classes 00055 class objectRegistry; 00056 class dictionary; 00057 class mapPolyMesh; 00058 00059 /*---------------------------------------------------------------------------*\ 00060 Class faceZonesIntegration Declaration 00061 \*---------------------------------------------------------------------------*/ 00062 00063 class faceZonesIntegration 00064 { 00065 00066 protected: 00067 00068 // Private data 00069 00070 //- Name of this set of face zone integration, 00071 // Also used as the name of the probes directory. 00072 word name_; 00073 00074 const objectRegistry& obr_; 00075 00076 //- on/off switch 00077 bool active_; 00078 00079 //- Switch to send output to Info as well as to file 00080 Switch log_; 00081 00082 //- Current open files 00083 HashPtrTable<OFstream> faceZonesIntegrationFilePtr_; 00084 00085 // Read from dictionary 00086 00087 //- faceZones to integrate over 00088 wordList faceZonesSet_; 00089 00090 //- Names of the surface fields 00091 wordList fItems_; 00092 00093 00094 // Private Member Functions 00095 00096 //- If the integration file has not been created create it 00097 void makeFile(); 00098 00099 scalar calcFaceZonesIntegral 00100 ( 00101 const surfaceScalarField& fD, 00102 const faceZone& fz 00103 ) const; 00104 00105 00106 //- Disallow default bitwise copy construct 00107 faceZonesIntegration(const faceZonesIntegration&); 00108 00109 //- Disallow default bitwise assignment 00110 void operator=(const faceZonesIntegration&); 00111 00112 //- Output file header information 00113 virtual void writeFileHeader(); 00114 00115 00116 public: 00117 00118 //- Runtime type information 00119 TypeName("faceZonesIntegration"); 00120 00121 00122 // Constructors 00123 00124 //- Construct for given objectRegistry and dictionary. 00125 // Allow the possibility to load fields from files 00126 faceZonesIntegration 00127 ( 00128 const word& name, 00129 const objectRegistry&, 00130 const dictionary&, 00131 const bool loadFromFiles = false 00132 ); 00133 00134 00135 // Destructor 00136 00137 virtual ~faceZonesIntegration(); 00138 00139 00140 // Member Functions 00141 00142 //- Return name of the set of zones 00143 virtual const word& name() const 00144 { 00145 return name_; 00146 }; 00147 00148 //- Read the zone integration data 00149 virtual void read(const dictionary&); 00150 00151 //- Execute, currently does nothing 00152 virtual void execute(); 00153 00154 //- Execute at the final time-loop, currently does nothing 00155 virtual void end(); 00156 00157 //- Write the integration 00158 virtual void write(); 00159 00160 //- Update for changes of mesh 00161 virtual void updateMesh(const mapPolyMesh&) 00162 {} 00163 00164 //- Update for changes of mesh 00165 virtual void movePoints(const pointField&) 00166 {} 00167 }; 00168 00169 00170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00171 00172 } // End namespace Foam 00173 00174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00175 00176 #endif 00177 00178 // ************************************************************************* // |