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-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::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 Member Functions
114 
115  //- Read coefficient from dictionary
116  scalar readCoeff(const word& coeffName, const dictionary& dict);
117 
118 
119 public:
120 
121  // Constructors
122 
123  //- Construct as named copy
124  inline WLFTransport(const word&, const WLFTransport&);
125 
126  //- Construct from dictionary
127  WLFTransport(const dictionary& dict);
128 
129  //- Construct and return a clone
130  inline autoPtr<WLFTransport> clone() const;
131 
132  // Selector from dictionary
133  inline static autoPtr<WLFTransport> New(const dictionary& dict);
134 
135 
136  // Member Functions
137 
138  //- Return the instantiated type name
139  static word typeName()
140  {
141  return "WLF<" + Thermo::typeName() + '>';
142  }
143 
144  //- Dynamic viscosity [kg/m/s]
145  inline scalar mu(const scalar p, const scalar T) const;
146 
147  //- Thermal conductivity [W/m/K]
148  inline scalar kappa(const scalar p, const scalar T) const;
149 
150  //- Thermal diffusivity of enthalpy [kg/m/s]
151  inline scalar alphah(const scalar p, const scalar T) const;
152 
153  // Species diffusivity
154  // inline scalar D(const scalar p, const scalar T) const;
155 
156  //- Write to Ostream
157  void write(Ostream& os) const;
158 
159 
160  // Member Operators
161 
162  inline void operator+=(const WLFTransport&);
163  inline void operator*=(const scalar);
164 
165 
166  // Friend operators
167 
168  friend WLFTransport operator+ <Thermo>
169  (
170  const WLFTransport&,
171  const WLFTransport&
172  );
173 
174  friend WLFTransport operator* <Thermo>
175  (
176  const scalar,
177  const WLFTransport&
178  );
179 
180 
181  // Ostream Operator
182 
183  friend Ostream& operator<< <Thermo>
184  (
185  Ostream&,
186  const WLFTransport&
187  );
188 };
189 
190 
191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 
193 } // End namespace Foam
194 
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 
197 #include "WLFTransportI.H"
198 
199 #ifdef NoRepository
200  #include "WLFTransport.C"
201 #endif
202 
203 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 
205 #endif
206 
207 // ************************************************************************* //
WLFTransport(const word &, const WLFTransport &)
Construct as named copy.
Definition: WLFTransportI.H:32
dictionary dict
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
void operator*=(const scalar)
scalar mu(const scalar p, const scalar T) const
Dynamic viscosity [kg/m/s].
Definition: WLFTransportI.H:75
static word typeName()
Return the instantiated type name.
Definition: WLFTransport.H:138
A class for handling words, derived from string.
Definition: word.H:59
scalar alphah(const scalar p, const scalar T) const
Thermal diffusivity of enthalpy [kg/m/s].
Definition: WLFTransportI.H:96
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
autoPtr< WLFTransport > clone() const
Construct and return a clone.
Definition: WLFTransportI.H:48
static autoPtr< WLFTransport > New(const dictionary &dict)
Definition: WLFTransportI.H:60
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].
Definition: WLFTransportI.H:86
void operator+=(const WLFTransport &)
volScalarField & p
void write(Ostream &os) const
Write to Ostream.
Definition: WLFTransport.C:59
Namespace for OpenFOAM.