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::pressureGradientExplicitSource 00026 00027 Description 00028 Creates a cell set pressure gradient source 00029 00030 Note: Currently only handles kinematic pressure 00031 00032 SourceFiles 00033 pressureGradientExplicitSource.C 00034 00035 \*---------------------------------------------------------------------------*/ 00036 00037 #ifndef pressureGradientExplicitSource_H 00038 #define pressureGradientExplicitSource_H 00039 00040 #include <OpenFOAM/autoPtr.H> 00041 #include <meshTools/topoSetSource.H> 00042 #include <meshTools/cellSet.H> 00043 #include <finiteVolume/fvMesh.H> 00044 #include <finiteVolume/volFields.H> 00045 00046 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00047 00048 namespace Foam 00049 { 00050 00051 /*---------------------------------------------------------------------------*\ 00052 Class pressureGradientExplicitSource Declaration 00053 \*---------------------------------------------------------------------------*/ 00054 00055 class pressureGradientExplicitSource 00056 { 00057 // Private data 00058 00059 //- Name of the source 00060 const word sourceName_; 00061 00062 //- Reference to the mesh 00063 const fvMesh& mesh_; 00064 00065 //- Reference to the velocity field 00066 volVectorField& U_; 00067 00068 //- Properties dictionary 00069 IOdictionary dict_; 00070 00071 //- Average velocity 00072 vector Ubar_; 00073 00074 //- Initial pressure gradient 00075 dimensionedScalar gradPini_; 00076 00077 //- Pressure gradient 00078 dimensionedScalar gradP_; 00079 00080 //- Flow direction 00081 vector flowDir_; 00082 00083 //- Name of cell source 00084 word cellSource_; 00085 00086 //- The method by which the cells will be selecetd 00087 autoPtr<topoSetSource> cellSelector_; 00088 00089 //- The set of selected cells 00090 cellSet selectedCellSet_; 00091 00092 00093 // Private Member Functions 00094 00095 //- Write the pressure gradient to file (for restarts etc) 00096 void writeGradP() const; 00097 00098 //- Disallow default bitwise copy construct 00099 pressureGradientExplicitSource(const pressureGradientExplicitSource&); 00100 00101 //- Disallow default bitwise assignment 00102 void operator=(const pressureGradientExplicitSource&); 00103 00104 00105 public: 00106 00107 // Constructors 00108 00109 //- Construct from explicit source name and mesh 00110 pressureGradientExplicitSource 00111 ( 00112 const word& sourceName, 00113 volVectorField& U 00114 ); 00115 00116 00117 // Member Functions 00118 00119 // Access 00120 00121 //- Return a tmp field of the source 00122 tmp<DimensionedField<vector, volMesh> > Su() const; 00123 00124 00125 //- Correct driving force for a constant mass flow rate 00126 void update(); 00127 }; 00128 00129 00130 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00131 00132 } // End namespace Foam 00133 00134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00135 00136 #endif 00137 00138 // ************************ vim: set sw=4 sts=4 et: ************************ //