logPolynomialTransport.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) 2016-2017 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::logPolynomialTransport
29
30Group
31 grpSpecieTransport
32
33Description
34 Transport package using polynomial functions of \c ln(T) for \c mu and
35 \c kappa:
36
37 \f[
38 ln(mu) = \sum_{i=1}^N \left( a[i] * ln(T)^{i-1} \right)
39 \f]
40
41 \f[
42 ln(kappa) = \sum_{i=1}^N \left( b[i] * ln(T)^{i-1} \right)
43 \f]
44
45Usage
46
47 \table
48 Property | Description
49 muCoeffs<8> | Dynamic viscosity polynomial coefficients
50 kappaCoeffs<8> | Thermal conductivity polynomial coefficients
51 \endtable
52
53 Example of the specification of the transport properties:
54 \verbatim
55 transport
56 {
57 muCoeffs<8> ( 1000 -0.05 0.003 0 0 0 0 0 );
58 kappaCoeffs<8> ( 2000 -0.15 0.023 0 0 0 0 0 );
59 }
60 \endverbatim
61
62 The polynomial expressions are evaluated as so:
63
64 \f[
65 \mu = 1000 - 0.05 ln(T) + 0.003 ln(T)^2
66 \f]
67
68 \f[
69 \kappa = 2000 - 0.15 ln(T) + 0.023 ln(T)^2
70 \f]
71
72Note
73 - Dynamic viscosity polynomial coefficients evaluate to an expression in
74 [Pa.s], but internally uses [Pa.s/kmol].
75 - Thermal conductivity polynomial coefficients evaluate to an expression in
76 [W/m/K], but internally uses [W/m/K/kmol].
77
78SourceFiles
79 logPolynomialTransportI.H
80 logPolynomialTransport.C
81
82See also
83 Foam::Polynomial
84
85\*---------------------------------------------------------------------------*/
86
87#ifndef logPolynomialTransport_H
88#define logPolynomialTransport_H
89
90#include "Polynomial.H"
91
92// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
93
94namespace Foam
95{
96
97// Forward Declarations
98
99template<class Thermo, int PolySize> class logPolynomialTransport;
100
101template<class Thermo, int PolySize>
102inline logPolynomialTransport<Thermo, PolySize> operator+
103(
104 const logPolynomialTransport<Thermo, PolySize>&,
105 const logPolynomialTransport<Thermo, PolySize>&
106);
107
108template<class Thermo, int PolySize>
109inline logPolynomialTransport<Thermo, PolySize> operator*
111 const scalar,
113);
114
115template<class Thermo, int PolySize>
116Ostream& operator<<
118 Ostream&,
120);
121
122
123/*---------------------------------------------------------------------------*\
124 Class logPolynomialTransport Declaration
125\*---------------------------------------------------------------------------*/
126
127template<class Thermo, int PolySize=8>
129:
130 public Thermo
131{
132 // Private Data
133
134 //- Dynamic viscosity polynomial coefficients
135 // Note: input in [Pa.s], but internally uses [Pa.s/kmol]
137
138 //- Thermal conductivity polynomial coefficients
139 // Note: input in [W/m/K], but internally uses [W/m/K/kmol]
140 Polynomial<PolySize> kappaCoeffs_;
141
142
143 // Private Member Functions
144
145 //- Coeffs name. Eg, "muLogCoeffs<10>"
146 inline static word coeffsName(const char* name)
147 {
148 return word(name + ("LogCoeffs<" + std::to_string(PolySize) + '>'));
149 }
150
151 //- Construct from components
153 (
154 const Thermo& t,
155 const Polynomial<PolySize>& muPoly,
156 const Polynomial<PolySize>& kappaPoly
157 );
158
159
160public:
161
162 // Generated Methods: copy construct, copy assignment
163
164
165 // Constructors
166
167 //- Construct as named copy
169 (
170 const word&,
172 );
173
174 //- Construct from dictionary
175 explicit logPolynomialTransport(const dictionary& dict);
176
177 //- Construct and return a clone
179
180 // Selector from dictionary
182 (
183 const dictionary& dict
184 );
185
186
187 // Member Functions
188
189 //- Return the instantiated type name
190 static word typeName()
191 {
192 return "logPolynomial<" + Thermo::typeName() + '>';
193 }
194
195 //- Dynamic viscosity [kg/ms]
196 inline scalar mu(const scalar p, const scalar T) const;
197
198 //- Thermal conductivity [W/mK]
199 inline scalar kappa(const scalar p, const scalar T) const;
200
201 //- Thermal diffusivity of enthalpy [kg/ms]
202 inline scalar alphah(const scalar p, const scalar T) const;
203
204 // Species diffusivity
205 //inline scalar D(const scalar p, const scalar T) const;
206
207 //- Write to Ostream
208 void write(Ostream& os) const;
209
210
211 // Member Operators
212
213 inline void operator+=(const logPolynomialTransport&);
214
215 inline void operator*=(const scalar);
216
217
218 // Friend Operators
219
220 friend logPolynomialTransport operator+ <Thermo, PolySize>
221 (
224 );
225
226 friend logPolynomialTransport operator* <Thermo, PolySize>
227 (
228 const scalar,
230 );
231
232
233 // IOstream Operators
235 friend Ostream& operator<< <Thermo, PolySize>
236 (
237 Ostream&,
239 );
240};
241
242
243// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
244
245} // End namespace Foam
246
247// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
248
250
251#ifdef NoRepository
252 #include "logPolynomialTransport.C"
253#endif
254
255// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
256
257#endif
258
259// ************************************************************************* //
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
Polynomial templated on size (order):
Definition: Polynomial.H:78
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
Transport package using polynomial functions of ln(T) for mu and kappa:
scalar kappa(const scalar p, const scalar T) const
Thermal conductivity [W/mK].
static word typeName()
Return the instantiated type name.
scalar alphah(const scalar p, const scalar T) const
Thermal diffusivity of enthalpy [kg/ms].
static autoPtr< logPolynomialTransport > New(const dictionary &dict)
autoPtr< logPolynomialTransport > clone() const
Construct and return a clone.
void operator+=(const logPolynomialTransport &)
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.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
runTime write()
dictionary dict