OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

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-2009 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 the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     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, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     Foam::polynomialTransport
00027 
00028 Description
00029     Transport package using polynomial functions for mu and kappa
00030 
00031 SourceFiles
00032     polynomialTransportI.H
00033     polynomialTransport.C
00034 
00035 \*---------------------------------------------------------------------------*/
00036 
00037 #ifndef polynomialTransport_H
00038 #define polynomialTransport_H
00039 
00040 #include "Polynomial.H"
00041 
00042 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00043 
00044 namespace Foam
00045 {
00046 
00047 // Forward declaration of friend functions and operators
00048 
00049 template<class Thermo, int PolySize> class polynomialTransport;
00050 
00051 template<class Thermo, int PolySize>
00052 inline polynomialTransport<Thermo, PolySize> operator+
00053 (
00054     const polynomialTransport<Thermo, PolySize>&,
00055     const polynomialTransport<Thermo, PolySize>&
00056 );
00057 
00058 template<class Thermo, int PolySize>
00059 inline polynomialTransport<Thermo, PolySize> operator-
00060 (
00061     const polynomialTransport<Thermo, PolySize>&,
00062     const polynomialTransport<Thermo, PolySize>&
00063 );
00064 
00065 template<class Thermo, int PolySize>
00066 inline polynomialTransport<Thermo, PolySize> operator*
00067 (
00068     const scalar,
00069     const polynomialTransport<Thermo, PolySize>&
00070 );
00071 
00072 template<class Thermo, int PolySize>
00073 inline polynomialTransport<Thermo, PolySize> operator==
00074 (
00075     const polynomialTransport<Thermo, PolySize>&,
00076     const polynomialTransport<Thermo, PolySize>&
00077 );
00078 
00079 template<class Thermo, int PolySize>
00080 Ostream& operator<<
00081 (
00082     Ostream&,
00083     const polynomialTransport<Thermo, PolySize>&
00084 );
00085 
00086 
00087 /*---------------------------------------------------------------------------*\
00088                      Class polynomialTransport Declaration
00089 \*---------------------------------------------------------------------------*/
00090 
00091 template<class Thermo, int PolySize>
00092 class polynomialTransport
00093 :
00094     public Thermo
00095 {
00096     // Private data
00097 
00098         //- Dynamic viscosity
00099         Polynomial<PolySize> muPolynomial_;
00100 
00101         //- Thermal conductivity
00102         Polynomial<PolySize> kappaPolynomial_;
00103 
00104 
00105     // Private member functions
00106 
00107         //- Construct from components
00108         inline polynomialTransport
00109         (
00110             const Thermo& t,
00111             const Polynomial<PolySize>& muPoly,
00112             const Polynomial<PolySize>& kappaPoly
00113         );
00114 
00115 
00116 public:
00117 
00118     // Constructors
00119 
00120         //- Construct as named copy
00121         inline polynomialTransport(const word&, const polynomialTransport&);
00122 
00123         //- Construct from Istream
00124         polynomialTransport(Istream& is);
00125 
00126         //- Construct and return a clone
00127         inline autoPtr<polynomialTransport> clone() const;
00128 
00129         // Selector from Istream
00130         inline static autoPtr<polynomialTransport> New(Istream& is);
00131 
00132 
00133     // Member functions
00134 
00135         //- Dynamic viscosity [kg/ms]
00136         inline scalar mu(const scalar T) const;
00137 
00138         //- Thermal conductivity [W/mK]
00139         inline scalar kappa(const scalar T) const;
00140 
00141         //- Thermal diffusivity for enthalpy [kg/ms]
00142         inline scalar alpha(const scalar T) const;
00143 
00144         // Species diffusivity
00145         //inline scalar D(const scalar T) const;
00146 
00147 
00148     // Member operators
00149 
00150         inline polynomialTransport& operator=(const polynomialTransport&);
00151 
00152 
00153     // Friend operators
00154 
00155         friend polynomialTransport operator+ <Thermo, PolySize>
00156         (
00157             const polynomialTransport&,
00158             const polynomialTransport&
00159         );
00160 
00161         friend polynomialTransport operator- <Thermo, PolySize>
00162         (
00163             const polynomialTransport&,
00164             const polynomialTransport&
00165         );
00166 
00167         friend polynomialTransport operator* <Thermo, PolySize>
00168         (
00169             const scalar,
00170             const polynomialTransport&
00171         );
00172 
00173         friend polynomialTransport operator== <Thermo, PolySize>
00174         (
00175             const polynomialTransport&,
00176             const polynomialTransport&
00177         );
00178 
00179 
00180     // Ostream Operator
00181 
00182         friend Ostream& operator<< <Thermo, PolySize>
00183         (
00184             Ostream&,
00185             const polynomialTransport&
00186         );
00187 };
00188 
00189 
00190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00191 
00192 } // End namespace Foam
00193 
00194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00195 
00196 #include "polynomialTransportI.H"
00197 
00198 #ifdef NoRepository
00199 #   include "polynomialTransport.C"
00200 #endif
00201 
00202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00203 
00204 #endif
00205 
00206 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd