Forward compatibility: flex
[foam-extend-3.2.git] / src / thermophysicalModels / specie / transport / sutherland / sutherlandTransport.H
blob9cc9d0c0991c315b6b075c6597b593988e2db1f0
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | foam-extend: Open Source CFD
4    \\    /   O peration     | Version:     3.2
5     \\  /    A nd           | Web:         http://www.foam-extend.org
6      \\/     M anipulation  | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
8 License
9     This file is part of foam-extend.
11     foam-extend 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 3 of the License, or (at your
14     option) any later version.
16     foam-extend is distributed in the hope that it will be useful, but
17     WITHOUT ANY WARRANTY; without even the implied warranty of
18     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19     General Public License for more details.
21     You should have received a copy of the GNU General Public License
22     along with foam-extend.  If not, see <http://www.gnu.org/licenses/>.
24 Class
25     Foam::sutherlandTransport
27 Description
28     Transport package using Sutherland's formula.
30     Templated into a given thermodynamics package (needed for thermal
31     conductivity).
33     Dynamic viscosity [kg/m.s]
34     @f[
35         \mu = A_s \frac{\sqrt{T}}{1 + T_s / T}
36     @f]
38 SourceFiles
39     sutherlandTransportI.H
40     sutherlandTransport.C
42 \*---------------------------------------------------------------------------*/
44 #ifndef sutherlandTransport_H
45 #define sutherlandTransport_H
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 namespace Foam
52 // Forward declaration of friend functions and operators
54 template<class thermo> class sutherlandTransport;
56 template<class thermo>
57 inline sutherlandTransport<thermo> operator+
59     const sutherlandTransport<thermo>&,
60     const sutherlandTransport<thermo>&
63 template<class thermo>
64 inline sutherlandTransport<thermo> operator-
66     const sutherlandTransport<thermo>&,
67     const sutherlandTransport<thermo>&
70 template<class thermo>
71 inline sutherlandTransport<thermo> operator*
73     const scalar,
74     const sutherlandTransport<thermo>&
77 template<class thermo>
78 inline sutherlandTransport<thermo> operator==
80     const sutherlandTransport<thermo>&,
81     const sutherlandTransport<thermo>&
84 template<class thermo>
85 Ostream& operator<<
87     Ostream&,
88     const sutherlandTransport<thermo>&
92 /*---------------------------------------------------------------------------*\
93                            Class sutherlandTransport Declaration
94 \*---------------------------------------------------------------------------*/
96 template<class thermo>
97 class sutherlandTransport
99     public thermo
101     // Private data
103         // Sutherland's coefficients
104         scalar As, Ts;
107     // Private member functions
109         //- Calculate the Sutherland coefficients
110         //  given two viscosities and temperatures
111         inline void calcCoeffs
112         (
113             const scalar mu1, const scalar T1,
114             const scalar mu2, const scalar T2
115         );
118 public:
120     // Constructors
122         //- Construct from components
123         inline sutherlandTransport
124         (
125             const thermo& t,
126             const scalar as,
127             const scalar ts
128         );
130         //- Construct from two viscosities
131         inline sutherlandTransport
132         (
133             const thermo& t,
134             const scalar mu1, const scalar T1,
135             const scalar mu2, const scalar T2
136         );
138         //- Construct as named copy
139         inline sutherlandTransport(const word&, const sutherlandTransport&);
141         //- Construct from Istream
142         sutherlandTransport(Istream&);
144         //- Construct and return a clone
145         inline autoPtr<sutherlandTransport> clone() const;
147         // Selector from Istream
148         inline static autoPtr<sutherlandTransport> New(Istream& is);
151     // Member functions
153         //- Dynamic viscosity [kg/ms]
154         inline scalar mu(const scalar T) const;
156         //- Thermal conductivity [W/mK]
157         inline scalar kappa(const scalar T) const;
159         //- Thermal diffusivity for enthalpy [kg/ms]
160         inline scalar alpha(const scalar T) const;
162         // Species diffusivity
163         //inline scalar D(const scalar T) const;
166     // Member operators
168         inline sutherlandTransport& operator=(const sutherlandTransport&);
170         inline void operator+=(const sutherlandTransport&);
172         inline void operator-=(const sutherlandTransport&);
174         inline void operator*=(const scalar);
177     // Friend operators
179         friend sutherlandTransport operator+ <thermo>
180         (
181             const sutherlandTransport&,
182             const sutherlandTransport&
183         );
185         friend sutherlandTransport operator- <thermo>
186         (
187             const sutherlandTransport&,
188             const sutherlandTransport&
189         );
191         friend sutherlandTransport operator* <thermo>
192         (
193             const scalar,
194             const sutherlandTransport&
195         );
197         friend sutherlandTransport operator== <thermo>
198         (
199             const sutherlandTransport&,
200             const sutherlandTransport&
201         );
204     // Ostream Operator
206         friend Ostream& operator<< <thermo>
207         (
208             Ostream&,
209             const sutherlandTransport&
210         );
214 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
216 } // End namespace Foam
218 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
220 #include "sutherlandTransportI.H"
222 #ifdef NoRepository
223 #   include "sutherlandTransport.C"
224 #endif
226 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
228 #endif
230 // ************************************************************************* //