Merge branch 'upstream/OpenFOAM' into master
[freefoam.git] / src / thermophysicalModels / specie / transport / polynomial / polynomialTransport.H
blob1e4ca70768cd53b391931828f33c9bc16cb8af1f
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2008-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
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 the
13     Free Software Foundation; either version 2 of the License, or (at your
14     option) any later version.
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.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Class
26     Foam::polynomialTransport
28 Description
29     Transport package using polynomial functions for mu and kappa
31 SourceFiles
32     polynomialTransportI.H
33     polynomialTransport.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef polynomialTransport_H
38 #define polynomialTransport_H
40 #include <OpenFOAM/Polynomial.H>
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 namespace Foam
47 // Forward declaration of friend functions and operators
49 template<class Thermo, int PolySize> class polynomialTransport;
51 template<class Thermo, int PolySize>
52 inline polynomialTransport<Thermo, PolySize> operator+
54     const polynomialTransport<Thermo, PolySize>&,
55     const polynomialTransport<Thermo, PolySize>&
58 template<class Thermo, int PolySize>
59 inline polynomialTransport<Thermo, PolySize> operator-
61     const polynomialTransport<Thermo, PolySize>&,
62     const polynomialTransport<Thermo, PolySize>&
65 template<class Thermo, int PolySize>
66 inline polynomialTransport<Thermo, PolySize> operator*
68     const scalar,
69     const polynomialTransport<Thermo, PolySize>&
72 template<class Thermo, int PolySize>
73 inline polynomialTransport<Thermo, PolySize> operator==
75     const polynomialTransport<Thermo, PolySize>&,
76     const polynomialTransport<Thermo, PolySize>&
79 template<class Thermo, int PolySize>
80 Ostream& operator<<
82     Ostream&,
83     const polynomialTransport<Thermo, PolySize>&
87 /*---------------------------------------------------------------------------*\
88                      Class polynomialTransport Declaration
89 \*---------------------------------------------------------------------------*/
91 template<class Thermo, int PolySize>
92 class polynomialTransport
94     public Thermo
96     // Private data
98         //- Dynamic viscosity
99         Polynomial<PolySize> muPolynomial_;
101         //- Thermal conductivity
102         Polynomial<PolySize> kappaPolynomial_;
105     // Private member functions
107         //- Construct from components
108         inline polynomialTransport
109         (
110             const Thermo& t,
111             const Polynomial<PolySize>& muPoly,
112             const Polynomial<PolySize>& kappaPoly
113         );
116 public:
118     // Constructors
120         //- Construct as named copy
121         inline polynomialTransport(const word&, const polynomialTransport&);
123         //- Construct from Istream
124         polynomialTransport(Istream& is);
126         //- Construct and return a clone
127         inline autoPtr<polynomialTransport> clone() const;
129         // Selector from Istream
130         inline static autoPtr<polynomialTransport> New(Istream& is);
133     // Member functions
135         //- Dynamic viscosity [kg/ms]
136         inline scalar mu(const scalar T) const;
138         //- Thermal conductivity [W/mK]
139         inline scalar kappa(const scalar T) const;
141         //- Thermal diffusivity for enthalpy [kg/ms]
142         inline scalar alpha(const scalar T) const;
144         // Species diffusivity
145         //inline scalar D(const scalar T) const;
148     // Member operators
150         inline polynomialTransport& operator=(const polynomialTransport&);
153     // Friend operators
155         friend polynomialTransport operator+ <Thermo, PolySize>
156         (
157             const polynomialTransport&,
158             const polynomialTransport&
159         );
161         friend polynomialTransport operator- <Thermo, PolySize>
162         (
163             const polynomialTransport&,
164             const polynomialTransport&
165         );
167         friend polynomialTransport operator* <Thermo, PolySize>
168         (
169             const scalar,
170             const polynomialTransport&
171         );
173         friend polynomialTransport operator== <Thermo, PolySize>
174         (
175             const polynomialTransport&,
176             const polynomialTransport&
177         );
180     // Ostream Operator
182         friend Ostream& operator<< <Thermo, PolySize>
183         (
184             Ostream&,
185             const polynomialTransport&
186         );
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 } // End namespace Foam
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 #include "polynomialTransportI.H"
198 #ifdef NoRepository
199 #   include "polynomialTransport.C"
200 #endif
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 #endif
206 // ************************ vim: set sw=4 sts=4 et: ************************ //