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-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::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>
117 :
118  public Thermo
119 {
120  // Private Typedefs
121 
122  //- Table type
123  typedef Function2s::UniformTable<scalar> table2D;
124 
125 
126  // Private Data
127 
128  //- Dynamic viscosity table [Pa.s]
129  table2D mu_;
130 
131  //- Thermal conductivity table [W/m/K]
132  table2D kappa_;
133 
134 
135 public:
136 
137  // Constructors
138 
139  //- Construct from components
140  inline tabulatedTransport
141  (
142  const Thermo& t,
143  const table2D& muPoly,
144  const table2D& kappaPoly
145  );
146 
147  //- Construct as named copy
148  inline tabulatedTransport(const word&, const tabulatedTransport&);
149 
150  //- Construct from name and dictionary
151  tabulatedTransport(const word& name, const dictionary& dict);
152 
153  //- Construct and return a clone
154  inline autoPtr<tabulatedTransport> clone() const;
155 
156 
157  // Member Functions
158 
159  //- Return the instantiated type name
160  static word typeName()
161  {
162  return "tabulated<" + Thermo::typeName() + '>';
163  }
164 
165  //- Dynamic viscosity [kg/m/s]
166  inline scalar mu(const scalar p, const scalar T) const;
167 
168  //- Thermal conductivity [W/m/K]
169  inline scalar kappa(const scalar p, const scalar T) const;
170 
171  //- Write to Ostream
172  void write(Ostream& os) const;
173 
174 
175  // Ostream Operator
176 
177  friend Ostream& operator<< <Thermo>
178  (
179  Ostream&,
180  const tabulatedTransport&
181  );
182 };
183 
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 } // End namespace Foam
188 
189 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
190 
191 #include "tabulatedTransportI.H"
192 
193 #ifdef NoRepository
194  #include "tabulatedTransport.C"
195 #endif
196 
197 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198 
199 #endif
200 
201 // ************************************************************************* //
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
Transport properties package using uniformly-spaced tabulated data for viscosity and thermal conducti...
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 word typeName()
Return the instantiated type name.
autoPtr< tabulatedTransport > clone() const
Construct and return a clone.
void write(Ostream &os) const
Write to Ostream.
tabulatedTransport(const Thermo &t, const table2D &muPoly, const table2D &kappaPoly)
Construct from components.
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
word name(const bool)
Return a word representation of a bool.
Definition: boolIO.C:39
Ostream & operator<<(Ostream &, const ensightPart &)
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
dictionary dict
volScalarField & p