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 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 (
55 );
56 
57 template<class Thermo, int PolySize>
59 (
62 );
63 
64 template<class Thermo, int PolySize>
66 (
67  const scalar,
69 );
70 
71 template<class Thermo, int PolySize>
73 (
76 );
77 
78 template<class Thermo, int PolySize>
79 Ostream& operator<<
80 (
81  Ostream&,
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]
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 polynomialSolidTransport& operator=
176  (
178  );
179  inline void operator+=(const polynomialSolidTransport&);
180  inline void operator-=(const polynomialSolidTransport&);
181  inline void operator*=(const scalar);
182 
183 
184  // Friend operators
185 
186  friend polynomialSolidTransport operator+ <Thermo, PolySize>
187  (
190  );
191 
192  friend polynomialSolidTransport operator- <Thermo, PolySize>
193  (
196  );
197 
198  friend polynomialSolidTransport operator* <Thermo, PolySize>
199  (
200  const scalar,
202  );
203 
204  friend polynomialSolidTransport operator== <Thermo, PolySize>
205  (
208  );
209 
210 
211  // Ostream Operator
212 
213  friend Ostream& operator<< <Thermo, PolySize>
214  (
215  Ostream&,
217  );
218 };
219 
220 
221 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
222 
223 } // End namespace Foam
224 
225 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
226 
228 
229 #ifdef NoRepository
230 # include "polynomialSolidTransport.C"
231 #endif
232 
233 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
234 
235 #endif
236 
237 // ************************************************************************* //
Foam::polynomialSolidTransport::mu
scalar mu(const scalar p, const scalar T) const
Dynamic viscosity [kg/ms].
Definition: polynomialSolidTransportI.H:105
Foam::polynomialSolidTransport::New
static autoPtr< polynomialSolidTransport > New(Istream &is)
Definition: polynomialSolidTransportI.H:81
p
p
Definition: pEqn.H:62
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::polynomialSolidTransport::polynomialSolidTransport
polynomialSolidTransport(const Thermo &t, const Polynomial< PolySize > &kappaPoly)
Construct from components.
polynomialSolidTransport.C
Foam::polynomialSolidTransport::clone
autoPtr< polynomialSolidTransport > clone() const
Construct and return a clone.
Definition: polynomialSolidTransportI.H:70
Foam::polynomialSolidTransport::write
void write(Ostream &os) const
Write to Ostream.
Definition: polynomialSolidTransport.C:64
Foam::polynomialSolidTransport::operator-=
void operator-=(const polynomialSolidTransport &)
Definition: polynomialSolidTransportI.H:184
Foam::polynomialSolidTransport::Kappa
vector Kappa(const scalar p, const scalar T) const
Thermal conductivity [W/mK].
Definition: polynomialSolidTransportI.H:128
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:57
polynomialSolidTransportI.H
Foam::T
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Definition: FieldFieldFunctions.C:55
Foam::polynomialSolidTransport
Transport package using polynomial functions for solid kappa.
Definition: polynomialSolidTransport.H:47
Foam::polynomialSolidTransport::typeName
static word typeName()
Return the instantiated type name.
Definition: polynomialSolidTransport.H:147
Polynomial.H
Foam::polynomialSolidTransport::isotropic
static const bool isotropic
Is the thermal conductivity isotropic.
Definition: polynomialSolidTransport.H:153
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::polynomialSolidTransport::kappaCoeffs_
Polynomial< PolySize > kappaCoeffs_
Thermal conductivity polynomial coefficients.
Definition: polynomialSolidTransport.H:98
Foam::polynomialSolidTransport::operator*=
void operator*=(const scalar)
Definition: polynomialSolidTransportI.H:201
Foam::autoPtr
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:117
Foam::Polynomial< PolySize >
Foam::Vector< scalar >
PolySize
const int PolySize
Definition: Test-Polynomial.C:37
Foam::polynomialSolidTransport::kappa
scalar kappa(const scalar p, const scalar T) const
Thermal conductivity [W/mK].
Definition: polynomialSolidTransportI.H:117
Foam::polynomialSolidTransport::operator+=
void operator+=(const polynomialSolidTransport &)
Definition: polynomialSolidTransportI.H:167
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::polynomialSolidTransport::alphah
scalar alphah(const scalar p, const scalar T) const
Thermal diffusivity of enthalpy [kg/ms].
Definition: polynomialSolidTransportI.H:140