variable.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) 2011-2023 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::heatTransferCoefficientModels::variable
26 
27 Description
28  Variable heat transfer model depending on local values. The Nusselt number
29  is calculated as:
30 
31  \f[
32  Nu = a*Re^b*Pr^c
33  \f]
34 
35  And the heat transfer coefficient is calculated as:
36 
37  \f[
38  htc = Nu*\kappa/L
39  \f]
40 
41  Where:
42 
43  \vartable
44  \kappa | Conductivity
45  L | Length scale
46  \endvartable
47 
48 Usage
49  Example usage:
50  \verbatim
51  {
52  heatTransferCoefficientModel variable;
53 
54  a 1;
55  b 2;
56  c 3;
57  Pr 0.7;
58  L 1e-3;
59  }
60  \endverbatim
61 
62 \*---------------------------------------------------------------------------*/
63 
64 #ifndef heatTransferCoefficientModels_variable_H
65 #define heatTransferCoefficientModels_variable_H
66 
68 
69 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
70 
71 namespace Foam
72 {
73 namespace fv
74 {
75 namespace heatTransferCoefficientModels
76 {
77 
78 /*---------------------------------------------------------------------------*\
79  Class variable Declaration
80 \*---------------------------------------------------------------------------*/
81 
82 class variable
83 :
84  public heatTransferCoefficientModel
85 {
86  // Private Data
87 
88  //- Name of neighbour velocity field; default = U
89  word UName_;
90 
91  //- Model constant
92  scalar a_;
93 
94  //- Model constant
95  scalar b_;
96 
97  //- Model constant
98  scalar c_;
99 
100  //- Length scale
102 
103  //- Fluid Prandtl number
104  dimensionedScalar Pr_;
105 
106  //- Heat transfer coefficient [W/m^2/K]
107  volScalarField htc_;
108 
109 
110  // Private Member Functions
111 
112  //- Non-virtual read
113  void readCoeffs(const dictionary& dict);
114 
115 
116 public:
117 
118  //- Runtime type information
119  TypeName("variable");
120 
121 
122  // Constructors
123 
124  //- Construct from dictionary and mesh
125  variable(const dictionary& dict, const fvMesh& mesh);
126 
127  //- Construct from dictionary and model
128  variable(const dictionary& dict, const interRegionModel& model);
129 
130 
131  //- Destructor
132  virtual ~variable();
133 
134 
135  // Member Functions
136 
137  //- Get the heat transfer coefficient
138  virtual tmp<volScalarField> htc() const
139  {
140  return htc_;
141  }
142 
143  //- Correct the heat transfer coefficient
144  virtual void correct();
145 
146  //- Read dictionary
147  virtual bool read(const dictionary& dict);
148 };
149 
150 
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 
153 } // End namespace heatTransferCoefficientModels
154 } // End namespace fv
155 } // End namespace Foam
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
159 #endif
160 
161 // ************************************************************************* //
Generic GeometricField class.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:101
TypeName("variable")
Runtime type information.
virtual void correct()
Correct the heat transfer coefficient.
Definition: variable.C:118
virtual bool read(const dictionary &dict)
Read dictionary.
Definition: variable.C:138
virtual tmp< volScalarField > htc() const
Get the heat transfer coefficient.
Definition: variable.H:145
variable(const dictionary &dict, const fvMesh &mesh)
Construct from dictionary and mesh.
Definition: variable.C:67
Base class for inter-region exchange.
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
labelList fv(nPoints)
dictionary dict