ENH: autoLayerDriver: better layering information message
[OpenFOAM-2.0.x.git] / src / thermophysicalModels / specie / transport / polynomial / polynomialTransport.C
blob32640927d95f96913c67bdbf3ce8e097e28a166b
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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)
34     Thermo(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
49     Thermo(dict),
50     muCoeffs_
51     (
52         dict.subDict("transport").lookup
53         (
54             "muCoeffs<" + Foam::name(PolySize) + '>'
55         )
56     ),
57     kappaCoeffs_
58     (
59         dict.subDict("transport").lookup
60         (
61             "kappaCoeffs<" + Foam::name(PolySize) + '>'
62         )
63     )
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;
78     Thermo::write(os);
80     dictionary dict("transport");
81     dict.add
82     (
83         word("muCoeffs<" + Foam::name(PolySize) + '>'),
84         muCoeffs_/this->W()
85     );
86     dict.add
87     (
88         word("kappaCoeffs<" + Foam::name(PolySize) + '>'),
89         kappaCoeffs_/this->W()
90     );
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<<
102     Ostream& os,
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();
112     os.check
113     (
114         "Ostream& operator<<"
115         "("
116             "Ostream&, "
117             "const polynomialTransport<Thermo, PolySize>&"
118         ")"
119     );
121     return os;
125 // ************************************************************************* //