mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
- use the dictionary 'get' methods instead of readScalar for
additional checking
Unchecked: readScalar(dict.lookup("key"));
Checked: dict.get<scalar>("key");
- In templated classes that also inherit from a dictionary, an additional
'template' keyword will be required. Eg,
this->coeffsDict().template get<scalar>("key");
For this common use case, the predefined getXXX shortcuts may be
useful. Eg,
this->coeffsDict().getScalar("key");
This commit is contained in:
@ -76,12 +76,12 @@ FSD<ReactionThermo, ThermoType>::FSD
|
||||
),
|
||||
YFuelFuelStream_(dimensionedScalar("YFuelStream", dimless, 1.0)),
|
||||
YO2OxiStream_(dimensionedScalar("YOxiStream", dimless, 0.23)),
|
||||
Cv_(readScalar(this->coeffs().lookup("Cv"))),
|
||||
Cv_(this->coeffs().getScalar("Cv")),
|
||||
C_(5.0),
|
||||
ftMin_(0.0),
|
||||
ftMax_(1.0),
|
||||
ftDim_(300),
|
||||
ftVarMin_(readScalar(this->coeffs().lookup("ftVarMin")))
|
||||
ftVarMin_(this->coeffs().getScalar("ftVarMin"))
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -39,10 +39,10 @@ Foam::consumptionSpeed::consumptionSpeed
|
||||
(
|
||||
const dictionary& dict
|
||||
)
|
||||
: omega0_(readScalar(dict.lookup("omega0"))),
|
||||
eta_(readScalar(dict.lookup("eta"))),
|
||||
sigmaExt_(readScalar(dict.lookup("sigmaExt"))),
|
||||
omegaMin_(readScalar(dict.lookup("omegaMin")))
|
||||
: omega0_(dict.get<scalar>("omega0")),
|
||||
eta_(dict.get<scalar>("eta")),
|
||||
sigmaExt_(dict.get<scalar>("sigmaExt")),
|
||||
omegaMin_(dict.get<scalar>("omegaMin"))
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -57,11 +57,8 @@ Foam::reactionRateFlameAreaModels::relaxation::relaxation
|
||||
:
|
||||
reactionRateFlameArea(modelType, dict, mesh, combModel),
|
||||
correlation_(dict.optionalSubDict(typeName + "Coeffs").subDict(fuel_)),
|
||||
C_(readScalar(dict.optionalSubDict(typeName + "Coeffs").lookup("C"))),
|
||||
alpha_
|
||||
(
|
||||
readScalar(dict.optionalSubDict(typeName + "Coeffs").lookup("alpha"))
|
||||
)
|
||||
C_(dict.optionalSubDict(typeName + "Coeffs").get<scalar>("C")),
|
||||
alpha_(dict.optionalSubDict(typeName + "Coeffs").get<scalar>("alpha"))
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -37,7 +37,7 @@ Foam::combustionModels::PaSR<ReactionThermo>::PaSR
|
||||
)
|
||||
:
|
||||
laminar<ReactionThermo>(modelType, thermo, turb, combustionProperties),
|
||||
Cmix_(readScalar(this->coeffs().lookup("Cmix"))),
|
||||
Cmix_(this->coeffs().getScalar("Cmix")),
|
||||
kappa_
|
||||
(
|
||||
IOobject
|
||||
|
||||
@ -49,7 +49,7 @@ diffusion<ReactionThermo, ThermoType>::diffusion
|
||||
turb,
|
||||
combustionProperties
|
||||
),
|
||||
C_(readScalar(this->coeffs().lookup("C"))),
|
||||
C_(this->coeffs().getScalar("C")),
|
||||
oxidantName_(this->coeffs().template lookupOrDefault<word>("oxidant", "O2"))
|
||||
{}
|
||||
|
||||
|
||||
@ -48,7 +48,7 @@ eddyDissipationDiffusionModel
|
||||
turb,
|
||||
combustionProperties
|
||||
),
|
||||
Cd_(readScalar(this->coeffs().lookup("Cd")))
|
||||
Cd_(this->coeffs().getScalar("Cd"))
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -48,7 +48,7 @@ eddyDissipationModelBase<ReactionThermo, ThermoType>::eddyDissipationModelBase
|
||||
turb,
|
||||
combustionProperties
|
||||
),
|
||||
CEDC_(readScalar(this->coeffs().lookup("CEDC")))
|
||||
CEDC_(this->coeffs().getScalar("CEDC"))
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -48,7 +48,7 @@ infinitelyFastChemistry<ReactionThermo, ThermoType>::infinitelyFastChemistry
|
||||
turb,
|
||||
combustionProperties
|
||||
),
|
||||
C_(readScalar(this->coeffs().lookup("C")))
|
||||
C_(this->coeffs().getScalar("C"))
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@ singleStepCombustion<ReactionThermo, ThermoType>::singleStepCombustion
|
||||
this->mesh(),
|
||||
dimensionedScalar(dimMass/dimVolume/dimTime, Zero)
|
||||
),
|
||||
semiImplicit_(readBool(this->coeffs_.lookup("semiImplicit")))
|
||||
semiImplicit_(this->coeffs_.getBool("semiImplicit"))
|
||||
{
|
||||
if (isA<singleStepReactingMixture<ThermoType>>(this->thermo()))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user