Gulder.C
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) 2011-2024 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 \*---------------------------------------------------------------------------*/
25 
26 #include "Gulder.H"
28 
29 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
30 
31 namespace Foam
32 {
33 namespace laminarFlameSpeedModels
34 {
36 
38  (
40  Gulder,
42  );
43 }
44 }
45 
46 
47 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
48 
50 (
51  const dictionary& dict,
52  const dictionary& coeffDict,
53  const psiuMulticomponentThermo& ct
54 )
55 :
57 
58  W_(coeffDict.lookup<scalar>("W")),
59  eta_(coeffDict.lookup<scalar>("eta")),
60  xi_(coeffDict.lookup<scalar>("xi")),
61  f_(coeffDict.lookup<scalar>("f")),
62  alpha_(coeffDict.lookup<scalar>("alpha")),
63  beta_(coeffDict.lookup<scalar>("beta"))
64 {}
65 
66 
67 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
68 
70 {}
71 
72 
73 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
74 
75 inline Foam::scalar Foam::laminarFlameSpeedModels::Gulder::SuRef
76 (
77  scalar phi
78 ) const
79 {
80  if (phi > small)
81  {
82  return W_*pow(phi, eta_)*exp(-xi_*sqr(phi - 1.075));
83  }
84  else
85  {
86  return 0;
87  }
88 }
89 
90 
91 inline Foam::scalar Foam::laminarFlameSpeedModels::Gulder::Su0pTphi
92 (
93  scalar p,
94  scalar Tu,
95  scalar phi,
96  scalar Yres
97 ) const
98 {
99  static const scalar Tref = 300.0;
100  static const scalar pRef = 1.013e5;
101 
102  return SuRef(phi)*pow((Tu/Tref), alpha_)*pow((p/pRef), beta_)*(1 - f_*Yres);
103 }
104 
105 
106 Foam::tmp<Foam::volScalarField> Foam::laminarFlameSpeedModels::Gulder::Su0pTphi
107 (
108  const volScalarField& p,
109  const volScalarField& Tu,
110  scalar phi
111 ) const
112 {
113  tmp<volScalarField> tSu0
114  (
116  (
117  "Su0",
118  p.mesh(),
120  )
121  );
122 
123  volScalarField& Su0 = tSu0.ref();
124 
125  forAll(Su0, celli)
126  {
127  Su0[celli] = Su0pTphi(p[celli], Tu[celli], phi, 0);
128  }
129 
130  volScalarField::Boundary& Su0Bf = Su0.boundaryFieldRef();
131 
132  forAll(Su0Bf, patchi)
133  {
134  forAll(Su0Bf[patchi], facei)
135  {
136  Su0Bf[patchi][facei] =
137  Su0pTphi
138  (
139  p.boundaryField()[patchi][facei],
140  Tu.boundaryField()[patchi][facei],
141  phi,
142  0
143  );
144  }
145  }
146 
147  return tSu0;
148 }
149 
150 
151 Foam::tmp<Foam::volScalarField> Foam::laminarFlameSpeedModels::Gulder::Su0pTphi
152 (
153  const volScalarField& p,
154  const volScalarField& Tu,
155  const volScalarField& phi
156 ) const
157 {
158  tmp<volScalarField> tSu0
159  (
161  (
162  "Su0",
163  p.mesh(),
165  )
166  );
167 
168  volScalarField& Su0 = tSu0.ref();
169 
170  forAll(Su0, celli)
171  {
172  Su0[celli] = Su0pTphi(p[celli], Tu[celli], phi[celli], 0);
173  }
174 
175  volScalarField::Boundary& Su0Bf = Su0.boundaryFieldRef();
176 
177  forAll(Su0Bf, patchi)
178  {
179  forAll(Su0Bf[patchi], facei)
180  {
181  Su0Bf[patchi][facei] =
182  Su0pTphi
183  (
184  p.boundaryField()[patchi][facei],
185  Tu.boundaryField()[patchi][facei],
186  phi.boundaryField()[patchi][facei],
187  0
188  );
189  }
190  }
191 
192  return tSu0;
193 }
194 
195 
197 Foam::laminarFlameSpeedModels::Gulder::Su0pTphi
198 (
199  const volScalarField& p,
200  const volScalarField& Tu,
201  const volScalarField& phi,
202  const volScalarField& egr
203 ) const
204 {
205  tmp<volScalarField> tSu0
206  (
208  (
209  "Su0",
210  p.mesh(),
212  )
213  );
214 
215  volScalarField& Su0 = tSu0.ref();
216 
217  forAll(Su0, celli)
218  {
219  Su0[celli] = Su0pTphi(p[celli], Tu[celli], phi[celli], egr[celli]);
220  }
221 
222  volScalarField::Boundary& Su0Bf = Su0.boundaryFieldRef();
223 
224  forAll(Su0Bf, patchi)
225  {
226  forAll(Su0Bf[patchi], facei)
227  {
228  Su0Bf[patchi][facei] =
229  Su0pTphi
230  (
231  p.boundaryField()[patchi][facei],
232  Tu.boundaryField()[patchi][facei],
233  phi.boundaryField()[patchi][facei],
234  egr.boundaryField()[patchi][facei]
235  );
236  }
237  }
238 
239  return tSu0;
240 }
241 
242 
245 {
246  if
247  (
248  psiuMulticomponentThermo_.containsSpecie("ft")
249  && psiuMulticomponentThermo_.containsSpecie("egr")
250  )
251  {
252  const volScalarField& ft = psiuMulticomponentThermo_.Y("ft");
253  const volScalarField& egr = psiuMulticomponentThermo_.Y("egr");
254 
255  return Su0pTphi
256  (
257  psiuMulticomponentThermo_.p(),
258  psiuMulticomponentThermo_.Tu(),
260  (
261  "stoichiometricAirFuelMassRatio",
262  dimless,
263  psiuMulticomponentThermo_.properties()
264  )*ft/max(1 - ft - egr, small),
265  egr
266  );
267  }
268  else if (psiuMulticomponentThermo_.containsSpecie("ft"))
269  {
270  const volScalarField& ft = psiuMulticomponentThermo_.Y("ft");
271 
272  return Su0pTphi
273  (
274  psiuMulticomponentThermo_.p(),
275  psiuMulticomponentThermo_.Tu(),
277  (
278  "stoichiometricAirFuelMassRatio",
279  dimless,
280  psiuMulticomponentThermo_.properties()
281  )*ft/max(1 - ft, small)
282  );
283  }
284  else
285  {
286  return Su0pTphi
287  (
288  psiuMulticomponentThermo_.p(),
289  psiuMulticomponentThermo_.Tu(),
290  equivalenceRatio_
291  );
292  }
293 }
294 
295 
296 // ************************************************************************* //
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:433
Macros for easy insertion into run-time selection tables.
Generic GeometricField class.
GeometricBoundaryField< Type, GeoMesh, PrimitiveField > Boundary
Type of the boundary field.
static tmp< GeometricField< Type, GeoMesh, PrimitiveField > > New(const word &name, const Internal &, const PtrList< Patch > &, const HashPtrTable< Source > &=HashPtrTable< Source >())
Return a temporary field constructed from name,.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Laminar flame speed obtained from Gulder's correlation.
Definition: Gulder.H:66
Gulder(const dictionary &dict, const dictionary &coeffDict, const psiuMulticomponentThermo &)
Construct from dictionary and psiuMulticomponentThermo.
Definition: Gulder.C:50
tmp< volScalarField > operator()() const
Return the laminar flame speed [m/s].
Definition: Gulder.C:244
virtual ~Gulder()
Destructor.
Definition: Gulder.C:69
Abstract class for laminar flame speed.
Base-class for combustion fluid thermodynamic properties based on compressibility.
A class for managing temporary objects.
Definition: tmp.H:55
label patchi
addToRunTimeSelectionTable(laminarFlameSpeed, constant, dictionary)
Namespace for OpenFOAM.
dimensionedScalar exp(const dimensionedScalar &ds)
const dimensionSet dimless
void pow(LagrangianPatchField< typename powProduct< Type, r >::type > &f, const LagrangianPatchField< Type > &f1)
VolField< scalar > volScalarField
Definition: volFieldsFwd.H:62
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
void sqr(LagrangianPatchField< typename outerProduct< Type, Type >::type > &f, const LagrangianPatchField< Type > &f1)
const dimensionSet dimVelocity
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
dictionary dict
volScalarField & p