33 namespace laminarFlameSpeedModels
56 coeffsDict_(
dict.optionalSubDict(typeName +
"Coeffs").subDict(fuel_)),
57 pPoints_(coeffsDict_.lookup(
"pPoints")),
58 EqRPoints_(coeffsDict_.lookup(
"EqRPoints")),
59 alpha_(coeffsDict_.lookup(
"alpha")),
60 beta_(coeffsDict_.lookup(
"beta")),
61 TRef_(coeffsDict_.lookup<scalar>(
"TRef"))
63 checkPointsMonotonicity(
"equivalenceRatio", EqRPoints_);
64 checkPointsMonotonicity(
"pressure", pPoints_);
65 checkCoefficientArrayShape(
"alpha", alpha_);
66 checkCoefficientArrayShape(
"beta", beta_);
78 void Foam::laminarFlameSpeedModels::RaviPetersen::checkPointsMonotonicity
84 for (
label i = 1; i <
x.size(); i ++)
91 ) <<
"Data points for the " <<
name
92 <<
" do not increase monotonically" <<
endl
99 void Foam::laminarFlameSpeedModels::RaviPetersen::checkCoefficientArrayShape
102 const List<List<List<scalar>>>&
x
107 ok &=
x.size() == EqRPoints_.size() - 1;
111 ok &=
x[i].size() == pPoints_.size();
115 ok &=
x[i][j].size() ==
x[i][0].size();
124 ) <<
"Inconsistent size of " <<
name <<
" coefficients array" <<
endl
130 inline bool Foam::laminarFlameSpeedModels::RaviPetersen::interval
132 const List<scalar>& xPoints,
139 if (
x < xPoints.first())
143 xLim = xPoints.first();
147 else if (
x > xPoints.last())
149 xIndex = xPoints.size() - 2;
151 xLim = xPoints.last();
155 for (xIndex = 0;
x > xPoints[xIndex+1]; xIndex ++)
160 xXi = (
x - xPoints[xIndex])/(xPoints[xIndex+1] - xPoints[xIndex]);
167 inline Foam::scalar Foam::laminarFlameSpeedModels::RaviPetersen::polynomial
169 const List<scalar>& coeffs,
184 inline Foam::scalar Foam::laminarFlameSpeedModels::RaviPetersen::dPolynomial
186 const List<scalar>& coeffs,
192 for (
label i = 1; i < coeffs.size(); i++)
194 y += i*coeffs[i]*xPow;
201 inline Foam::scalar Foam::laminarFlameSpeedModels::RaviPetersen::THatPowB
203 const label EqRIndex,
212 polynomial(beta_[EqRIndex][pIndex],EqR)
218 Foam::laminarFlameSpeedModels::RaviPetersen::correlationInRange
220 const label EqRIndex,
228 polynomial(alpha_[EqRIndex][pIndex],EqR)
229 *THatPowB(EqRIndex, pIndex, EqR, Tu);
234 Foam::laminarFlameSpeedModels::RaviPetersen::correlationOutOfRange
236 const label EqRIndex,
243 scalar
A = polynomial(alpha_[EqRIndex][pIndex], EqRLim);
244 scalar dA = dPolynomial(alpha_[EqRIndex][pIndex], EqRLim);
245 scalar dB = dPolynomial(beta_[EqRIndex][pIndex], EqRLim);
246 scalar TB = THatPowB(EqRIndex, pIndex, EqRLim, Tu);
249 return max(TB*(
A + (dA +
A*
log(Tu/TRef_)*dB)*(EqR - EqRLim)), 0.0);
253 inline Foam::scalar Foam::laminarFlameSpeedModels::RaviPetersen::speed
262 label EqRIndex, pIndex;
267 EqRInRange = interval(EqRPoints_, EqR, EqRIndex, EqRXi, EqRLim);
269 interval(pPoints_,
p, pIndex, pXi, pLim);
271 for (
label pI = 0; pI < 2; pI ++)
275 s = correlationInRange(EqRIndex, pIndex + pI, EqR, Tu);
279 s = correlationOutOfRange(EqRIndex, pIndex + pI, EqR, EqRLim, Tu);
313 if (psiuMulticomponentThermo_.containsSpecie(
"ft"))
320 "stoichiometricAirFuelMassRatio",
322 psiuMulticomponentThermo_.properties()
323 )*ft/
max(1 - ft, small);
327 EqR = equivalenceRatio_;
344 Su0[celli] = speed(EqR[celli],
p[celli], Tu[celli]);
static const Foam::dimensionedScalar A("A", Foam::dimPressure, 611.21)
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
Generic GeometricField class.
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &name, const Internal &, const PtrList< PatchField< Type >> &, const HashPtrTable< Source > &=HashPtrTable< Source >())
Return a temporary field constructed from name,.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
A list of keyword definitions, which are a keyword followed by any number of values (e....
Laminar flame speed obtained from Ravi and Petersen's correlation.
virtual ~RaviPetersen()
Destructor.
tmp< volScalarField > operator()() const
Return the laminar flame speed [m/s].
RaviPetersen(const dictionary &, const psiuMulticomponentThermo &)
Construct from dictionary and psiuMulticomponentThermo.
Abstract class for laminar flame speed.
Base-class for combustion fluid thermodynamic properties based on compressibility.
A class for managing temporary objects.
T & ref() const
Return non-const reference or generate a fatal error.
A class for handling words, derived from string.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.name(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
tmp< VolField< Type > > Su(const VolField< Type > &su, const VolField< Type > &vf)
addToRunTimeSelectionTable(laminarFlameSpeed, constant, dictionary)
defineTypeNameAndDebug(constant, 0)
errorManipArg< error, int > exit(error &err, const int errNo=1)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const bool)
Return a word representation of a bool.
const dimensionSet dimless
dimensionedScalar log(const dimensionedScalar &ds)
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
const dimensionSet dimVelocity
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.