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