AndradeTransport.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) 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::AndradeTransport
26 
27 Description
28  Transport package using the Andrade function for the natural logarithm of
29  dynamic viscosity and thermal conductivity of liquids:
30 
31  \verbatim
32  log(mu) = muCoeffs[0] + muCoeffs[1]*T + muCoeffs[2]*sqr(T)
33  + muCoeffs_[3]/(muCoeffs_[4] + T)
34 
35  log(kappa) = kappaCoeffs[0] + kappaCoeffs[1]*T + kappaCoeffs[2]*sqr(T)
36  + kappaCoeffs_[3]/(kappaCoeffs_[4] + T)
37  );
38  \endverbatim
39 
40  References:
41  \verbatim
42  Andrade, E. D. C. (1934).
43  XLI. A theory of the viscosity of liquids.—Part I.
44  The London, Edinburgh, and Dublin Philosophical Magazine
45  and Journal of Science, 17(112), 497-511.
46 
47  Andrade, E. D. C. (1934).
48  LVIII. A theory of the viscosity of liquids.—Part II.
49  The London, Edinburgh, and Dublin Philosophical Magazine
50  and Journal of Science, 17(113), 698-732.
51  \endverbatim
52 
53 Usage
54  \table
55  Property | Description
56  muCoeffs | Dynamic viscosity polynomial coefficients
57  kappaCoeffs | Thermal conductivity polynomial coefficients
58  \endtable
59 
60  Example of the specification of the transport properties for water@200bar:
61  \verbatim
62  transport
63  {
64  muCoeffs (-25.8542 0.031256 -2.2e-05 3289.918 -11.4784);
65  kappaCoeffs (-2.56543 0.008794 -9.8e-06 100.368 0);
66  }
67  \endverbatim
68 
69 SourceFiles
70  AndradeTransportI.H
71  AndradeTransport.C
72 
73 \*---------------------------------------------------------------------------*/
74 
75 #ifndef AndradeTransport_H
76 #define AndradeTransport_H
77 
78 #include "FixedList.H"
79 
80 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
81 
82 namespace Foam
83 {
84 
85 // Forward declaration of friend functions and operators
86 
87 template<class Thermo> class AndradeTransport;
88 
89 template<class Thermo>
90 inline AndradeTransport<Thermo> operator+
91 (
92  const AndradeTransport<Thermo>&,
93  const AndradeTransport<Thermo>&
94 );
95 
96 template<class Thermo>
97 inline AndradeTransport<Thermo> operator*
98 (
99  const scalar,
100  const AndradeTransport<Thermo>&
101 );
102 
103 template<class Thermo>
104 Ostream& operator<<
105 (
106  Ostream&,
107  const AndradeTransport<Thermo>&
108 );
109 
110 
111 /*---------------------------------------------------------------------------*\
112  Class AndradeTransport Declaration
113 \*---------------------------------------------------------------------------*/
114 
115 template<class Thermo>
116 class AndradeTransport
117 :
118  public Thermo
119 {
120  // Private Data
121 
123 
124  //- Dynamic viscosity coefficients
125  coeffList muCoeffs_;
126 
127  //- Thermal conductivity coefficients
128  coeffList kappaCoeffs_;
129 
130 
131  // Private Member Functions
132 
133  //- Construct from components
134  inline AndradeTransport
135  (
136  const Thermo& t,
137  const coeffList& muCoeffs,
138  const coeffList& kappaCoeffs
139  );
140 
141 
142 public:
143 
144  // Constructors
145 
146  //- Construct as named copy
147  inline AndradeTransport
148  (
149  const word&,
150  const AndradeTransport&
151  );
152 
153  //- Construct from dictionary
155 
156  //- Construct and return a clone
157  inline autoPtr<AndradeTransport> clone() const;
158 
159  // Selector from dictionary
160  inline static autoPtr<AndradeTransport> New
161  (
162  const dictionary& dict
163  );
164 
165 
166  // Member Functions
167 
168  //- Return the instantiated type name
169  static word typeName()
170  {
171  return "Andrade<" + Thermo::typeName() + '>';
172  }
173 
174  //- Dynamic viscosity [kg/m/s]
175  inline scalar mu(const scalar p, const scalar T) const;
176 
177  //- Thermal conductivity [W/m/K]
178  inline scalar kappa(const scalar p, const scalar T) const;
179 
180  //- Write to Ostream
181  void write(Ostream& os) const;
182 
183 
184  // Ostream Operator
185 
186  friend Ostream& operator<< <Thermo>
187  (
188  Ostream&,
189  const AndradeTransport&
190  );
191 };
192 
193 
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
195 
196 } // End namespace Foam
197 
198 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
199 
200 #include "AndradeTransportI.H"
201 
202 #ifdef NoRepository
203  #include "AndradeTransport.C"
204 #endif
205 
206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
207 
208 #endif
209 
210 // ************************************************************************* //
dictionary dict
void write(Ostream &os) const
Write to Ostream.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
static autoPtr< AndradeTransport > New(const dictionary &dict)
Transport package using the Andrade function for the natural logarithm of dynamic viscosity and therm...
scalar mu(const scalar p, const scalar T) const
Dynamic viscosity [kg/m/s].
A class for handling words, derived from string.
Definition: word.H:59
scalar kappa(const scalar p, const scalar T) const
Thermal conductivity [W/m/K].
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
autoPtr< AndradeTransport > clone() const
Construct and return a clone.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
static word typeName()
Return the instantiated type name.
volScalarField & p
Namespace for OpenFOAM.