mirror of
https://github.com/OpenFOAM/OpenFOAM-6.git
synced 2025-12-08 06:57:46 +00:00
combustionModels: Default to the "none" model
When the constant/combustionProperties dictionary is missing, the solver will now default to the "none" model. This is consistent with how radiation models are selected.
This commit is contained in:
@ -25,8 +25,7 @@ License
|
||||
|
||||
#include "makeCombustionTypes.H"
|
||||
|
||||
#include "ChemistryCombustion.H"
|
||||
#include "ThermoCombustion.H"
|
||||
#include "CombustionModel.H"
|
||||
|
||||
#include "rhoReactionThermo.H"
|
||||
#include "psiReactionThermo.H"
|
||||
|
||||
@ -38,6 +38,36 @@ const Foam::word Foam::combustionModel::combustionPropertiesName
|
||||
);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
Foam::IOobject Foam::combustionModel::createIOobject
|
||||
(
|
||||
basicThermo& thermo,
|
||||
const word& combustionProperties
|
||||
) const
|
||||
{
|
||||
IOobject io
|
||||
(
|
||||
thermo.phasePropertyName(combustionProperties),
|
||||
thermo.db().time().constant(),
|
||||
thermo.db(),
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
);
|
||||
|
||||
if (io.typeHeaderOk<IOdictionary>(true))
|
||||
{
|
||||
io.readOpt() = IOobject::MUST_READ_IF_MODIFIED;
|
||||
return io;
|
||||
}
|
||||
else
|
||||
{
|
||||
io.readOpt() = IOobject::NO_READ;
|
||||
return io;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::combustionModel::combustionModel
|
||||
@ -48,17 +78,7 @@ Foam::combustionModel::combustionModel
|
||||
const word& combustionProperties
|
||||
)
|
||||
:
|
||||
IOdictionary
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
thermo.phasePropertyName(combustionProperties),
|
||||
thermo.db().time().constant(),
|
||||
thermo.db(),
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
),
|
||||
IOdictionary(createIOobject(thermo, combustionProperties)),
|
||||
mesh_(thermo.p().mesh()),
|
||||
turb_(turb),
|
||||
active_(lookupOrDefault<Switch>("active", true)),
|
||||
|
||||
@ -59,6 +59,13 @@ class combustionModel
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const combustionModel&);
|
||||
|
||||
//- Construct the base IO object
|
||||
IOobject createIOobject
|
||||
(
|
||||
basicThermo& thermo,
|
||||
const word& combustionProperties
|
||||
) const;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
@ -33,22 +33,31 @@ Foam::autoPtr<CombustionModel> Foam::combustionModel::New
|
||||
const word& combustionProperties
|
||||
)
|
||||
{
|
||||
word combModelName
|
||||
IOobject combIO
|
||||
(
|
||||
IOdictionary
|
||||
IOobject
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
thermo.phasePropertyName(combustionProperties),
|
||||
thermo.db().time().constant(),
|
||||
thermo.db(),
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
)
|
||||
).lookup("combustionModel")
|
||||
thermo.phasePropertyName(combustionProperties),
|
||||
thermo.db().time().constant(),
|
||||
thermo.db(),
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
)
|
||||
);
|
||||
|
||||
word combModelName("none");
|
||||
if (combIO.typeHeaderOk<IOdictionary>(false))
|
||||
{
|
||||
IOdictionary(combIO).lookup("combustionModel") >> combModelName;
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< "Combustion model not active: "
|
||||
<< thermo.phasePropertyName(combustionProperties)
|
||||
<< " not found" << endl;
|
||||
}
|
||||
|
||||
Info<< "Selecting combustion model " << combModelName << endl;
|
||||
|
||||
const wordList cmpts2(basicThermo::splitThermoName(combModelName, 2));
|
||||
|
||||
Reference in New Issue
Block a user