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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-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::constTransport
29 
30 Group
31  grpSpecieTransport
32 
33 Description
34  Constant properties Transport package.
35  Templated into a given thermodynamics package (needed for thermal
36  conductivity).
37 
38 SourceFiles
39  constTransportI.H
40  constTransport.C
41 
42 \*---------------------------------------------------------------------------*/
43 
44 #ifndef constTransport_H
45 #define constTransport_H
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 // Forward Declarations
53 
54 template<class Thermo> class constTransport;
55 
56 template<class Thermo>
57 inline constTransport<Thermo> operator+
58 (
61 );
62 
63 template<class Thermo>
64 inline constTransport<Thermo> operator*
65 (
66  const scalar,
68 );
69 
70 template<class Thermo>
71 Ostream& operator<<
72 (
73  Ostream&,
75 );
76 
77 
78 /*---------------------------------------------------------------------------*\
79  Class constTransport Declaration
80 \*---------------------------------------------------------------------------*/
81 
82 template<class Thermo>
83 class constTransport
84 :
85  public Thermo
86 {
87  // Private Data
88 
89  //- Constant dynamic viscosity [Pa.s]
90  scalar mu_;
91 
92  //- Reciprocal Prandtl Number [-]
93  scalar rPr_;
94 
95 
96  // Private Member Functions
97 
98  //- Construct from components
99  inline constTransport
100  (
101  const Thermo& t,
102  const scalar mu,
103  const scalar Pr
104  );
105 
106 
107 public:
108 
109  // Generated Methods: copy construct, copy assignment
110 
111 
112  // Constructors
113 
114  //- Construct as named copy
115  inline constTransport(const word&, const constTransport&);
116 
117  //- Construct from dictionary
118  explicit constTransport(const dictionary& dict);
119 
120  //- Construct and return a clone
121  inline autoPtr<constTransport> clone() const;
122 
123  // Selector from dictionary
124  inline static autoPtr<constTransport> New(const dictionary& dict);
125 
126 
127  // Member Functions
128 
129  //- Return the instantiated type name
130  static word typeName()
131  {
132  return "const<" + Thermo::typeName() + '>';
133  }
134 
135  //- Dynamic viscosity [kg/ms]
136  inline scalar mu(const scalar p, const scalar T) const;
137 
138  //- Thermal conductivity [W/mK]
139  inline scalar kappa(const scalar p, const scalar T) const;
140 
141  //- Thermal diffusivity of enthalpy [kg/ms]
142  inline scalar alphah(const scalar p, const scalar T) const;
143 
144  // Species diffusivity
145  //inline scalar D(const scalar p, const scalar T) const;
146 
147  //- Write to Ostream
148  void write(Ostream& os) const;
149 
150 
151  // Member Operators
152 
153  inline void operator+=(const constTransport&);
154 
155  inline void operator*=(const scalar);
156 
157 
158  // Friend Operators
159 
160  friend constTransport operator+ <Thermo>
161  (
162  const constTransport&,
163  const constTransport&
164  );
165 
166  friend constTransport operator* <Thermo>
167  (
168  const scalar,
169  const constTransport&
170  );
171 
172 
173  // IOstream Operators
174 
175  friend Ostream& operator<< <Thermo>
176  (
177  Ostream&,
178  const constTransport&
179  );
180 };
181 
182 
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184 
185 } // End namespace Foam
186 
187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
188 
189 #include "constTransportI.H"
190 
191 #ifdef NoRepository
192  #include "constTransport.C"
193 #endif
194 
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 
197 #endif
198 
199 // ************************************************************************* //
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::constTransport::operator+=
void operator+=(const constTransport &)
Definition: constTransportI.H:115
Foam::constTransport::write
void write(Ostream &os) const
Write to Ostream.
Foam::constTransport::New
static autoPtr< constTransport > New(const dictionary &dict)
Definition: constTransportI.H:68
Foam::constTransport::typeName
static word typeName()
Return the instantiated type name.
Definition: constTransport.H:129
constTransportI.H
Pr
dimensionedScalar Pr("Pr", dimless, laminarTransport)
Foam::T
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Definition: FieldFieldFunctions.C:58
Foam::constTransport::kappa
scalar kappa(const scalar p, const scalar T) const
Thermal conductivity [W/mK].
Definition: constTransportI.H:91
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::constTransport
Constant properties Transport package. Templated into a given thermodynamics package (needed for ther...
Definition: constTransport.H:53
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::constTransport::alphah
scalar alphah(const scalar p, const scalar T) const
Thermal diffusivity of enthalpy [kg/ms].
Definition: constTransportI.H:102
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::constTransport::mu
scalar mu(const scalar p, const scalar T) const
Dynamic viscosity [kg/ms].
Definition: constTransportI.H:80
Foam::constTransport::clone
autoPtr< constTransport > clone() const
Construct and return a clone.
Definition: constTransportI.H:59
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::constTransport::operator*=
void operator*=(const scalar)
Definition: constTransportI.H:136
constTransport.C