logPolynomialTransport.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) 2016-2018 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::logPolynomialTransport
26 
27 Description
28  Transport package using polynomial functions of \c ln(T) for \c mu and
29  \c kappa:
30 
31  \f[
32  ln(mu) = \sum_{i=1}^N \left( a[i] * ln(T)^{i-1} \right)
33  \f]
34 
35  \f[
36  ln(kappa) = \sum_{i=1}^N \left( b[i] * ln(T)^{i-1} \right)
37  \f]
38 
39 Usage
40 
41  \table
42  Property | Description
43  muCoeffs<8> | Dynamic viscosity polynomial coefficients
44  kappaCoeffs<8> | Thermal conductivity polynomial coefficients
45  \endtable
46 
47  Example of the specification of the transport properties:
48  \verbatim
49  transport
50  {
51  muCoeffs<8> ( 1000 -0.05 0.003 0 0 0 0 0 );
52  kappaCoeffs<8> ( 2000 -0.15 0.023 0 0 0 0 0 );
53  }
54  \endverbatim
55 
56  The polynomial expressions are evaluated as so:
57 
58  \f[
59  \mu = 1000 - 0.05 ln(T) + 0.003 ln(T)^2
60  \f]
61 
62  \f[
63  \kappa = 2000 - 0.15 ln(T) + 0.023 ln(T)^2
64  \f]
65 
66 Note
67  - Dynamic viscosity polynomial coefficients evaluate to an expression in
68  [Pa.s], but internally uses [Pa.s/kmol].
69  - Thermal conductivity polynomial coefficients evaluate to an expression in
70  [W/m/K], but internally uses [W/m/K/kmol].
71 
72 SourceFiles
73  logPolynomialTransportI.H
74  logPolynomialTransport.C
75 
76 See also
77  Foam::Polynomial
78 
79 \*---------------------------------------------------------------------------*/
80 
81 #ifndef logPolynomialTransport_H
82 #define logPolynomialTransport_H
83 
84 #include "Polynomial.H"
85 
86 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
87 
88 namespace Foam
89 {
90 
91 // Forward declaration of friend functions and operators
92 
93 template<class Thermo, int PolySize> class logPolynomialTransport;
94 
95 template<class Thermo, int PolySize>
96 inline logPolynomialTransport<Thermo, PolySize> operator+
97 (
98  const logPolynomialTransport<Thermo, PolySize>&,
99  const logPolynomialTransport<Thermo, PolySize>&
100 );
102 template<class Thermo, int PolySize>
103 inline logPolynomialTransport<Thermo, PolySize> operator*
104 (
105  const scalar,
106  const logPolynomialTransport<Thermo, PolySize>&
107 );
108 
109 template<class Thermo, int PolySize>
110 Ostream& operator<<
111 (
112  Ostream&,
113  const logPolynomialTransport<Thermo, PolySize>&
114 );
115 
116 
117 /*---------------------------------------------------------------------------*\
118  Class logPolynomialTransport Declaration
119 \*---------------------------------------------------------------------------*/
120 
121 template<class Thermo, int PolySize=8>
123 :
124  public Thermo
125 {
126  // Private data
127 
128  //- Dynamic viscosity polynomial coefficients
129  // Note: input in [Pa.s], but internally uses [Pa.s/kmol]
130  Polynomial<PolySize> muCoeffs_;
131 
132  //- Thermal conductivity polynomial coefficients
133  // Note: input in [W/m/K], but internally uses [W/m/K/kmol]
134  Polynomial<PolySize> kappaCoeffs_;
135 
136 
137  // Private Member Functions
138 
139  //- Construct from components
141  (
142  const Thermo& t,
143  const Polynomial<PolySize>& muPoly,
144  const Polynomial<PolySize>& kappaPoly
145  );
146 
147 
148 public:
149 
150  // Constructors
151 
152  //- Construct as named copy
154  (
155  const word&,
157  );
158 
159  //- Construct from dictionary
161 
162  //- Construct and return a clone
163  inline autoPtr<logPolynomialTransport> clone() const;
164 
165  // Selector from dictionary
167  (
168  const dictionary& dict
169  );
170 
171 
172  // Member functions
173 
174  //- Return the instantiated type name
175  static word typeName()
176  {
177  return "logPolynomial<" + Thermo::typeName() + '>';
178  }
179 
180  //- Dynamic viscosity [kg/ms]
181  inline scalar mu(const scalar p, const scalar T) const;
182 
183  //- Thermal conductivity [W/mK]
184  inline scalar kappa(const scalar p, const scalar T) const;
185 
186  //- Thermal diffusivity of enthalpy [kg/ms]
187  inline scalar alphah(const scalar p, const scalar T) const;
188 
189  // Species diffusivity
190  // inline scalar D(const scalar p, const scalar T) const;
191 
192  //- Write to Ostream
193  void write(Ostream& os) const;
194 
195 
196  // Member operators
197 
198  inline void operator=(const logPolynomialTransport&);
199 
200  inline void operator+=(const logPolynomialTransport&);
201 
202  inline void operator*=(const scalar);
203 
204 
205  // Friend operators
206 
207  friend logPolynomialTransport operator+ <Thermo, PolySize>
208  (
209  const logPolynomialTransport&,
210  const logPolynomialTransport&
211  );
212 
213  friend logPolynomialTransport operator* <Thermo, PolySize>
214  (
215  const scalar,
216  const logPolynomialTransport&
217  );
218 
219 
220  // Ostream Operator
221 
222  friend Ostream& operator<< <Thermo, PolySize>
223  (
224  Ostream&,
225  const logPolynomialTransport&
226  );
227 };
228 
229 
230 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
231 
232 } // End namespace Foam
233 
234 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
235 
236 #include "logPolynomialTransportI.H"
237 
238 #ifdef NoRepository
239  #include "logPolynomialTransport.C"
240 #endif
241 
242 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
243 
244 #endif
245 
246 // ************************************************************************* //
autoPtr< logPolynomialTransport > clone() const
Construct and return a clone.
static autoPtr< logPolynomialTransport > New(const dictionary &dict)
dictionary dict
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
void operator+=(const logPolynomialTransport &)
A class for handling words, derived from string.
Definition: word.H:59
static word typeName()
Return the instantiated type name.
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:53
scalar alphah(const scalar p, const scalar T) const
Thermal diffusivity of enthalpy [kg/ms].
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
scalar mu(const scalar p, const scalar T) const
Dynamic viscosity [kg/ms].
Polynomial templated on size (order):
Definition: Polynomial.H:65
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
Transport package using polynomial functions of ln(T) for mu and kappa:
volScalarField & p
scalar kappa(const scalar p, const scalar T) const
Thermal conductivity [W/mK].
void operator=(const logPolynomialTransport &)
Namespace for OpenFOAM.