FreeFOAM The Cross-Platform CFD Toolkit
sutherlandTransport.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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
19  for more details.
20 
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/>.
23 
24 Class
25  Foam::sutherlandTransport
26 
27 Description
28  Transport package using Sutherland's formula.
29 
30  Templated into a given thermodynamics package (needed for thermal
31  conductivity).
32 
33  Dynamic viscosity [kg/m.s]
34  @f[
35  \mu = A_s \frac{\sqrt{T}}{1 + T_s / T}
36  @f]
37 
38 SourceFiles
39  sutherlandTransportI.H
40  sutherlandTransport.C
41 
42 \*---------------------------------------------------------------------------*/
43 
44 #ifndef sutherlandTransport_H
45 #define sutherlandTransport_H
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 // Forward declaration of friend functions and operators
53 
54 template<class thermo> class sutherlandTransport;
55 
56 template<class thermo>
57 inline sutherlandTransport<thermo> operator+
58 (
59  const sutherlandTransport<thermo>&,
60  const sutherlandTransport<thermo>&
61 );
62 
63 template<class thermo>
64 inline sutherlandTransport<thermo> operator-
65 (
66  const sutherlandTransport<thermo>&,
67  const sutherlandTransport<thermo>&
68 );
69 
70 template<class thermo>
71 inline sutherlandTransport<thermo> operator*
72 (
73  const scalar,
74  const sutherlandTransport<thermo>&
75 );
76 
77 template<class thermo>
78 inline sutherlandTransport<thermo> operator==
79 (
80  const sutherlandTransport<thermo>&,
81  const sutherlandTransport<thermo>&
82 );
83 
84 template<class thermo>
85 Ostream& operator<<
86 (
87  Ostream&,
88  const sutherlandTransport<thermo>&
89 );
90 
91 
92 /*---------------------------------------------------------------------------*\
93  Class sutherlandTransport Declaration
94 \*---------------------------------------------------------------------------*/
95 
96 template<class thermo>
98 :
99  public thermo
100 {
101  // Private data
102 
103  // Sutherland's coefficients
104  scalar As, Ts;
105 
106 
107  // Private member functions
108 
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  );
116 
117 
118 public:
119 
120  // Constructors
121 
122  //- Construct from components
123  inline sutherlandTransport
124  (
125  const thermo& t,
126  const scalar as,
127  const scalar ts
128  );
129 
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  );
137 
138  //- Construct as named copy
139  inline sutherlandTransport(const word&, const sutherlandTransport&);
140 
141  //- Construct from Istream
143 
144  //- Construct and return a clone
145  inline autoPtr<sutherlandTransport> clone() const;
146 
147  // Selector from Istream
148  inline static autoPtr<sutherlandTransport> New(Istream& is);
149 
150 
151  // Member functions
152 
153  //- Dynamic viscosity [kg/ms]
154  inline scalar mu(const scalar T) const;
155 
156  //- Thermal conductivity [W/mK]
157  inline scalar kappa(const scalar T) const;
158 
159  //- Thermal diffusivity for enthalpy [kg/ms]
160  inline scalar alpha(const scalar T) const;
161 
162  // Species diffusivity
163  //inline scalar D(const scalar T) const;
164 
165 
166  // Member operators
167 
168  inline sutherlandTransport& operator=
169  (
170  const sutherlandTransport&
171  );
172 
173 
174  // Friend operators
175 
176  friend sutherlandTransport operator+ <thermo>
177  (
178  const sutherlandTransport&,
179  const sutherlandTransport&
180  );
181 
182  friend sutherlandTransport operator- <thermo>
183  (
184  const sutherlandTransport&,
185  const sutherlandTransport&
186  );
187 
188  friend sutherlandTransport operator* <thermo>
189  (
190  const scalar,
191  const sutherlandTransport&
192  );
193 
194  friend sutherlandTransport operator== <thermo>
195  (
196  const sutherlandTransport&,
197  const sutherlandTransport&
198  );
199 
200 
201  // Ostream Operator
202 
203  friend Ostream& operator<< <thermo>
204  (
205  Ostream&,
206  const sutherlandTransport&
207  );
208 };
209 
210 
211 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
212 
213 } // End namespace Foam
214 
215 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
216 
218 
219 #ifdef NoRepository
221 #endif
222 
223 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
224 
225 #endif
226 
227 // ************************ vim: set sw=4 sts=4 et: ************************ //