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