BUG: UListIO: byteSize overflowing on really big faceLists
[OpenFOAM-2.0.x.git] / applications / utilities / thermophysical / equilibriumCO / equilibriumCO.C
blob0e67fa0b7ffc4f7b8d466d4755207668e543d128
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 Application
26 Description
27     Calculates the equilibrium level of carbon monoxide
29 \*---------------------------------------------------------------------------*/
31 #include "argList.H"
32 #include "Time.H"
33 #include "dictionary.H"
34 #include "IFstream.H"
35 #include "OSspecific.H"
36 #include "IOmanip.H"
38 #include "specieThermo.H"
39 #include "janafThermo.H"
40 #include "perfectGas.H"
41 #include "SLPtrList.H"
43 using namespace Foam;
45 typedef specieThermo<janafThermo<perfectGas> > thermo;
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 // Main program:
50 int main(int argc, char *argv[])
53 #   include "setRootCase.H"
54 #   include "createTime.H"
56     Info<< nl << "Reading Burcat data IOdictionary" << endl;
58     IOdictionary CpData
59     (
60         IOobject
61         (
62             "BurcatCpData",
63             runTime.constant(),
64             runTime,
65             IOobject::MUST_READ_IF_MODIFIED,
66             IOobject::NO_WRITE,
67             false
68         )
69     );
73     scalar T = 3000.0;
75     SLPtrList<thermo> EQreactions;
77     EQreactions.append
78     (
79         new thermo
80         (
81             thermo(CpData.lookup("CO2"))
82          ==
83             thermo(CpData.lookup("CO"))
84           + 0.5*thermo(CpData.lookup("O2"))
85         )
86     );
88     EQreactions.append
89     (
90         new thermo
91         (
92             thermo(CpData.lookup("O2"))
93          ==
94             2.0*thermo(CpData.lookup("O"))
95         )
96     );
98     EQreactions.append
99     (
100         new thermo
101         (
102             thermo(CpData.lookup("H2O"))
103          ==
104             thermo(CpData.lookup("H2"))
105           + 0.5*thermo(CpData.lookup("O2"))
106         )
107     );
109     EQreactions.append
110     (
111         new thermo
112         (
113             thermo(CpData.lookup("H2O"))
114          ==
115             thermo(CpData.lookup("H"))
116           + thermo(CpData.lookup("OH"))
117         )
118     );
121     forAllConstIter(SLPtrList<thermo>, EQreactions, iter)
122     {
123         Info<< "Kc(EQreactions) = " << iter().Kc(T) << endl;
124     }
126     Info<< nl << "end" << endl;
128     return 0;
132 // ************************************************************************* //