Loading...
Searching...
No Matches
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-------------------------------------------------------------------------------
11License
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\*---------------------------------------------------------------------------*/
29#include "volFields.H"
30
31// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
32
33template<class CompType, class SolidThermo>
37 return RRs_;
38}
39
40
41template<class CompType, class SolidThermo>
45 return reactions_;
46}
47
48
49template<class CompType, class SolidThermo>
50inline Foam::label
52nReaction() const
54 return nReaction_;
55}
56
57
58template<class CompType, class SolidThermo>
61(
62 const label i
63) const
65 return RRs_[i];
66}
67
68
69template<class CompType, class SolidThermo>
72{
74 (
75 "RRs",
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
93template<class CompType, class SolidThermo>
96{
97 auto tRRsHs = DimensionedField<scalar, volMesh>::New
98 (
99 "RRsHs",
100 IOobject::NO_REGISTER,
101 this->mesh(),
102 dimensionedScalar(dimEnergy/dimVolume/dimTime, Zero)
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// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
static tmp< DimensionedField< Type, GeoMesh > > New(const word &name, IOobjectOption::registerOption regOpt, const Mesh &mesh, const dimensionSet &dims, const Field< Type > &iField)
Return tmp field (NO_READ, NO_WRITE) from name, mesh, dimensions, copy of internal field....
@ NO_REGISTER
Do not request registration (bool: false).
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition PtrList.H:67
virtual const volScalarField & T() const
Temperature [K].
virtual volScalarField & p()
Pressure [Pa].
const PtrList< Reaction< SolidThermo > > & reactions() const
The reactions.
const PtrList< Reaction< SolidThermo > > & reactions_
Reactions.
label nSolids_
Number of solid components.
tmp< DimensionedField< scalar, volMesh > > RRsHs() const
Return net solid sensible enthalpy.
label nReaction() const
The number of reactions.
PtrList< volScalarField::Internal > RRs_
List of reaction rate per solid [kg/m3/s].
const PtrList< SolidThermo > & solidThermo_
Thermodynamic data of solids.
label nReaction_
Number of solid reactions.
PtrList< volScalarField::Internal > & RRs()
Write access to source terms for solids.
Fundamental solid thermodynamic properties.
Definition solidThermo.H:51
A class for managing temporary objects.
Definition tmp.H:75
volScalarField & p
const volScalarField & T
dynamicFvMesh & mesh
const dimensionSet dimEnergy
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
static constexpr const zero Zero
Global zero (0).
Definition zero.H:127
const dimensionSet dimVolume(pow3(dimLength))
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
#define forAll(list, i)
Loop across all elements in list.
Definition stdFoam.H:299