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-2018 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 is 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
82  (
83  const volScalarField& p,
84  const volScalarField& rho,
85  const dictionary& dict,
86  const bool pRefRequired = true
87  );
88 
89 
90  // Member Functions
91 
92  //- Return the cell in which the reference pressure is set
93  inline label refCell() const;
94 
95  //- Return the pressure reference level
96  inline scalar refValue() const;
97 
98  //- Limit the pressure if necessary and return true if so
99  bool limit(volScalarField& p) const;
100 };
101 
102 
103 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
104 
105 } // End namespace Foam
106 
107 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
108 
109 #include "pressureControlI.H"
110 
111 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
112 
113 #endif
114 
115 // ************************************************************************* //
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:137
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 is closed-volume simulations and a general method for li...
volScalarField & p
pressureControl(const volScalarField &p, const volScalarField &rho, const dictionary &dict, const bool pRefRequired=true)
Construct from the simple/pimple sub-dictionary.
Namespace for OpenFOAM.
label refCell() const
Return the cell in which the reference pressure is set.