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-2018 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/ms]
127  inline scalar mu(const scalar p, const scalar T) const;
128 
129  //- Thermal conductivity [W/mK]
130  inline scalar kappa(const scalar p, const scalar T) const;
131 
132  //- Thermal diffusivity of enthalpy [kg/ms]
133  inline scalar alphah(const scalar p, const scalar T) const;
134 
135  // Species diffusivity
136  // inline scalar D(const scalar p, const scalar T) const;
137 
138  //- Write to Ostream
139  void write(Ostream& os) const;
140 
141 
142  // Member operators
143 
144  inline void operator=(const constTransport&);
145 
146  inline void operator+=(const constTransport&);
147 
148  inline void operator*=(const scalar);
149 
150 
151  // Friend operators
152 
153  friend constTransport operator+ <Thermo>
154  (
155  const constTransport&,
156  const constTransport&
157  );
158 
159  friend constTransport operator* <Thermo>
160  (
161  const scalar,
162  const constTransport&
163  );
164 
165 
166  // Ostream Operator
167 
168  friend Ostream& operator<< <Thermo>
169  (
170  Ostream&,
171  const constTransport&
172  );
173 };
174 
175 
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 
178 } // End namespace Foam
179 
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 
182 #include "constTransportI.H"
183 
184 #ifdef NoRepository
185  #include "constTransport.C"
186 #endif
187 
188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189 
190 #endif
191 
192 // ************************************************************************* //
dimensionedScalar Pr("Pr", dimless, laminarTransport)
dictionary dict
scalar kappa(const scalar p, const scalar T) const
Thermal conductivity [W/mK].
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...
static word typeName()
Return the instantiated type name.
scalar alphah(const scalar p, const scalar T) const
Thermal diffusivity of enthalpy [kg/ms].
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: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:52
static autoPtr< constTransport > New(const dictionary &dict)
volScalarField & p
scalar mu(const scalar p, const scalar T) const
Dynamic viscosity [kg/ms].
Namespace for OpenFOAM.