initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / applications / utilities / thermophysical / equilibriumCO / equilibriumCO.C
blobbade7abd05ee6bd4d3f98274942818c80ba21a90
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 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 the
13     Free Software Foundation; either version 2 of the License, or (at your
14     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, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Application
26     
27 Description
28     Calculates the equilibrium level of carbon monoxide
30 \*---------------------------------------------------------------------------*/
32 #include "argList.H"
33 #include "Time.H"
34 #include "dictionary.H"
35 #include "IFstream.H"
36 #include "OSspecific.H"
37 #include "IOmanip.H"
39 #include "specieThermo.H"
40 #include "janafThermo.H"
41 #include "perfectGas.H"
42 #include "SLPtrList.H"
44 using namespace Foam;
46 typedef specieThermo<janafThermo<perfectGas> > thermo;
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 // Main program:
51 int main(int argc, char *argv[])
54 #   include "setRootCase.H"
56 #   include "createTime.H"
58     Info<< nl << "Reading Burcat data IOdictionary" << endl;
60     IOdictionary CpData
61     (
62         IOobject
63         (
64             "BurcatCpData",
65             runTime.constant(),
66             runTime,
67             IOobject::MUST_READ,
68             IOobject::NO_WRITE,
69             false
70         )
71     );
75     scalar T = 3000.0;
77     SLPtrList<thermo> EQreactions;
79     EQreactions.append
80     (
81         new thermo
82         (
83             thermo(CpData.lookup("CO2"))
84          ==
85             thermo(CpData.lookup("CO"))
86           + 0.5*thermo(CpData.lookup("O2"))
87         )
88     );
90     EQreactions.append
91     (
92         new thermo
93         (
94             thermo(CpData.lookup("O2"))
95          ==
96             2.0*thermo(CpData.lookup("O"))
97         )
98     );
100     EQreactions.append
101     (
102         new thermo
103         (
104             thermo(CpData.lookup("H2O"))
105          ==
106             thermo(CpData.lookup("H2"))
107           + 0.5*thermo(CpData.lookup("O2"))
108         )
109     );
111     EQreactions.append
112     (
113         new thermo
114         (
115             thermo(CpData.lookup("H2O"))
116          ==
117             thermo(CpData.lookup("H"))
118           + thermo(CpData.lookup("OH"))
119         )
120     );
123     for
124     (
125         SLPtrList<thermo>::iterator EQreactionsIter = EQreactions.begin();
126         EQreactionsIter != EQreactions.end();
127         ++EQreactionsIter
128     )
129     {
130         Info<< "Kc(EQreactions) = " << EQreactionsIter().Kc(T) << endl;
131     }
134     Info<< nl << "end" << endl;
136     return 0;
140 // ************************************************************************* //