binaryNodeI.H
Go to the documentation of this file.
1 
2 /*---------------------------------------------------------------------------*\
3  ========= |
4  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5  \\ / O peration | Website: https://openfoam.org
6  \\ / A nd | Copyright (C) 2016-2022 OpenFOAM Foundation
7  \\/ M anipulation |
8 -------------------------------------------------------------------------------
9 License
10  This file is part of OpenFOAM.
11 
12  OpenFOAM is free software: you can redistribute it and/or modify it
13  under the terms of the GNU General Public License as published by
14  the Free Software Foundation, either version 3 of the License, or
15  (at your option) any later version.
16 
17  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
18  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
19  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
20  for more details.
21 
22  You should have received a copy of the GNU General Public License
23  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
24 
25 \*---------------------------------------------------------------------------*/
26 
27 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
28 
29 inline Foam::scalar Foam::binaryNode::calcA
30 (
31  const chemPointISAT& elementLeft,
32  const chemPointISAT& elementRight
33 )
34 {
35  const scalarField& phil(elementLeft.phi());
36  const scalarField& phir(elementRight.phi());
37 
38  scalar a = 0;
39  forAll(v_, i)
40  {
41  a += v_[i]*(phil[i] + phir[i]);
42  }
43 
44  return a/2;
45 }
46 
47 
48 // ************************************************************************* //
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:434
scalarField v_
Definition: binaryNode.H:68
scalar calcA(const chemPointISAT &elementLeft, const chemPointISAT &elementRight)
Compute a the product v^T.phih, with phih = (phi0 + phiq)/2.
Definition: binaryNodeI.H:30
const scalar & a() const
Definition: binaryNode.H:170
Leaf of the binary tree. The chemPoint stores the composition 'phi', the mapping of this composition ...
const scalarField & phi() const