limitTemperature.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2012-2017 OpenFOAM Foundation
9  Copyright (C) 2020-2022 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::fv::limitTemperature
29 
30 Group
31  grpFvOptionsCorrections
32 
33 Description
34  Corrects temperature field (i.e. \c T) within a specified
35  region by applying limits between a given minimum and maximum.
36 
37  Corrections applied to:
38  \verbatim
39  T | Temperature [K]
40  \endverbatim
41 
42  Required fields:
43  \verbatim
44  T | Temperature [K]
45  e/h | Internal energy/Enthalphy [m2/s2]
46  \endverbatim
47 
48 Usage
49  Minimal example by using \c constant/fvOptions:
50  \verbatim
51  limitTemperature1
52  {
53  // Mandatory entries (unmodifiable)
54  type limitTemperature;
55 
56  // Mandatory entries (runtime modifiable)
57  min <minValue>;
58  max <maxValue>;
59 
60  // Optional entries (runtime modifiable)
61  phase <phaseName>;
62 
63  // Mandatory/Optional (inherited) entries
64  ...
65  }
66  \endverbatim
67 
68  where the entries mean:
69  \table
70  Property | Description | Type | Reqd | Dflt
71  type | Type name: limitTemperature | word | yes | -
72  min | Minimum temperature limit [K] | scalar | yes | -
73  max | Maximum temperature limit [K] | scalar | yes | -
74  phase | Name of operand phase field | word | no | ""
75  \endtable
76 
77  The inherited entries are elaborated in:
78  - \link fvOption.H \endlink
79  - \link cellSetOption.H \endlink
80  - \link writeFile.H \endlink
81 
82 See also
83  - Foam::fv::fixedTemperatureConstraint
84 
85 SourceFiles
86  limitTemperature.C
87 
88 \*---------------------------------------------------------------------------*/
89 
90 #ifndef fv_limitTemperature_H
91 #define fv_limitTemperature_H
92 
93 #include "cellSetOption.H"
94 #include "writeFile.H"
95 
96 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
97 
98 namespace Foam
99 {
100 namespace fv
101 {
102 
103 /*---------------------------------------------------------------------------*\
104  Class limitTemperature Declaration
105 \*---------------------------------------------------------------------------*/
106 
107 class limitTemperature
108 :
109  public fv::cellSetOption,
110  public functionObjects::writeFile
111 {
112 protected:
113 
114  // Protected Data
115 
116  //- Minimum temperature limit [K]
117  scalar Tmin_;
118 
119  //- Maximum temperature limit [K]
120  scalar Tmax_;
121 
122  //- Optional phase name
123  word phase_;
124 
125 
126  // Protected Member Functions
127 
128  //- Write file header information
129  void writeFileHeader(Ostream& os);
130 
131 
132 public:
133 
134  //- Runtime type information
135  TypeName("limitTemperature");
136 
137 
138  // Constructors
139 
140  //- Construct from components
142  (
143  const word& name,
144  const word& modelType,
145  const dictionary& dict,
146  const fvMesh& mesh
147  );
148 
149  //- No copy construct
150  limitTemperature(const limitTemperature&) = delete;
151 
152  //- No copy assignment
153  void operator=(const limitTemperature&) = delete;
155 
156  //- Destructor
157  virtual ~limitTemperature() = default;
158 
159 
160  // Member Functions
161 
162  //- Read dictionary
163  virtual bool read(const dictionary& dict);
164 
165  //- Correct the energy field
166  virtual void correct(volScalarField& he);
167 };
168 
169 
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 
172 } // End namespace fv
173 } // End namespace Foam
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 
177 #endif
178 
179 // ************************************************************************* //
volScalarField & he
Definition: YEEqn.H:52
limitTemperature(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from components.
dictionary dict
const fvMesh & mesh() const noexcept
Return const access to the mesh database.
Definition: fvOptionI.H:30
Corrects temperature field (i.e. T) within a specified region by applying limits between a given mini...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
virtual void correct(volScalarField &he)
Correct the energy field.
void writeFileHeader(Ostream &os)
Write file header information.
scalar Tmin_
Minimum temperature limit [K].
void operator=(const limitTemperature &)=delete
No copy assignment.
A class for handling words, derived from Foam::string.
Definition: word.H:63
labelList fv(nPoints)
scalar Tmax_
Maximum temperature limit [K].
const word & name() const noexcept
Return const access to the source name.
Definition: fvOptionI.H:24
virtual ~limitTemperature()=default
Destructor.
OBJstream os(runTime.globalPath()/outputName)
word phase_
Optional phase name.
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.
Namespace for OpenFOAM.