constTransport.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) 2011-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::constTransport
26 
27 Description
28  Constant properties Transport package.
29  Templated into a given thermodynamics package (needed for thermal
30  conductivity).
31 
32 SourceFiles
33  constTransportI.H
34  constTransport.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef constTransport_H
39 #define constTransport_H
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 // Forward declaration of friend functions and operators
47 
48 template<class Thermo> class constTransport;
49 
50 template<class Thermo>
51 inline constTransport<Thermo> operator+
52 (
54  const constTransport<Thermo>&
55 );
56 
57 template<class Thermo>
58 inline constTransport<Thermo> operator-
59 (
60  const constTransport<Thermo>&,
61  const constTransport<Thermo>&
62 );
63 
64 template<class Thermo>
65 inline constTransport<Thermo> operator*
66 (
67  const scalar,
68  const constTransport<Thermo>&
69 );
70 
71 template<class Thermo>
72 inline constTransport<Thermo> operator==
73 (
74  const constTransport<Thermo>&,
75  const constTransport<Thermo>&
76 );
77 
78 template<class Thermo>
79 Ostream& operator<<
80 (
81  Ostream&,
82  const constTransport<Thermo>&
83 );
84 
85 
86 /*---------------------------------------------------------------------------*\
87  Class constTransport Declaration
88 \*---------------------------------------------------------------------------*/
89 
90 template<class Thermo>
91 class constTransport
92 :
93  public Thermo
94 {
95  // Private data
96 
97  //- Constant dynamic viscosity [Pa.s]
98  scalar mu_;
99 
100  //- Reciprocal Prandtl Number []
101  scalar rPr_;
102 
103 
104  // Private Member Functions
105 
106  //- Construct from components
107  inline constTransport
108  (
109  const Thermo& t,
110  const scalar mu,
111  const scalar Pr
112  );
113 
114 
115 public:
116 
117  // Constructors
118 
119  //- Construct as named copy
120  inline constTransport(const word&, const constTransport&);
121 
122  //- Construct from Istream
124 
125  //- Construct from dictionary
127 
128  //- Construct and return a clone
129  inline autoPtr<constTransport> clone() const;
130 
131  // Selector from Istream
132  inline static autoPtr<constTransport> New(Istream& is);
133 
134  // Selector from dictionary
135  inline static autoPtr<constTransport> New(const dictionary& dict);
136 
137 
138  // Member functions
139 
140  //- Return the instantiated type name
141  static word typeName()
142  {
143  return "const<" + Thermo::typeName() + '>';
144  }
145 
146  //- Dynamic viscosity [kg/ms]
147  inline scalar mu(const scalar p, const scalar T) const;
148 
149  //- Thermal conductivity [W/mK]
150  inline scalar kappa(const scalar p, const scalar T) const;
151 
152  //- Thermal diffusivity of enthalpy [kg/ms]
153  inline scalar alphah(const scalar p, const scalar T) const;
154 
155  // Species diffusivity
156  //inline scalar D(const scalar p, const scalar T) const;
157 
158  //- Write to Ostream
159  void write(Ostream& os) const;
160 
161 
162  // Member operators
163 
164  inline void operator=(const constTransport&);
165 
166  inline void operator+=(const constTransport&);
167 
168  inline void operator-=(const constTransport&);
169 
170  inline void operator*=(const scalar);
171 
172 
173  // Friend operators
174 
175  friend constTransport operator+ <Thermo>
176  (
177  const constTransport&,
178  const constTransport&
179  );
180 
181  friend constTransport operator- <Thermo>
182  (
183  const constTransport&,
184  const constTransport&
185  );
186 
187  friend constTransport operator* <Thermo>
188  (
189  const scalar,
190  const constTransport&
191  );
192 
193  friend constTransport operator== <Thermo>
194  (
195  const constTransport&,
196  const constTransport&
197  );
198 
199 
200  // Ostream Operator
201 
202  friend Ostream& operator<< <Thermo>
203  (
204  Ostream&,
205  const constTransport&
206  );
207 };
208 
209 
210 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
211 
212 } // End namespace Foam
213 
214 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
215 
216 #include "constTransportI.H"
217 
218 #ifdef NoRepository
219  #include "constTransport.C"
220 #endif
221 
222 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
223 
224 #endif
225 
226 // ************************************************************************* //
scalar alphah(const scalar p, const scalar T) const
Thermal diffusivity of enthalpy [kg/ms].
dimensionedScalar Pr("Pr", dimless, laminarTransport)
dictionary dict
scalar mu(const scalar p, const scalar T) const
Dynamic viscosity [kg/ms].
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
Constant properties Transport package. Templated into a given thermodynamics package (needed for ther...
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
autoPtr< constTransport > clone() const
Construct and return a clone.
static word typeName()
Return the instantiated type name.
scalar kappa(const scalar p, const scalar T) const
Thermal conductivity [W/mK].
A class for handling words, derived from string.
Definition: word.H:59
static autoPtr< constTransport > New(Istream &is)
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)
void operator*=(const scalar)
void operator+=(const constTransport &)
void operator=(const constTransport &)
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 constTransport &)
void write(Ostream &os) const
Write to Ostream.
Namespace for OpenFOAM.