OpenFOAM logo
Open Source CFD Toolkit

sutherlandTransport.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) 1991-2005 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     sutherlandTransport
00027 
00028 Description
00029     Transport package using Sutherland's formula.  Templated ito a given
00030     thermodynamics package (needed for thermal conductivity).
00031 
00032 SourceFiles
00033     sutherlandTransportI.H
00034     sutherlandTransport.C
00035 
00036 \*---------------------------------------------------------------------------*/
00037 
00038 #ifndef sutherlandTransport_H
00039 #define sutherlandTransport_H
00040 
00041 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00042 
00043 namespace Foam
00044 {
00045 
00046 // * * * * * * Forward declaration of template friend fuctions * * * * * * * //
00047 
00048 template<class thermo> class sutherlandTransport;
00049 
00050 template<class thermo>
00051 inline sutherlandTransport<thermo> operator+
00052 (
00053     const sutherlandTransport<thermo>&,
00054     const sutherlandTransport<thermo>&
00055 );
00056 
00057 template<class thermo>
00058 inline sutherlandTransport<thermo> operator-
00059 (
00060     const sutherlandTransport<thermo>&,
00061     const sutherlandTransport<thermo>&
00062 );
00063 
00064 template<class thermo>
00065 inline sutherlandTransport<thermo> operator*
00066 (
00067     const scalar,
00068     const sutherlandTransport<thermo>&
00069 );
00070 
00071 template<class thermo>
00072 inline sutherlandTransport<thermo> operator==
00073 (
00074     const sutherlandTransport<thermo>&,
00075     const sutherlandTransport<thermo>&
00076 );
00077 
00078 template<class thermo>
00079 Ostream& operator<<
00080 (
00081     Ostream&,
00082     const sutherlandTransport<thermo>&
00083 );
00084 
00085 
00086 /*---------------------------------------------------------------------------*\
00087                            Class sutherlandTransport Declaration
00088 \*---------------------------------------------------------------------------*/
00089 
00090 template<class thermo>
00091 class sutherlandTransport
00092 :
00093     public thermo
00094 {
00095     // Private data
00096 
00097         // Sutherland's coefficients
00098         scalar As, Ts;
00099 
00100 
00101     // Private member functions
00102 
00103         //- Calculate the Sutherland coefficients
00104         //  given two viscosities and temperatures
00105         inline void calcCoeffs
00106         (
00107             const scalar mu1, const scalar T1,
00108             const scalar mu2, const scalar T2
00109         );
00110 
00111 
00112 public:
00113 
00114     // Constructors
00115 
00116         //- Construct from components
00117         inline sutherlandTransport
00118         (
00119             const thermo& t,
00120             const scalar as,
00121             const scalar ts
00122         );
00123 
00124         //- Construct from two viscosities
00125         inline sutherlandTransport
00126         (
00127             const thermo& t,
00128             const scalar mu1, const scalar T1,
00129             const scalar mu2, const scalar T2
00130         );
00131 
00132         //- Construct as named copy
00133         inline sutherlandTransport(const word&, const sutherlandTransport&);
00134 
00135         //- Construct from Istream
00136         sutherlandTransport(Istream&);
00137 
00138         //- Construct and return a clone
00139         inline autoPtr<sutherlandTransport> clone() const;
00140 
00141         // Selector from Istream
00142         inline static autoPtr<sutherlandTransport> New(Istream& is);
00143 
00144 
00145     // Member functions
00146 
00147         //- Dynamic viscosity [kg/ms]
00148         inline scalar mu(const scalar T) const;
00149 
00150         //- Thermal conductivity [W/mK]
00151         inline scalar kappa(const scalar T) const;
00152 
00153         //- Thermal diffusivity for enthalpy [kg/ms]
00154         inline scalar alpha(const scalar T) const;
00155 
00156         // Species diffusivity
00157         //inline scalar D(const scalar T) const;
00158 
00159 
00160     // Member operators
00161 
00162         inline sutherlandTransport& operator=
00163         (
00164             const sutherlandTransport&
00165         );
00166 
00167 
00168     // Friend operators
00169 
00170         friend sutherlandTransport operator+ <thermo>
00171         (
00172             const sutherlandTransport&,
00173             const sutherlandTransport&
00174         );
00175 
00176         friend sutherlandTransport operator- <thermo>
00177         (
00178             const sutherlandTransport&,
00179             const sutherlandTransport&
00180         );
00181 
00182         friend sutherlandTransport operator* <thermo>
00183         (
00184             const scalar,
00185             const sutherlandTransport&
00186         );
00187 
00188         friend sutherlandTransport operator== <thermo>
00189         (
00190             const sutherlandTransport&,
00191             const sutherlandTransport&
00192         );
00193 
00194 
00195     // Ostream Operator
00196 
00197         friend Ostream& operator<< <thermo>
00198         (
00199             Ostream&,
00200             const sutherlandTransport&
00201         );
00202 };
00203 
00204 
00205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00206 
00207 } // End namespace Foam
00208 
00209 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00210 
00211 #include "sutherlandTransportI.H"
00212 
00213 #ifdef NoRepository
00214 #   include "sutherlandTransport.C"
00215 #endif
00216 
00217 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00218 
00219 #endif
00220 
00221 // ************************************************************************* //
For further information go to www.openfoam.org