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