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