RaviPetersen.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 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::laminarFlameSpeedModels::RaviPetersen
28 
29 Description
30  Laminar flame speed obtained from Ravi and Petersen's correlation.
31 
32  The correlation for the laminar flame speed \f$Su\f$ is of the following
33  form:
34  \f[
35  Su = \left( \sum \alpha_i \phi^i \right)
36  \left( \frac{T}{T_{ref}} \right)^{\left( \sum \beta_j \phi^j \right)}
37  \f]
38 
39  Where \f$\phi\f$ is the equivalence ratio, and \f$\alpha\f$ and \f$\beta\f$
40  are polynomial coefficients given for a number of pressure and equivalence
41  ratio points.
42 
43 SourceFiles
44  RaviPetersen.C
45 
46 \*---------------------------------------------------------------------------*/
47 
48 #ifndef RaviPetersen_H
49 #define RaviPetersen_H
50 
51 #include "laminarFlameSpeed.H"
52 
53 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 
55 namespace Foam
56 {
57 namespace laminarFlameSpeedModels
58 {
59 
60 /*---------------------------------------------------------------------------*\
61  Class RaviPetersen Declaration
62 \*---------------------------------------------------------------------------*/
63 
64 class RaviPetersen
65 :
66  public laminarFlameSpeed
67 {
68  // Private Data
69 
70  dictionary coeffsDict_;
71 
72  //- Correlation pressure values
73  List<scalar> pPoints_;
74 
75  //- Correlation equivalence ratios
76  List<scalar> EqRPoints_;
77 
78  //- Correlation alpha coefficients
79  List<List<List<scalar>>> alpha_;
80 
81  //- Correlation beta coefficients
82  List<List<List<scalar>>> beta_;
83 
84  //- Reference temperature
85  scalar TRef_;
86 
87 
88  // Private Member Functions
89 
90  //- Check that input points are ordered
91  void checkPointsMonotonicity
92  (
93  const word& name,
94  const List<scalar>& x
95  ) const;
96 
97  //- Check that the coefficient arrays are of the correct shape
98  void checkCoefficientArrayShape
99  (
100  const word& name,
101  const List<List<List<scalar>>>& x
102  ) const;
103 
104  //- Find and interpolate a value in the data point arrays
105  inline bool interval
106  (
107  const List<scalar>& xPoints,
108  const scalar x,
109  label& xIndex,
110  scalar& xXi,
111  scalar& xLim
112  ) const;
113 
114  //- Evaluate a polynomial
115  inline scalar polynomial
116  (
117  const List<scalar>& coeffs,
118  const scalar x
119  ) const;
120 
121  //- Evaluate a polynomial differential
122  inline scalar dPolynomial
123  (
124  const List<scalar>& coeffs,
125  const scalar x
126  ) const;
127 
128  //- Calculate normalised temperature to the power of the B polynomial
129  inline scalar THatPowB
130  (
131  const label EqRIndex,
132  const label pIndex,
133  const scalar EqR,
134  const scalar Tu
135  ) const;
136 
137  //- Return the flame speed within the correlation range
138  inline scalar correlationInRange
139  (
140  const label EqRIndex,
141  const label pIndex,
142  const scalar EqR,
143  const scalar Tu
144  ) const;
145 
146  //- Extrapolate the flame speed correlation outside its range
147  inline scalar correlationOutOfRange
148  (
149  const label EqRIndex,
150  const label pIndex,
151  const scalar EqR,
152  const scalar EqRLim,
153  const scalar Tu
154  ) const;
155 
156  //- Return the laminar flame speed [m/s]
157  inline scalar speed
158  (
159  const scalar EqR,
160  const scalar p,
161  const scalar Tu
162  ) const;
163 
164 
165  //- Construct as copy (not implemented)
166  RaviPetersen(const RaviPetersen&);
167  void operator=(const RaviPetersen&);
168 
169 
170 public:
171 
172  //- Runtime type information
173  TypeName("RaviPetersen");
174 
175  // Constructors
176 
177  //- Construct from dictionary and psiuReactionThermo
179  (
180  const dictionary&,
181  const psiuReactionThermo&
182  );
183 
184 
185  //- Destructor
186  virtual ~RaviPetersen();
187 
188 
189  // Member functions
190 
191  //- Return the laminar flame speed [m/s]
193 };
194 
195 
196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 
198 } // End laminarFlameSpeedModels
199 } // End namespace Foam
200 
201 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202 
203 #endif
204 
205 // ************************************************************************* //
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::psiuReactionThermo
Foam::psiuReactionThermo.
Definition: psiuReactionThermo.H:55
Foam::laminarFlameSpeedModels::RaviPetersen::~RaviPetersen
virtual ~RaviPetersen()
Destructor.
Definition: RaviPetersen.C:74
Foam::laminarFlameSpeedModels::RaviPetersen::TypeName
TypeName("RaviPetersen")
Runtime type information.
laminarFlameSpeed.H
Foam::laminarFlameSpeedModels::RaviPetersen::operator()
tmp< volScalarField > operator()() const
Return the laminar flame speed [m/s].
Definition: RaviPetersen.C:291
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::laminarFlameSpeed
Abstract class for laminar flame speed.
Definition: laminarFlameSpeed.H:60
Foam::List< scalar >
x
x
Definition: LISASMDCalcMethod2.H:52
Foam::laminarFlameSpeedModels::RaviPetersen
Laminar flame speed obtained from Ravi and Petersen's correlation.
Definition: RaviPetersen.H:63
Foam::name
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59