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-2023 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&,
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 Member Functions
135 
136  //- Read coefficient from dictionary
137  scalar readCoeff(const word& coeffName, const dictionary& dict);
138 
139 
140 public:
141 
142  // Constructors
143 
144  //- Construct from components
145  inline WLFTransport
146  (
147  const Thermo& t,
148  const scalar mu0,
149  const scalar Tr,
150  const scalar C1,
151  const scalar C2,
152  const scalar Pr
153  );
154 
155  //- Construct as named copy
156  inline WLFTransport(const word&, const WLFTransport&);
157 
158  //- Construct from name and dictionary
159  WLFTransport(const word& name, const dictionary& dict);
160 
161  //- Construct and return a clone
162  inline autoPtr<WLFTransport> clone() const;
163 
164 
165  // Member Functions
166 
167  //- Return the instantiated type name
168  static word typeName()
169  {
170  return "WLF<" + Thermo::typeName() + '>';
171  }
172 
173  //- Dynamic viscosity [kg/m/s]
174  inline scalar mu(const scalar p, const scalar T) const;
175 
176  //- Thermal conductivity [W/m/K]
177  inline scalar kappa(const scalar p, const scalar T) const;
178 
179  //- Write to Ostream
180  void write(Ostream& os) const;
181 
182 
183  // Member Operators
184 
185  inline void operator+=(const WLFTransport&);
186  inline void operator*=(const scalar);
187 
188 
189  // Friend operators
190 
191  friend WLFTransport operator+ <Thermo>
192  (
193  const WLFTransport&,
194  const WLFTransport&
195  );
196 
197  friend WLFTransport operator* <Thermo>
198  (
199  const scalar,
200  const WLFTransport&
201  );
202 
203 
204  // Ostream Operator
205 
206  friend Ostream& operator<< <Thermo>
207  (
209  const WLFTransport&
210  );
211 };
212 
213 
214 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
215 
216 } // End namespace Foam
217 
218 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
219 
220 #include "WLFTransportI.H"
221 
222 #ifdef NoRepository
223  #include "WLFTransport.C"
224 #endif
225 
226 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
227 
228 #endif
229 
230 // ************************************************************************* //
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
Transport package using the Williams-Landel-Ferry model for viscosity of polymer melts:
Definition: WLFTransport.H:132
scalar mu(const scalar p, const scalar T) const
Dynamic viscosity [kg/m/s].
Definition: WLFTransportI.H:81
void operator+=(const WLFTransport &)
scalar kappa(const scalar p, const scalar T) const
Thermal conductivity [W/m/K].
Definition: WLFTransportI.H:92
static word typeName()
Return the instantiated type name.
Definition: WLFTransport.H:185
void write(Ostream &os) const
Write to Ostream.
Definition: WLFTransport.C:63
WLFTransport(const Thermo &t, const scalar mu0, const scalar Tr, const scalar C1, const scalar C2, const scalar Pr)
Construct from components.
Definition: WLFTransportI.H:32
autoPtr< WLFTransport > clone() const
Construct and return a clone.
Definition: WLFTransportI.H:68
void operator*=(const scalar)
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
A class for handling words, derived from string.
Definition: word.H:62
const dimensionedScalar mu0
Magnetic constant/permeability of free space: default SI units: [H/m].
Namespace for OpenFOAM.
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
dictionary dict
volScalarField & p