1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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.
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
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/>.
24 \*---------------------------------------------------------------------------*/
26 #include "polynomialTransport.H"
27 #include "IOstreams.H"
29 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
31 template<class Thermo, int PolySize>
32 Foam::polynomialTransport<Thermo, PolySize>::polynomialTransport(Istream& is)
35 muCoeffs_("muCoeffs<" + Foam::name(PolySize) + '>', is),
36 kappaCoeffs_("kappaCoeffs<" + Foam::name(PolySize) + '>', is)
38 muCoeffs_ *= this->W();
39 kappaCoeffs_ *= this->W();
43 template<class Thermo, int PolySize>
44 Foam::polynomialTransport<Thermo, PolySize>::polynomialTransport
46 const dictionary& dict
52 dict.subDict("transport").lookup
54 "muCoeffs<" + Foam::name(PolySize) + '>'
59 dict.subDict("transport").lookup
61 "kappaCoeffs<" + Foam::name(PolySize) + '>'
65 muCoeffs_ *= this->W();
66 kappaCoeffs_ *= this->W();
70 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
72 template<class Thermo, int PolySize>
73 void Foam::polynomialTransport<Thermo, PolySize>::write(Ostream& os) const
75 os << this->name() << endl;
76 os << token::BEGIN_BLOCK << incrIndent << nl;
80 dictionary dict("transport");
83 word("muCoeffs<" + Foam::name(PolySize) + '>'),
88 word("kappaCoeffs<" + Foam::name(PolySize) + '>'),
89 kappaCoeffs_/this->W()
91 os << indent << dict.dictName() << dict;
93 os << decrIndent << token::END_BLOCK << nl;
97 // * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
99 template<class Thermo, int PolySize>
100 Foam::Ostream& Foam::operator<<
103 const polynomialTransport<Thermo, PolySize>& pt
106 os << static_cast<const Thermo&>(pt) << tab
107 << "muCoeffs<" << Foam::name(PolySize) << '>' << tab
108 << pt.muCoeffs_/pt.W() << tab
109 << "kappaCoeffs<" << Foam::name(PolySize) << '>' << tab
110 << pt.kappaCoeffs_/pt.W();
114 "Ostream& operator<<"
117 "const polynomialTransport<Thermo, PolySize>&"
125 // ************************************************************************* //