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-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::sutherlandTransport
29
30Group
31 grpSpecieTransport
32
33Description
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
44SourceFiles
45 sutherlandTransportI.H
46 sutherlandTransport.C
47
48\*---------------------------------------------------------------------------*/
49
50#ifndef sutherlandTransport_H
51#define sutherlandTransport_H
52
53// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54
55namespace Foam
56{
57
58// Forward Declarations
59
60template<class Thermo> class sutherlandTransport;
61
62template<class Thermo>
63inline sutherlandTransport<Thermo> operator+
64(
67);
68
69template<class Thermo>
70inline sutherlandTransport<Thermo> operator*
71(
72 const scalar,
74);
75
76template<class Thermo>
77Ostream& operator<<
78(
79 Ostream&,
81);
82
83
84/*---------------------------------------------------------------------------*\
85 Class sutherlandTransport Declaration
86\*---------------------------------------------------------------------------*/
87
88template<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
113public:
114
115 // Generated Methods: copy construct, copy assignment
116
117
118 // Constructors
119
120 //- Construct from components
122 (
123 const Thermo& t,
124 const scalar As,
125 const scalar Ts
126 );
127
128 //- Construct from two viscosities
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
185 friend sutherlandTransport operator+ <Thermo>
186 (
187 const sutherlandTransport&,
189 );
191 friend sutherlandTransport operator* <Thermo>
192 (
193 const scalar,
195 );
196
197
198 // IOstream Operators
200 friend Ostream& operator<< <Thermo>
201 (
202 Ostream&,
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// ************************************************************************* //
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Transport package using Sutherland's formula.
scalar kappa(const scalar p, const scalar T) const
Thermal conductivity [W/mK].
static word typeName()
Return the instantiated type name.
static autoPtr< sutherlandTransport > New(const dictionary &dict)
autoPtr< sutherlandTransport > clone() const
Construct and return a clone.
scalar alphah(const scalar p, const scalar T) const
Thermal diffusivity of enthalpy [kg/ms].
void operator+=(const sutherlandTransport &)
A class for handling words, derived from Foam::string.
Definition: word.H:68
volScalarField & p
const volScalarField & mu
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
runTime write()
dictionary dict