solidChemistryModelI.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2013-2016 OpenFOAM Foundation
9  Copyright (C) 2016-2023 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 \*---------------------------------------------------------------------------*/
28 
29 #include "volFields.H"
30 
31 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
32 
33 template<class CompType, class SolidThermo>
36 {
37  return RRs_;
38 }
39 
40 
41 template<class CompType, class SolidThermo>
44 {
45  return reactions_;
46 }
47 
48 
49 template<class CompType, class SolidThermo>
50 inline Foam::label
52 nReaction() const
53 {
54  return nReaction_;
55 }
56 
57 
58 template<class CompType, class SolidThermo>
61 (
62  const label i
63 ) const
64 {
65  return RRs_[i];
66 }
67 
68 
69 template<class CompType, class SolidThermo>
72 {
74  (
75  "RRs",
76  IOobject::NO_REGISTER,
77  this->mesh(),
79  );
80  auto& RRs = tRRs.ref();
81 
82  if (this->chemistry_)
83  {
84  for (label i=0; i < nSolids_; i++)
85  {
86  RRs += RRs_[i];
87  }
88  }
89  return tRRs;
90 }
91 
92 
93 template<class CompType, class SolidThermo>
96 {
98  (
99  "RRsHs",
100  IOobject::NO_REGISTER,
101  this->mesh(),
103  );
104  auto& RRs = tRRsHs.ref();
105 
106  if (this->chemistry_)
107  {
108  const volScalarField& T = this->solidThermo().T();
109  const volScalarField& p = this->solidThermo().p();
110 
111  for (label i=0; i < nSolids_; i++)
112  {
113  forAll(RRs, cellI)
114  {
115  RRs[cellI] +=
116  RRs_[i][cellI]*solidThermo_[i].Hs(p[cellI], T[cellI]);
117  }
118  }
119  }
120  return tRRsHs;
121 }
122 
123 
124 // ************************************************************************* //
PtrList< volScalarField::Internal > & RRs()
Write access to source terms for solids.
const PtrList< Reaction< SolidThermo > > & reactions() const
The reactions.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:421
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:72
const dimensionSet dimVolume(pow3(dimLength))
Definition: dimensionSets.H:58
dynamicFvMesh & mesh
const volScalarField & T
const dimensionSet dimEnergy
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
tmp< DimensionedField< scalar, volMesh > > RRsHs() const
Return net solid sensible enthalpy.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
Definition: List.H:55
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
label nReaction() const
The number of reactions.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Definition: dimensionSets.H:51
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:49
volScalarField & p
A class for managing temporary objects.
Definition: HashPtrTable.H:50
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:127