33 namespace laminarFlameSpeedModels
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
91 ) <<
"Data points for the " << name
92 <<
" do not increase monotonically" <<
endl 99 void Foam::laminarFlameSpeedModels::RaviPetersen::checkCoefficientArrayShape
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
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
184 inline Foam::scalar Foam::laminarFlameSpeedModels::RaviPetersen::dPolynomial
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 (psiuReactionThermo_.composition().contains(
"ft"))
315 const volScalarField& ft = psiuReactionThermo_.composition().Y(
"ft");
320 "stoichiometricAirFuelMassRatio",
322 psiuReactionThermo_.properties()
323 )*ft/
max(1 - ft, small);
327 EqR = equivalenceRatio_;
344 Su0[celli] = speed(EqR[celli], p[celli], Tu[celli]);
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
dimensionedScalar log(const dimensionedScalar &ds)
errorManipArg< error, int > exit(error &err, const int errNo=1)
RaviPetersen(const dictionary &, const psiuReactionThermo &)
Construct from dictionary and psiuReactionThermo.
A list of keyword definitions, which are a keyword followed by any number of values (e...
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
T & ref() const
Return non-const reference or generate a fatal error.
void size(const label)
Override size to be inconsistent with allocated storage.
static tmp< GeometricField< scalar, fvPatchField, volMesh > > New(const word &name, const Internal &, const PtrList< fvPatchField< scalar >> &)
Return a temporary field constructed from name,.
Ostream & endl(Ostream &os)
Add newline and flush stream.
tmp< volScalarField > operator()() const
Return the laminar flame speed [m/s].
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
const dimensionSet dimless
T & first()
Return the first element of the list.
Macros for easy insertion into run-time selection tables.
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
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.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
const dictionary & optionalSubDict(const word &) const
Find and return a sub-dictionary if found.
A class for handling words, derived from string.
addToRunTimeSelectionTable(laminarFlameSpeed, constant, dictionary)
Base-class for combustion fluid thermodynamic properties based on compressibility.
const dimensionSet dimVelocity
const Mesh & mesh() const
Return mesh.
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
Abstract class for laminar flame speed.
virtual ~RaviPetersen()
Destructor.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
const Time & time() const
Return time.
const tmp< volScalarField::Internal > & Su
A class for managing temporary objects.
T & last()
Return the last element of the list.
const objectRegistry & db() const
Return the local objectRegistry.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
defineTypeNameAndDebug(constant, 0)