All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
psiuMulticomponentThermoI.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) 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 
27 #include "FieldListSlice.H"
28 
29 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
30 
32 (
33  const word& specieName
34 ) const
35 {
36  return species().found(specieName);
37 }
38 
39 
41 (
42  const word& specieName
43 )
44 {
45  return Y()[species()[specieName]];
46 }
47 
48 
50 (
51  const word& specieName
52 ) const
53 {
54  return Y()[species()[specieName]];
55 }
56 
57 
58 inline Foam::volScalarFieldListSlicer
60 {
61  return volScalarFieldListSlicer(mesh(), Y_);
62 }
63 
64 
65 inline Foam::scalarFieldListSlice
67 (
68  const volScalarFieldListSlicer& Yslicer,
69  const label celli
70 ) const
71 {
72  return Yslicer.slice(celli);
73 }
74 
75 
76 inline Foam::scalarFieldListSlice
78 (
79  const volScalarFieldListSlicer& Yslicer,
80  const label patchi,
81  const label facei
82 ) const
83 {
84  return Yslicer.patchSlice(patchi, facei);
85 }
86 
87 
90 (
91  const fvSource& source
92 ) const
93 {
94  PtrList<scalarField> result(Y_.size());
95 
96  forAll(Y_, i)
97  {
98  result.set
99  (
100  i,
101  Y_[i].sources()[source.name()].sourceValue(source).ptr()
102  );
103  }
104 
105  return result;
106 }
107 
108 
109 inline Foam::scalarFieldListSlice
111 (
112  const PtrList<scalarField>& Yslicer,
113  const label i
114 ) const
115 {
116  return scalarFieldListSlice(Yslicer, i);
117 }
118 
119 
120 // ************************************************************************* //
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:434
Generic GeometricField class.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: PtrList.H:75
bool set(const label) const
Is element set.
Definition: PtrListI.H:62
const word & name() const
Return const access to the source name.
Definition: fvModelI.H:47
Base class for finite volume sources.
Definition: fvSource.H:52
bool found(const word &) const
Does the list contain the specified name.
scalarFieldListSlice cellComposition(const volScalarFieldListSlicer &Yslicer, const label celli) const
Get the composition of an internal cell.
volScalarFieldListSlicer Yslicer() const
Get the slicer.
scalarFieldListSlice patchFaceComposition(const volScalarFieldListSlicer &Yslicer, const label patchi, const label facei) const
Get the composition of a boundary face.
scalarFieldListSlice sourceCellComposition(const PtrList< scalarField > &Yslicer, const label i) const
Get the composition of a source cell.
virtual const speciesTable & species() const =0
The table of species.
virtual PtrList< volScalarField > & Y()=0
Access the mass-fraction fields.
bool containsSpecie(const word &specieName) const
Does the mixture include this specie?
A class for handling words, derived from string.
Definition: word.H:62
label patchi
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
PtrList< volScalarField > & Y