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 | Copyright (C) 2013-2016 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 kappa
29 
30 SourceFiles
31  polynomialSolidTransportI.H
32  polynomialSolidTransport.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef polynomialSolidTransport_H
37 #define polynomialSolidTransport_H
38 
39 #include "Polynomial.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 // Forward declaration of friend functions and operators
47 
48 template<class Thermo, int PolySize> class polynomialSolidTransport;
49 
50 template<class Thermo, int PolySize>
52 (
54  const polynomialSolidTransport<Thermo, PolySize>&
55 );
56 
57 template<class Thermo, int PolySize>
58 inline polynomialSolidTransport<Thermo, PolySize> operator-
59 (
60  const polynomialSolidTransport<Thermo, PolySize>&,
61  const polynomialSolidTransport<Thermo, PolySize>&
62 );
63 
64 template<class Thermo, int PolySize>
65 inline polynomialSolidTransport<Thermo, PolySize> operator*
66 (
67  const scalar,
68  const polynomialSolidTransport<Thermo, PolySize>&
69 );
70 
71 template<class Thermo, int PolySize>
72 inline polynomialSolidTransport<Thermo, PolySize> operator==
73 (
74  const polynomialSolidTransport<Thermo, PolySize>&,
75  const polynomialSolidTransport<Thermo, PolySize>&
76 );
77 
78 template<class Thermo, int PolySize>
79 Ostream& operator<<
80 (
81  Ostream&,
82  const polynomialSolidTransport<Thermo, PolySize>&
83 );
84 
85 
86 /*---------------------------------------------------------------------------*\
87  Class polynomialSolidTransport Declaration
88 \*---------------------------------------------------------------------------*/
89 
90 template<class Thermo, int PolySize=8>
92 :
93  public Thermo
94 {
95  // Private data
96 
97  //- Thermal conductivity polynomial coefficients
98  // Note: input in [W/m/K]
99  Polynomial<PolySize> kappaCoeffs_;
100 
101 
102  // Private Member Functions
103 
104  //- Construct from components
106  (
107  const Thermo& t,
108  const Polynomial<PolySize>& kappaPoly
109  );
110 
111 
112 public:
113 
114  // Constructors
115 
116  //- Construct copy
118 
119  //- Construct as named copy
121  (
122  const word&,
124  );
125 
126  //- Construct from Istream
128 
129  //- Construct from dictionary
131 
132  //- Construct and return a clone
134 
135  // Selector from Istream
136  inline static autoPtr<polynomialSolidTransport> New(Istream& is);
137 
138  // Selector from dictionary
140  (
141  const dictionary&dict
142  );
143 
144 
145  // Member functions
146 
147  //- Return the instantiated type name
148  static word typeName()
149  {
150  return "polynomial<" + Thermo::typeName() + '>';
151  }
152 
153  //- Is the thermal conductivity isotropic
154  static const bool isotropic = true;
155 
156  //- Dynamic viscosity [kg/ms]
157  inline scalar mu(const scalar p, const scalar T) const;
158 
159  //- Thermal conductivity [W/mK]
160  inline scalar kappa(const scalar p, const scalar T) const;
161 
162  //- Thermal conductivity [W/mK]
163  inline vector Kappa(const scalar p, const scalar T) const;
164 
165  //- Thermal diffusivity of enthalpy [kg/ms]
166  inline scalar alphah(const scalar p, const scalar T) const;
167 
168 
169  //- Write to Ostream
170  void write(Ostream& os) const;
171 
172 
173  // Member operators
174 
175  inline void operator=(const polynomialSolidTransport&);
176  inline void operator+=(const polynomialSolidTransport&);
177  inline void operator-=(const polynomialSolidTransport&);
178  inline void operator*=(const scalar);
179 
180 
181  // Friend operators
182 
183  friend polynomialSolidTransport operator+ <Thermo, PolySize>
184  (
186  const polynomialSolidTransport&
187  );
188 
189  friend polynomialSolidTransport operator- <Thermo, PolySize>
190  (
191  const polynomialSolidTransport&,
192  const polynomialSolidTransport&
193  );
194 
195  friend polynomialSolidTransport operator* <Thermo, PolySize>
196  (
197  const scalar,
198  const polynomialSolidTransport&
199  );
200 
201  friend polynomialSolidTransport operator== <Thermo, PolySize>
202  (
203  const polynomialSolidTransport&,
204  const polynomialSolidTransport&
205  );
206 
207 
208  // Ostream Operator
209 
210  friend Ostream& operator<< <Thermo, PolySize>
211  (
212  Ostream&,
213  const polynomialSolidTransport&
214  );
215 };
216 
217 
218 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
219 
220 } // End namespace Foam
221 
222 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
223 
225 
226 #ifdef NoRepository
227  #include "polynomialSolidTransport.C"
228 #endif
229 
230 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
231 
232 #endif
233 
234 // ************************************************************************* //
dictionary dict
vector Kappa(const scalar p, const scalar T) const
Thermal conductivity [W/mK].
void operator+=(const polynomialSolidTransport &)
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
void write(Ostream &os) const
Write to Ostream.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
static const bool isotropic
Is the thermal conductivity isotropic.
void operator-=(const polynomialSolidTransport &)
scalar alphah(const scalar p, const scalar T) const
Thermal diffusivity of enthalpy [kg/ms].
Transport package using polynomial functions for solid kappa.
static autoPtr< polynomialSolidTransport > New(Istream &is)
scalar mu(const scalar p, const scalar T) const
Dynamic viscosity [kg/ms].
A class for handling words, derived from string.
Definition: word.H:59
scalar kappa(const scalar p, const scalar T) const
Thermal conductivity [W/mK].
autoPtr< polynomialSolidTransport > clone() const
Construct and return a clone.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Polynomial templated on size (order):
Definition: Polynomial.H:63
static word typeName()
Return the instantiated type name.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:53
volScalarField & p
void operator=(const polynomialSolidTransport &)
Namespace for OpenFOAM.