1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by
13 the Free Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 Foam::pressureGradientExplicitSource
28 Creates a cell set pressure gradient source
30 Note: Currently only handles kinematic pressure
33 pressureGradientExplicitSource.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef pressureGradientExplicitSource_H
38 #define pressureGradientExplicitSource_H
41 #include "topoSetSource.H"
44 #include "volFields.H"
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 /*---------------------------------------------------------------------------*\
52 Class pressureGradientExplicitSource Declaration
53 \*---------------------------------------------------------------------------*/
55 class pressureGradientExplicitSource
59 //- Name of the source
60 const word sourceName_;
62 //- Reference to the mesh
65 //- Reference to the velocity field
68 //- Properties dictionary
74 //- Initial pressure gradient
75 dimensionedScalar gradPini_;
78 dimensionedScalar gradP_;
83 //- Name of cell source
86 //- The method by which the cells will be selected
87 autoPtr<topoSetSource> cellSelector_;
89 //- The set of selected cells
90 cellSet selectedCellSet_;
93 // Private Member Functions
95 //- Write the pressure gradient to file (for restarts etc)
96 void writeGradP() const;
98 //- Disallow default bitwise copy construct
99 pressureGradientExplicitSource(const pressureGradientExplicitSource&);
101 //- Disallow default bitwise assignment
102 void operator=(const pressureGradientExplicitSource&);
109 //- Construct from explicit source name and mesh
110 pressureGradientExplicitSource
112 const word& sourceName,
121 //- Return a tmp field of the source
122 tmp<DimensionedField<vector, volMesh> > Su() const;
125 //- Correct driving force for a constant mass flow rate
130 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 } // End namespace Foam
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138 // ************************************************************************* //