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