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-2023 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 namespace Foam
27 {
28 
30 {
32 
33  scalarList W(composition.Y().size());
34 
35  forAll(W, i)
36  {
37  W[i] = composition.Wi(i);
38  }
39 
40  return W;
41 }
42 
43 
44 scalar h0
45 (
47  const scalarList& Y,
48  const scalar p,
49  const scalar T
50 )
51 {
53 
54  scalar h0 = 0;
55 
56  forAll(Y, i)
57  {
58  h0 += Y[i]*composition.Hs(i, p, T);
59  }
60 
61  return h0;
62 }
63 
64 }
65 
66 
67 // ************************************************************************* //
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:434
Specialisation of basicMixture for a mixture consisting of a number for molecular species.
virtual scalar Hs(const label speciei, const scalar p, const scalar T) const =0
Sensible enthalpy [J/kg].
virtual scalar Wi(const label speciei) const =0
Molecular weight of the given specie [kg/kmol].
PtrList< volScalarField > & Y()
Return the mass-fraction fields.
Base-class for multi-component fluid thermodynamic properties.
virtual basicSpecieMixture & composition()=0
Return the composition of the multi-component mixture.
Namespace for OpenFOAM.
scalar h0(const fluidMulticomponentThermo &thermo, const scalarList &Y, const scalar p, const scalar T)
scalarList W(const fluidMulticomponentThermo &thermo)
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
basicSpecieMixture & composition
volScalarField & p
PtrList< volScalarField > & Y
fluidMulticomponentThermo & thermo
Definition: createFields.H:31