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-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::WLFTransport
29
30Description
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
49SourceFiles
50 WLFTransportI.H
51 WLFTransport.C
52
53\*---------------------------------------------------------------------------*/
54
55#ifndef WLFTransport_H
56#define WLFTransport_H
57
58// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
59
60namespace Foam
61{
62
63// Forward Declarations
64
65template<class Thermo> class WLFTransport;
66
67template<class Thermo>
68inline WLFTransport<Thermo> operator+
69(
72);
73
74template<class Thermo>
75inline WLFTransport<Thermo> operator*
76(
77 const scalar,
79);
80
81template<class Thermo>
82Ostream& operator<<
83(
84 Ostream&,
86);
87
88
89/*---------------------------------------------------------------------------*\
90 Class WLFTransport Declaration
91\*---------------------------------------------------------------------------*/
92
93template<class Thermo>
94class 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
125public:
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
178 friend WLFTransport operator+ <Thermo>
179 (
180 const WLFTransport&,
181 const WLFTransport&
182 );
184 friend WLFTransport operator* <Thermo>
185 (
186 const scalar,
187 const WLFTransport&
188 );
189
190
191 // IOstream Operators
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// ************************************************************************* //
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
Transport package using the Williams-Landel-Ferry model.
Definition: WLFTransport.H:96
void operator+=(const WLFTransport &)
scalar kappa(const scalar p, const scalar T) const
Thermal conductivity [W/mK].
Definition: WLFTransportI.H:88
static word typeName()
Return the instantiated type name.
Definition: WLFTransport.H:147
static autoPtr< WLFTransport > New(const dictionary &dict)
Definition: WLFTransportI.H:62
scalar alphah(const scalar p, const scalar T) const
Thermal diffusivity of enthalpy [kg/ms].
Definition: WLFTransportI.H:98
autoPtr< WLFTransport > clone() const
Construct and return a clone.
Definition: WLFTransportI.H:50
void operator*=(const scalar)
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
Definition: dictionary.C:460
A class for handling words, derived from Foam::string.
Definition: word.H:68
volScalarField & p
const volScalarField & mu
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
runTime write()
dictionary dict