Initial commit for version 2.0.x patch release
[OpenFOAM-2.0.x.git] / src / thermophysicalModels / specie / thermo / eConst / eConstThermo.C
bloba89059c52b6576b5b1924e63f9826f2ba294ed95
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2004-2011 OpenCFD Ltd.
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 "eConstThermo.H"
27 #include "IOstreams.H"
29 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
31 template<class EquationOfState>
32 Foam::eConstThermo<EquationOfState>::eConstThermo(Istream& is)
34     EquationOfState(is),
35     Cv_(readScalar(is)),
36     Hf_(readScalar(is))
38     is.check("eConstThermo<EquationOfState>::eConstThermo(Istream&)");
42 template<class EquationOfState>
43 Foam::eConstThermo<EquationOfState>::eConstThermo(const dictionary& dict)
45     EquationOfState(dict),
46     Cv_(readScalar(dict.subDict("thermodynamics").lookup("Cv"))),
47     Hf_(readScalar(dict.subDict("thermodynamics").lookup("Hf")))
51 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
53 template<class EquationOfState>
54 void Foam::eConstThermo<EquationOfState>::write(Ostream& os) const
56     EquationOfState::write(os);
58     dictionary dict("thermodynamics");
59     dict.add("Cv", Cv_);
60     dict.add("Hf", Hf_);
61     os  << dict;
65 // * * * * * * * * * * * * * * * Ostream Operator  * * * * * * * * * * * * * //
67 template<class EquationOfState>
68 Foam::Ostream& Foam::operator<<
70     Ostream& os,
71     const eConstThermo<EquationOfState>& ct
74     os  << static_cast<const EquationOfState&>(ct) << tab
75         << ct.Cv_ << tab << ct.Hf_;
77     os.check("Ostream& operator<<(Ostream&, const eConstThermo&)");
78     return os;
82 // ************************************************************************* //