Loading...
Searching...
No Matches
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>
86);
87
88template<class Thermo, int PolySize>
91 const scalar,
93);
94
95template<class Thermo, int PolySize>
96Ostream& operator<<
98 Ostream&,
100);
101
102
103/*---------------------------------------------------------------------------*\
104 Class polynomialSolidTransport Declaration
105\*---------------------------------------------------------------------------*/
106
107template<class Thermo, int PolySize=8>
110 public Thermo
111{
112 // Private Data
113
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
128 inline polynomialSolidTransport
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
143 inline polynomialSolidTransport
144 (
145 const word&,
146 const polynomialSolidTransport&
147 );
148
149 //- Construct from dictionary
150 explicit polynomialSolidTransport(const dictionary& dict);
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;
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
190 // Member Operators
191
192 inline void operator+=(const polynomialSolidTransport&);
193 inline void operator*=(const scalar);
195
196 // Friend Operators
197
198 friend polynomialSolidTransport operator+ <Thermo, PolySize>
200 const polynomialSolidTransport&,
201 const polynomialSolidTransport&
202 );
203
204 friend polynomialSolidTransport operator* <Thermo, PolySize>
205 (
206 const scalar,
207 const polynomialSolidTransport&
208 );
210
211 // IOstream Operators
212
214 (
216 const polynomialSolidTransport&
217 );
218};
219
221// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
222
223} // End namespace Foam
224
225// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
228
229#ifdef NoRepository
231#endif
233// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
234
235#endif
236
237// ************************************************************************* //
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
Polynomial templated on size (order):
Definition Polynomial.H:74
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
Transport package using polynomial functions for solid kappa.
static autoPtr< polynomialSolidTransport > New(const dictionary &dict)
scalar mu(const scalar p, const scalar T) const
Dynamic viscosity [kg/ms].
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 &)
polynomialSolidTransport(const word &, const polynomialSolidTransport &)
Construct as named copy.
friend Ostream & operator(Ostream &, const polynomialSolidTransport &)
scalar kappa(const scalar p, const scalar T) const
Thermal conductivity [W/mK].
static word typeName()
Return the instantiated type name.
void write(Ostream &os) const
Write to Ostream.
scalar alphah(const scalar p, const scalar T) const
Thermal diffusivity of enthalpy [kg/ms].
polynomialSolidTransport(const dictionary &dict)
Construct from dictionary.
A class for handling words, derived from Foam::string.
Definition word.H:66
volScalarField & p
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition exprTraits.C:127
Vector< scalar > vector
Definition vector.H:57
runTime write()
dictionary dict