All Classes Namespaces Files Functions Variables Typedefs Friends Macros Groups
powerLawTransport.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) 2011-2016 OpenFOAM Foundation
9  Copyright (C) 2019 OpenCFD Ltd.
10  Copyright (C) 2016-2019 ISP RAS (www.ispras.ru) UniCFD Group (www.unicfd.ru)
11 -------------------------------------------------------------------------------
12 
13 License
14  This file is part of QGDsolver, based on OpenFOAM library.
15 
16  OpenFOAM is free software: you can redistribute it and/or modify it
17  under the terms of the GNU General Public License as published by
18  the Free Software Foundation, either version 3 of the License, or
19  (at your option) any later version.
20 
21  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
22  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
23  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
24  for more details.
25 
26  You should have received a copy of the GNU General Public License
27  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
28 
29 Class
30  Foam::powerLawTransport
31 
32 Description
33  Constant properties Transport package.
34  Templated into a given thermodynamics package (needed for thermal
35  conductivity).
36 
37 SourceFiles
38  powerLawTransportI.H
39  powerLawTransport.C
40 
41 \*---------------------------------------------------------------------------*/
42 
43 #ifndef powerLawTransport_H
44 #define powerLawTransport_H
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 // Forward declaration of friend functions and operators
52 
53 template<class Thermo> class powerLawTransport;
54 
55 template<class Thermo>
56 inline powerLawTransport<Thermo> operator+
57 (
60 );
61 
62 template<class Thermo>
63 inline powerLawTransport<Thermo> operator-
64 (
67 );
68 
69 template<class Thermo>
70 inline powerLawTransport<Thermo> operator*
71 (
72  const scalar,
74 );
75 
76 template<class Thermo>
77 inline powerLawTransport<Thermo> operator==
78 (
81 );
82 
83 template<class Thermo>
84 Ostream& operator<<
85 (
86  Ostream&,
88 );
89 
90 
91 /*---------------------------------------------------------------------------*\
92  Class powerLawTransport Declaration
93 \*---------------------------------------------------------------------------*/
94 
95 template<class Thermo>
97 :
98  public Thermo
99 {
100  // Private data
101 
102  //- Constant dynamic viscosity [Pa.s]
103  scalar mu0_;
104 
105  //- [K]
106  scalar T0_;
107 
108  //- power coeff.
109  scalar k_;
110 
111  //- Reciprocal Prandtl Number []
112  scalar rPr_;
113 
114 
115  // Private Member Functions
116 
117  //- Construct from components
118  inline powerLawTransport
119  (
120  const Thermo& t,
121  const scalar mu0,
122  const scalar T0,
123  const scalar kk,
124  const scalar Pr
125  );
126 
127 
128 public:
129 
130  // Constructors
131 
132  //- Construct as named copy
133  inline powerLawTransport(const word&, const powerLawTransport&);
134 
135  //- Construct from Istream
136  powerLawTransport(Istream&);
137 
138  //- Construct from dictionary
139  powerLawTransport(const dictionary& dict);
140 
141  //- Construct and return a clone
142  inline autoPtr<powerLawTransport> clone() const;
143 
144  // Selector from Istream
145  inline static autoPtr<powerLawTransport> New(Istream& is);
146 
147  // Selector from dictionary
148  inline static autoPtr<powerLawTransport> New(const dictionary& dict);
149 
150 
151  // Member functions
152 
153  //- Return the instantiated type name
154  static word typeName()
155  {
156  return "powerLaw<" + Thermo::typeName() + '>';
157  }
158 
159  //- Dynamic viscosity [kg/ms]
160  inline scalar mu(const scalar p, const scalar T) const;
161 
162  //- Thermal conductivity [W/mK]
163  inline scalar 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  // Species diffusivity
169  //inline scalar D(const scalar p, const scalar T) const;
170 
171  //- Write to Ostream
172  void write(Ostream& os) const;
173 
174 
175  // Member operators
176 
178 
179  inline void operator+=(const powerLawTransport&);
180 
181  inline void operator-=(const powerLawTransport&);
182 
183  inline void operator*=(const scalar);
184 
185 
186  // Friend operators
187 
188  friend powerLawTransport operator+ <Thermo>
189  (
190  const powerLawTransport&,
191  const powerLawTransport&
192  );
193 
194  friend powerLawTransport operator- <Thermo>
195  (
196  const powerLawTransport&,
197  const powerLawTransport&
198  );
199 
200  friend powerLawTransport operator* <Thermo>
201  (
202  const scalar,
203  const powerLawTransport&
204  );
205 
206  friend powerLawTransport operator== <Thermo>
207  (
208  const powerLawTransport&,
209  const powerLawTransport&
210  );
211 
212 
213  // Ostream Operator
214 
215  friend Ostream& operator<< <Thermo>
216  (
217  Ostream&,
218  const powerLawTransport&
219  );
220 };
221 
222 
223 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
224 
225 } // End namespace Foam
226 
227 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
228 
229 #include "powerLawTransportI.H"
230 
231 #ifdef NoRepository
232 # include "powerLawTransport.C"
233 #endif
234 
235 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
236 
237 #endif
238 
239 // ************************************************************************* //
powerLawTransport & operator=(const powerLawTransport &)
volScalarField T0("T0", T)
autoPtr< powerLawTransport > clone() const
Construct and return a clone.
static autoPtr< powerLawTransport > New(Istream &is)
scalar alphah(const scalar p, const scalar T) const
Thermal diffusivity of enthalpy [kg/ms].
scalar kappa(const scalar p, const scalar T) const
Thermal conductivity [W/mK].
void write(Ostream &os) const
Write to Ostream.
void operator-=(const powerLawTransport &)
static word typeName()
Return the instantiated type name.
scalar mu(const scalar p, const scalar T) const
Dynamic viscosity [kg/ms].
void operator+=(const powerLawTransport &)
void operator*=(const scalar)
volScalarField & T
Definition: createFields.H:53
volScalarField & p
Definition: createFields.H:52
Constant properties Transport package. Templated into a given thermodynamics package (needed for ther...