Home
Downloads
Documentation
Installation
User Guide
man-pages
API Documentation
README
Release Notes
Changes
License
Support
SourceForge Project
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
src
finiteVolume
cfdTools
general
fieldSources
pressureGradientExplicitSource
pressureGradientExplicitSource.H
Go to the documentation of this file.
1
/*---------------------------------------------------------------------------*\
2
========= |
3
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4
\\ / O peration |
5
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
6
\\/ M anipulation |
7
-------------------------------------------------------------------------------
8
License
9
This file is part of OpenFOAM.
10
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.
15
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
19
for more details.
20
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/>.
23
24
Class
25
Foam::pressureGradientExplicitSource
26
27
Description
28
Creates a cell set pressure gradient source
29
30
Note: Currently only handles kinematic pressure
31
32
SourceFiles
33
pressureGradientExplicitSource.C
34
35
\*---------------------------------------------------------------------------*/
36
37
#ifndef pressureGradientExplicitSource_H
38
#define pressureGradientExplicitSource_H
39
40
#include <
OpenFOAM/autoPtr.H
>
41
#include <
meshTools/topoSetSource.H
>
42
#include <
meshTools/cellSet.H
>
43
#include <
finiteVolume/fvMesh.H
>
44
#include <
finiteVolume/volFields.H
>
45
46
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47
48
namespace
Foam
49
{
50
51
/*---------------------------------------------------------------------------*\
52
Class pressureGradientExplicitSource Declaration
53
\*---------------------------------------------------------------------------*/
54
55
class
pressureGradientExplicitSource
56
{
57
// Private data
58
59
//- Name of the source
60
const
word
sourceName_;
61
62
//- Reference to the mesh
63
const
fvMesh
& mesh_;
64
65
//- Reference to the velocity field
66
volVectorField
& U_;
67
68
//- Properties dictionary
69
IOdictionary
dict_;
70
71
//- Average velocity
72
vector
Ubar_;
73
74
//- Initial pressure gradient
75
dimensionedScalar
gradPini_;
76
77
//- Pressure gradient
78
dimensionedScalar
gradP_;
79
80
//- Flow direction
81
vector
flowDir_;
82
83
//- Name of cell source
84
word
cellSource_;
85
86
//- The method by which the cells will be selecetd
87
autoPtr<topoSetSource>
cellSelector_;
88
89
//- The set of selected cells
90
cellSet
selectedCellSet_;
91
92
93
// Private Member Functions
94
95
//- Write the pressure gradient to file (for restarts etc)
96
void
writeGradP()
const
;
97
98
//- Disallow default bitwise copy construct
99
pressureGradientExplicitSource
(
const
pressureGradientExplicitSource
&);
100
101
//- Disallow default bitwise assignment
102
void
operator=(
const
pressureGradientExplicitSource
&);
103
104
105
public
:
106
107
// Constructors
108
109
//- Construct from explicit source name and mesh
110
pressureGradientExplicitSource
111
(
112
const
word
& sourceName,
113
volVectorField
&
U
114
);
115
116
117
// Member Functions
118
119
// Access
120
121
//- Return a tmp field of the source
122
tmp<DimensionedField<vector, volMesh>
>
Su
()
const
;
123
124
125
//- Correct driving force for a constant mass flow rate
126
void
update
();
127
};
128
129
130
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
131
132
}
// End namespace Foam
133
134
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135
136
#endif
137
138
// ************************ vim: set sw=4 sts=4 et: ************************ //