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-2018 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 in
53  [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 "polynomial<" + Thermo::typeName() + '>';
156  }
157 
158  //- Is the thermal conductivity isotropic
159  static const bool isotropic = true;
160 
161  //- Dynamic viscosity [kg/ms]
162  inline scalar mu(const scalar p, const scalar T) const;
163 
164  //- Thermal conductivity [W/mK]
165  inline scalar kappa(const scalar p, const scalar T) const;
166 
167  //- Thermal conductivity [W/mK]
168  inline vector Kappa(const scalar p, const scalar T) const;
169 
170  //- Thermal diffusivity of enthalpy [kg/ms]
171  inline scalar alphah(const scalar p, const scalar T) const;
172 
173 
174  //- Write to Ostream
175  void write(Ostream& os) const;
176 
177 
178  // Member operators
179 
180  inline void operator=(const polynomialSolidTransport&);
181  inline void operator+=(const polynomialSolidTransport&);
182  inline void operator*=(const scalar);
183 
184 
185  // Friend operators
186 
187  friend polynomialSolidTransport operator+ <Thermo, PolySize>
188  (
190  const polynomialSolidTransport&
191  );
192 
193  friend polynomialSolidTransport operator* <Thermo, PolySize>
194  (
195  const scalar,
196  const polynomialSolidTransport&
197  );
198 
199 
200  // Ostream Operator
201 
202  friend Ostream& operator<< <Thermo, PolySize>
203  (
204  Ostream&,
205  const polynomialSolidTransport&
206  );
207 };
208 
209 
210 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
211 
212 } // End namespace Foam
213 
214 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
215 
217 
218 #ifdef NoRepository
219  #include "polynomialSolidTransport.C"
220 #endif
221 
222 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
223 
224 #endif
225 
226 // ************************************************************************* //
dictionary dict
void operator+=(const polynomialSolidTransport &)
scalar kappa(const scalar p, const scalar T) const
Thermal conductivity [W/mK].
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
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/ms].
vector Kappa(const scalar p, const scalar T) const
Thermal conductivity [W/mK].
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
scalar alphah(const scalar p, const scalar T) const
Thermal diffusivity of enthalpy [kg/ms].
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.
void operator=(const polynomialSolidTransport &)
Namespace for OpenFOAM.