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