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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2017 OpenFOAM Foundation
9  Copyright (C) 2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::sutherlandTransport
29 
30 Group
31  grpSpecieTransport
32 
33 Description
34  Transport package using Sutherland's formula.
35 
36  Templated into a given thermodynamics package (needed for thermal
37  conductivity).
38 
39  Dynamic viscosity [kg/m.s]
40  \f[
41  \mu = A_s \frac{\sqrt{T}}{1 + T_s / T}
42  \f]
43 
44 SourceFiles
45  sutherlandTransportI.H
46  sutherlandTransport.C
47 
48 \*---------------------------------------------------------------------------*/
49 
50 #ifndef sutherlandTransport_H
51 #define sutherlandTransport_H
52 
53 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 
55 namespace Foam
56 {
57 
58 // Forward Declarations
59 
60 template<class Thermo> class sutherlandTransport;
61 
62 template<class Thermo>
63 inline sutherlandTransport<Thermo> operator+
64 (
67 );
68 
69 template<class Thermo>
70 inline sutherlandTransport<Thermo> operator*
71 (
72  const scalar,
74 );
75 
76 template<class Thermo>
77 Ostream& operator<<
78 (
79  Ostream&,
81 );
82 
83 
84 /*---------------------------------------------------------------------------*\
85  Class sutherlandTransport Declaration
86 \*---------------------------------------------------------------------------*/
87 
88 template<class Thermo>
90 :
91  public Thermo
92 {
93  // Private Data
94 
95  // Sutherland's coefficients
96  scalar As_, Ts_;
97 
98 
99  // Private Member Functions
100 
101  //- Calculate the Sutherland coefficients
102  // given two viscosities and temperatures
103  inline void calcCoeffs
104  (
105  const scalar mu1, const scalar T1,
106  const scalar mu2, const scalar T2
107  );
108 
109  //- Read coefficient from dictionary
110  scalar readCoeff(const word& coeffName, const dictionary& dict);
111 
112 
113 public:
114 
115  // Generated Methods: copy construct, copy assignment
116 
117 
118  // Constructors
119 
120  //- Construct from components
121  inline sutherlandTransport
122  (
123  const Thermo& t,
124  const scalar As,
125  const scalar Ts
126  );
127 
128  //- Construct from two viscosities
129  inline sutherlandTransport
130  (
131  const Thermo& t,
132  const scalar mu1, const scalar T1,
133  const scalar mu2, const scalar T2
134  );
135 
136  //- Construct as named copy
137  inline sutherlandTransport(const word&, const sutherlandTransport&);
138 
139  //- Construct from dictionary
140  explicit sutherlandTransport(const dictionary& dict);
141 
142  //- Construct from base thermo and dictionary
143  sutherlandTransport(const Thermo& t, const dictionary& dict);
144 
145  //- Construct and return a clone
146  inline autoPtr<sutherlandTransport> clone() const;
147 
148  // Selector from dictionary
149  inline static autoPtr<sutherlandTransport> New(const dictionary& dict);
150 
151 
152  // Member Functions
153 
154  //- Return the instantiated type name
155  static word typeName()
156  {
157  return "sutherland<" + Thermo::typeName() + '>';
158  }
159 
160  //- Dynamic viscosity [kg/ms]
161  inline scalar mu(const scalar p, const scalar T) const;
162 
163  //- Thermal conductivity [W/mK]
164  inline scalar kappa(const scalar p, const scalar T) const;
165 
166  //- Thermal diffusivity of enthalpy [kg/ms]
167  inline scalar alphah(const scalar p, const scalar T) const;
168 
169  // Species diffusivity
170  //inline scalar D(const scalar p, const scalar T) const;
171 
172  //- Write to Ostream
173  void write(Ostream& os) const;
174 
175 
176  // Member Operators
177 
178  inline void operator+=(const sutherlandTransport&);
179 
180  inline void operator*=(const scalar);
181 
182 
183  // Friend Operators
184 
185  friend sutherlandTransport operator+ <Thermo>
186  (
187  const sutherlandTransport&,
188  const sutherlandTransport&
189  );
190 
191  friend sutherlandTransport operator* <Thermo>
192  (
193  const scalar,
194  const sutherlandTransport&
195  );
196 
197 
198  // IOstream Operators
199 
200  friend Ostream& operator<< <Thermo>
201  (
202  Ostream&,
203  const sutherlandTransport&
204  );
205 };
206 
207 
208 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
209 
210 } // End namespace Foam
211 
212 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
213 
214 #include "sutherlandTransportI.H"
215 
216 #ifdef NoRepository
217  #include "sutherlandTransport.C"
218 #endif
219 
220 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
221 
222 #endif
223 
224 // ************************************************************************* //
p
volScalarField & p
Definition: createFieldRefs.H:8
sutherlandTransport.C
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::sutherlandTransport::kappa
scalar kappa(const scalar p, const scalar T) const
Thermal conductivity [W/mK].
Definition: sutherlandTransportI.H:126
Foam::sutherlandTransport::alphah
scalar alphah(const scalar p, const scalar T) const
Thermal diffusivity of enthalpy [kg/ms].
Definition: sutherlandTransportI.H:137
Foam::sutherlandTransport::typeName
static word typeName()
Return the instantiated type name.
Definition: sutherlandTransport.H:154
Foam::sutherlandTransport::write
void write(Ostream &os) const
Write to Ostream.
Definition: sutherlandTransport.C:71
Foam::sutherlandTransport::mu
scalar mu(const scalar p, const scalar T) const
Dynamic viscosity [kg/ms].
Definition: sutherlandTransportI.H:115
Foam::T
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Definition: FieldFieldFunctions.C:58
Foam::sutherlandTransport::clone
autoPtr< sutherlandTransport > clone() const
Construct and return a clone.
Definition: sutherlandTransportI.H:94
Foam::sutherlandTransport
Transport package using Sutherland's formula.
Definition: sutherlandTransport.H:59
sutherlandTransportI.H
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
os
OBJstream os(runTime.globalPath()/outputName)
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::sutherlandTransport::New
static autoPtr< sutherlandTransport > New(const dictionary &dict)
Definition: sutherlandTransportI.H:103
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::sutherlandTransport::operator+=
void operator+=(const sutherlandTransport &)
Definition: sutherlandTransportI.H:151
Foam::sutherlandTransport::operator*=
void operator*=(const scalar)
Definition: sutherlandTransportI.H:172
Foam::sutherlandTransport::sutherlandTransport
sutherlandTransport(const Thermo &t, const scalar As, const scalar Ts)
Construct from components.
Definition: sutherlandTransportI.H:53
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56