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