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-2022 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  // field T; // Optional energy/temperature field name
40  // Set to T for compressibleInterFoam
41 
42  phase gas; // Optional phase name
43 
44  min 200;
45  max 500;
46  }
47  \endverbatim
48 
49 SourceFiles
50  limitTemperature.C
51 
52 \*---------------------------------------------------------------------------*/
53 
54 #ifndef limitTemperature_H
55 #define limitTemperature_H
56 
57 #include "fvConstraint.H"
58 #include "fvCellSet.H"
59 
60 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
61 
62 namespace Foam
63 {
64 namespace fv
65 {
66 
67 /*---------------------------------------------------------------------------*\
68  Class limitTemperature Declaration
69 \*---------------------------------------------------------------------------*/
70 
71 class limitTemperature
72 :
73  public fvConstraint
74 {
75  // Private data
76 
77  //- The set of cells the fvConstraint applies to
78  fvCellSet set_;
79 
80  //- Minimum temperature limit [K]
81  scalar Tmin_;
82 
83  //- Maximum temperature limit [K]
84  scalar Tmax_;
85 
86  //- Optional energy/temperature field name
87  word fieldName_;
88 
89  //- Optional phase name
90  word phaseName_;
91 
92 
93  // Private Member Functions
94 
95  //- Non-virtual read
96  void readCoeffs();
97 
98 
99 public:
100 
101  //- Runtime type information
102  TypeName("limitTemperature");
103 
104 
105  // Constructors
106 
107  //- Construct from components
109  (
110  const word& name,
111  const word& modelType,
112  const dictionary& dict,
113  const fvMesh& mesh
114  );
115 
116  //- Disallow default bitwise copy construction
117  limitTemperature(const limitTemperature&) = delete;
118 
119 
120  //- Destructor
121  virtual ~limitTemperature()
122  {}
123 
124 
125  // Member Functions
126 
127  //- Return the list of fields constrained by the fvConstraint
128  virtual wordList constrainedFields() const;
129 
130  //- Constrain the energy field
131  virtual bool constrain(volScalarField& he) const;
132 
133  //- Update for mesh motion
134  virtual bool movePoints();
135 
136  //- Update topology using the given map
137  virtual void topoChange(const polyTopoChangeMap&);
138 
139  //- Update from another mesh using the given map
140  virtual void mapMesh(const polyMeshMap&);
141 
142  //- Redistribute or update using the given distribution map
143  virtual void distribute(const polyDistributionMap&);
144 
145  //- Read dictionary
146  virtual bool read(const dictionary& dict);
147 
148 
149  // Member Operators
150 
151  //- Disallow default bitwise assignment
152  void operator=(const limitTemperature&) = delete;
153 };
154 
155 
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 
158 } // End namespace fv
159 } // End namespace Foam
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 #endif
164 
165 // ************************************************************************* //
limitTemperature(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from components.
dictionary dict
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
virtual bool movePoints()
Update for mesh motion.
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 void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
virtual bool constrain(volScalarField &he) const
Constrain the energy field.
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)
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
virtual void topoChange(const polyTopoChangeMap &)
Update topology using the given map.
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:95
virtual bool read(const dictionary &dict)
Read dictionary.
virtual void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
TypeName("limitTemperature")
Runtime type information.
Class containing mesh-to-mesh mapping information.
Definition: polyMeshMap.H:50
virtual ~limitTemperature()
Destructor.
Finite volume options abstract base class.
Definition: fvConstraint.H:56
Namespace for OpenFOAM.