psiuMulticomponentThermo.C
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) 2011-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 
31 
32 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
33 
34 namespace Foam
35 {
38 }
39 
40 
41 // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
42 
44 {
45  const volScalarField::Boundary& tbf =
46  this->Tu().boundaryField();
47 
48  wordList hbt = tbf.types();
49 
50  forAll(tbf, patchi)
51  {
52  if (isA<fixedValueFvPatchScalarField>(tbf[patchi]))
53  {
55  }
56  else if
57  (
58  isA<zeroGradientFvPatchScalarField>(tbf[patchi])
59  || isA<fixedGradientFvPatchScalarField>(tbf[patchi])
60  )
61  {
63  }
64  else if (isA<mixedFvPatchScalarField>(tbf[patchi]))
65  {
67  }
68  }
69 
70  return hbt;
71 }
72 
74 {
76 
77  forAll(hbf, patchi)
78  {
79  if
80  (
81  isA<gradientUnburntEnthalpyFvPatchScalarField>(hbf[patchi])
82  )
83  {
84  refCast<gradientUnburntEnthalpyFvPatchScalarField>(hbf[patchi])
85  .gradient() = hbf[patchi].fvPatchField::snGrad();
86  }
87  else if
88  (
89  isA<mixedUnburntEnthalpyFvPatchScalarField>(hbf[patchi])
90  )
91  {
92  refCast<mixedUnburntEnthalpyFvPatchScalarField>(hbf[patchi])
93  .refGrad() = hbf[patchi].fvPatchField::snGrad();
94  }
95  }
96 }
97 
98 
99 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
100 
102 (
103  const dictionary& dict,
104  const wordList& specieNames,
105  const fvMesh& mesh,
106  const word& phaseName
107 )
108 :
109  species_(specieNames),
110  Y_(species_.size())
111 {
112  forAll(species_, i)
113  {
114  Y_.set
115  (
116  i,
117  new volScalarField
118  (
119  IOobject
120  (
122  mesh.time().name(),
123  mesh,
126  ),
127  mesh
128  )
129  );
130  }
131 }
132 
133 
134 // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
135 
138 (
139  const fvMesh& mesh,
140  const word& phaseName
141 )
142 {
143  return basicThermo::New<psiuMulticomponentThermo>(mesh, phaseName);
144 }
145 
146 
147 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
148 
150 {}
151 
152 
154 {}
155 
156 
157 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
158 
160 {
161  return p()*psiu();
162 }
163 
164 
166 {
167  return p()*psib();
168 }
169 
170 
171 const Foam::speciesTable&
173 {
174  return species_;
175 }
176 
177 
180 {
181  return Y_;
182 }
183 
184 
187 {
188  return Y_;
189 }
190 
191 
192 // ************************************************************************* //
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:449
Generic GeometricBoundaryField class.
wordList types() const
Return a list of the patch field types.
Generic GeometricField class.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
Boundary & boundaryFieldRef()
Return a reference to the boundary field.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:99
static word groupName(Name name, const word &group)
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
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
virtual const fvMesh & mesh() const =0
Return const access to the mesh.
virtual const word & phaseName() const =0
Phase name.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
const word & name() const
Return const reference to name.
virtual const volScalarField & p() const =0
Pressure [Pa].
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:98
const Time & time() const
Return the top-level database.
Definition: fvMesh.H:433
A wordList with hashed indices for faster lookup by name.
virtual const speciesTable & species() const
The table of species.
implementation(const dictionary &, const wordList &, const fvMesh &, const word &)
Construct from dictionary, specie names, mesh and phase name.
virtual PtrList< volScalarField > & Y()
Access the mass-fraction fields.
PtrList< volScalarField > Y_
Species mass fractions.
Base-class for combustion fluid thermodynamic properties based on compressibility.
tmp< volScalarField > rhob() const
Burnt gas density [kg/m^3].
void heuBoundaryCorrection(volScalarField &heu)
...
wordList heuBoundaryTypes()
Return the unburnt enthalpy/internal energy field boundary types.
virtual ~psiuMulticomponentThermo()
Destructor.
virtual tmp< volScalarField > psib() const =0
Burnt gas compressibility [s^2/m^2].
virtual const volScalarField & Tu() const =0
Unburnt gas temperature [K].
virtual tmp< volScalarField > psiu() const =0
Unburnt gas compressibility [s^2/m^2].
tmp< volScalarField > rhou() const
Unburnt gas density [kg/m^3].
static autoPtr< psiuMulticomponentThermo > New(const fvMesh &, const word &phaseName=word::null)
Standard selection based on fvMesh.
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:63
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
label patchi
Namespace for OpenFOAM.
String typeName(const std::type_info &info)
Return the un-mangled name given the standard type info.
defineRunTimeSelectionTable(fvConstraint, dictionary)
defineTypeNameAndDebug(atmosphericBoundaryLayer, 0)
dictionary dict