All Classes Namespaces Files Functions Variables Typedefs Friends Macros Groups
powerLawTransport.C
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 Group
30  grpPowerLawQGD
31 
32 \*---------------------------------------------------------------------------*/
33 
34 #include "powerLawTransport.H"
35 #include "IOstreams.H"
36 
37 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
38 
39 template<class Thermo>
41 :
42  Thermo(is),
43  mu0_(readScalar(is)),
44  T0_(readScalar(is)),
45  k_(readScalar(is)),
46  rPr_(1.0/readScalar(is))
47 {
48  is.check("powerLawTransport::powerLawTransport(Istream& is)");
49 }
50 
51 
52 template<class Thermo>
54 :
55  Thermo(dict),
56  mu0_(readScalar(dict.subDict("transport").lookup("mu0"))),
57  T0_(readScalar(dict.subDict("transport").lookup("T0"))),
58  k_(readScalar(dict.subDict("transport").lookup("k"))),
59  rPr_(1.0/readScalar(dict.subDict("transport").lookup("Pr")))
60 {}
61 
62 
63 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
64 
65 template<class Thermo>
67 {
68  os << this->name() << endl;
69  os << token::BEGIN_BLOCK << incrIndent << nl;
70 
71  Thermo::write(os);
72 
73  dictionary dict("transport");
74  dict.add("mu0", mu0_);
75  dict.add("T0", T0_);
76  dict.add("k", k_);
77  dict.add("Pr", 1.0/rPr_);
78  os << indent << dict.dictName() << dict;
79 
80  os << decrIndent << token::END_BLOCK << nl;
81 }
82 
83 
84 // * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
85 
86 template<class Thermo>
87 Foam::Ostream& Foam::operator<<(Ostream& os, const powerLawTransport<Thermo>& ct)
88 {
89  operator<<(os, static_cast<const Thermo&>(ct));
90  os<< tab << ct.mu0_ << tab << ct.T0_
91  << tab << ct.k_ << tab << 1.0/ct.rPr_;
92 
93  os.check("Ostream& operator<<(Ostream&, const powerLawTransport&)");
94 
95  return os;
96 }
97 
98 
99 // ************************************************************************* //
thermo lookup("ScNumbers") >> ScNumbersTuples
Constant properties Transport package. Templated into a given thermodynamics package (needed for ther...