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