Commit f94be1be authored by Mark Olesen's avatar Mark Olesen Committed by Andrew Heather
Browse files

ENH: use FatalIOErrorInLookup instead of FatalErrorInLookup

parent 5d0f1788
......@@ -31,14 +31,14 @@ License
Foam::autoPtr<Foam::PDRDragModel> Foam::PDRDragModel::New
(
const dictionary& PDRProperties,
const dictionary& dict,
const compressible::RASModel& turbulence,
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi
)
{
const word modelType(PDRProperties.get<word>("PDRDragModel"));
const word modelType(dict.get<word>("PDRDragModel"));
Info<< "Selecting drag model " << modelType << endl;
......@@ -46,16 +46,17 @@ Foam::autoPtr<Foam::PDRDragModel> Foam::PDRDragModel::New
if (!cstrIter.found())
{
FatalErrorInLookup
FatalIOErrorInLookup
(
dict,
"PDRDragModel",
modelType,
*dictionaryConstructorTablePtr_
) << exit(FatalError);
) << exit(FatalIOError);
}
return autoPtr<PDRDragModel>
(cstrIter()(PDRProperties, turbulence, rho, U, phi));
(cstrIter()(dict, turbulence, rho, U, phi));
}
......
......@@ -31,13 +31,13 @@ License
Foam::autoPtr<Foam::XiEqModel> Foam::XiEqModel::New
(
const dictionary& propDict,
const dictionary& dict,
const psiuReactionThermo& thermo,
const compressible::RASModel& turbulence,
const volScalarField& Su
)
{
const word modelType(propDict.get<word>("XiEqModel"));
const word modelType(dict.get<word>("XiEqModel"));
Info<< "Selecting flame-wrinkling model " << modelType << endl;
......@@ -45,15 +45,16 @@ Foam::autoPtr<Foam::XiEqModel> Foam::XiEqModel::New
if (!cstrIter.found())
{
FatalErrorInLookup
FatalIOErrorInLookup
(
dict,
"XiEqModel",
modelType,
*dictionaryConstructorTablePtr_
) << exit(FatalError);
) << exit(FatalIOError);
}
return autoPtr<XiEqModel>(cstrIter()(propDict, thermo, turbulence, Su));
return autoPtr<XiEqModel>(cstrIter()(dict, thermo, turbulence, Su));
}
......
......@@ -31,13 +31,13 @@ License
Foam::autoPtr<Foam::XiGModel> Foam::XiGModel::New
(
const dictionary& propDict,
const dictionary& dict,
const psiuReactionThermo& thermo,
const compressible::RASModel& turbulence,
const volScalarField& Su
)
{
const word modelType(propDict.get<word>("XiGModel"));
const word modelType(dict.get<word>("XiGModel"));
Info<< "Selecting flame-wrinkling model " << modelType << endl;
......@@ -45,15 +45,16 @@ Foam::autoPtr<Foam::XiGModel> Foam::XiGModel::New
if (!cstrIter.found())
{
FatalErrorInLookup
FatalIOErrorInLookup
(
dict,
"XiGModel",
modelType,
*dictionaryConstructorTablePtr_
) << exit(FatalError);
) << exit(FatalIOError);
}
return autoPtr<XiGModel>(cstrIter()(propDict, thermo, turbulence, Su));
return autoPtr<XiGModel>(cstrIter()(dict, thermo, turbulence, Su));
}
......
......@@ -31,7 +31,7 @@ License
Foam::autoPtr<Foam::XiModel> Foam::XiModel::New
(
const dictionary& propDict,
const dictionary& dict,
const psiuReactionThermo& thermo,
const compressible::RASModel& turbulence,
const volScalarField& Su,
......@@ -40,7 +40,7 @@ Foam::autoPtr<Foam::XiModel> Foam::XiModel::New
const surfaceScalarField& phi
)
{
const word modelType(propDict.get<word>("XiModel"));
const word modelType(dict.get<word>("XiModel"));
Info<< "Selecting flame-wrinkling model " << modelType << endl;
......@@ -48,16 +48,17 @@ Foam::autoPtr<Foam::XiModel> Foam::XiModel::New
if (!cstrIter.found())
{
FatalErrorInLookup
FatalIOErrorInLookup
(
dict,
"XiModel",
modelType,
*dictionaryConstructorTablePtr_
) << exit(FatalError);
) << exit(FatalIOError);
}
return autoPtr<XiModel>
(cstrIter()(propDict, thermo, turbulence, Su, rho, b, phi));
(cstrIter()(dict, thermo, turbulence, Su, rho, b, phi));
}
......
......@@ -34,12 +34,12 @@ License
Foam::autoPtr<Foam::mixtureViscosityModel> Foam::mixtureViscosityModel::New
(
const word& name,
const dictionary& viscosityProperties,
const dictionary& dict,
const volVectorField& U,
const surfaceScalarField& phi
)
{
const word modelType(viscosityProperties.get<word>("transportModel"));
const word modelType(dict.get<word>("transportModel"));
Info<< "Selecting incompressible transport model " << modelType << endl;
......@@ -47,16 +47,17 @@ Foam::autoPtr<Foam::mixtureViscosityModel> Foam::mixtureViscosityModel::New
if (!cstrIter.found())
{
FatalErrorInLookup
FatalIOErrorInLookup
(
dict,
"mixtureViscosityModel",
modelType,
*dictionaryConstructorTablePtr_
) << exit(FatalError);
) << exit(FatalIOError);
}
return autoPtr<mixtureViscosityModel>
(cstrIter()(name, viscosityProperties, U, phi));
(cstrIter()(name, dict, U, phi));
}
......
......@@ -114,12 +114,13 @@ Foam::autoPtr<Foam::relativeVelocityModel> Foam::relativeVelocityModel::New
if (!cstrIter.found())
{
FatalErrorInLookup
FatalIOErrorInLookup
(
dict,
"relative velocity",
modelType,
*dictionaryConstructorTablePtr_
) << abort(FatalError);
) << abort(FatalIOError);
}
return
......
......@@ -55,12 +55,13 @@ Foam::interfaceCompositionModel::New
if (!cstrIter.found())
{
FatalErrorInLookup
FatalIOErrorInLookup
(
dict,
"interfaceCompositionModel",
modelType,
*dictionaryConstructorTablePtr_
) << exit(FatalError);
) << exit(FatalIOError);
}
return cstrIter()(dict, pair);
......
......@@ -43,12 +43,13 @@ Foam::autoPtr<Foam::porousModel> Foam::porousModel::New
if (!cstrIter.found())
{
FatalErrorInLookup
FatalIOErrorInLookup
(
dict,
"porousModel",
modelType,
*dictionaryConstructorTablePtr_
) << exit(FatalError);
) << exit(FatalIOError);
}
return cstrIter()(dict, mesh);
......
......@@ -43,12 +43,13 @@ Foam::autoPtr<Foam::surfaceTensionModel> Foam::surfaceTensionModel::New
if (!cstrIter.found())
{
FatalErrorInLookup
FatalIOErrorInLookup
(
dict,
"surfaceTensionModel",
modelType,
*dictionaryConstructorTablePtr_
) << exit(FatalError);
) << exit(FatalIOError);
}
return cstrIter()(dict, pair, true);
......
......@@ -34,7 +34,9 @@ Foam::autoPtr<Foam::phaseModel> Foam::phaseModel::New
const word& phaseName
)
{
const word modelType(fluid.subDict(phaseName).get<word>("type"));
const dictionary& dict = fluid.subDict(phaseName);
const word modelType(dict.get<word>("type"));
Info<< "Selecting phaseModel for "
<< phaseName << ": " << modelType << endl;
......@@ -43,12 +45,13 @@ Foam::autoPtr<Foam::phaseModel> Foam::phaseModel::New
if (!cstrIter.found())
{
FatalErrorInLookup
FatalIOErrorInLookup
(
dict,
"phaseModel",
modelType,
*phaseSystemConstructorTablePtr_
) << exit(FatalError);
) << exit(FatalIOError);
}
return cstrIter()(fluid, phaseName);
......
......@@ -32,34 +32,34 @@ Foam::autoPtr<Foam::multiphaseSystem> Foam::multiphaseSystem::New
const fvMesh& mesh
)
{
const word systemType
const IOdictionary dict
(
IOdictionary
IOobject
(
IOobject
(
phasePropertiesName,
mesh.time().constant(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE,
false
)
).get<word>("type")
phasePropertiesName,
mesh.time().constant(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE,
false // Do not register
)
);
const word systemType(dict.get<word>("type"));
Info<< "Selecting multiphaseSystem " << systemType << endl;
const auto cstrIter = dictionaryConstructorTablePtr_->cfind(systemType);
if (!cstrIter.found())
{
FatalErrorInLookup
FatalIOErrorInLookup
(
dict,
"multiphaseSystem",
systemType,
*dictionaryConstructorTablePtr_
) << exit(FatalError);
) << exit(FatalIOError);
}
return autoPtr<multiphaseSystem>(cstrIter()(mesh));
......
......@@ -35,34 +35,34 @@ Foam::temperaturePhaseChangeTwoPhaseMixture::New
const fvMesh& mesh
)
{
const word modelType
const IOdictionary dict
(
IOdictionary
IOobject
(
IOobject
(
"phaseChangeProperties",
mesh.time().constant(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE,
false // Do not register
)
).get<word>("phaseChangeTwoPhaseModel")
"phaseChangeProperties",
mesh.time().constant(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE,
false // Do not register
)
);
const word modelType(dict.get<word>("phaseChangeTwoPhaseModel"));
Info<< "Selecting phaseChange model " << modelType << endl;
auto cstrIter = componentsConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalErrorInLookup
FatalIOErrorInLookup
(
dict,
"temperaturePhaseChangeTwoPhaseMixture",
modelType,
*componentsConstructorTablePtr_
) << exit(FatalError);
) << exit(FatalIOError);
}
return
......
......@@ -37,34 +37,34 @@ Foam::phaseChangeTwoPhaseMixture::New
const surfaceScalarField& phi
)
{
const word modelType
const IOdictionary dict
(
IOdictionary
IOobject
(
IOobject
(
"transportProperties",
U.time().constant(),
U.db(),
IOobject::MUST_READ,
IOobject::NO_WRITE,
false // Do not register
)
).get<word>("phaseChangeTwoPhaseMixture")
"transportProperties",
U.time().constant(),
U.db(),
IOobject::MUST_READ,
IOobject::NO_WRITE,
false // Do not register
)
);
const word modelType(dict.get<word>("phaseChangeTwoPhaseMixture"));
Info<< "Selecting phaseChange model " << modelType << endl;
auto cstrIter = componentsConstructorTablePtr_->cfind(modelType);
if (!cstrIter.found())
{
FatalErrorInLookup
FatalIOErrorInLookup
(
dict,
"phaseChangeTwoPhaseMixture",
modelType,
*componentsConstructorTablePtr_
) << exit(FatalError);
) << exit(FatalIOError);
}
return autoPtr<phaseChangeTwoPhaseMixture>(cstrIter()(U, phi));
......
......@@ -47,12 +47,13 @@ Foam::autoPtr<Foam::dragModel> Foam::dragModel::New
if (!cstrIter.found())
{
FatalErrorInLookup
FatalIOErrorInLookup
(
interfaceDict,
"dragModel",
modelType,
*dictionaryConstructorTablePtr_
) << exit(FatalError);
) << exit(FatalIOError);
}
return cstrIter()(interfaceDict, phase1, phase2);
......
......@@ -51,12 +51,13 @@ Foam::autoPtr<Foam::heatTransferModel> Foam::heatTransferModel::New
if (!cstrIter.found())
{
FatalErrorInLookup
FatalIOErrorInLookup
(
interfaceDict,
"heatTransferModel",
modelType,
*dictionaryConstructorTablePtr_
) << exit(FatalError);
) << exit(FatalIOError);
}
return cstrIter()(interfaceDict, alpha1, phase1, phase2);
......
......@@ -46,12 +46,13 @@ Foam::autoPtr<Foam::diameterModel> Foam::diameterModel::New
if (!cstrIter.found())
{
FatalErrorInLookup
FatalIOErrorInLookup
(
dict,
"diameterModel",
modelType,
*dictionaryConstructorTablePtr_
) << exit(FatalError);
) << exit(FatalIOError);
}
return cstrIter()
......
......@@ -46,12 +46,13 @@ Foam::aspectRatioModel::New
if (!cstrIter.found())
{
FatalErrorInLookup
FatalIOErrorInLookup
(
dict,
"aspectRatioModel",
modelType,
*dictionaryConstructorTablePtr_
) << exit(FatalError);
) << exit(FatalIOError);
}
return cstrIter()(dict, pair);
......
......@@ -45,12 +45,13 @@ Foam::autoPtr<Foam::dragModel> Foam::dragModel::New
if (!cstrIter.found())
{
FatalErrorInLookup
FatalIOErrorInLookup
(
dict,
"dragModel",
modelType,
*dictionaryConstructorTablePtr_
) << exit(FatalError);
) << exit(FatalIOError);
}
return cstrIter()(dict, pair, true);
......
......@@ -45,12 +45,13 @@ Foam::autoPtr<Foam::heatTransferModel> Foam::heatTransferModel::New
if (!cstrIter.found())
{
FatalErrorInLookup
FatalIOErrorInLookup
(
dict,
"heatTransferModel",
modelType,
*dictionaryConstructorTablePtr_
) << exit(FatalError);
) << exit(FatalIOError);
}