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 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 
81 See also
82  - Foam::fv::fixedTemperatureConstraint
83 
84 SourceFiles
85  limitTemperature.C
86 
87 \*---------------------------------------------------------------------------*/
88 
89 #ifndef limitTemperature_H
90 #define limitTemperature_H
91 
92 #include "cellSetOption.H"
93 
94 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
95 
96 namespace Foam
97 {
98 namespace fv
99 {
100 
101 /*---------------------------------------------------------------------------*\
102  Class limitTemperature Declaration
103 \*---------------------------------------------------------------------------*/
104 
105 class limitTemperature
106 :
107  public fv::cellSetOption
108 {
109 protected:
110 
111  // Protected Data
112 
113  //- Minimum temperature limit [K]
114  scalar Tmin_;
115 
116  //- Maximum temperature limit [K]
117  scalar Tmax_;
118 
119  //- Optional phase name [K]
120  word phase_;
121 
122 
123 public:
124 
125  //- Runtime type information
126  TypeName("limitTemperature");
127 
128 
129  // Constructors
130 
131  //- Construct from components
133  (
134  const word& name,
135  const word& modelType,
136  const dictionary& dict,
137  const fvMesh& mesh
138  );
139 
140  //- No copy construct
141  limitTemperature(const limitTemperature&) = delete;
142 
143  //- No copy assignment
144  void operator=(const limitTemperature&) = delete;
145 
146 
147  //- Destructor
148  virtual ~limitTemperature() = default;
149 
150 
151  // Member Functions
152 
153  //- Read dictionary
154  virtual bool read(const dictionary& dict);
155 
156  //- Correct the energy field
157  virtual void correct(volScalarField& he);
158 };
159 
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 } // End namespace fv
164 } // End namespace Foam
165 
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 
168 #endif
169 
170 // ************************************************************************* //
Foam::fv::limitTemperature::read
virtual bool read(const dictionary &dict)
Read dictionary.
Definition: limitTemperature.C:77
Foam::fv::option::name
const word & name() const noexcept
Return const access to the source name.
Definition: fvOptionI.H:31
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::fv::cellSetOption
Intermediate abstract class for handling cell-set options for the derived fvOptions.
Definition: cellSetOption.H:163
Foam::fv::limitTemperature::operator=
void operator=(const limitTemperature &)=delete
No copy assignment.
cellSetOption.H
Foam::fv::limitTemperature
Corrects temperature field (i.e. T) within a specified region by applying limits between a given mini...
Definition: limitTemperature.H:134
Foam::fv::limitTemperature::TypeName
TypeName("limitTemperature")
Runtime type information.
Foam::fv::limitTemperature::phase_
word phase_
Optional phase name [K].
Definition: limitTemperature.H:149
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::fv::limitTemperature::Tmin_
scalar Tmin_
Minimum temperature limit [K].
Definition: limitTemperature.H:143
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::fv::limitTemperature::~limitTemperature
virtual ~limitTemperature()=default
Destructor.
fv
labelList fv(nPoints)
Foam::fv::option::mesh
const fvMesh & mesh() const noexcept
Return const access to the mesh database.
Definition: fvOptionI.H:37
he
volScalarField & he
Definition: YEEqn.H:52
Foam::fv::limitTemperature::correct
virtual void correct(volScalarField &he)
Correct the energy field.
Definition: limitTemperature.C:108
Foam::fv::limitTemperature::Tmax_
scalar Tmax_
Maximum temperature limit [K].
Definition: limitTemperature.H:146
Foam::fv::limitTemperature::limitTemperature
limitTemperature(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from components.
Definition: limitTemperature.C:49
Foam::GeometricField< scalar, fvPatchField, volMesh >