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