WLFTransport.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) 2018-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::WLFTransport
26 
27 Description
28  Transport package using the Williams-Landel-Ferry model.
29 
30  Templated into a given thermodynamics package (needed for thermal
31  conductivity).
32 
33  Dynamic viscosity [kg/m.s]
34  \f[
35  \mu = \mu_0 \exp \left(\frac{-C_1 ( T - T_r )}{C_2 + T - T_r}\right)
36  \f]
37 
38  References:
39  \verbatim
40  Williams, M. L., Landel, R. F., & Ferry, J. D. (1955).
41  The temperature dependence of relaxation mechanisms
42  in amorphous polymers and other glass-forming liquids.
43  Journal of the American Chemical society, 77(14), 3701-3707.
44  \endverbatim
45 
46 SourceFiles
47  WLFTransportI.H
48  WLFTransport.C
49 
50 \*---------------------------------------------------------------------------*/
51 
52 #ifndef WLFTransport_H
53 #define WLFTransport_H
54 
55 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56 
57 namespace Foam
58 {
59 
60 // Forward declaration of friend functions and operators
61 
62 template<class Thermo> class WLFTransport;
63 
64 template<class Thermo>
65 inline WLFTransport<Thermo> operator+
66 (
67  const WLFTransport<Thermo>&,
68  const WLFTransport<Thermo>&
69 );
70 
71 template<class Thermo>
72 inline WLFTransport<Thermo> operator*
73 (
74  const scalar,
75  const WLFTransport<Thermo>&
76 );
77 
78 template<class Thermo>
79 Ostream& operator<<
80 (
81  Ostream&,
82  const WLFTransport<Thermo>&
83 );
84 
85 
86 /*---------------------------------------------------------------------------*\
87  Class WLFTransport Declaration
88 \*---------------------------------------------------------------------------*/
89 
90 template<class Thermo>
91 class WLFTransport
92 :
93  public Thermo
94 {
95  // Private Data
96 
97  //- Dynamic viscosity at the reference temperature [Pa.s]
98  scalar mu0_;
99 
100  //- Reference temperature [T]
101  scalar Tr_;
102 
103  //- WLF coefficient 1 []
104  scalar C1_;
105 
106  //- WLF coefficient 2 [T]
107  scalar C2_;
108 
109  //- Reciprocal Prandtl Number []
110  scalar rPr_;
111 
112 
113  // Private Constructors
114 
115  //- Construct from components
116  inline WLFTransport
117  (
118  const Thermo& t,
119  const scalar mu0,
120  const scalar Tr,
121  const scalar C1,
122  const scalar C2,
123  const scalar Pr
124  );
125 
126 
127  // Private Member Functions
128 
129  //- Read coefficient from dictionary
130  scalar readCoeff(const word& coeffName, const dictionary& dict);
131 
132 
133 public:
134 
135  // Constructors
136 
137  //- Construct as named copy
138  inline WLFTransport(const word&, const WLFTransport&);
139 
140  //- Construct from dictionary
141  WLFTransport(const dictionary& dict);
142 
143  //- Construct and return a clone
144  inline autoPtr<WLFTransport> clone() const;
145 
146  // Selector from dictionary
147  inline static autoPtr<WLFTransport> New(const dictionary& dict);
148 
149 
150  // Member Functions
151 
152  //- Return the instantiated type name
153  static word typeName()
154  {
155  return "WLF<" + Thermo::typeName() + '>';
156  }
157 
158  //- Dynamic viscosity [kg/m/s]
159  inline scalar mu(const scalar p, const scalar T) const;
160 
161  //- Thermal conductivity [W/m/K]
162  inline scalar kappa(const scalar p, const scalar T) const;
163 
164  //- Write to Ostream
165  void write(Ostream& os) const;
166 
167 
168  // Member Operators
169 
170  inline void operator+=(const WLFTransport&);
171  inline void operator*=(const scalar);
172 
173 
174  // Friend operators
175 
176  friend WLFTransport operator+ <Thermo>
177  (
178  const WLFTransport&,
179  const WLFTransport&
180  );
181 
182  friend WLFTransport operator* <Thermo>
183  (
184  const scalar,
185  const WLFTransport&
186  );
187 
188 
189  // Ostream Operator
190 
191  friend Ostream& operator<< <Thermo>
192  (
193  Ostream&,
194  const WLFTransport&
195  );
196 };
197 
198 
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200 
201 } // End namespace Foam
202 
203 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 
205 #include "WLFTransportI.H"
206 
207 #ifdef NoRepository
208  #include "WLFTransport.C"
209 #endif
210 
211 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
212 
213 #endif
214 
215 // ************************************************************************* //
dictionary dict
const dimensionedScalar mu0
Magnetic constant/permeability of free space: default SI units: [H/m].
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
void operator*=(const scalar)
scalar mu(const scalar p, const scalar T) const
Dynamic viscosity [kg/m/s].
Definition: WLFTransportI.H:95
static word typeName()
Return the instantiated type name.
Definition: WLFTransport.H:152
A class for handling words, derived from string.
Definition: word.H:59
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
autoPtr< WLFTransport > clone() const
Construct and return a clone.
Definition: WLFTransportI.H:68
static autoPtr< WLFTransport > New(const dictionary &dict)
Definition: WLFTransportI.H:80
Transport package using the Williams-Landel-Ferry model.
Definition: WLFTransport.H:61
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
scalar kappa(const scalar p, const scalar T) const
Thermal conductivity [W/m/K].
void operator+=(const WLFTransport &)
volScalarField & p
void write(Ostream &os) const
Write to Ostream.
Definition: WLFTransport.C:59
Namespace for OpenFOAM.