fixedTemperatureConstraint.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-2019 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::fixedTemperatureConstraint
26 
27 Description
28  Fixed temperature equation constraint
29 
30 Usage
31  \verbatim
32  fixedTemperature
33  {
34  type fixedTemperatureConstraint;
35  active yes;
36 
37  mode uniform; // uniform or lookup
38 
39  // For uniform option
40  temperature constant 500; // fixed temperature with time [K]
41 
42  // For lookup option
43  // T <Tname>; // optional temperature field name
44  }
45  \endverbatim
46 
47 Note:
48  The 'uniform' option allows the use of a time-varying uniform temperature
49  by means of the Function1 type.
50 
51 See also
52  Foam::fvOption
53 
54 SourceFiles
55  fixedTemperatureConstraint.C
56 
57 \*---------------------------------------------------------------------------*/
58 
59 #ifndef fixedTemperatureConstraint_H
60 #define fixedTemperatureConstraint_H
61 
62 #include "cellSetOption.H"
63 #include "NamedEnum.H"
64 #include "Function1.H"
65 
66 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
67 
68 namespace Foam
69 {
70 namespace fv
71 {
72 
73 /*---------------------------------------------------------------------------*\
74  Class fixedTemperatureConstraint Declaration
75 \*---------------------------------------------------------------------------*/
76 
78 :
79  public cellSetOption
80 {
81 public:
82 
83  //- Temperature mode
84  enum temperatureMode
85  {
87  tmLookup
88  };
89 
90 
91  //- String representation of temperatureMode enums
93 
94 
95 protected:
96 
97  // Protected data
98 
99  //- Operation mode
101 
102  //- Uniform temperature [K]
104 
105  //- Temperature field name
106  word TName_;
107 
108 
109 public:
110 
111  //- Runtime type information
112  TypeName("fixedTemperatureConstraint");
113 
114 
115  // Constructors
116 
117  //- Construct from components
119  (
120  const word& name,
121  const word& modelType,
122  const dictionary& dict,
123  const fvMesh& mesh
124  );
125 
126  //- Disallow default bitwise copy construction
128 
129 
130  //- Destructor
132  {}
133 
134 
135  // Member Functions
136 
137  //- Constrain energy equation to fix the temperature
138  virtual void constrain(fvMatrix<scalar>& eqn, const label fieldi);
139 
140  //- Read dictionary
141  virtual bool read(const dictionary& dict);
142 
143 
144  // Member Operators
145 
146  //- Disallow default bitwise assignment
147  void operator=(const fixedTemperatureConstraint&) = delete;
148 };
149 
150 
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 
153 } // End namespace fv
154 } // End namespace Foam
155 
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 
158 #endif
159 
160 // ************************************************************************* //
dictionary dict
virtual bool read(const dictionary &dict)
Read dictionary.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
TypeName("fixedTemperatureConstraint")
Runtime type information.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
autoPtr< Function1< scalar > > Tuniform_
Uniform temperature [K].
fixedTemperatureConstraint(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from components.
Fixed temperature equation constraint.
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvOptionI.H:34
void operator=(const fixedTemperatureConstraint &)=delete
Disallow default bitwise assignment.
static const NamedEnum< temperatureMode, 2 > temperatureModeNames_
String representation of temperatureMode enums.
virtual void constrain(fvMatrix< scalar > &eqn, const label fieldi)
Constrain energy equation to fix the temperature.
A class for handling words, derived from string.
Definition: word.H:59
labelList fv(nPoints)
A special matrix type and solver, designed for finite volume solutions of scalar equations. Face addressing is used to make all matrix assembly and solution loops vectorise.
Definition: fvPatchField.H:72
const word & name() const
Return const access to the source name.
Definition: fvOptionI.H:28
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Cell-set options abstract base class. Provides a base set of controls, e.g.:
Definition: cellSetOption.H:69
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
Namespace for OpenFOAM.