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-2025 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 {
35  defineTypeNameAndDebug(Gulder, 0);
36 
38  (
39  laminarFlameSpeed,
40  Gulder,
41  dictionary
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  const 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  const scalar p,
94  const scalar Tu,
95  const scalar Phi,
96  const scalar Yegr
97 ) const
98 {
99  static const scalar Tref = 300.0;
100  static const scalar pRef = 1.013e5;
101 
102  return
103  SuRef(Phi)*pow((Tu/Tref), alpha_)*pow((p/pRef), beta_)
104  *max(1 - f_*Yegr, 0);
105 }
106 
107 
108 Foam::tmp<Foam::volScalarField> Foam::laminarFlameSpeedModels::Gulder::Su0pTphi
109 (
110  const volScalarField& p,
111  const volScalarField& Tu,
112  const volScalarField& phi
113 ) const
114 {
115  tmp<volScalarField> tSu0
116  (
118  (
119  "Su0",
120  p.mesh(),
122  )
123  );
124 
125  volScalarField& Su0 = tSu0.ref();
126 
127  forAll(Su0, celli)
128  {
129  Su0[celli] = Su0pTphi(p[celli], Tu[celli], phi[celli], 0);
130  }
131 
132  volScalarField::Boundary& Su0Bf = Su0.boundaryFieldRef();
133 
134  forAll(Su0Bf, patchi)
135  {
136  forAll(Su0Bf[patchi], facei)
137  {
138  Su0Bf[patchi][facei] =
139  Su0pTphi
140  (
141  p.boundaryField()[patchi][facei],
142  Tu.boundaryField()[patchi][facei],
143  phi.boundaryField()[patchi][facei],
144  0
145  );
146  }
147  }
148 
149  return tSu0;
150 }
151 
152 
153 Foam::tmp<Foam::volScalarField> Foam::laminarFlameSpeedModels::Gulder::Su0pTphi
154 (
155  const volScalarField& p,
156  const volScalarField& Tu,
157  const volScalarField& Phi,
158  const volScalarField& egr
159 ) const
160 {
161  tmp<volScalarField> tSu0
162  (
164  (
165  "Su0",
166  p.mesh(),
168  )
169  );
170 
171  volScalarField& Su0 = tSu0.ref();
172 
173  forAll(Su0, celli)
174  {
175  Su0[celli] = Su0pTphi(p[celli], Tu[celli], Phi[celli], egr[celli]);
176  }
177 
178  volScalarField::Boundary& Su0Bf = Su0.boundaryFieldRef();
179 
180  forAll(Su0Bf, patchi)
181  {
182  forAll(Su0Bf[patchi], facei)
183  {
184  Su0Bf[patchi][facei] =
185  Su0pTphi
186  (
187  p.boundaryField()[patchi][facei],
188  Tu.boundaryField()[patchi][facei],
189  Phi.boundaryField()[patchi][facei],
190  egr.boundaryField()[patchi][facei]
191  );
192  }
193  }
194 
195  return tSu0;
196 }
197 
198 
201 {
202  if (psiuMulticomponentThermo_.containsSpecie("egr"))
203  {
204  return Su0pTphi
205  (
206  psiuMulticomponentThermo_.p(),
207  psiuMulticomponentThermo_.Tu(),
208  psiuMulticomponentThermo_.Phi(),
209  psiuMulticomponentThermo_.Y("egr")
210  );
211  }
212  else
213  {
214  return Su0pTphi
215  (
216  psiuMulticomponentThermo_.p(),
217  psiuMulticomponentThermo_.Tu(),
218  psiuMulticomponentThermo_.Phi()
219  );
220  }
221 }
222 
223 
224 // ************************************************************************* //
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:449
Macros for easy insertion into run-time selection tables.
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
Gulder(const dictionary &dict, const dictionary &coeffDict, const uRhoMulticomponentThermo &)
Construct from dictionary and uRhoMulticomponentThermo.
tmp< volScalarField > operator()() const
Return the laminar flame speed [m/s].
Definition: Gulder.C:200
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)
const unitSet & lookup(const word &unitName)
Lookup and return the named unit from the table.
Definition: units.C:346
Namespace for OpenFOAM.
dimensionedScalar exp(const dimensionedScalar &ds)
tmp< DimensionedField< typename outerProduct< Type, Type >::type, GeoMesh, Field >> sqr(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
const dimensionSet & dimVelocity
Definition: dimensions.C:154
VolField< scalar > volScalarField
Definition: volFieldsFwd.H:62
tmp< DimensionedField< typename powProduct< Type, r >::type, GeoMesh, Field > > pow(const DimensionedField< Type, GeoMesh, PrimitiveField > &df, typename powProduct< Type, r >::type)
dimensioned< Type > max(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
dictionary dict
volScalarField & p