homogeneousMixture.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) 2011-2017 OpenFOAM Foundation
9  Copyright (C) 2020 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 Class
28  Foam::homogeneousMixture
29 
30 Group
31  grpReactionThermophysicalMixtures
32 
33 Description
34  The homogeneous mixture contains species ("b").
35 
36 SourceFiles
37  homogeneousMixture.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef homogeneousMixture_H
42 #define homogeneousMixture_H
43 
44 #include "basicCombustionMixture.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 /*---------------------------------------------------------------------------*\
52  Class homogeneousMixture Declaration
53 \*---------------------------------------------------------------------------*/
54 
55 template<class ThermoType>
57 :
59 {
60  // Private Data
61 
62  ThermoType reactants_;
63  ThermoType products_;
64 
65  mutable ThermoType mixture_;
66 
67  //- Regress variable
68  volScalarField& b_;
69 
70  //- No copy construct
72 
73 
74 public:
75 
76  //- The type of thermodynamics this mixture is instantiated for
77  typedef ThermoType thermoType;
78 
79 
80  // Constructors
81 
82  //- Construct from dictionary, mesh and phase name
84  (
85  const dictionary& thermoDict,
86  const fvMesh& mesh,
87  const word& phaseName
88  );
89 
90 
91  //- Destructor
92  virtual ~homogeneousMixture() = default;
93 
94 
95  // Member functions
96 
97  //- Return the instantiated type name
98  static word typeName()
99  {
100  return "homogeneousMixture<" + ThermoType::typeName() + '>';
101  }
102 
103  const ThermoType& mixture(const scalar) const;
104 
105  const ThermoType& cellMixture(const label celli) const
106  {
107  return mixture(b_[celli]);
108  }
109 
110  const ThermoType& cellVolMixture
111  (
112  const scalar p,
113  const scalar T,
114  const label celli
115  ) const
116  {
117  return mixture(b_[celli]);
118  }
119 
120  const ThermoType& patchFaceMixture
121  (
122  const label patchi,
123  const label facei
124  ) const
125  {
126  return mixture(b_.boundaryField()[patchi][facei]);
127  }
128 
129 
130  const ThermoType& patchFaceVolMixture
131  (
132  const scalar p,
133  const scalar T,
134  const label patchi,
135  const label facei
136  ) const
137  {
138  return mixture(b_.boundaryField()[patchi][facei]);
139  }
140 
141 
142  const ThermoType& cellReactants(const label) const
143  {
144  return reactants_;
145  }
146 
147  const ThermoType& patchFaceReactants(const label, const label) const
148  {
149  return reactants_;
150  }
151 
152  const ThermoType& cellProducts(const label) const
153  {
154  return products_;
155  }
156 
157  const ThermoType& patchFaceProducts(const label, const label) const
158  {
159  return products_;
160  }
161 
162  //- Read dictionary
163  void read(const dictionary&);
164 
165  //- Return thermo based on index
166  const ThermoType& getLocalThermo(const label speciei) const;
167 };
168 
169 
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 
172 } // End namespace Foam
173 
174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 
176 #ifdef NoRepository
177  #include "homogeneousMixture.C"
178 #endif
179 
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 
182 #endif
183 
184 // ************************************************************************* //
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::homogeneousMixture::read
void read(const dictionary &)
Read dictionary.
Definition: homogeneousMixture.C:83
homogeneousMixture.C
Foam::homogeneousMixture::patchFaceReactants
const ThermoType & patchFaceReactants(const label, const label) const
Definition: homogeneousMixture.H:146
Foam::homogeneousMixture
The homogeneous mixture contains species ("b").
Definition: homogeneousMixture.H:55
Foam::homogeneousMixture::patchFaceMixture
const ThermoType & patchFaceMixture(const label patchi, const label facei) const
Definition: homogeneousMixture.H:120
Foam::homogeneousMixture::cellVolMixture
const ThermoType & cellVolMixture(const scalar p, const scalar T, const label celli) const
Definition: homogeneousMixture.H:110
Foam::homogeneousMixture::cellReactants
const ThermoType & cellReactants(const label) const
Definition: homogeneousMixture.H:141
Foam::homogeneousMixture::cellMixture
const ThermoType & cellMixture(const label celli) const
Definition: homogeneousMixture.H:104
basicCombustionMixture.H
Foam::homogeneousMixture::thermoType
ThermoType thermoType
The type of thermodynamics this mixture is instantiated for.
Definition: homogeneousMixture.H:76
Foam::homogeneousMixture::patchFaceVolMixture
const ThermoType & patchFaceVolMixture(const scalar p, const scalar T, const label patchi, const label facei) const
Definition: homogeneousMixture.H:130
Foam::T
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Definition: FieldFieldFunctions.C:58
Foam::basicCombustionMixture
Specialization of the basicSpecieMixture for combustion.
Definition: basicCombustionMixture.H:53
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::homogeneousMixture::cellProducts
const ThermoType & cellProducts(const label) const
Definition: homogeneousMixture.H:151
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::homogeneousMixture::patchFaceProducts
const ThermoType & patchFaceProducts(const label, const label) const
Definition: homogeneousMixture.H:156
Foam::homogeneousMixture::mixture
const ThermoType & mixture(const scalar) const
Definition: homogeneousMixture.C:60
thermoDict
const dictionary & thermoDict
Definition: EEqn.H:16
Foam::homogeneousMixture::getLocalThermo
const ThermoType & getLocalThermo(const label speciei) const
Return thermo based on index.
Definition: homogeneousMixture.C:92
Foam::homogeneousMixture::typeName
static word typeName()
Return the instantiated type name.
Definition: homogeneousMixture.H:97
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::homogeneousMixture::~homogeneousMixture
virtual ~homogeneousMixture()=default
Destructor.
Foam::GeometricField::boundaryField
const Boundary & boundaryField() const
Return const-reference to the boundary field.
Definition: GeometricFieldI.H:62