WLFTransport.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) 2018 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::WLFTransport
28 
29 Description
30  Transport package using the Williams-Landel-Ferry model.
31 
32  Templated into a given thermodynamics package (needed for thermal
33  conductivity).
34 
35  Dynamic viscosity [kg/m.s]
36  \f[
37  \mu = \mu_0 \exp \left(\frac{-C_1 ( T - T_r )}{C_2 + T - T_r}\right)
38  \f]
39 
40  References:
41  \verbatim
42  Williams, M. L., Landel, R. F., & Ferry, J. D. (1955).
43  The temperature dependence of relaxation mechanisms
44  in amorphous polymers and other glass-forming liquids.
45  Journal of the American Chemical society, 77(14), 3701-3707.
46  \endverbatim
47 
48 SourceFiles
49  WLFTransportI.H
50  WLFTransport.C
51 
52 \*---------------------------------------------------------------------------*/
53 
54 #ifndef WLFTransport_H
55 #define WLFTransport_H
56 
57 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
58 
59 namespace Foam
60 {
61 
62 // Forward declaration of friend functions and operators
63 
64 template<class Thermo> class WLFTransport;
65 
66 template<class Thermo>
67 inline WLFTransport<Thermo> operator+
68 (
69  const WLFTransport<Thermo>&,
71 );
72 
73 template<class Thermo>
74 inline WLFTransport<Thermo> operator*
75 (
76  const scalar,
78 );
79 
80 template<class Thermo>
81 Ostream& operator<<
82 (
83  Ostream&,
85 );
86 
87 
88 /*---------------------------------------------------------------------------*\
89  Class WLFTransport Declaration
90 \*---------------------------------------------------------------------------*/
91 
92 template<class Thermo>
93 class WLFTransport
94 :
95  public Thermo
96 {
97  // Private data
98 
99  //- Dynamic viscosity at the reference temperature [Pa.s]
100  scalar mu0_;
101 
102  //- Reference temperature [T]
103  scalar Tr_;
104 
105  //- WLF coefficient 1 []
106  scalar C1_;
107 
108  //- WLF coefficient 2 [T]
109  scalar C2_;
110 
111  //- Reciprocal Prandtl Number []
112  scalar rPr_;
113 
114 
115  // Private Member Functions
116 
117  //- Read coefficient from dictionary
118  scalar readCoeff(const word& coeffName, const dictionary& dict);
119 
120 
121 public:
122 
123  // Constructors
124 
125  //- Construct as named copy
126  inline WLFTransport(const word&, const WLFTransport&);
127 
128  //- Construct from dictionary
129  WLFTransport(const dictionary& dict);
130 
131  //- Construct and return a clone
132  inline autoPtr<WLFTransport> clone() const;
133 
134  // Selector from dictionary
135  inline static autoPtr<WLFTransport> New(const dictionary& dict);
136 
137 
138  // Member functions
139 
140  //- Return the instantiated type name
141  static word typeName()
142  {
143  return "WLF<" + Thermo::typeName() + '>';
144  }
145 
146  //- Dynamic viscosity [kg/ms]
147  inline scalar mu(const scalar p, const scalar T) const;
148 
149  //- Thermal conductivity [W/mK]
150  inline scalar kappa(const scalar p, const scalar T) const;
151 
152  //- Thermal diffusivity of enthalpy [kg/ms]
153  inline scalar alphah(const scalar p, const scalar T) const;
154 
155  // Species diffusivity
156  // inline scalar D(const scalar p, const scalar T) const;
157 
158  //- Write to Ostream
159  void write(Ostream& os) const;
160 
161 
162  // Member operators
163 
164  inline void operator=(const WLFTransport&);
165 
166  inline void operator+=(const WLFTransport&);
167 
168  inline void operator*=(const scalar);
169 
170 
171  // Friend operators
172 
173  friend WLFTransport operator+ <Thermo>
174  (
175  const WLFTransport&,
176  const WLFTransport&
177  );
178 
179  friend WLFTransport operator* <Thermo>
180  (
181  const scalar,
182  const WLFTransport&
183  );
184 
185 
186  // Ostream Operator
187 
188  friend Ostream& operator<< <Thermo>
189  (
190  Ostream&,
191  const WLFTransport&
192  );
193 };
194 
195 
196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 
198 } // End namespace Foam
199 
200 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
201 
202 #include "WLFTransportI.H"
203 
204 #ifdef NoRepository
205  #include "WLFTransport.C"
206 #endif
207 
208 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
209 
210 #endif
211 
212 // ************************************************************************* //
Foam::WLFTransport::alphah
scalar alphah(const scalar p, const scalar T) const
Thermal diffusivity of enthalpy [kg/ms].
Definition: WLFTransportI.H:98
Foam::WLFTransport::New
static autoPtr< WLFTransport > New(const dictionary &dict)
Definition: WLFTransportI.H:62
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::WLFTransport::clone
autoPtr< WLFTransport > clone() const
Construct and return a clone.
Definition: WLFTransportI.H:50
WLFTransportI.H
Foam::WLFTransport::operator=
void operator=(const WLFTransport &)
Definition: WLFTransportI.H:112
Foam::WLFTransport::WLFTransport
WLFTransport(const word &, const WLFTransport &)
Construct as named copy.
Definition: WLFTransportI.H:34
Foam::WLFTransport::write
void write(Ostream &os) const
Write to Ostream.
Definition: WLFTransport.C:61
Foam::WLFTransport::typeName
static word typeName()
Return the instantiated type name.
Definition: WLFTransport.H:140
Foam::WLFTransport
Transport package using the Williams-Landel-Ferry model.
Definition: WLFTransport.H:63
Foam::T
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Definition: FieldFieldFunctions.C:58
Foam::WLFTransport::operator*=
void operator*=(const scalar)
Definition: WLFTransportI.H:152
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
WLFTransport.C
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::WLFTransport::mu
scalar mu(const scalar p, const scalar T) const
Dynamic viscosity [kg/ms].
Definition: WLFTransportI.H:77
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::WLFTransport::kappa
scalar kappa(const scalar p, const scalar T) const
Thermal conductivity [W/mK].
Definition: WLFTransportI.H:88
Foam::WLFTransport::operator+=
void operator+=(const WLFTransport &)
Definition: WLFTransportI.H:128