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 Copyright (C) 2020 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::fv::fixedTemperatureConstraint
29
30Group
31 grpFvOptionsConstraints
32
33Description
34 Constrain temperature equation (i.e. \c T) with
35 a given set of fixed values within a specified region.
36
37 Constraints 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
48Usage
49 Minimal example by using \c constant/fvOptions:
50 \verbatim
51 fixedTemperatureConstraint1
52 {
53 // Mandatory entries (unmodifiable)
54 type fixedTemperatureConstraint;
55 mode <mode>;
56
57 // Conditional mandatory/optional entries (runtime modifiable)
58
59 // when mode=uniform (mandatory)
60 temperature constant 500; // fixed temperature with time [K]
61
62 // when mode=lookup (optional)
63 T <Tname>;
64
65 // Mandatory/Optional (inherited) entries
66 ...
67 }
68 \endverbatim
69
70 where the entries mean:
71 \table
72 Property | Description | Type | Reqd | Dflt
73 type | Type name: fixedTemperatureConstraint | word | yes | -
74 mode | Temperature mode - see below | word | yes | -
75 temperature | Function1 type temperature field | Function1 | cndtnl | -
76 T | Name of operand temperature field | word | cndtnl | T
77 \endtable
78
79 Options for the \c mode entry:
80 \verbatim
81 uniform | Use Function1 type temperature field
82 lookup | Use temperature field given field name
83 \endverbatim
84
85 The inherited entries are elaborated in:
86 - \link fvOption.H \endlink
87 - \link cellSetOption.H \endlink
88
89Note:
90 - The \c uniform option allows the use of a time-varying
91 uniform temperature by means of the \c Function1 type.
92
93See also
94 - Foam::fv::limitTemperature
95 - Foam::Function1
96
97SourceFiles
98 fixedTemperatureConstraint.C
99
100\*---------------------------------------------------------------------------*/
101
102#ifndef fixedTemperatureConstraint_H
103#define fixedTemperatureConstraint_H
104
105#include "cellSetOption.H"
106#include "Enum.H"
107#include "Function1.H"
108
109// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
110
111namespace Foam
112{
113namespace fv
114{
115
116/*---------------------------------------------------------------------------*\
117 Class fixedTemperatureConstraint Declaration
118\*---------------------------------------------------------------------------*/
119
120class fixedTemperatureConstraint
121:
122 public fv::cellSetOption
123{
124public:
125
126 //- Temperature mode
127 enum temperatureMode
128 {
129 tmUniform,
131 };
132
133 //- String representation of temperatureMode enums
134 static const Enum<temperatureMode> temperatureModeNames_;
135
136
137protected:
138
139 // Protected Data
140
141 //- Operation mode
143
144 //- Uniform temperature [K]
145 autoPtr<Function1<scalar>> Tuniform_;
146
147 //- Temperature field name
148 word TName_;
150
151public:
152
153 //- Runtime type information
154 TypeName("fixedTemperatureConstraint");
155
157 // Constructors
159 //- Construct from components
161 (
162 const word& name,
163 const word& modelType,
164 const dictionary& dict,
165 const fvMesh& mesh
166 );
167
168 //- No copy construct
170
171 //- No copy assignment
172 void operator=(const fixedTemperatureConstraint&) = delete;
173
175 //- Destructor
176 virtual ~fixedTemperatureConstraint() = default;
178
179 // Member Functions
180
181 //- Constrain energy equation to fix the temperature
182 virtual void constrain(fvMatrix<scalar>& eqn, const label fieldi);
184
185 // IO
186
187 //- Read dictionary
188 virtual bool read(const dictionary& dict);
189};
190
191
192// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193
194} // End namespace fv
195} // End namespace Foam
196
197// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
199#endif
200
201// ************************************************************************* //
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
Definition: Enum.H:61
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Definition: fvMatrix.H:121
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
Intermediate abstract class for handling cell-set options for the derived fvOptions.
Constrain temperature equation (i.e. T) with a given set of fixed values within a specified region.
autoPtr< Function1< scalar > > Tuniform_
Uniform temperature [K].
virtual ~fixedTemperatureConstraint()=default
Destructor.
TypeName("fixedTemperatureConstraint")
Runtime type information.
virtual bool read(const dictionary &dict)
Read dictionary.
virtual void constrain(fvMatrix< scalar > &eqn, const label fieldi)
Constrain energy equation to fix the temperature.
void operator=(const fixedTemperatureConstraint &)=delete
No copy assignment.
static const Enum< temperatureMode > temperatureModeNames_
String representation of temperatureMode enums.
fixedTemperatureConstraint(const fixedTemperatureConstraint &)=delete
No copy construct.
const word & name() const noexcept
Return const access to the source name.
Definition: fvOptionI.H:31
const fvMesh & mesh() const noexcept
Return const access to the mesh database.
Definition: fvOptionI.H:37
A class for handling words, derived from Foam::string.
Definition: word.H:68
Namespace for OpenFOAM.
labelList fv(nPoints)
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73