Test-thermoMixture.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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.
20 
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/>.
23 
24 Application
25  ThermoMixture
26 
27 Description
28 
29 \*---------------------------------------------------------------------------*/
30 
31 #include "dictionary.H"
32 #include "IFstream.H"
33 #include "specie.H"
34 #include "perfectGas.H"
35 #include "hConstThermo.H"
36 #include "sensibleEnthalpy.H"
37 #include "thermo.H"
38 #include "constTransport.H"
39 
40 using namespace Foam;
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 // Main program:
44 
45 int main(int argc, char *argv[])
46 {
47  typedef constTransport
48  <
50  <
53  >
54  > ThermoType;
55 
56  dictionary dict(IFstream("thermoDict")());
57 
58  ThermoType t1(dict.subDict("specie1"));
59  ThermoType t2(dict.subDict("specie2"));
60 
61  Info<< "Checking Cp of mixture of hConstThermo" << endl;
62 
63  Info<< "W 1, 2, (1 + 2) = " << t1.W() << " " << t2.W() << " "
64  << (t1 + t2).W() << endl;
65 
66  Info<< "Cp 1, 2, 1 + 2 = " << t1.cp(1, 1) << " " << t2.cp(1, 1) << " "
67  << (t1 + t2).cp(1, 1) << endl;
68 
69  ThermoType t3(t1);
70  t3 += t2;
71  Info<< "Cp (1 += 2) = " << t3.cp(1, 1) << endl;
72 
73  Info<< "\nEnd\n" << endl;
74 
75  return 0;
76 }
77 
78 
79 // ************************************************************************* //
Foam::IFstream
Input from file stream.
Definition: IFstream.H:81
thermo.H
sensibleEnthalpy.H
Foam::sensibleEnthalpy
Thermodynamics mapping class to expose the sensible enthalpy function as the standard enthalpy functi...
Definition: sensibleEnthalpy.H:45
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
specie.H
Foam::cp
bool cp(const fileName &src, const fileName &dst)
Copy, recursively if necessary, the source to the destination.
Definition: POSIX.C:755
main
int main(int argc, char *argv[])
Definition: Test-thermoMixture.C:42
hConstThermo.H
Foam::Info
messageStream Info
IFstream.H
dict
dictionary dict
Definition: searchingEngine.H:14
perfectGas.H
Foam::constTransport
Constant properties Transport package. Templated into a given thermodynamics package (needed for ther...
Definition: constTransport.H:47
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::species::thermo
Definition: thermo.H:52
dictionary.H
Foam::hConstThermo
Constant properties thermodynamics package templated into the EquationOfState.
Definition: hConstThermo.H:46
Foam::dictionary::subDict
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
Definition: dictionary.C:631
constTransport.H