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-2019 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.
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 (
60  const sutherlandTransport<Thermo>&
61 );
62 
63 template<class Thermo>
64 inline sutherlandTransport<Thermo> operator*
65 (
66  const scalar,
67  const sutherlandTransport<Thermo>&
68 );
69 
70 template<class Thermo>
71 Ostream& operator<<
72 (
73  Ostream&,
74  const sutherlandTransport<Thermo>&
75 );
76 
77 
78 /*---------------------------------------------------------------------------*\
79  Class sutherlandTransport Declaration
80 \*---------------------------------------------------------------------------*/
81 
82 template<class Thermo>
84 :
85  public Thermo
86 {
87  // Private Data
88 
89  // Sutherland's coefficients
90  scalar As_, Ts_;
91 
92 
93  // Private Member Functions
94 
95  //- Calculate the Sutherland coefficients
96  // given two viscosities and temperatures
97  inline void calcCoeffs
98  (
99  const scalar mu1, const scalar T1,
100  const scalar mu2, const scalar T2
101  );
102 
103  //- Read coefficient from dictionary
104  scalar readCoeff(const word& coeffName, const dictionary& dict);
105 
106 
107 public:
108 
109  // Constructors
110 
111  //- Construct from components
112  inline sutherlandTransport
113  (
114  const Thermo& t,
115  const scalar As,
116  const scalar Ts
117  );
118 
119  //- Construct from two viscosities
120  inline sutherlandTransport
121  (
122  const Thermo& t,
123  const scalar mu1, const scalar T1,
124  const scalar mu2, const scalar T2
125  );
126 
127  //- Construct as named copy
128  inline sutherlandTransport(const word&, const sutherlandTransport&);
129 
130  //- Construct from dictionary
132 
133  //- Construct from base thermo and dictionary
134  sutherlandTransport(const Thermo& t,const dictionary& dict);
135 
136  //- Construct and return a clone
137  inline autoPtr<sutherlandTransport> clone() const;
138 
139  // Selector from dictionary
140  inline static autoPtr<sutherlandTransport> New(const dictionary& dict);
141 
142 
143  // Member Functions
144 
145  //- Return the instantiated type name
146  static word typeName()
147  {
148  return "sutherland<" + Thermo::typeName() + '>';
149  }
150 
151  //- Dynamic viscosity [kg/m/s]
152  inline scalar mu(const scalar p, const scalar T) const;
153 
154  //- Thermal conductivity [W/m/K]
155  inline scalar kappa(const scalar p, const scalar T) const;
156 
157  //- Thermal diffusivity of enthalpy [kg/m/s]
158  inline scalar alphah(const scalar p, const scalar T) const;
159 
160  // Species diffusivity
161  // inline scalar D(const scalar p, const scalar T) const;
162 
163  //- Write to Ostream
164  void write(Ostream& os) const;
165 
166 
167  // Member Operators
168 
169  inline void operator+=(const sutherlandTransport&);
170  inline void operator*=(const scalar);
171 
172 
173  // Friend operators
174 
175  friend sutherlandTransport operator+ <Thermo>
176  (
177  const sutherlandTransport&,
178  const sutherlandTransport&
179  );
180 
181  friend sutherlandTransport operator* <Thermo>
182  (
183  const scalar,
184  const sutherlandTransport&
185  );
186 
187 
188  // Ostream Operator
189 
190  friend Ostream& operator<< <Thermo>
191  (
192  Ostream&,
193  const sutherlandTransport&
194  );
195 };
196 
197 
198 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
199 
200 } // End namespace Foam
201 
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 
204 #include "sutherlandTransportI.H"
205 
206 #ifdef NoRepository
207  #include "sutherlandTransport.C"
208 #endif
209 
210 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
211 
212 #endif
213 
214 // ************************************************************************* //
dictionary dict
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
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.
scalar alphah(const scalar p, const scalar T) const
Thermal diffusivity of enthalpy [kg/m/s].
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:53
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.
volScalarField & p
Namespace for OpenFOAM.