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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2013-2017 OpenFOAM Foundation
9  Copyright (C) 2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::polynomialSolidTransport
29 
30 Description
31  Transport package using polynomial functions for solid \c kappa.
32 
33 Usage
34 
35  \table
36  Property | Description
37  kappaCoeffs<8> | Thermal conductivity polynomial coefficients
38  \endtable
39 
40  Example of the specification of the transport properties:
41  \verbatim
42  transport
43  {
44  kappaCoeffs<8> ( 1000 -0.05 0.003 0 0 0 0 0 );
45  }
46  \endverbatim
47 
48  The polynomial expression is evaluated as so:
49 
50  \f[
51  \kappa = 1000 - 0.05 T + 0.003 T^2
52  \f]
53 
54 Note
55  Thermal conductivity polynomial coefficients evaluate to an expression in
56  [W/m/K].
57 
58 SourceFiles
59  polynomialSolidTransportI.H
60  polynomialSolidTransport.C
61 
62 See also
63  Foam::Polynomial
64 
65 \*---------------------------------------------------------------------------*/
66 
67 #ifndef polynomialSolidTransport_H
68 #define polynomialSolidTransport_H
69 
70 #include "Polynomial.H"
71 
72 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
73 
74 namespace Foam
75 {
76 
77 // Forward Declarations
78 
79 template<class Thermo, int PolySize> class polynomialSolidTransport;
80 
81 template<class Thermo, int PolySize>
82 inline polynomialSolidTransport<Thermo, PolySize> operator+
83 (
86 );
87 
88 template<class Thermo, int PolySize>
90 (
91  const scalar,
93 );
94 
95 template<class Thermo, int PolySize>
96 Ostream& operator<<
97 (
98  Ostream&,
100 );
101 
102 
103 /*---------------------------------------------------------------------------*\
104  Class polynomialSolidTransport Declaration
105 \*---------------------------------------------------------------------------*/
106 
107 template<class Thermo, int PolySize=8>
109 :
110  public Thermo
111 {
112  // Private Data
113 
114  //- Thermal conductivity polynomial coefficients
115  // Note: input in [W/m/K]
116  Polynomial<PolySize> kappaCoeffs_;
117 
118 
119  // Private Member Functions
120 
121  //- Coeffs name. Eg, "kappaCoeffs<10>"
122  inline static word coeffsName(const char* name)
123  {
124  return word(name + ("Coeffs<" + std::to_string(PolySize) + '>'));
125  }
126 
127  //- Construct from components
129  (
130  const Thermo& t,
131  const Polynomial<PolySize>& kappaPoly
132  );
133 
134 
135 public:
136 
137  // Generated Methods: copy construct, copy assignment
138 
139 
140  // Constructors
141 
142  //- Construct as named copy
144  (
145  const word&,
147  );
148 
149  //- Construct from dictionary
150  explicit polynomialSolidTransport(const dictionary& dict);
151 
152  //- Construct and return a clone
154 
155  // Selector from dictionary
157  (
158  const dictionary&dict
159  );
160 
161 
162  // Member Functions
163 
164  //- Return the instantiated type name
165  static word typeName()
166  {
167  return "polynomial<" + Thermo::typeName() + '>';
168  }
169 
170  //- Is the thermal conductivity isotropic
171  static const bool isotropic = true;
172 
173  //- Dynamic viscosity [kg/ms]
174  inline scalar mu(const scalar p, const scalar T) const;
175 
176  //- Thermal conductivity [W/mK]
177  inline scalar kappa(const scalar p, const scalar T) const;
178 
179  //- Thermal conductivity [W/mK]
180  inline vector Kappa(const scalar p, const scalar T) const;
181 
182  //- Thermal diffusivity of enthalpy [kg/ms]
183  inline scalar alphah(const scalar p, const scalar T) const;
184 
185 
186  //- Write to Ostream
187  void write(Ostream& os) const;
188 
189 
190  // Member Operators
191 
192  inline void operator+=(const polynomialSolidTransport&);
193  inline void operator*=(const scalar);
194 
195 
196  // Friend Operators
197 
198  friend polynomialSolidTransport operator+ <Thermo, PolySize>
199  (
202  );
203 
204  friend polynomialSolidTransport operator* <Thermo, PolySize>
205  (
206  const scalar,
208  );
209 
210 
211  // IOstream Operators
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:78
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
polynomialSolidTransport.C
Foam::polynomialSolidTransport::clone
autoPtr< polynomialSolidTransport > clone() const
Construct and return a clone.
Definition: polynomialSolidTransportI.H:60
Foam::polynomialSolidTransport::write
void write(Ostream &os) const
Write to Ostream.
Definition: polynomialSolidTransport.C:47
Foam::polynomialSolidTransport::Kappa
vector Kappa(const scalar p, const scalar T) const
Thermal conductivity [W/mK].
Definition: polynomialSolidTransportI.H:101
polynomialSolidTransportI.H
Foam::T
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Definition: FieldFieldFunctions.C:58
Foam::polynomialSolidTransport
Transport package using polynomial functions for solid kappa.
Definition: polynomialSolidTransport.H:84
Foam::polynomialSolidTransport::typeName
static word typeName()
Return the instantiated type name.
Definition: polynomialSolidTransport.H:170
Polynomial.H
Foam::polynomialSolidTransport::isotropic
static const bool isotropic
Is the thermal conductivity isotropic.
Definition: polynomialSolidTransport.H:176
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
os
OBJstream os(runTime.globalPath()/outputName)
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::polynomialSolidTransport::operator*=
void operator*=(const scalar)
Definition: polynomialSolidTransportI.H:142
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::Polynomial
Polynomial templated on size (order):
Definition: Polynomial.H:68
Foam::Vector< scalar >
Foam::name
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
Foam::polynomialSolidTransport::kappa
scalar kappa(const scalar p, const scalar T) const
Thermal conductivity [W/mK].
Definition: polynomialSolidTransportI.H:90
Foam::polynomialSolidTransport::New
static autoPtr< polynomialSolidTransport > New(const dictionary &dict)
Definition: polynomialSolidTransportI.H:68
Foam::polynomialSolidTransport::operator+=
void operator+=(const polynomialSolidTransport &)
Definition: polynomialSolidTransportI.H:125
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::polynomialSolidTransport::alphah
scalar alphah(const scalar p, const scalar T) const
Thermal diffusivity of enthalpy [kg/ms].
Definition: polynomialSolidTransportI.H:113