FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

polynomialTransport.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 2008-2010 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software: you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
00023 
00024 Class
00025     Foam::polynomialTransport
00026 
00027 Description
00028     Transport package using polynomial functions for mu and kappa
00029 
00030 SourceFiles
00031     polynomialTransportI.H
00032     polynomialTransport.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef polynomialTransport_H
00037 #define polynomialTransport_H
00038 
00039 #include <OpenFOAM/Polynomial.H>
00040 
00041 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00042 
00043 namespace Foam
00044 {
00045 
00046 // Forward declaration of friend functions and operators
00047 
00048 template<class Thermo, int PolySize> class polynomialTransport;
00049 
00050 template<class Thermo, int PolySize>
00051 inline polynomialTransport<Thermo, PolySize> operator+
00052 (
00053     const polynomialTransport<Thermo, PolySize>&,
00054     const polynomialTransport<Thermo, PolySize>&
00055 );
00056 
00057 template<class Thermo, int PolySize>
00058 inline polynomialTransport<Thermo, PolySize> operator-
00059 (
00060     const polynomialTransport<Thermo, PolySize>&,
00061     const polynomialTransport<Thermo, PolySize>&
00062 );
00063 
00064 template<class Thermo, int PolySize>
00065 inline polynomialTransport<Thermo, PolySize> operator*
00066 (
00067     const scalar,
00068     const polynomialTransport<Thermo, PolySize>&
00069 );
00070 
00071 template<class Thermo, int PolySize>
00072 inline polynomialTransport<Thermo, PolySize> operator==
00073 (
00074     const polynomialTransport<Thermo, PolySize>&,
00075     const polynomialTransport<Thermo, PolySize>&
00076 );
00077 
00078 template<class Thermo, int PolySize>
00079 Ostream& operator<<
00080 (
00081     Ostream&,
00082     const polynomialTransport<Thermo, PolySize>&
00083 );
00084 
00085 
00086 /*---------------------------------------------------------------------------*\
00087                      Class polynomialTransport Declaration
00088 \*---------------------------------------------------------------------------*/
00089 
00090 template<class Thermo, int PolySize>
00091 class polynomialTransport
00092 :
00093     public Thermo
00094 {
00095     // Private data
00096 
00097         //- Dynamic viscosity
00098         //  Note: input in [Pa.s], but internally uses [Pa.s/kmol]
00099         Polynomial<PolySize> muPolynomial_;
00100 
00101         //- Thermal conductivity
00102         //  Note: input in [W/m/K], but internally uses [W/m/K/kmol]
00103         Polynomial<PolySize> kappaPolynomial_;
00104 
00105 
00106     // Private member functions
00107 
00108         //- Construct from components
00109         inline polynomialTransport
00110         (
00111             const Thermo& t,
00112             const Polynomial<PolySize>& muPoly,
00113             const Polynomial<PolySize>& kappaPoly
00114         );
00115 
00116 
00117 public:
00118 
00119     // Constructors
00120 
00121         //- Construct copy
00122         inline polynomialTransport(const polynomialTransport&);
00123 
00124         //- Construct as named copy
00125         inline polynomialTransport(const word&, const polynomialTransport&);
00126 
00127         //- Construct from Istream
00128         polynomialTransport(Istream& is);
00129 
00130         //- Construct and return a clone
00131         inline autoPtr<polynomialTransport> clone() const;
00132 
00133         // Selector from Istream
00134         inline static autoPtr<polynomialTransport> New(Istream& is);
00135 
00136 
00137     // Member functions
00138 
00139         //- Dynamic viscosity [kg/ms]
00140         inline scalar mu(const scalar T) const;
00141 
00142         //- Thermal conductivity [W/mK]
00143         inline scalar kappa(const scalar T) const;
00144 
00145         //- Thermal diffusivity for enthalpy [kg/ms]
00146         inline scalar alpha(const scalar T) const;
00147 
00148         // Species diffusivity
00149         //inline scalar D(const scalar T) const;
00150 
00151 
00152     // Member operators
00153 
00154         inline polynomialTransport& operator=(const polynomialTransport&);
00155         inline void operator+=(const polynomialTransport&);
00156         inline void operator-=(const polynomialTransport&);
00157         inline void operator*=(const scalar);
00158 
00159 
00160     // Friend operators
00161 
00162         friend polynomialTransport operator+ <Thermo, PolySize>
00163         (
00164             const polynomialTransport&,
00165             const polynomialTransport&
00166         );
00167 
00168         friend polynomialTransport operator- <Thermo, PolySize>
00169         (
00170             const polynomialTransport&,
00171             const polynomialTransport&
00172         );
00173 
00174         friend polynomialTransport operator* <Thermo, PolySize>
00175         (
00176             const scalar,
00177             const polynomialTransport&
00178         );
00179 
00180         friend polynomialTransport operator== <Thermo, PolySize>
00181         (
00182             const polynomialTransport&,
00183             const polynomialTransport&
00184         );
00185 
00186 
00187     // Ostream Operator
00188 
00189         friend Ostream& operator<< <Thermo, PolySize>
00190         (
00191             Ostream&,
00192             const polynomialTransport&
00193         );
00194 };
00195 
00196 
00197 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00198 
00199 } // End namespace Foam
00200 
00201 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00202 
00203 #include "polynomialTransportI.H"
00204 
00205 #ifdef NoRepository
00206 #   include "polynomialTransport.C"
00207 #endif
00208 
00209 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00210 
00211 #endif
00212 
00213 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines