constTransport.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2021 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 scalar,
61  const constTransport<Thermo>&
62 );
63 
64 template<class Thermo>
65 Ostream& operator<<
66 (
67  Ostream&,
68  const constTransport<Thermo>&
69 );
70 
71 
72 /*---------------------------------------------------------------------------*\
73  Class constTransport Declaration
74 \*---------------------------------------------------------------------------*/
75 
76 template<class Thermo>
77 class constTransport
78 :
79  public Thermo
80 {
81  // Private Data
82 
83  //- Constant dynamic viscosity [Pa.s]
84  scalar mu_;
85 
86  //- Reciprocal Prandtl Number []
87  scalar rPr_;
88 
89 
90  // Private Member Functions
91 
92  //- Construct from components
93  inline constTransport
94  (
95  const Thermo& t,
96  const scalar mu,
97  const scalar Pr
98  );
99 
100 
101 public:
102 
103  // Constructors
104 
105  //- Construct as named copy
106  inline constTransport(const word&, const constTransport&);
107 
108  //- Construct from dictionary
110 
111  //- Construct and return a clone
112  inline autoPtr<constTransport> clone() const;
113 
114  // Selector from dictionary
115  inline static autoPtr<constTransport> New(const dictionary& dict);
116 
117 
118  // Member Functions
119 
120  //- Return the instantiated type name
121  static word typeName()
122  {
123  return "const<" + Thermo::typeName() + '>';
124  }
125 
126  //- Dynamic viscosity [kg/m/s]
127  inline scalar mu(const scalar p, const scalar T) const;
128 
129  //- Thermal conductivity [W/m/K]
130  inline scalar kappa(const scalar p, const scalar T) const;
131 
132  //- Write to Ostream
133  void write(Ostream& os) const;
134 
135 
136  // Member Operators
137 
138  inline void operator+=(const constTransport&);
139  inline void operator*=(const scalar);
140 
141 
142  // Friend operators
143 
144  friend constTransport operator+ <Thermo>
145  (
146  const constTransport&,
147  const constTransport&
148  );
149 
150  friend constTransport operator* <Thermo>
151  (
152  const scalar,
153  const constTransport&
154  );
155 
156 
157  // Ostream Operator
158 
159  friend Ostream& operator<< <Thermo>
160  (
161  Ostream&,
162  const constTransport&
163  );
164 };
165 
166 
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 
169 } // End namespace Foam
170 
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 
173 #include "constTransportI.H"
174 
175 #ifdef NoRepository
176  #include "constTransport.C"
177 #endif
178 
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 
181 #endif
182 
183 // ************************************************************************* //
dictionary dict
scalar kappa(const scalar p, const scalar T) const
Thermal conductivity [W/m/K].
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
Constant properties Transport package. Templated into a given thermodynamics package (needed for ther...
static word typeName()
Return the instantiated type name.
void write(Ostream &os) const
Write to Ostream.
A class for handling words, derived from string.
Definition: word.H:59
autoPtr< constTransport > 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:54
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
void operator*=(const scalar)
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:52
static autoPtr< constTransport > New(const dictionary &dict)
volScalarField & p
scalar mu(const scalar p, const scalar T) const
Dynamic viscosity [kg/m/s].
Namespace for OpenFOAM.