limitTemperature.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) 2012-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::limitTemperature
26 
27 Description
28  Limits the temperature to be between minimum and maximum values.
29 
30 Usage
31  Example usage:
32  \verbatim
33  limitT
34  {
35  type limitTemperature;
36 
37  selectionMode all;
38 
39  phase gas; // Optional phase name
40 
41  min 200;
42  max 500;
43  }
44  \endverbatim
45 
46 SourceFiles
47  limitTemperature.C
48 
49 \*---------------------------------------------------------------------------*/
50 
51 #ifndef limitTemperature_H
52 #define limitTemperature_H
53 
54 #include "fvConstraint.H"
55 #include "fvCellSet.H"
56 
57 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
58 
59 namespace Foam
60 {
61 namespace fv
62 {
63 
64 /*---------------------------------------------------------------------------*\
65  Class limitTemperature Declaration
66 \*---------------------------------------------------------------------------*/
67 
68 class limitTemperature
69 :
70  public fvConstraint
71 {
72  // Private data
73 
74  //- The set of cells the fvConstraint applies to
75  fvCellSet set_;
76 
77  //- Minimum temperature limit [K]
78  scalar Tmin_;
79 
80  //- Maximum temperature limit [K]
81  scalar Tmax_;
82 
83  //- Optional phase name
84  word phaseName_;
85 
86 
87  // Private Member Functions
88 
89  //- Non-virtual read
90  void readCoeffs();
91 
92 
93 public:
94 
95  //- Runtime type information
96  TypeName("limitTemperature");
97 
98 
99  // Constructors
100 
101  //- Construct from components
103  (
104  const word& name,
105  const word& modelType,
106  const dictionary& dict,
107  const fvMesh& mesh
108  );
109 
110  //- Disallow default bitwise copy construction
111  limitTemperature(const limitTemperature&) = delete;
112 
113 
114  //- Destructor
115  virtual ~limitTemperature()
116  {}
117 
118 
119  // Member Functions
120 
121  //- Return the list of fields constrained by the fvConstraint
122  virtual wordList constrainedFields() const;
123 
124  //- Constrain the energy field
125  virtual bool constrain(volScalarField& he) const;
126 
127  //- Update for mesh changes
128  virtual void updateMesh(const mapPolyMesh&);
129 
130  //- Read dictionary
131  virtual bool read(const dictionary& dict);
132 
133 
134  // Member Operators
135 
136  //- Disallow default bitwise assignment
137  void operator=(const limitTemperature&) = delete;
138 };
139 
140 
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142 
143 } // End namespace fv
144 } // End namespace Foam
145 
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147 
148 #endif
149 
150 // ************************************************************************* //
limitTemperature(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from components.
dictionary dict
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvConstraintI.H:34
Limits the temperature to be between minimum and maximum values.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
Cell-set fvConstraint abstract base class. Provides a base set of controls regarding the location whe...
virtual bool constrain(volScalarField &he) const
Constrain the energy field.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:158
virtual void updateMesh(const mapPolyMesh &)
Update for mesh changes.
const word & name() const
Return const access to the source name.
Definition: fvConstraintI.H:28
void operator=(const limitTemperature &)=delete
Disallow default bitwise assignment.
A class for handling words, derived from string.
Definition: word.H:59
labelList fv(nPoints)
thermo he()
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
virtual bool read(const dictionary &dict)
Read dictionary.
TypeName("limitTemperature")
Runtime type information.
virtual ~limitTemperature()
Destructor.
Finite volume options abstract base class.
Definition: fvConstraint.H:54
Namespace for OpenFOAM.