inhomogeneousMixture.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 | Copyright (C) 2011-2015 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 Class
25  Foam::inhomogeneousMixture
26 
27 Description
28  Foam::inhomogeneousMixture
29 
30 SourceFiles
31  inhomogeneousMixture.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef inhomogeneousMixture_H
36 #define inhomogeneousMixture_H
37 
38 #include "basicCombustionMixture.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 /*---------------------------------------------------------------------------*\
46  Class inhomogeneousMixture Declaration
47 \*---------------------------------------------------------------------------*/
48 
49 template<class ThermoType>
51 :
53 {
54  // Private data
55 
56  static const int nSpecies_ = 2;
57  static const char* specieNames_[2];
58 
60 
61  ThermoType fuel_;
62  ThermoType oxidant_;
63  ThermoType products_;
64 
65  mutable ThermoType mixture_;
66 
67  //- Mixture fraction
69 
70  //- Regress variable
72 
73  //- Construct as copy (not implemented)
75 
76 
77 public:
78 
79  //- The type of thermodynamics this mixture is instantiated for
80  typedef ThermoType thermoType;
81 
82 
83  // Constructors
84 
85  //- Construct from dictionary, mesh and phase name
86  inhomogeneousMixture(const dictionary&, const fvMesh&, const word&);
87 
88 
89  //- Destructor
90  virtual ~inhomogeneousMixture()
91  {}
92 
93 
94  // Member functions
95 
96  const dimensionedScalar& stoicRatio() const
97  {
98  return stoicRatio_;
99  }
100 
101  const ThermoType& mixture(const scalar, const scalar) const;
102 
103  const ThermoType& cellMixture(const label celli) const
104  {
105  return mixture(ft_[celli], b_[celli]);
106  }
107 
108  const ThermoType& patchFaceMixture
109  (
110  const label patchi,
111  const label facei
112  ) const
113  {
114  return mixture
115  (
116  ft_.boundaryField()[patchi][facei],
117  b_.boundaryField()[patchi][facei]
118  );
119  }
120 
121  const ThermoType& cellReactants(const label celli) const
122  {
123  return mixture(ft_[celli], 1);
124  }
125 
126  const ThermoType& patchFaceReactants
127  (
128  const label patchi,
129  const label facei
130  ) const
131  {
132  return mixture
133  (
134  ft_.boundaryField()[patchi][facei],
135  1
136  );
137  }
138 
139  const ThermoType& cellProducts(const label celli) const
140  {
141  return mixture(ft_[celli], 0);
142  }
143 
144  const ThermoType& patchFaceProducts
145  (
146  const label patchi,
147  const label facei
148  ) const
149  {
150  return mixture
151  (
152  ft_.boundaryField()[patchi][facei],
153  0
154  );
155  }
156 
157  //- Read dictionary
158  void read(const dictionary&);
159 
160  //- Return thermo based on index
161  const ThermoType& getLocalThermo(const label speciei) const;
162 };
163 
164 
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 
167 } // End namespace Foam
168 
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
170 
171 #ifdef NoRepository
172 # include "inhomogeneousMixture.C"
173 #endif
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 
177 #endif
178 
179 // ************************************************************************* //
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::inhomogeneousMixture::ft_
volScalarField & ft_
Mixture fraction.
Definition: inhomogeneousMixture.H:67
Foam::inhomogeneousMixture::patchFaceMixture
const ThermoType & patchFaceMixture(const label patchi, const label facei) const
Definition: inhomogeneousMixture.H:108
inhomogeneousMixture.C
Foam::GeometricField::boundaryField
GeometricBoundaryField & boundaryField()
Return reference to GeometricBoundaryField.
Definition: GeometricField.C:735
Foam::inhomogeneousMixture::oxidant_
ThermoType oxidant_
Definition: inhomogeneousMixture.H:61
Foam::inhomogeneousMixture::cellProducts
const ThermoType & cellProducts(const label celli) const
Definition: inhomogeneousMixture.H:138
basicCombustionMixture.H
Foam::label
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
Foam::inhomogeneousMixture::nSpecies_
static const int nSpecies_
Definition: inhomogeneousMixture.H:55
Foam::inhomogeneousMixture::mixture_
ThermoType mixture_
Definition: inhomogeneousMixture.H:64
Foam::inhomogeneousMixture::b_
volScalarField & b_
Regress variable.
Definition: inhomogeneousMixture.H:70
Foam::basicCombustionMixture
Specialization of the basicSpecieMixture for combustion.
Definition: basicCombustionMixture.H:48
Foam::inhomogeneousMixture::stoicRatio
const dimensionedScalar & stoicRatio() const
Definition: inhomogeneousMixture.H:95
Foam::inhomogeneousMixture::~inhomogeneousMixture
virtual ~inhomogeneousMixture()
Destructor.
Definition: inhomogeneousMixture.H:89
Foam::inhomogeneousMixture::cellMixture
const ThermoType & cellMixture(const label celli) const
Definition: inhomogeneousMixture.H:102
Foam::inhomogeneousMixture::mixture
const ThermoType & mixture(const scalar, const scalar) const
Definition: inhomogeneousMixture.C:74
Foam::inhomogeneousMixture::products_
ThermoType products_
Definition: inhomogeneousMixture.H:62
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam::dimensioned
Generic dimensioned Type class.
Definition: dimensionedScalarFwd.H:41
Foam::inhomogeneousMixture::patchFaceReactants
const ThermoType & patchFaceReactants(const label patchi, const label facei) const
Definition: inhomogeneousMixture.H:126
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::inhomogeneousMixture::thermoType
ThermoType thermoType
The type of thermodynamics this mixture is instantiated for.
Definition: inhomogeneousMixture.H:79
Foam::inhomogeneousMixture::specieNames_
static const char * specieNames_[2]
Definition: inhomogeneousMixture.H:56
Foam::inhomogeneousMixture::fuel_
ThermoType fuel_
Definition: inhomogeneousMixture.H:60
patchi
label patchi
Definition: getPatchFieldScalar.H:1
Foam::inhomogeneousMixture::patchFaceProducts
const ThermoType & patchFaceProducts(const label patchi, const label facei) const
Definition: inhomogeneousMixture.H:144
Foam::inhomogeneousMixture::read
void read(const dictionary &)
Read dictionary.
Definition: inhomogeneousMixture.C:99
Foam::inhomogeneousMixture::inhomogeneousMixture
inhomogeneousMixture(const inhomogeneousMixture< ThermoType > &)
Construct as copy (not implemented)
Foam::GeometricField
Generic GeometricField class.
Definition: surfaceFieldsFwd.H:52
Foam::inhomogeneousMixture
Foam::inhomogeneousMixture.
Definition: inhomogeneousMixture.H:49
Foam::inhomogeneousMixture::getLocalThermo
const ThermoType & getLocalThermo(const label speciei) const
Return thermo based on index.
Definition: inhomogeneousMixture.C:111
Foam::inhomogeneousMixture::stoicRatio_
dimensionedScalar stoicRatio_
Definition: inhomogeneousMixture.H:58
Foam::inhomogeneousMixture::cellReactants
const ThermoType & cellReactants(const label celli) const
Definition: inhomogeneousMixture.H:120