tabulatedTransport.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) 2020-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::tabulatedTransport
26 
27 Description
28  Transport properties package using uniformly-spaced tabulated data for
29  viscosity and thermal conductivity vs pressure and temperature.
30 
31 Usage
32  \table
33  Property | Description
34  mu | Dynamic viscosity vs pressure and temperature table
35  kappa | Thermal conductivity vs pressure and temperature table
36  \endtable
37 
38  Example of the specification of the transport properties:
39  \verbatim
40  transport
41  {
42  mu
43  {
44  pLow 1e3;
45  pHigh 1e6;
46 
47  Tlow 200;
48  Thigh 1500;
49 
50  values
51  <m> <n>
52  (
53  (..........)
54  .
55  .
56  .
57  (..........)
58  );
59  }
60 
61  kappa
62  {
63  pLow 1e3;
64  pHigh 1e6;
65 
66  Tlow 200;
67  Thigh 1500;
68 
69  values
70  <m> <n>
71  (
72  (..........)
73  .
74  .
75  .
76  (..........)
77  );
78  }
79  }
80  \endverbatim
81 
82  See also tutorials/resources/thermoData/wallBoiling*
83 
84 SourceFiles
85  tabulatedTransportI.H
86  tabulatedTransport.C
87 
88 See also
89  Foam::Function2s::uniformTable
90 
91 \*---------------------------------------------------------------------------*/
92 
93 #ifndef tabulatedTransport_H
94 #define tabulatedTransport_H
95 
96 #include "UniformTable2.H"
97 
98 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
99 
100 namespace Foam
101 {
102 
103 // Forward declaration of friend functions and operators
104 
105 template<class Thermo> class tabulatedTransport;
106 
107 template<class Thermo>
108 Ostream& operator<<(Ostream&, const tabulatedTransport<Thermo>&);
109 
110 
111 /*---------------------------------------------------------------------------*\
112  Class tabulatedTransport Declaration
113 \*---------------------------------------------------------------------------*/
114 
115 template<class Thermo>
116 class tabulatedTransport
117 :
118  public Thermo
119 {
121 
122 
123  // Private Data
124 
125  //- Dynamic viscosity table [Pa.s]
126  table2D mu_;
127 
128  //- Thermal conductivity table [W/m/K]
129  table2D kappa_;
130 
131 
132  // Private Member Functions
133 
134  //- Construct from components
135  inline tabulatedTransport
136  (
137  const Thermo& t,
138  const table2D& muPoly,
139  const table2D& kappaPoly
140  );
141 
142 
143 public:
144 
145  // Constructors
146 
147  //- Construct as named copy
148  inline tabulatedTransport(const word&, const tabulatedTransport&);
149 
150  //- Construct from dictionary
152 
153  //- Construct and return a clone
154  inline autoPtr<tabulatedTransport> clone() const;
155 
156  // Selector from dictionary
157  inline static autoPtr<tabulatedTransport> New(const dictionary& dict);
158 
159 
160  // Member Functions
161 
162  //- Return the instantiated type name
163  static word typeName()
164  {
165  return "tabulated<" + Thermo::typeName() + '>';
166  }
167 
168  //- Dynamic viscosity [kg/m/s]
169  inline scalar mu(const scalar p, const scalar T) const;
170 
171  //- Thermal conductivity [W/m/K]
172  inline scalar kappa(const scalar p, const scalar T) const;
173 
174  //- Write to Ostream
175  void write(Ostream& os) const;
176 
177 
178  // Ostream Operator
179 
180  friend Ostream& operator<< <Thermo>
181  (
182  Ostream&,
183  const tabulatedTransport&
184  );
185 };
186 
187 
188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189 
190 } // End namespace Foam
191 
192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193 
194 #include "tabulatedTransportI.H"
195 
196 #ifdef NoRepository
197  #include "tabulatedTransport.C"
198 #endif
199 
200 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
201 
202 #endif
203 
204 // ************************************************************************* //
dictionary dict
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
scalar mu(const scalar p, const scalar T) const
Dynamic viscosity [kg/m/s].
scalar kappa(const scalar p, const scalar T) const
Thermal conductivity [W/m/K].
static autoPtr< tabulatedTransport > New(const dictionary &dict)
A class for handling words, derived from string.
Definition: word.H:59
Transport properties package using uniformly-spaced tabulated data for viscosity and thermal conducti...
void write(Ostream &os) const
Write to Ostream.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
static word typeName()
Return the instantiated type name.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
autoPtr< tabulatedTransport > clone() const
Construct and return a clone.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
volScalarField & p
Namespace for OpenFOAM.