sutherlandTransport.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
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 for viscosity:
29 
30  \verbatim
31  mu = As*sqrt(T)/(1 + Ts/T)
32  \endverbatim
33 
34  and the thermal conductivity (for gases) is obtained from:
35 
36  \verbatim
37  kappa = mu*Cv*(1.32 + 1.77*R/Cv)
38  \endverbatim
39 
40 Usage
41  \table
42  Property | Description
43  As | Sutherland constant kg/(ms K^1/2)
44  Ts | Sutherland temperature [K]
45  \endtable
46 
47  Example specification of sutherlandTransport for air:
48  \verbatim
49  transport
50  {
51  As 1.458e-06;
52  Ts 110.4;
53  }
54  \endverbatim
55 
56 SourceFiles
57  sutherlandTransportI.H
58  sutherlandTransport.C
59 
60 \*---------------------------------------------------------------------------*/
61 
62 #ifndef sutherlandTransport_H
63 #define sutherlandTransport_H
64 
65 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
66 
67 namespace Foam
68 {
69 
70 // Forward declaration of friend functions and operators
71 
72 template<class Thermo> class sutherlandTransport;
73 
74 template<class Thermo>
75 inline sutherlandTransport<Thermo> operator+
76 (
77  const sutherlandTransport<Thermo>&,
78  const sutherlandTransport<Thermo>&
79 );
80 
81 template<class Thermo>
82 inline sutherlandTransport<Thermo> operator*
83 (
84  const scalar,
85  const sutherlandTransport<Thermo>&
86 );
87 
88 template<class Thermo>
89 Ostream& operator<<
90 (
91  Ostream&,
92  const sutherlandTransport<Thermo>&
93 );
94 
95 
96 /*---------------------------------------------------------------------------*\
97  Class sutherlandTransport Declaration
98 \*---------------------------------------------------------------------------*/
99 
100 template<class Thermo>
102 :
103  public Thermo
104 {
105  // Private Data
106 
107  // Sutherland's coefficients
108  scalar As_, Ts_;
109 
110 
111  // Private Member Functions
112 
113  //- Calculate the Sutherland coefficients
114  // given two viscosities and temperatures
115  inline void calcCoeffs
116  (
117  const scalar mu1, const scalar T1,
118  const scalar mu2, const scalar T2
119  );
120 
121  //- Read coefficient from dictionary
122  scalar readCoeff(const word& coeffName, const dictionary& dict);
123 
124 
125 public:
126 
127  // Constructors
128 
129  //- Construct from components
130  inline sutherlandTransport
131  (
132  const Thermo& t,
133  const scalar As,
134  const scalar Ts
135  );
136 
137  //- Construct from two viscosities
138  inline sutherlandTransport
139  (
140  const Thermo& t,
141  const scalar mu1, const scalar T1,
142  const scalar mu2, const scalar T2
143  );
144 
145  //- Construct as named copy
146  inline sutherlandTransport(const word&, const sutherlandTransport&);
147 
148  //- Construct from dictionary
149  sutherlandTransport(const dictionary& dict);
150 
151  //- Construct from base thermo and dictionary
152  sutherlandTransport(const Thermo& t,const dictionary& dict);
153 
154  //- Construct and return a clone
155  inline autoPtr<sutherlandTransport> clone() const;
156 
157  // Selector from dictionary
158  inline static autoPtr<sutherlandTransport> New(const dictionary& dict);
159 
160 
161  // Member Functions
162 
163  //- Return the instantiated type name
164  static word typeName()
165  {
166  return "sutherland<" + Thermo::typeName() + '>';
167  }
168 
169  //- Dynamic viscosity [kg/m/s]
170  inline scalar mu(const scalar p, const scalar T) const;
171 
172  //- Thermal conductivity [W/m/K]
173  inline scalar kappa(const scalar p, const scalar T) const;
174 
175  //- Write to Ostream
176  void write(Ostream& os) const;
177 
178 
179  // Member Operators
180 
181  inline void operator+=(const sutherlandTransport&);
182  inline void operator*=(const scalar);
183 
184 
185  // Friend operators
186 
187  friend sutherlandTransport operator+ <Thermo>
188  (
189  const sutherlandTransport&,
190  const sutherlandTransport&
191  );
192 
193  friend sutherlandTransport operator* <Thermo>
194  (
195  const scalar,
196  const sutherlandTransport&
197  );
198 
199 
200  // Ostream Operator
201 
202  friend Ostream& operator<< <Thermo>
203  (
204  Ostream&,
205  const sutherlandTransport&
206  );
207 };
208 
209 
210 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
211 
212 } // End namespace Foam
213 
214 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
215 
216 #include "sutherlandTransportI.H"
217 
218 #ifdef NoRepository
219  #include "sutherlandTransport.C"
220 #endif
221 
222 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
223 
224 #endif
225 
226 // ************************************************************************* //
dictionary dict
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
scalar kappa(const scalar p, const scalar T) const
Thermal conductivity [W/m/K].
void operator+=(const sutherlandTransport &)
static word typeName()
Return the instantiated type name.
A class for handling words, derived from string.
Definition: word.H:59
sutherlandTransport(const Thermo &t, const scalar As, const scalar Ts)
Construct from components.
autoPtr< sutherlandTransport > clone() const
Construct and return a clone.
static autoPtr< sutherlandTransport > New(const dictionary &dict)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
scalar mu(const scalar p, const scalar T) const
Dynamic viscosity [kg/m/s].
void write(Ostream &os) const
Write to Ostream.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
Transport package using Sutherland&#39;s formula for viscosity:
volScalarField & p
Namespace for OpenFOAM.