limitPressure.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) 2021 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::fv::limitPressure
26 
27 Description
28  Limits the pressure to be between minimum and maximum values.
29 
30 Usage
31  Example usage:
32  \verbatim
33  limitp
34  {
35  type limitPressure;
36 
37  min 200;
38  max 500;
39  }
40  \endverbatim
41 
42 SourceFiles
43  limitPressure.C
44 
45 \*---------------------------------------------------------------------------*/
46 
47 #ifndef limitPressure_H
48 #define limitPressure_H
49 
50 #include "fvConstraint.H"
51 #include "dimensionedScalar.H"
52 
53 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 
55 namespace Foam
56 {
57 namespace fv
58 {
59 
60 /*---------------------------------------------------------------------------*\
61  Class limitPressure Declaration
62 \*---------------------------------------------------------------------------*/
63 
64 class limitPressure
65 :
66  public fvConstraint
67 {
68  // Private data
69 
70  //- Minimum pressure limit
71  dimensionedScalar pMin_;
72 
73  //- Maximum pressure limit
74  dimensionedScalar pMax_;
75 
76  //- Pressure min-limited
77  bool limitMinP_;
78 
79  //- Pressure max-limited
80  bool limitMaxP_;
81 
82 
83  // Private Member Functions
84 
85  //- Non-virtual read
86  void readCoeffs();
87 
88 
89 public:
90 
91  //- Runtime type information
92  TypeName("limitPressure");
93 
94 
95  // Constructors
96 
97  //- Construct from components
99  (
100  const word& name,
101  const word& modelType,
102  const dictionary& dict,
103  const fvMesh& mesh
104  );
105 
106  //- Disallow default bitwise copy construction
107  limitPressure(const limitPressure&) = delete;
108 
109 
110  //- Destructor
111  virtual ~limitPressure()
112  {}
113 
114 
115  // Member Functions
116 
117  //- Return the list of fields constrained by the fvConstraint
118  virtual wordList constrainedFields() const;
119 
120  //- Constrain the energy field
121  virtual bool constrain(volScalarField& he) const;
122 
123  //- Read dictionary
124  virtual bool read(const dictionary& dict);
125 
126 
127  // Member Operators
128 
129  //- Disallow default bitwise assignment
130  void operator=(const limitPressure&) = delete;
131 };
132 
133 
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 
136 } // End namespace fv
137 } // End namespace Foam
138 
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 
141 #endif
142 
143 // ************************************************************************* //
virtual ~limitPressure()
Destructor.
dictionary dict
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvConstraintI.H:34
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
Limits the pressure to be between minimum and maximum values.
Definition: limitPressure.H:63
const word & name() const
Return const access to the source name.
Definition: fvConstraintI.H:28
virtual bool constrain(volScalarField &he) const
Constrain the energy field.
A class for handling words, derived from string.
Definition: word.H:59
labelList fv(nPoints)
thermo he()
void operator=(const limitPressure &)=delete
Disallow default bitwise assignment.
virtual wordList constrainedFields() const
Return the list of fields constrained by the fvConstraint.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
limitPressure(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from components.
virtual bool read(const dictionary &dict)
Read dictionary.
Finite volume options abstract base class.
Definition: fvConstraint.H:54
Namespace for OpenFOAM.
TypeName("limitPressure")
Runtime type information.