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