icoTabulatedTransport.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::icoTabulatedTransport
26 
27 Description
28  Transport properties package using non-uniformly-spaced tabulated data for
29  viscosity and thermal conductivity vs temperature.
30 
31 Usage
32  \table
33  Property | Description
34  mu | Dynamic viscosity vs temperature table
35  kappa | Thermal conductivity vs temperature table
36  \endtable
37 
38  Example of the specification of the transport properties:
39  \verbatim
40  transport
41  {
42  mu
43  {
44  values
45  (
46  (200 1.82e-05)
47  (350 2.61e-05)
48  (400 3.93e-05)
49  );
50  }
51 
52  kappa
53  {
54  values
55  (
56  (200 2.56e-5)
57  (350 3.33e-5)
58  (400 4.72e-5)
59  );
60  }
61  }
62  \endverbatim
63 
64 SourceFiles
65  icoTabulatedTransportI.H
66  icoTabulatedTransport.C
67 
68 See also
69  Foam::Function1s::NonUniformTable
70 
71 \*---------------------------------------------------------------------------*/
72 
73 #ifndef icoTabulatedTransport_H
74 #define icoTabulatedTransport_H
75 
76 #include "NonUniformTable1.H"
77 
78 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
79 
80 namespace Foam
81 {
82 
83 // Forward declaration of friend functions and operators
84 
85 template<class Thermo> class icoTabulatedTransport;
86 
87 template<class Thermo>
88 Ostream& operator<<(Ostream&, const icoTabulatedTransport<Thermo>&);
89 
90 
91 /*---------------------------------------------------------------------------*\
92  Class icoTabulatedTransport Declaration
93 \*---------------------------------------------------------------------------*/
94 
95 template<class Thermo>
97 :
98  public Thermo
99 {
100  // Private Typedefs
101 
102  //- Table type
103  typedef Function1s::NonUniformTable<scalar> nonUniformTable;
104 
105 
106  // Private Data
107 
108  //- Dynamic viscosity table [Pa.s]
109  nonUniformTable mu_;
110 
111  //- Thermal conductivity table [W/m/K]
112  nonUniformTable kappa_;
113 
114 
115 public:
116 
117  // Constructors
118 
119  //- Construct from components
120  inline icoTabulatedTransport
121  (
122  const Thermo& t,
123  const nonUniformTable& mu,
124  const nonUniformTable& kappa
125  );
126 
127  //- Construct as named copy
128  inline icoTabulatedTransport(const word&, const icoTabulatedTransport&);
129 
130  //- Construct from name and dictionary
132 
133  //- Construct and return a clone
134  inline autoPtr<icoTabulatedTransport> clone() const;
135 
136 
137  // Member Functions
138 
139  //- Return the instantiated type name
140  static word typeName()
141  {
142  return "tabulated<" + Thermo::typeName() + '>';
143  }
144 
145  //- Dynamic viscosity [kg/m/s]
146  inline scalar mu(const scalar p, const scalar T) const;
147 
148  //- Thermal conductivity [W/m/K]
149  inline scalar kappa(const scalar p, const scalar T) const;
150 
151  //- Write to Ostream
152  void write(Ostream& os) const;
153 
154 
155  // Ostream Operator
156 
157  friend Ostream& operator<< <Thermo>
158  (
159  Ostream&,
160  const icoTabulatedTransport&
161  );
162 };
163 
164 
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 
167 } // End namespace Foam
168 
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 
171 #include "icoTabulatedTransportI.H"
172 
173 #ifdef NoRepository
174  #include "icoTabulatedTransport.C"
175 #endif
176 
177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178 
179 #endif
180 
181 // ************************************************************************* //
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 non-uniformly-spaced tabulated data for viscosity and thermal cond...
scalar mu(const scalar p, const scalar T) const
Dynamic viscosity [kg/m/s].
icoTabulatedTransport(const Thermo &t, const nonUniformTable &mu, const nonUniformTable &kappa)
Construct from components.
scalar kappa(const scalar p, const scalar T) const
Thermal conductivity [W/m/K].
static word typeName()
Return the instantiated type name.
void write(Ostream &os) const
Write to Ostream.
autoPtr< icoTabulatedTransport > clone() const
Construct and return a clone.
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