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 (
55 );
56 
57 template<class Thermo, int PolySize>
59 (
62 );
63 
64 template<class Thermo, int PolySize>
66 (
67  const scalar,
69 );
70 
71 template<class Thermo, int PolySize>
73 (
76 );
77 
78 template<class Thermo, int PolySize>
79 Ostream& operator<<
80 (
81  Ostream&,
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]
100 
101  //- Thermal conductivity polynomial coefficients
102  // Note: input in [W/m/K], but internally uses [W/m/K/kmol]
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 // ************************************************************************* //
polynomialTransport.C
p
p
Definition: pEqn.H:62
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::polynomialTransport::write
void write(Ostream &os) const
Write to Ostream.
Definition: polynomialTransport.C:73
Foam::polynomialTransport::New
static autoPtr< polynomialTransport > New(Istream &is)
Definition: polynomialTransportI.H:82
Foam::polynomialTransport::kappaCoeffs_
Polynomial< PolySize > kappaCoeffs_
Thermal conductivity polynomial coefficients.
Definition: polynomialTransport.H:102
Foam::polynomialTransport::typeName
static word typeName()
Return the instantiated type name.
Definition: polynomialTransport.H:145
Foam::polynomialTransport::operator-=
void operator-=(const polynomialTransport &)
Definition: polynomialTransportI.H:174
Foam::polynomialTransport::operator*=
void operator*=(const scalar)
Definition: polynomialTransportI.H:192
polynomialTransportI.H
Foam::polynomialTransport::kappa
scalar kappa(const scalar p, const scalar T) const
Thermal conductivity [W/mK].
Definition: polynomialTransportI.H:117
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:57
Foam::polynomialTransport::mu
scalar mu(const scalar p, const scalar T) const
Dynamic viscosity [kg/ms].
Definition: polynomialTransportI.H:106
Foam::T
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Definition: FieldFieldFunctions.C:55
Polynomial.H
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::polynomialTransport::operator=
polynomialTransport & operator=(const polynomialTransport &)
Definition: polynomialTransportI.H:141
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam::polynomialTransport::operator+=
void operator+=(const polynomialTransport &)
Definition: polynomialTransportI.H:156
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::autoPtr
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:117
Foam::polynomialTransport::alphah
scalar alphah(const scalar p, const scalar T) const
Thermal diffusivity of enthalpy [kg/ms].
Definition: polynomialTransportI.H:128
Foam::Polynomial< PolySize >
Foam::polynomialTransport::muCoeffs_
Polynomial< PolySize > muCoeffs_
Dynamic viscosity polynomial coefficients.
Definition: polynomialTransport.H:98
Foam::polynomialTransport::polynomialTransport
polynomialTransport(const Thermo &t, const Polynomial< PolySize > &muPoly, const Polynomial< PolySize > &kappaPoly)
Construct from components.
Foam::polynomialTransport
Transport package using polynomial functions for mu and kappa.
Definition: polynomialTransport.H:47
PolySize
const int PolySize
Definition: Test-Polynomial.C:37
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::polynomialTransport::clone
autoPtr< polynomialTransport > clone() const
Construct and return a clone.
Definition: polynomialTransportI.H:71