1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
7 -------------------------------------------------------------------------------
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
13 the Free Software Foundation, either version 3 of the License, or
14 (at your 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
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/>.
25 Foam::polynomialTransport
28 Transport package using polynomial functions for mu and kappa
31 polynomialTransportI.H
34 \*---------------------------------------------------------------------------*/
36 #ifndef polynomialTransport_H
37 #define polynomialTransport_H
39 #include "Polynomial.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 // Forward declaration of friend functions and operators
48 template<class Thermo, int PolySize> class polynomialTransport;
50 template<class Thermo, int PolySize>
51 inline polynomialTransport<Thermo, PolySize> operator+
53 const polynomialTransport<Thermo, PolySize>&,
54 const polynomialTransport<Thermo, PolySize>&
57 template<class Thermo, int PolySize>
58 inline polynomialTransport<Thermo, PolySize> operator-
60 const polynomialTransport<Thermo, PolySize>&,
61 const polynomialTransport<Thermo, PolySize>&
64 template<class Thermo, int PolySize>
65 inline polynomialTransport<Thermo, PolySize> operator*
68 const polynomialTransport<Thermo, PolySize>&
71 template<class Thermo, int PolySize>
72 inline polynomialTransport<Thermo, PolySize> operator==
74 const polynomialTransport<Thermo, PolySize>&,
75 const polynomialTransport<Thermo, PolySize>&
78 template<class Thermo, int PolySize>
82 const polynomialTransport<Thermo, PolySize>&
86 /*---------------------------------------------------------------------------*\
87 Class polynomialTransport Declaration
88 \*---------------------------------------------------------------------------*/
90 template<class Thermo, int PolySize>
91 class polynomialTransport
97 //- Dynamic viscosity polynomial coefficients
98 // Note: input in [Pa.s], but internally uses [Pa.s/kmol]
99 Polynomial<PolySize> muCoeffs_;
101 //- Thermal conductivity polynomial coefficients
102 // Note: input in [W/m/K], but internally uses [W/m/K/kmol]
103 Polynomial<PolySize> kappaCoeffs_;
106 // Private Member Functions
108 //- Construct from components
109 inline polynomialTransport
112 const Polynomial<PolySize>& muPoly,
113 const Polynomial<PolySize>& kappaPoly
122 inline polynomialTransport(const polynomialTransport&);
124 //- Construct as named copy
125 inline polynomialTransport(const word&, const polynomialTransport&);
127 //- Construct from Istream
128 polynomialTransport(Istream& is);
130 //- Construct from dictionary
131 polynomialTransport(const dictionary& dict);
133 //- Construct and return a clone
134 inline autoPtr<polynomialTransport> clone() const;
136 // Selector from Istream
137 inline static autoPtr<polynomialTransport> New(Istream& is);
139 // Selector from dictionary
140 inline static autoPtr<polynomialTransport> New(const dictionary& dict);
145 //- Dynamic viscosity [kg/ms]
146 inline scalar mu(const scalar T) const;
148 //- Thermal conductivity [W/mK]
149 inline scalar kappa(const scalar T) const;
151 //- Thermal diffusivity for enthalpy [kg/ms]
152 inline scalar alpha(const scalar T) const;
154 // Species diffusivity
155 //inline scalar D(const scalar T) const;
158 void write(Ostream& os) const;
163 inline polynomialTransport& operator=(const polynomialTransport&);
164 inline void operator+=(const polynomialTransport&);
165 inline void operator-=(const polynomialTransport&);
166 inline void operator*=(const scalar);
171 friend polynomialTransport operator+ <Thermo, PolySize>
173 const polynomialTransport&,
174 const polynomialTransport&
177 friend polynomialTransport operator- <Thermo, PolySize>
179 const polynomialTransport&,
180 const polynomialTransport&
183 friend polynomialTransport operator* <Thermo, PolySize>
186 const polynomialTransport&
189 friend polynomialTransport operator== <Thermo, PolySize>
191 const polynomialTransport&,
192 const polynomialTransport&
198 friend Ostream& operator<< <Thermo, PolySize>
201 const polynomialTransport&
206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
208 } // End namespace Foam
210 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
212 #include "polynomialTransportI.H"
215 # include "polynomialTransport.C"
218 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
222 // ************************************************************************* //