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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2012-2017 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::fv::fixedTemperatureConstraint
28 
29 Group
30  grpFvOptionsConstraints
31 
32 Description
33  Fixed temperature equation constraint
34 
35 Usage
36  \verbatim
37  fixedTemperature
38  {
39  type fixedTemperatureConstraint;
40  active yes;
41 
42  mode uniform; // uniform or lookup
43 
44  // For uniform option
45  temperature constant 500; // fixed temperature with time [K]
46 
47  // For lookup option
48  // T <Tname>; // optional temperature field name
49  }
50  \endverbatim
51 
52 Note:
53  The 'uniform' option allows the use of a time-varying uniform temperature
54  by means of the Function1 type.
55 
56 SourceFiles
57  fvOption.C
58 
59 \*---------------------------------------------------------------------------*/
60 
61 #ifndef fixedTemperatureConstraint_H
62 #define fixedTemperatureConstraint_H
63 
64 #include "cellSetOption.H"
65 #include "Enum.H"
66 #include "Function1.H"
67 
68 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
69 
70 namespace Foam
71 {
72 namespace fv
73 {
74 
75 /*---------------------------------------------------------------------------*\
76  Class fixedTemperatureConstraint Declaration
77 \*---------------------------------------------------------------------------*/
78 
80 :
81  public cellSetOption
82 {
83 public:
84 
85  //- Temperature mode
86  enum temperatureMode
87  {
89  tmLookup
90  };
91 
92 
93  //- String representation of temperatureMode enums
95 
96 
97 protected:
98 
99  // Protected data
100 
101  //- Operation mode
103 
104  //- Uniform temperature [K]
106 
107  //- Temperature field name
108  word TName_;
109 
110 
111 private:
112 
113  // Private Member Functions
114 
115  //- No copy construct
117 
118  //- No copy assignment
119  void operator=(const fixedTemperatureConstraint&) = delete;
120 
121 
122 public:
123 
124  //- Runtime type information
125  TypeName("fixedTemperatureConstraint");
126 
127 
128  // Constructors
129 
130  //- Construct from components
132  (
133  const word& name,
134  const word& modelType,
135  const dictionary& dict,
136  const fvMesh& mesh
137  );
138 
139 
140  //- Destructor
141  virtual ~fixedTemperatureConstraint() = default;
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 // ************************************************************************* //
Foam::fv::fixedTemperatureConstraint::tmLookup
Definition: fixedTemperatureConstraint.H:88
Foam::Enum< temperatureMode >
Foam::fv::fixedTemperatureConstraint::temperatureModeNames_
static const Enum< temperatureMode > temperatureModeNames_
String representation of temperatureMode enums.
Definition: fixedTemperatureConstraint.H:93
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::fv::cellSetOption
Cell-set options abstract base class. Provides a base set of controls, e.g.:
Definition: cellSetOption.H:72
Foam::fv::option::name
const word & name() const
Return const access to the source name.
Definition: fvOptionI.H:30
Function1.H
cellSetOption.H
Foam::fv::fixedTemperatureConstraint::TypeName
TypeName("fixedTemperatureConstraint")
Runtime type information.
Foam::fv::fixedTemperatureConstraint::mode_
temperatureMode mode_
Operation mode.
Definition: fixedTemperatureConstraint.H:101
Foam::fv::fixedTemperatureConstraint::read
virtual bool read(const dictionary &dict)
Read dictionary.
Definition: fixedTemperatureConstraint.C:150
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:121
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:84
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::fv::fixedTemperatureConstraint::tmUniform
Definition: fixedTemperatureConstraint.H:87
fv
labelList fv(nPoints)
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::fv::fixedTemperatureConstraint
Fixed temperature equation constraint.
Definition: fixedTemperatureConstraint.H:78
Foam::fv::fixedTemperatureConstraint::TName_
word TName_
Temperature field name.
Definition: fixedTemperatureConstraint.H:107
Foam::fv::fixedTemperatureConstraint::Tuniform_
autoPtr< Function1< scalar > > Tuniform_
Uniform temperature [K].
Definition: fixedTemperatureConstraint.H:104
Foam::fv::option::mesh
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvOptionI.H:36
Foam::fvMatrix
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Definition: fvPatchField.H:76
Foam::fv::fixedTemperatureConstraint::~fixedTemperatureConstraint
virtual ~fixedTemperatureConstraint()=default
Destructor.
Foam::fv::fixedTemperatureConstraint::constrain
virtual void constrain(fvMatrix< scalar > &eqn, const label fieldi)
Constrain energy equation to fix the temperature.
Definition: fixedTemperatureConstraint.C:114
Foam::fv::fixedTemperatureConstraint::temperatureMode
temperatureMode
Temperature mode.
Definition: fixedTemperatureConstraint.H:85
Enum.H