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-2023 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,
86 );
87 
88 template<class Thermo>
89 Ostream& operator<<
90 (
91  Ostream&,
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,
118  const scalar T1,
119  const scalar mu2,
120  const scalar T2
121  );
122 
123  //- Read coefficient from dictionary
124  scalar readCoeff(const word& coeffName, const dictionary& dict);
125 
126 
127 public:
128 
129  // Constructors
130 
131  //- Construct from components
132  inline sutherlandTransport
133  (
134  const Thermo& t,
135  const scalar As,
136  const scalar Ts
137  );
138 
139  //- Construct from two viscosities
140  inline sutherlandTransport
141  (
142  const Thermo& t,
143  const scalar mu1,
144  const scalar T1,
145  const scalar mu2,
146  const scalar T2
147  );
148 
149  //- Construct as named copy
150  inline sutherlandTransport(const word&, const sutherlandTransport&);
151 
152  //- Construct from name and dictionary
153  sutherlandTransport(const word& name, const dictionary& dict);
154 
155  //- Construct from base thermo and dictionary
156  sutherlandTransport(const Thermo& t,const dictionary& dict);
157 
158  //- Construct and return a clone
159  inline autoPtr<sutherlandTransport> clone() const;
160 
161 
162  // Member Functions
163 
164  //- Return the instantiated type name
165  static word typeName()
166  {
167  return "sutherland<" + Thermo::typeName() + '>';
168  }
169 
170  //- Dynamic viscosity [kg/m/s]
171  inline scalar mu(const scalar p, const scalar T) const;
172 
173  //- Thermal conductivity [W/m/K]
174  inline scalar kappa(const scalar p, const scalar T) const;
175 
176  //- Write to Ostream
177  void write(Ostream& os) const;
178 
179 
180  // Member Operators
181 
182  inline void operator+=(const sutherlandTransport&);
183  inline void operator*=(const scalar);
184 
185 
186  // Friend operators
187 
188  friend sutherlandTransport operator+ <Thermo>
189  (
190  const sutherlandTransport&,
191  const sutherlandTransport&
192  );
193 
194  friend sutherlandTransport operator* <Thermo>
195  (
196  const scalar,
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 
217 #include "sutherlandTransportI.H"
218 
219 #ifdef NoRepository
220  #include "sutherlandTransport.C"
221 #endif
222 
223 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
224 
225 #endif
226 
227 // ************************************************************************* //
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
Transport package using Sutherland's formula for viscosity:
scalar mu(const scalar p, const scalar T) const
Dynamic viscosity [kg/m/s].
scalar kappa(const scalar p, const scalar T) const
Thermal conductivity [W/m/K].
static word typeName()
Return the instantiated type name.
void write(Ostream &os) const
Write to Ostream.
sutherlandTransport(const Thermo &t, const scalar As, const scalar Ts)
Construct from components.
autoPtr< sutherlandTransport > clone() const
Construct and return a clone.
void operator+=(const sutherlandTransport &)
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
dictionary dict
volScalarField & p