RaviPetersen.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2013-2018 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::laminarFlameSpeedModels::RaviPetersen
26 
27 Description
28  Laminar flame speed obtained from Ravi and Petersen's correlation.
29 
30  The correlation for the laminar flame speed \f$Su\f$ is of the following
31  form:
32  \f[
33  Su = \left( \sum \alpha_i \phi^i \right)
34  \left( \frac{T}{T_{ref}} \right)^{\left( \sum \beta_j \phi^j \right)}
35  \f]
36 
37  Where \f$\phi\f$ is the equivalence ratio, and \f$\alpha\f$ and \f$\beta\f$
38  are polynomial coefficients given for a number of pressure and equivalence
39  ratio points.
40 
41 SourceFiles
42  RaviPetersen.C
43 
44 \*---------------------------------------------------------------------------*/
45 
46 #ifndef RaviPetersen_H
47 #define RaviPetersen_H
48 
49 #include "laminarFlameSpeed.H"
50 
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 
53 namespace Foam
54 {
55 namespace laminarFlameSpeedModels
56 {
57 
58 /*---------------------------------------------------------------------------*\
59  Class RaviPetersen Declaration
60 \*---------------------------------------------------------------------------*/
61 
62 class RaviPetersen
63 :
64  public laminarFlameSpeed
65 {
66  // Private Data
67 
68  dictionary coeffsDict_;
69 
70  //- Correlation pressure values
71  List<scalar> pPoints_;
72 
73  //- Correlation equivalence ratios
74  List<scalar> EqRPoints_;
75 
76  //- Correlation alpha coefficients
77  List<List<List<scalar>>> alpha_;
78 
79  //- Correlation beta coefficients
80  List<List<List<scalar>>> beta_;
81 
82  //- Reference temperature
83  scalar TRef_;
84 
85 
86  // Private Member Functions
87 
88  //- Check that input points are ordered
89  void checkPointsMonotonicity
90  (
91  const word& name,
92  const List<scalar>& x
93  ) const;
94 
95  //- Check that the coefficient arrays are of the correct shape
96  void checkCoefficientArrayShape
97  (
98  const word& name,
99  const List<List<List<scalar>>>& x
100  ) const;
101 
102  //- Find and interpolate a value in the data point arrays
103  inline bool interval
104  (
105  const List<scalar>& xPoints,
106  const scalar x,
107  label& xIndex,
108  scalar& xXi,
109  scalar& xLim
110  ) const;
111 
112  //- Evaluate a polynomial
113  inline scalar polynomial
114  (
115  const List<scalar>& coeffs,
116  const scalar x
117  ) const;
118 
119  //- Evaluate a polynomial differential
120  inline scalar dPolynomial
121  (
122  const List<scalar>& coeffs,
123  const scalar x
124  ) const;
125 
126  //- Calculate normalised temperature to the power of the B polynomial
127  inline scalar THatPowB
128  (
129  const label EqRIndex,
130  const label pIndex,
131  const scalar EqR,
132  const scalar Tu
133  ) const;
134 
135  //- Return the flame speed within the correlation range
136  inline scalar correlationInRange
137  (
138  const label EqRIndex,
139  const label pIndex,
140  const scalar EqR,
141  const scalar Tu
142  ) const;
143 
144  //- Extrapolate the flame speed correlation outside its range
145  inline scalar correlationOutOfRange
146  (
147  const label EqRIndex,
148  const label pIndex,
149  const scalar EqR,
150  const scalar EqRLim,
151  const scalar Tu
152  ) const;
153 
154  //- Return the laminar flame speed [m/s]
155  inline scalar speed
156  (
157  const scalar EqR,
158  const scalar p,
159  const scalar Tu
160  ) const;
161 
162 
163  //- Construct as copy (not implemented)
164  RaviPetersen(const RaviPetersen&);
165  void operator=(const RaviPetersen&);
166 
167 
168 public:
169 
170  //- Runtime type information
171  TypeName("RaviPetersen");
172 
173  // Constructors
174 
175  //- Construct from dictionary and psiuReactionThermo
177  (
178  const dictionary&,
179  const psiuReactionThermo&
180  );
181 
182 
183  //- Destructor
184  virtual ~RaviPetersen();
185 
186 
187  // Member functions
188 
189  //- Return the laminar flame speed [m/s]
191 };
192 
193 
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
195 
196 } // End laminarFlameSpeedModels
197 } // End namespace Foam
198 
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200 
201 #endif
202 
203 // ************************************************************************* //
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
Laminar flame speed obtained from Ravi and Petersen&#39;s correlation.
Definition: RaviPetersen.H:61
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
tmp< volScalarField > operator()() const
Return the laminar flame speed [m/s].
Definition: RaviPetersen.C:293
A class for handling words, derived from string.
Definition: word.H:59
TypeName("RaviPetersen")
Runtime type information.
Foam::psiuReactionThermo.
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
Abstract class for laminar flame speed.
volScalarField & p
A class for managing temporary objects.
Definition: PtrList.H:53
Namespace for OpenFOAM.