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-2025 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 
28 #include "FieldListSlice.H"
29 
30 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
31 
33 (
34  const word& specieName
35 ) const
36 {
37  return species().found(specieName);
38 }
39 
40 
42 (
43  const word& specieName
44 )
45 {
46  return Y()[species()[specieName]];
47 }
48 
49 
51 (
52  const word& specieName
53 ) const
54 {
55  return Y()[species()[specieName]];
56 }
57 
58 
59 inline Foam::volScalarFieldListSlicer
61 {
62  return volScalarFieldListSlicer(mesh(), Y_);
63 }
64 
65 
66 inline Foam::scalarFieldListSlice
68 (
69  const volScalarFieldListSlicer& Yslicer,
70  const label celli
71 ) const
72 {
73  return Yslicer.slice(celli);
74 }
75 
76 
77 inline Foam::scalarFieldListSlice
79 (
80  const volScalarFieldListSlicer& Yslicer,
81  const label patchi,
82  const label facei
83 ) const
84 {
85  return Yslicer.patchSlice(patchi, facei);
86 }
87 
88 
91 (
92  const fvSource& model,
93  const volScalarField::Internal& source
94 ) const
95 {
97 
98  forAll(Y_, i)
99  {
100  result.set
101  (
102  i,
103  Y_[i]
104  .sources()[model.name()]
105  .sourceValue(model, source)
106  .ptr()
107  );
108  }
109 
110  return result;
111 }
112 
113 
114 inline Foam::scalarFieldListSlice
116 (
118  const label i
119 ) const
120 {
121  return Yslicer.slice(i);
122 }
123 
124 
127 (
128  const fvSource& model,
129  const scalarField& source,
130  const labelUList& cells
131 ) const
132 {
133  PtrList<scalarField> result(Y_.size());
134 
135  forAll(Y_, i)
136  {
137  result.set
138  (
139  i,
140  Y_[i]
141  .sources()[model.name()]
142  .sourceValue(model, source, cells)
143  .ptr()
144  );
145  }
146 
147  return result;
148 }
149 
150 
151 inline Foam::scalarFieldListSlice
153 (
154  const PtrList<scalarField>& Yslicer,
155  const label i
156 ) const
157 {
158  return scalarFieldListSlice(Yslicer, i);
159 }
160 
161 
162 // ************************************************************************* //
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:433
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
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:57
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 DimensionedFieldListAndSlicer< scalar, volMesh > &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
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
label patchi
const cellShapeList & cells
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