All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
pressureControl.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2017-2020 OpenFOAM Foundation
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::pressureControl
26 
27 Description
28  Provides controls for the pressure reference in closed-volume simulations
29  and a general method for limiting the pressure during the startup of
30  steady-state simulations.
31 
32 SourceFiles
33  pressureControlI.H
34  pressureControl.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef pressureControl_H
39 #define pressureControl_H
40 
41 #include "dimensionedScalar.H"
42 #include "volFieldsFwd.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class pressureControl Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 class pressureControl
54 {
55  // Private Data
56 
57  //- Optional cell in which the reference pressure is set
58  label refCell_;
59 
60  //- Optional pressure reference level
61  scalar refValue_;
62 
63  //- Pressure lower-limit
64  dimensionedScalar pMax_;
65 
66  //- Pressure upper-limit
67  dimensionedScalar pMin_;
68 
69  //- Pressure lower-limit
70  bool limitMaxP_;
71 
72  //- Pressure upper-limit
73  bool limitMinP_;
74 
75 
76 public:
77 
78  // Constructors
79 
80  //- Construct from the simple/pimple sub-dictionary
81  // supporting the pressure and derived pressure fields (e.g. p_rgh)
83  (
84  const volScalarField& p,
85  const volScalarField& pRef,
86  const volScalarField& rho,
87  const dictionary& dict,
88  const bool pRefRequired = true
89  );
90 
91  //- Construct from the simple/pimple sub-dictionary
93  (
94  const volScalarField& p,
95  const volScalarField& rho,
96  const dictionary& dict,
97  const bool pRefRequired = true
98  );
99 
100 
101  // Member Functions
102 
103  //- Return the cell in which the reference pressure is set
104  inline label refCell() const;
105 
106  //- Return the pressure reference level
107  inline scalar refValue() const;
108 
109  //- Limit the pressure if necessary and return true if so
110  bool limit(volScalarField& p) const;
111 };
112 
113 
114 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
115 
116 } // End namespace Foam
117 
118 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
119 
120 #include "pressureControlI.H"
121 
122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
123 
124 #endif
125 
126 // ************************************************************************* //
dictionary dict
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
pressureControl(const volScalarField &p, const volScalarField &pRef, const volScalarField &rho, const dictionary &dict, const bool pRefRequired=true)
Construct from the simple/pimple sub-dictionary.
scalar refValue() const
Return the pressure reference level.
bool limit(volScalarField &p) const
Limit the pressure if necessary and return true if so.
Provides controls for the pressure reference in closed-volume simulations and a general method for li...
scalar pRef
Definition: createFields.H:19
volScalarField & p
Namespace for OpenFOAM.
label refCell() const
Return the cell in which the reference pressure is set.