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-2021 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::heatTransferModels::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  type variable;
53 
54  AoV 1e3;
55 
56  a 1;
57  b 2;
58  c 3;
59  Pr 0.7;
60  L 1e-3;
61  }
62  \endverbatim
63 
64 \*---------------------------------------------------------------------------*/
65 
66 #ifndef heatTransferModels_variable_H
67 #define heatTransferModels_variable_H
68 
69 #include "heatTransferModel.H"
70 
71 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
72 
73 namespace Foam
74 {
75 namespace fv
76 {
77 namespace heatTransferModels
78 {
79 
80 /*---------------------------------------------------------------------------*\
81  Class variable Declaration
82 \*---------------------------------------------------------------------------*/
83 
84 class variable
85 :
86  public heatTransferModel
87 {
88  // Private Data
89 
90  //- Name of neighbour velocity field; default = U
91  word UName_;
92 
93  //- Model constant
94  scalar a_;
95 
96  //- Model constant
97  scalar b_;
98 
99  //- Model constant
100  scalar c_;
101 
102  //- Length scale
104 
105  //- Fluid Prandtl number
106  dimensionedScalar Pr_;
107 
108  //- Heat transfer coefficient [W/m^2/K]
109  volScalarField htc_;
110 
111 
112  // Private Member Functions
113 
114  //- Non-virtual read
115  void readCoeffs();
116 
117 
118 public:
119 
120  //- Runtime type information
121  TypeName("variable");
122 
123 
124  // Constructors
125 
126  //- Construct from dictionary and mesh
127  variable(const dictionary& dict, const fvMesh& mesh);
128 
129  //- Construct from dictionary and model
130  variable(const dictionary& dict, const interRegionModel& model);
131 
132 
133  //- Destructor
134  virtual ~variable();
135 
136 
137  // Member Functions
138 
139  //- Get the heat transfer coefficient
140  virtual tmp<volScalarField> htc() const
141  {
142  return htc_;
143  }
144 
145  //- Correct the heat transfer coefficient
146  virtual void correct();
148  //- Read dictionary
149  virtual bool read(const dictionary& dict);
150 };
151 
152 
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 
155 } // End namespace heatTransferModels
156 } // End namespace fv
157 } // End namespace Foam
158 
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 
161 #endif
162 
163 // ************************************************************************* //
dictionary dict
virtual tmp< volScalarField > htc() const
Get the heat transfer coefficient.
Definition: variable.H:147
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
virtual bool read(const dictionary &dict)
Read dictionary.
Definition: variable.C:136
Base class for inter-region exchange.
A class for handling words, derived from string.
Definition: word.H:59
labelList fv(nPoints)
virtual void correct()
Correct the heat transfer coefficient.
Definition: variable.C:115
virtual ~variable()
Destructor.
Definition: variable.C:109
variable(const dictionary &dict, const fvMesh &mesh)
Construct from dictionary and mesh.
Definition: variable.C:64
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:95
TypeName("variable")
Runtime type information.
const fvMesh & mesh() const
Return reference to the mesh.
A class for managing temporary objects.
Definition: PtrList.H:53
Namespace for OpenFOAM.