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 for viscosity of
29  polymer melts:
30 
31  \verbatim
32  mu = mu0*exp(-C1*(T - Tr)/(C2 + T - Tr))
33  \endverbatim
34 
35  References:
36  \verbatim
37  Williams, M. L., Landel, R. F., & Ferry, J. D. (1955).
38  The temperature dependence of relaxation mechanisms
39  in amorphous polymers and other glass-forming liquids.
40  Journal of the American Chemical society, 77(14), 3701-3707.
41  \endverbatim
42 
43  The thermal conductivity is obtained using a constant Prandtl number.
44 
45 Usage
46  \table
47  Property | Description
48  mu0 | Reference dynamic viscosity [Pa.s]
49  Tref | Reference temperature [K]
50  C1 | WLF constant []
51  C2 | WLF constant [K]
52  Pr | Constant Prandtl number []
53  \endtable
54 
55  Example specification of WLFTransport for a polymer:
56  \verbatim
57  transport
58  {
59  mu0 50000;
60  Tr 416;
61  C1 20.4;
62  C2 101.6;
63  Pr 10000;
64  }
65  \endverbatim
66 
67 SourceFiles
68  WLFTransportI.H
69  WLFTransport.C
70 
71 \*---------------------------------------------------------------------------*/
72 
73 #ifndef WLFTransport_H
74 #define WLFTransport_H
75 
76 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
77 
78 namespace Foam
79 {
80 
81 // Forward declaration of friend functions and operators
82 
83 template<class Thermo> class WLFTransport;
84 
85 template<class Thermo>
86 inline WLFTransport<Thermo> operator+
87 (
88  const WLFTransport<Thermo>&,
89  const WLFTransport<Thermo>&
90 );
91 
92 template<class Thermo>
93 inline WLFTransport<Thermo> operator*
94 (
95  const scalar,
96  const WLFTransport<Thermo>&
97 );
98 
99 template<class Thermo>
100 Ostream& operator<<
101 (
102  Ostream&,
103  const WLFTransport<Thermo>&
104 );
105 
106 
107 /*---------------------------------------------------------------------------*\
108  Class WLFTransport Declaration
109 \*---------------------------------------------------------------------------*/
110 
111 template<class Thermo>
112 class WLFTransport
113 :
114  public Thermo
115 {
116  // Private Data
117 
118  //- Dynamic viscosity at the reference temperature [Pa.s]
119  scalar mu0_;
120 
121  //- Reference temperature [T]
122  scalar Tr_;
123 
124  //- WLF coefficient 1 []
125  scalar C1_;
126 
127  //- WLF coefficient 2 [T]
128  scalar C2_;
129 
130  //- Reciprocal Prandtl Number []
131  scalar rPr_;
132 
133 
134  // Private Constructors
135 
136  //- Construct from components
137  inline WLFTransport
138  (
139  const Thermo& t,
140  const scalar mu0,
141  const scalar Tr,
142  const scalar C1,
143  const scalar C2,
144  const scalar Pr
145  );
146 
147 
148  // Private Member Functions
149 
150  //- Read coefficient from dictionary
151  scalar readCoeff(const word& coeffName, const dictionary& dict);
152 
153 
154 public:
155 
156  // Constructors
157 
158  //- Construct as named copy
159  inline WLFTransport(const word&, const WLFTransport&);
160 
161  //- Construct from dictionary
162  WLFTransport(const dictionary& dict);
163 
164  //- Construct and return a clone
165  inline autoPtr<WLFTransport> clone() const;
166 
167  // Selector from dictionary
168  inline static autoPtr<WLFTransport> New(const dictionary& dict);
169 
170 
171  // Member Functions
172 
173  //- Return the instantiated type name
174  static word typeName()
175  {
176  return "WLF<" + Thermo::typeName() + '>';
177  }
178 
179  //- Dynamic viscosity [kg/m/s]
180  inline scalar mu(const scalar p, const scalar T) const;
181 
182  //- Thermal conductivity [W/m/K]
183  inline scalar kappa(const scalar p, const scalar T) const;
184 
185  //- Write to Ostream
186  void write(Ostream& os) const;
187 
188 
189  // Member Operators
190 
191  inline void operator+=(const WLFTransport&);
192  inline void operator*=(const scalar);
193 
194 
195  // Friend operators
196 
197  friend WLFTransport operator+ <Thermo>
198  (
199  const WLFTransport&,
200  const WLFTransport&
201  );
202 
203  friend WLFTransport operator* <Thermo>
204  (
205  const scalar,
206  const WLFTransport&
207  );
208 
209 
210  // Ostream Operator
211 
212  friend Ostream& operator<< <Thermo>
213  (
214  Ostream&,
215  const WLFTransport&
216  );
217 };
218 
219 
220 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
221 
222 } // End namespace Foam
223 
224 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
225 
226 #include "WLFTransportI.H"
227 
228 #ifdef NoRepository
229  #include "WLFTransport.C"
230 #endif
231 
232 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
233 
234 #endif
235 
236 // ************************************************************************* //
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:191
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 for viscosity of polymer melts: ...
Definition: WLFTransport.H:100
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.