thermoTypeFunctions.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2018-2020 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 \*---------------------------------------------------------------------------*/
25 
26 scalarList W(const fluidReactionThermo& thermo)
27 {
28  const basicSpecieMixture& composition = thermo.composition();
29 
30  scalarList W(composition.Y().size());
31 
32  forAll(W, i)
33  {
34  W[i] = composition.Wi(i);
35  }
36 
37  return W;
38 }
39 
40 
41 scalar h0
42 (
43  const fluidReactionThermo& thermo,
44  const scalarList& Y,
45  const scalar p,
46  const scalar T
47 )
48 {
49  const basicSpecieMixture& composition = thermo.composition();
50 
51  scalar h0 = 0;
52 
53  forAll(Y, i)
54  {
55  h0 += Y[i]*composition.Hs(i, p, T);
56  }
57 
58  return h0;
59 }
60 
61 
62 // ************************************************************************* //
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:434
basicSpecieMixture & composition
scalarList W(const fluidReactionThermo &thermo)
scalar h0(const fluidReactionThermo &thermo, const scalarList &Y, const scalar p, const scalar T)
List< scalar > scalarList
A List of scalars.
Definition: scalarList.H:50