Transferred copyright to the OpenFOAM Foundation
[OpenFOAM-2.0.x.git] / src / thermophysicalModels / specie / thermo / hConst / hConstThermo.C
blob3f2a7cf1c4d78d7775238b68fbf84c703f982a98
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 "hConstThermo.H"
27 #include "IOstreams.H"
29 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
31 template<class equationOfState>
32 Foam::hConstThermo<equationOfState>::hConstThermo(Istream& is)
34     equationOfState(is),
35     Cp_(readScalar(is)),
36     Hf_(readScalar(is))
38     is.check("hConstThermo::hConstThermo(Istream& is)");
42 template<class equationOfState>
43 Foam::hConstThermo<equationOfState>::hConstThermo(const dictionary& dict)
45     equationOfState(dict),
46     Cp_(readScalar(dict.subDict("thermodynamics").lookup("Cp"))),
47     Hf_(readScalar(dict.subDict("thermodynamics").lookup("Hf")))
51 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
53 template<class equationOfState>
54 void Foam::hConstThermo<equationOfState>::write(Ostream& os) const
56     equationOfState::write(os);
58     dictionary dict("thermodynamics");
59     dict.add("Cp", Cp_);
60     dict.add("Hf", Hf_);
61     os  << indent << dict.dictName() << dict;
65 // * * * * * * * * * * * * * * * Ostream Operator  * * * * * * * * * * * * * //
67 template<class equationOfState>
68 Foam::Ostream& Foam::operator<<
70     Ostream& os,
71     const hConstThermo<equationOfState>& ct
74     os  << static_cast<const equationOfState&>(ct) << tab
75         << ct.Cp_ << tab << ct.Hf_;
77     os.check("Ostream& operator<<(Ostream& os, const hConstThermo& ct)");
78     return os;
82 // ************************************************************************* //