FreeFOAM The Cross-Platform CFD Toolkit
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) 2008-2010 OpenCFD Ltd.
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 <OpenFOAM/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>
51 inline polynomialTransport<Thermo, PolySize> operator+
52 (
53  const polynomialTransport<Thermo, PolySize>&,
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>
92 :
93  public Thermo
94 {
95  // Private data
96 
97  //- Dynamic viscosity
98  // Note: input in [Pa.s], but internally uses [Pa.s/kmol]
99  Polynomial<PolySize> muPolynomial_;
100 
101  //- Thermal conductivity
102  // Note: input in [W/m/K], but internally uses [W/m/K/kmol]
103  Polynomial<PolySize> kappaPolynomial_;
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 and return a clone
131  inline autoPtr<polynomialTransport> clone() const;
132 
133  // Selector from Istream
134  inline static autoPtr<polynomialTransport> New(Istream& is);
135 
136 
137  // Member functions
138 
139  //- Dynamic viscosity [kg/ms]
140  inline scalar mu(const scalar T) const;
141 
142  //- Thermal conductivity [W/mK]
143  inline scalar kappa(const scalar T) const;
144 
145  //- Thermal diffusivity for enthalpy [kg/ms]
146  inline scalar alpha(const scalar T) const;
147 
148  // Species diffusivity
149  //inline scalar D(const scalar T) const;
150 
151 
152  // Member operators
153 
155  inline void operator+=(const polynomialTransport&);
156  inline void operator-=(const polynomialTransport&);
157  inline void operator*=(const scalar);
158 
159 
160  // Friend operators
161 
162  friend polynomialTransport operator+ <Thermo, PolySize>
163  (
164  const polynomialTransport&,
165  const polynomialTransport&
166  );
167 
168  friend polynomialTransport operator- <Thermo, PolySize>
169  (
170  const polynomialTransport&,
171  const polynomialTransport&
172  );
173 
174  friend polynomialTransport operator* <Thermo, PolySize>
175  (
176  const scalar,
177  const polynomialTransport&
178  );
179 
180  friend polynomialTransport operator== <Thermo, PolySize>
181  (
182  const polynomialTransport&,
183  const polynomialTransport&
184  );
185 
186 
187  // Ostream Operator
188 
189  friend Ostream& operator<< <Thermo, PolySize>
190  (
191  Ostream&,
192  const polynomialTransport&
193  );
194 };
195 
196 
197 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198 
199 } // End namespace Foam
200 
201 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202 
203 #include "polynomialTransportI.H"
204 
205 #ifdef NoRepository
206 # include "polynomialTransport.C"
207 #endif
208 
209 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210 
211 #endif
212 
213 // ************************ vim: set sw=4 sts=4 et: ************************ //