fixedTemperatureConstraint.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 | Copyright (C) 2012-2017 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 SourceFiles
52  fvOption.C
53 
54 \*---------------------------------------------------------------------------*/
55 
56 #ifndef fixedTemperatureConstraint_H
57 #define fixedTemperatureConstraint_H
58 
59 #include "cellSetOption.H"
60 #include "NamedEnum.H"
61 #include "Function1.H"
62 
63 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
64 
65 namespace Foam
66 {
67 namespace fv
68 {
69 
70 /*---------------------------------------------------------------------------*\
71  Class fixedTemperatureConstraint Declaration
72 \*---------------------------------------------------------------------------*/
73 
75 :
76  public cellSetOption
77 {
78 
79 public:
80 
81  //- Temperature mode
82  enum temperatureMode
83  {
85  tmLookup
86  };
87 
88 
89  //- String representation of temperatureMode enums
91 
92 
93 protected:
94 
95  // Protected data
96 
97  //- Operation mode
99 
100  //- Uniform temperature [K]
102 
103  //- Temperature field name
104  word TName_;
105 
106 
107 private:
108 
109  // Private Member Functions
110 
111  //- Disallow default bitwise copy construct
113 
114  //- Disallow default bitwise assignment
115  void operator=(const fixedTemperatureConstraint&);
116 
117 
118 public:
119 
120  //- Runtime type information
121  TypeName("fixedTemperatureConstraint");
122 
123 
124  // Constructors
125 
126  //- Construct from components
128  (
129  const word& name,
130  const word& modelType,
131  const dictionary& dict,
132  const fvMesh& mesh
133  );
134 
135 
136  //- Destructor
138  {}
139 
140 
141  // Member Functions
142 
143  //- Constrain energy equation to fix the temperature
144  virtual void constrain(fvMatrix<scalar>& eqn, const label fieldi);
145 
146 
147  // IO
148 
149  //- Read dictionary
150  virtual bool read(const dictionary& dict);
151 };
152 
153 
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 
156 } // End namespace fv
157 } // End namespace Foam
158 
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 
161 #endif
162 
163 // ************************************************************************* //
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:137
autoPtr< Function1< scalar > > Tuniform_
Uniform temperature [K].
Fixed temperature equation constraint.
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvOptionI.H:34
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 abtract 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.