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-2023 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 (
81  const polynomialSolidTransport<Thermo, PolySize>&,
82  const polynomialSolidTransport<Thermo, PolySize>&
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 public:
117 
118  // Constructors
119 
120  //- Construct from components
122  (
123  const Thermo& t,
124  const Polynomial<PolySize>& kappaPoly
125  );
126 
127  //- Construct as named copy
129  (
130  const word&,
132  );
133 
134  //- Construct from name and dictionary
136 
137  //- Construct and return a clone
139 
140 
141  // Member Functions
142 
143  //- Return the instantiated type name
144  static word typeName()
145  {
146  return "polynomialSolid<" + Thermo::typeName() + '>';
147  }
148 
149  //- Is the thermal conductivity isotropic
150  static const bool isotropic = true;
151 
152  //- Isotropic thermal conductivity [W/m/K]
153  inline scalar kappa(const scalar p, const scalar T) const;
154 
155  //- Anisotropic thermal conductivity [W/m/K]
156  // Not implemented
157  inline vector Kappa(const scalar p, const scalar T) const;
158 
159  //- Write to Ostream
160  void write(Ostream& os) const;
161 
162 
163  // Member Operators
164 
165  inline void operator+=(const polynomialSolidTransport&);
166  inline void operator*=(const scalar);
167 
168 
169  // Friend operators
170 
171  friend polynomialSolidTransport operator+ <Thermo, PolySize>
172  (
175  );
176 
177  friend polynomialSolidTransport operator* <Thermo, PolySize>
178  (
179  const scalar,
181  );
182 
183 
184  // Ostream Operator
185 
186  friend Ostream& operator<< <Thermo, PolySize>
187  (
188  Ostream&,
190  );
191 };
192 
193 
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
195 
196 } // End namespace Foam
197 
198 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
199 
201 
202 #ifdef NoRepository
203  #include "polynomialSolidTransport.C"
204 #endif
205 
206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
207 
208 #endif
209 
210 // ************************************************************************* //
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
Polynomial templated on size (order):
Definition: Polynomial.H:84
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
Transport package using polynomial functions for solid kappa.
vector Kappa(const scalar p, const scalar T) const
Anisotropic thermal conductivity [W/m/K].
autoPtr< polynomialSolidTransport > clone() const
Construct and return a clone.
void operator+=(const polynomialSolidTransport &)
scalar kappa(const scalar p, const scalar T) const
Isotropic thermal conductivity [W/m/K].
static word typeName()
Return the instantiated type name.
static const bool isotropic
Is the thermal conductivity isotropic.
polynomialSolidTransport(const Thermo &t, const Polynomial< PolySize > &kappaPoly)
Construct from components.
void write(Ostream &os) const
Write to Ostream.
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
dictionary dict
volScalarField & p