FreeFOAM The Cross-Platform CFD Toolkit
staticPressure.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) 2009-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::staticPressure
26 
27 Description
28  Converts kinematic pressure to static pressure, from the name of the
29  pressure field, and density, i.e.
30 
31  p_static = density*p_kinematic
32 
33 SourceFiles
34  staticPressure.C
35  IOstaticPressure.H
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef staticPressure_H
40 #define staticPressure_H
41 
42 #include <OpenFOAM/pointFieldFwd.H>
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 // Forward declaration of classes
50 class objectRegistry;
51 class dictionary;
52 class mapPolyMesh;
53 
54 /*---------------------------------------------------------------------------*\
55  Class staticPressure Declaration
56 \*---------------------------------------------------------------------------*/
57 
59 {
60  // Private data
61 
62  //- Name of this set of staticPressure objects
63  word name_;
64 
65  const objectRegistry& obr_;
66 
67  //- on/off switch
68  bool active_;
69 
70  //- Name of pressure field, default is "p"
71  word pName_;
72 
73  //- Density value
74  scalar rho_;
75 
76 
77  // Private Member Functions
78 
79  //- Return true if the pressure field corresponds to kinematic pressure
80  bool isKinematicPressure();
81 
82  //- Disallow default bitwise copy construct
84 
85  //- Disallow default bitwise assignment
86  void operator=(const staticPressure&);
87 
88 
89 public:
90 
91  //- Runtime type information
92  TypeName("staticPressure");
93 
94 
95  // Constructors
96 
97  //- Construct for given objectRegistry and dictionary.
98  // Allow the possibility to load fields from files
100  (
101  const word& name,
102  const objectRegistry&,
103  const dictionary&,
104  const bool loadFromFiles = false
105  );
106 
107 
108  // Destructor
109 
110  virtual ~staticPressure();
111 
112 
113  // Member Functions
114 
115  //- Return name of the set of staticPressure
116  virtual const word& name() const
117  {
118  return name_;
119  }
120 
121  //- Read the staticPressure data
122  virtual void read(const dictionary&);
123 
124  //- Execute, currently does nothing
125  virtual void execute();
126 
127  //- Execute at the final time-loop, currently does nothing
128  virtual void end();
129 
130  //- Calculate the staticPressure and write
131  virtual void write();
132 
133  //- Update for changes of mesh
134  virtual void updateMesh(const mapPolyMesh&)
135  {}
136 
137  //- Update for changes of mesh
138  virtual void movePoints(const pointField&)
139  {}
140 };
141 
142 
143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144 
145 } // End namespace Foam
146 
147 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148 
149 #endif
150 
151 // ************************ vim: set sw=4 sts=4 et: ************************ //