37 namespace laminarFlameSpeedModels
53 Foam::laminarFlameSpeedModels::SCOPE::polynomial::polynomial
55 const dictionary& polyDict
58 FixedList<scalar, 7>(polyDict.lookup(
"coefficients")),
59 ll(polyDict.
get<scalar>(
"lowerLimit")),
60 ul(polyDict.
get<scalar>(
"upperLimit")),
61 llv(polyPhi(ll, *this)),
62 ulv(polyPhi(ul, *this)),
67 Foam::laminarFlameSpeedModels::SCOPE::SCOPE
69 const dictionary&
dict,
70 const psiuReactionThermo& ct
73 laminarFlameSpeed(
dict, ct),
83 ).optionalSubDict(typeName +
"Coeffs")
87 coeffsDict_.getCompat<scalar>
89 "lowerFlammabilityLimit",
90 {{
"lowerFlamabilityLimit", 1712}}
95 coeffsDict_.getCompat<scalar>
97 "upperFlammabilityLimit",
98 {{
"upperFlamabilityLimit", 1712}}
101 SuPolyL_(coeffsDict_.subDict(
"lowerSuPolynomial")),
102 SuPolyU_(coeffsDict_.subDict(
"upperSuPolynomial")),
103 Texp_(coeffsDict_.get<scalar>(
"Texp")),
104 pexp_(coeffsDict_.get<scalar>(
"pexp")),
105 MaPolyL_(coeffsDict_.subDict(
"lowerMaPolynomial")),
106 MaPolyU_(coeffsDict_.subDict(
"upperMaPolynomial"))
108 SuPolyL_.ll =
max(SuPolyL_.ll, LFL_) + SMALL;
109 SuPolyU_.ul =
min(SuPolyU_.ul, UFL_) - SMALL;
111 SuPolyL_.lu = 0.5*(SuPolyL_.ul + SuPolyU_.ll);
112 SuPolyU_.lu = SuPolyL_.lu - SMALL;
114 MaPolyL_.lu = 0.5*(MaPolyL_.ul + MaPolyU_.ll);
115 MaPolyU_.lu = MaPolyL_.lu - SMALL;
119 Info<<
"phi Su (T = Tref, p = pref)" <<
endl;
121 for (
int i=0; i<
n; i++)
123 scalar
phi = (2.0*i)/
n;
138 inline Foam::scalar Foam::laminarFlameSpeedModels::SCOPE::polyPhi
144 scalar
x =
phi - 1.0;
150 +
x*(a[1] +
x*(a[2] +
x*(a[3] +
x*(a[4] +
x*(a[5] +
x*a[6])))))
155 inline Foam::scalar Foam::laminarFlameSpeedModels::SCOPE::SuRef
160 if (phi < LFL_ || phi > UFL_)
165 else if (
phi < SuPolyL_.ll)
169 return SuPolyL_.llv*(
phi - LFL_)/(SuPolyL_.ll - LFL_);
171 else if (
phi > SuPolyU_.ul)
175 return SuPolyU_.ulv*(UFL_ -
phi)/(UFL_ - SuPolyU_.ul);
177 else if (
phi < SuPolyL_.lu)
180 return polyPhi(
phi, SuPolyL_);
182 else if (
phi > SuPolyU_.lu)
185 return polyPhi(
phi, SuPolyU_);
191 <<
" cannot be handled by SCOPE function with the " 205 if (
phi < MaPolyL_.ll)
210 else if (
phi > MaPolyU_.ul)
215 else if (
phi < SuPolyL_.lu)
218 return polyPhi(
phi, MaPolyL_);
220 else if (
phi > SuPolyU_.lu)
223 return polyPhi(
phi, MaPolyU_);
229 <<
" cannot be handled by SCOPE function with the " 238 inline Foam::scalar Foam::laminarFlameSpeedModels::SCOPE::Su0pTphi
245 static const scalar Tref = 300.0;
246 static const scalar pRef = 1.013e5;
248 return SuRef(
phi)*
pow((Tu/Tref), Texp_)*
pow((
p/pRef), pexp_);
266 auto& Su0 = tSu0.ref();
270 Su0[celli] = Su0pTphi(
p[celli], Tu[celli],
phi);
279 const scalarField& Tup = Tu.boundaryField()[patchi];
283 Su0p[facei] = Su0pTphi(
pp[facei], Tup[facei],
phi);
305 auto& Su0 = tSu0.ref();
309 Su0[celli] = Su0pTphi(
p[celli], Tu[celli],
phi[celli]);
318 const scalarField& Tup = Tu.boundaryField()[patchi];
349 auto& ma = tMa.ref();
353 ma[celli] = Ma(
phi[celli]);
365 map[facei] = Ma(phip[facei]);
376 if (psiuReactionThermo_.composition().contains(
"ft"))
378 const volScalarField& ft = psiuReactionThermo_.composition().Y(
"ft");
384 "stoichiometricAirFuelMassRatio",
dimless, psiuReactionThermo_
385 )*ft/(scalar(1) - ft)
390 const fvMesh&
mesh = psiuReactionThermo_.p().mesh();
406 if (psiuReactionThermo_.composition().contains(
"ft"))
408 const volScalarField& ft = psiuReactionThermo_.composition().Y(
"ft");
412 psiuReactionThermo_.p(),
413 psiuReactionThermo_.Tu(),
416 "stoichiometricAirFuelMassRatio",
dimless, psiuReactionThermo_
417 )*ft/(scalar(1) - ft)
424 psiuReactionThermo_.p(),
425 psiuReactionThermo_.Tu(),
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
errorManipArg< error, int > exit(error &err, const int errNo=1)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Ostream & endl(Ostream &os)
Add newline and flush stream.
tmp< volScalarField > operator()() const
Return the laminar flame speed [m/s].
GeometricBoundaryField< scalar, fvPatchField, volMesh > Boundary
Type of boundary fields.
const dimensionSet dimless
Dimensionless.
Macros for easy insertion into run-time selection tables.
#define forAll(list, i)
Loop across all elements in list.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
addToRunTimeSelectionTable(laminarFlameSpeed, constant, dictionary)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
static tmp< GeometricField< scalar, fvPatchField, volMesh > > New(const word &name, IOobjectOption::registerOption regOpt, const Mesh &mesh, const dimensionSet &dims, const word &patchFieldType=fvPatchField< scalar >::calculatedType())
Return tmp field (NO_READ, NO_WRITE) from name, mesh, dimensions and patch type. [Takes current timeN...
int debug
Static debugging option.
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
messageStream Info
Information stream (stdout output on master, null elsewhere)
A class for managing temporary objects.
tmp< volScalarField > Ma() const
Return the Markstein number.
Do not request registration (bool: false)
defineTypeNameAndDebug(constant, 0)
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
static constexpr const zero Zero
Global zero (0)
const dimensionSet dimVelocity