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-2016 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  fixedTemperatureConstraintCoeffs
38  {
39  mode uniform; // uniform or lookup
40 
41  // For uniform option
42  temperature constant 500; // fixed temperature with time [K]
43 
44  // For lookup option
45  // T <Tname>; // optional temperature field name
46  }
47  }
48  \endverbatim
49 
50 Note:
51  The 'uniform' option allows the use of a time-varying uniform temperature
52  by means of the Function1 type.
53 
54 SourceFiles
55  fvOption.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 
82 public:
83 
84  //- Temperature mode
85  enum temperatureMode
86  {
88  tmLookup
89  };
90 
91 
92  //- String representation of temperatureMode enums
94 
95 
96 protected:
97 
98  // Protected data
99 
100  //- Operation mode
102 
103  //- Uniform temperature [K]
105 
106  //- Temperature field name
107  word TName_;
108 
109 
110 private:
111 
112  // Private Member Functions
113 
114  //- Disallow default bitwise copy construct
116 
117  //- Disallow default bitwise assignment
118  void operator=(const fixedTemperatureConstraint&);
119 
120 
121 public:
122 
123  //- Runtime type information
124  TypeName("fixedTemperatureConstraint");
125 
126 
127  // Constructors
128 
129  //- Construct from components
131  (
132  const word& name,
133  const word& modelType,
134  const dictionary& dict,
135  const fvMesh& mesh
136  );
137 
138 
139  //- Destructor
141  {}
142 
143 
144  // Member Functions
145 
146  //- Constrain energy equation to fix the temperature
147  virtual void constrain(fvMatrix<scalar>& eqn, const label fieldi);
148 
149 
150  // IO
151 
152  //- Read dictionary
153  virtual bool read(const dictionary& dict);
154 };
155 
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
159 } // End namespace fv
160 } // End namespace Foam
161 
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 
164 #endif
165 
166 // ************************************************************************* //
const word & name() const
Return const access to the source name.
Definition: fvOptionI.H:28
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.
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:71
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvOptionI.H:34
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:72
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:53
Namespace for OpenFOAM.