33 namespace laminarFlameSpeedModels
49 Foam::laminarFlameSpeedModels::RaviPetersen::RaviPetersen
57 pPoints_(coeffsDict_.lookup(
"pPoints")),
58 EqRPoints_(coeffsDict_.lookup(
"EqRPoints")),
59 alpha_(coeffsDict_.lookup(
"alpha")),
60 beta_(coeffsDict_.lookup(
"beta")),
63 checkPointsMonotonicity(
"equivalenceRatio", EqRPoints_);
64 checkPointsMonotonicity(
"pressure", pPoints_);
65 checkCoefficientArrayShape(
"alpha", alpha_);
66 checkCoefficientArrayShape(
"beta", beta_);
78 void Foam::laminarFlameSpeedModels::RaviPetersen::checkPointsMonotonicity
90 "laminarFlameSpeedModels::RaviPetersen::checkPointsMonotonicity" 96 ) <<
"Data points for the " << name
97 <<
" do not increase monotonically" <<
endl 104 void Foam::laminarFlameSpeedModels::RaviPetersen::checkCoefficientArrayShape
112 ok &= x.
size() == EqRPoints_.size() - 1;
116 ok &= x[i].
size() == pPoints_.size();
120 ok &= x[i][j].
size() == x[i][0].
size();
128 "laminarFlameSpeedModels::RaviPetersen::checkCoefficientArrayShape" 131 "const List<List<List<scalar> > >&" 134 ) <<
"Inconsistent size of " << name <<
" coefficients array" <<
endl 140 inline bool Foam::laminarFlameSpeedModels::RaviPetersen::interval
149 if (x < xPoints.
first())
153 xLim = xPoints.
first();
157 else if (x > xPoints.
last())
159 xIndex = xPoints.
size() - 2;
161 xLim = xPoints.
last();
165 for (xIndex = 0; x > xPoints[xIndex+1]; xIndex ++)
170 xXi = (x - xPoints[xIndex])/(xPoints[xIndex+1] - xPoints[xIndex]);
177 inline Foam::scalar Foam::laminarFlameSpeedModels::RaviPetersen::polynomial
194 inline Foam::scalar Foam::laminarFlameSpeedModels::RaviPetersen::dPolynomial
202 for (
label i = 1; i < coeffs.
size(); i++)
204 y += i*coeffs[i]*xPow;
211 inline Foam::scalar Foam::laminarFlameSpeedModels::RaviPetersen::THatPowB
213 const label EqRIndex,
222 polynomial(beta_[EqRIndex][pIndex],EqR)
228 Foam::laminarFlameSpeedModels::RaviPetersen::correlationInRange
230 const label EqRIndex,
238 polynomial(alpha_[EqRIndex][pIndex],EqR)
239 *THatPowB(EqRIndex, pIndex, EqR, Tu);
244 Foam::laminarFlameSpeedModels::RaviPetersen::correlationOutOfRange
246 const label EqRIndex,
253 scalar A = polynomial(alpha_[EqRIndex][pIndex], EqRLim);
254 scalar dA = dPolynomial(alpha_[EqRIndex][pIndex], EqRLim);
255 scalar dB = dPolynomial(beta_[EqRIndex][pIndex], EqRLim);
256 scalar TB = THatPowB(EqRIndex, pIndex, EqRLim, Tu);
259 return max(TB*(A + (dA + A*
log(Tu/TRef_)*dB)*(EqR - EqRLim)), 0.0);
263 inline Foam::scalar Foam::laminarFlameSpeedModels::RaviPetersen::speed
272 label EqRIndex, pIndex;
277 EqRInRange = interval(EqRPoints_, EqR, EqRIndex, EqRXi, EqRLim);
279 interval(pPoints_, p, pIndex, pXi, pLim);
281 for (
label pI = 0; pI < 2; pI ++)
285 s = correlationInRange(EqRIndex, pIndex + pI, EqR, Tu);
289 s = correlationOutOfRange(EqRIndex, pIndex + pI, EqR, EqRLim, Tu);
323 if (psiuReactionThermo_.composition().contains(
"ft"))
325 const volScalarField& ft = psiuReactionThermo_.composition().Y(
"ft");
330 psiuReactionThermo_.lookup(
"stoichiometricAirFuelMassRatio")
331 )*ft/
max(1 - ft, SMALL);
335 EqR = equivalenceRatio_;
360 Su0[cellI] = speed(EqR[cellI], p[cellI], Tu[cellI]);
Foam::psiuReactionThermo.
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
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 ))
T & last()
Return the last element of the list.
A class for handling words, derived from string.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
void size(const label)
Override size to be inconsistent with allocated storage.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Abstract class for laminar flame speed.
const Mesh & mesh() const
Return mesh.
A list of keyword definitions, which are a keyword followed by any number of values (e...
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
T & first()
Return the first element of the list.
tmp< GeometricField< Type, fvPatchField, volMesh > > Su(const GeometricField< Type, fvPatchField, volMesh > &su, const GeometricField< Type, fvPatchField, volMesh > &vf)
defineTypeNameAndDebug(constant, 0)
dimensionedScalar log(const dimensionedScalar &ds)
Ostream & endl(Ostream &os)
Add newline and flush stream.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if succesful.
Macros for easy insertion into run-time selection tables.
addToRunTimeSelectionTable(laminarFlameSpeed, constant, dictionary)
const Time & time() const
Return time.
virtual ~RaviPetersen()
Destructor.
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
const objectRegistry & db() const
Return the local objectRegistry.
const dimensionSet dimVelocity
#define FatalIOErrorIn(functionName, ios)
Report an error message using Foam::FatalIOError.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
A class for managing temporary objects.
tmp< volScalarField > operator()() const
Return the laminar flame speed [m/s].