polynomialSolidTransport.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) 2013-2022 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::polynomialSolidTransport
26 
27 Description
28  Transport package using polynomial functions for solid \c kappa.
29 
30 Usage
31 
32  \table
33  Property | Description
34  kappaCoeffs<8> | Thermal conductivity polynomial coefficients
35  \endtable
36 
37  Example of the specification of the transport properties:
38  \verbatim
39  transport
40  {
41  kappaCoeffs<8> ( 1000 -0.05 0.003 0 0 0 0 0 );
42  }
43  \endverbatim
44 
45  The polynomial expression is evaluated as so:
46 
47  \f[
48  \kappa = 1000 - 0.05 T + 0.003 T^2
49  \f]
50 
51  Note:
52  Thermal conductivity polynomial coefficients evaluate to an expression
53  in [W/m/K].
54 
55 SourceFiles
56  polynomialSolidTransportI.H
57  polynomialSolidTransport.C
58 
59 See also
60  Foam::Polynomial
61 
62 \*---------------------------------------------------------------------------*/
63 
64 #ifndef polynomialSolidTransport_H
65 #define polynomialSolidTransport_H
66 
67 #include "Polynomial.H"
68 
69 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
70 
71 namespace Foam
72 {
73 
74 // Forward declaration of friend functions and operators
75 
76 template<class Thermo, int PolySize> class polynomialSolidTransport;
77 
78 template<class Thermo, int PolySize>
79 inline polynomialSolidTransport<Thermo, PolySize> operator+
80 (
83 );
84 
85 template<class Thermo, int PolySize>
87 (
88  const scalar,
90 );
91 
92 template<class Thermo, int PolySize>
93 Ostream& operator<<
94 (
95  Ostream&,
97 );
98 
99 
100 /*---------------------------------------------------------------------------*\
101  Class polynomialSolidTransport Declaration
102 \*---------------------------------------------------------------------------*/
103 
104 template<class Thermo, int PolySize=8>
106 :
107  public Thermo
108 {
109  // Private Data
110 
111  //- Thermal conductivity polynomial coefficients
112  // Note: input in [W/m/K]
113  Polynomial<PolySize> kappaCoeffs_;
114 
115 
116  // Private Member Functions
117 
118  //- Construct from components
120  (
121  const Thermo& t,
122  const Polynomial<PolySize>& kappaPoly
123  );
124 
125 
126 public:
127 
128  // Constructors
129 
130  //- Construct as named copy
132  (
133  const word&,
135  );
136 
137  //- Construct from dictionary
139 
140  //- Construct and return a clone
142 
143  // Selector from dictionary
145  (
146  const dictionary&dict
147  );
148 
149 
150  // Member Functions
151 
152  //- Return the instantiated type name
153  static word typeName()
154  {
155  return "polynomialSolid<" + Thermo::typeName() + '>';
156  }
157 
158  //- Is the thermal conductivity isotropic
159  static const bool isotropic = true;
160 
161  //- Dynamic viscosity [kg/m/s]
162  inline scalar mu(const scalar p, const scalar T) const;
163 
164  //- Thermal conductivity [W/m/K]
165  inline scalar kappa(const scalar p, const scalar T) const;
166 
167  //- Thermal conductivity [W/m/K]
168  inline vector Kappa(const scalar p, const scalar T) const;
169 
170  //- Write to Ostream
171  void write(Ostream& os) const;
172 
173 
174  // Member Operators
175 
176  inline void operator+=(const polynomialSolidTransport&);
177  inline void operator*=(const scalar);
178 
179 
180  // Friend operators
181 
182  friend polynomialSolidTransport operator+ <Thermo, PolySize>
183  (
185  const polynomialSolidTransport&
186  );
187 
188  friend polynomialSolidTransport operator* <Thermo, PolySize>
189  (
190  const scalar,
191  const polynomialSolidTransport&
192  );
193 
194 
195  // Ostream Operator
196 
197  friend Ostream& operator<< <Thermo, PolySize>
198  (
199  Ostream&,
200  const polynomialSolidTransport&
201  );
202 };
203 
204 
205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
206 
207 } // End namespace Foam
208 
209 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210 
212 
213 #ifdef NoRepository
214  #include "polynomialSolidTransport.C"
215 #endif
216 
217 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
218 
219 #endif
220 
221 // ************************************************************************* //
dictionary dict
void operator+=(const polynomialSolidTransport &)
scalar kappa(const scalar p, const scalar T) const
Thermal conductivity [W/m/K].
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
static const bool isotropic
Is the thermal conductivity isotropic.
Transport package using polynomial functions for solid kappa.
autoPtr< polynomialSolidTransport > clone() const
Construct and return a clone.
A class for handling words, derived from string.
Definition: word.H:59
scalar mu(const scalar p, const scalar T) const
Dynamic viscosity [kg/m/s].
vector 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)
Polynomial templated on size (order):
Definition: Polynomial.H:65
static word typeName()
Return the instantiated type name.
static autoPtr< polynomialSolidTransport > New(const dictionary &dict)
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
volScalarField & p
void write(Ostream &os) const
Write to Ostream.
Namespace for OpenFOAM.