From f94be1bebbe44fd77a767c093933e57f29f05a1e Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Tue, 16 Jul 2019 10:26:51 +0200 Subject: [PATCH] ENH: use FatalIOErrorInLookup instead of FatalErrorInLookup --- .../dragModels/PDRDragModel/PDRDragModelNew.C | 11 +- .../XiEqModels/XiEqModel/XiEqModelNew.C | 11 +- .../XiModels/XiGModels/XiGModel/XiGModelNew.C | 11 +- .../PDRFoam/XiModels/XiModel/XiModelNew.C | 11 +- .../mixtureViscosityModelNew.C | 11 +- .../relativeVelocityModel.C | 5 +- .../interfaceCompositionModelNew.C | 5 +- .../porousModels/porousModel/porousModelNew.C | 5 +- .../surfaceTensionModelNew.C | 5 +- .../phaseModel/phaseModel/phaseModelNew.C | 9 +- .../multiphaseSystem/multiphaseSystemNew.C | 28 ++--- ...newtemperaturePhaseChangeTwoPhaseMixture.C | 28 ++--- .../newPhaseChangeTwoPhaseMixture.C | 28 ++--- .../dragModels/dragModel/newDragModel.C | 5 +- .../heatTransferModel/newHeatTransferModel.C | 5 +- .../diameterModel/newDiameterModel.C | 5 +- .../aspectRatioModel/newAspectRatioModel.C | 5 +- .../dragModels/dragModel/newDragModel.C | 5 +- .../heatTransferModel/newHeatTransferModel.C | 5 +- .../liftModels/liftModel/newLiftModel.C | 5 +- .../swarmCorrection/newSwarmCorrection.C | 5 +- .../newTurbulentDispersionModel.C | 5 +- .../virtualMassModel/newVirtualMassModel.C | 5 +- .../newWallLubricationModel.C | 5 +- .../conductivityModel/newConductivityModel.C | 5 +- .../newFrictionalStressModel.C | 5 +- .../newGranularPressureModel.C | 5 +- .../radialModel/radialModel/newRadialModel.C | 5 +- .../viscosityModel/newViscosityModel.C | 5 +- .../blendingMethod/newBlendingMethod.C | 5 +- .../diameterModel/newDiameterModel.C | 5 +- .../cellSizeAndAlignmentControl.C | 5 +- .../cellSizeFunction/cellSizeFunction.C | 5 +- .../cellSizeCalculationType.C | 5 +- .../surfaceCellSizeFunction.C | 10 +- .../faceAreaWeightModel/faceAreaWeightModel.C | 15 +-- .../initialPointsMethod/initialPointsMethod.C | 11 +- .../relaxationModel/relaxationModel.C | 15 +-- .../searchableSurfaceFeatures.C | 8 +- .../faceSelection/faceSelection.C | 5 +- .../foamHelp/helpTypes/helpType/helpTypeNew.C | 6 +- .../tabulatedWallFunctionNew.C | 5 +- .../searchableSurfaceModifier.C | 5 +- src/ODE/ODESolvers/ODESolver/ODESolverNew.C | 3 +- .../functionObject/functionObject.C | 5 +- .../pointPatchField/pointPatchFieldNew.C | 2 +- .../tableReaders/tableReader.C | 5 +- .../turbulenceModels/LES/LESModel/LESModel.C | 30 ++--- .../LES/LESdeltas/LESdelta/LESdelta.C | 10 +- .../LES/LESfilters/LESfilter/LESfilter.C | 5 +- .../turbulenceModels/RAS/RASModel/RASModel.C | 30 ++--- .../TurbulenceModel/TurbulenceModel.C | 28 ++--- .../laminar/laminarModel/laminarModel.C | 18 +-- .../combustionModelTemplates.C | 117 ++++++++++-------- .../displacement/displacementMotionSolver.C | 7 +- .../solidBodyMotionFunctionNew.C | 11 +- .../motionSolvers/motionSolver/motionSolver.C | 5 +- .../engineMesh/engineMesh/engineMeshNew.C | 33 +++-- .../engineTime/engineTime/engineTimeNew.C | 9 +- .../SRF/SRFModel/SRFModel/SRFModelNew.C | 28 ++--- .../cfdTools/general/fvOptions/fvOption.C | 9 +- .../cfdTools/general/fvOptions/fvOption.H | 2 +- .../porosityModel/porosityModelNew.C | 5 +- .../fvsPatchField/fvsPatchFieldNew.C | 4 - .../patchDistMethod/patchDistMethod.C | 10 +- .../fieldValues/fieldValue/fieldValueNew.C | 5 +- .../heatTransferCoeffModelNew.C | 5 +- .../graphics/runTimePostProcessing/pathline.C | 5 +- .../runTimePostProcessing/pointData.C | 5 +- .../graphics/runTimePostProcessing/surface.C | 5 +- .../runTimeCondition/runTimeConditionNew.C | 5 +- .../motionDiffusivity/motionDiffusivity.C | 11 +- .../motionInterpolation/motionInterpolation.C | 11 +- .../profileModel/profileModel.C | 5 +- .../trimModel/trimModel/trimModelNew.C | 5 +- .../BinaryCollisionModelNew.C | 5 +- .../InflowBoundaryModelNew.C | 5 +- .../WallInteractionModelNew.C | 5 +- .../distributionModel/distributionModelNew.C | 5 +- .../integrationScheme/integrationSchemeNew.C | 5 +- .../CloudFunctionObjectNew.C | 5 +- .../HeterogeneousReactingModelNew.C | 5 +- .../CollisionModel/CollisionModelNew.C | 5 +- .../PairModel/PairModel/PairModelNew.C | 5 +- .../WallModel/WallModel/WallModelNew.C | 5 +- .../DispersionModel/DispersionModelNew.C | 5 +- .../InjectionModel/InjectionModelNew.C | 10 +- .../ParticleForce/ParticleForceNew.C | 5 +- .../PatchInteractionModelNew.C | 5 +- .../StochasticCollisionModelNew.C | 5 +- .../SurfaceFilmModel/SurfaceFilmModelNew.C | 5 +- .../AveragingMethod/AveragingMethod.C | 5 +- .../CorrectionLimitingMethod.C | 5 +- .../DampingModels/DampingModel/DampingModel.C | 5 +- .../IsotropyModel/IsotropyModel.C | 5 +- .../PackingModels/PackingModel/PackingModel.C | 5 +- .../ParticleStressModel/ParticleStressModel.C | 5 +- .../TimeScaleModel/TimeScaleModel.C | 5 +- .../CompositionModel/CompositionModelNew.C | 5 +- .../PhaseChangeModel/PhaseChangeModelNew.C | 5 +- .../DevolatilisationModelNew.C | 5 +- .../SurfaceReactionModelNew.C | 5 +- .../HeatTransferModel/HeatTransferModelNew.C | 5 +- .../basic/energyScalingFunctionNew.C | 11 +- .../pairPotential/basic/pairPotentialNew.C | 11 +- .../basic/tetherPotentialNew.C | 11 +- .../AtomizationModel/AtomizationModelNew.C | 5 +- .../BreakupModel/BreakupModelNew.C | 5 +- .../blockEdges/blockEdge/blockEdge.C | 5 +- .../blockFaces/blockFace/blockFace.C | 5 +- .../blockVertices/blockVertex/blockVertex.C | 5 +- .../extrudeModel/extrudeModelNew.C | 5 +- .../externalDisplacementMeshMover.C | 5 +- src/meshTools/edgeMesh/edgeMeshIO.C | 6 +- .../searchableSurface/searchableSurface.C | 5 +- .../topoSetCellSource/topoSetCellSource.C | 5 +- .../topoSetFaceSource/topoSetFaceSource.C | 5 +- .../topoSetPointSource/topoSetPointSource.C | 5 +- .../sets/topoSetSource/topoSetSource.C | 5 +- .../fvOptions/fvOptionAdjoint.C | 5 +- .../objectiveManager/objectiveManager.C | 5 +- .../objectiveIncompressible.C | 5 +- .../adjoint/objectives/objective/objective.C | 5 +- .../lineSearch/lineSearch/lineSearch.C | 5 +- .../stepUpdate/stepUpdate/stepUpdate.C | 5 +- .../optimisationManager/optimisationManager.C | 27 ++-- .../optimisationTypeIncompressible.C | 5 +- .../updateMethod/updateMethod/updateMethod.C | 5 +- .../incompressibleAdjointSolver.C | 5 +- .../incompressiblePrimalSolver.C | 5 +- .../adjointRASModel/adjointRASModel.C | 28 ++--- .../RAS/RASModelVariables/RASModelVariables.C | 30 ++--- .../cellCellStencil/cellCellStencil.C | 5 +- .../decompositionMethod/decompositionMethod.C | 5 +- .../CHFModels/CHFModel/newCHFModel.C | 5 +- .../CHFSubCoolModel/newCHFSubCoolModel.C | 5 +- .../LeidenfrostModel/newLeidenfrostModel.C | 5 +- .../MHFModels/MHFModel/newMHFModel.C | 5 +- .../TDNBModels/TDNBModel/newTDNBModel.C | 5 +- .../newDepartureDiameterModel.C | 5 +- .../newDepartureFrequencyModel.C | 5 +- .../filmBoilingModel/newfilmBoilingModel.C | 5 +- .../newNucleationSiteModel.C | 5 +- .../partitioningModel/newPartitioningModel.C | 5 +- .../newInterfaceCompositionModel.C | 5 +- .../massTransferModel/newMassTransferModel.C | 5 +- .../saturationModel/newSaturationModel.C | 5 +- .../newSurfaceTensionModel.C | 5 +- .../aspectRatioModel/newAspectRatioModel.C | 5 +- .../dragModels/dragModel/newDragModel.C | 5 +- .../heatTransferModel/newHeatTransferModel.C | 5 +- .../liftModels/liftModel/newLiftModel.C | 5 +- .../newPhaseTransferModel.C | 5 +- .../swarmCorrection/newSwarmCorrection.C | 5 +- .../newTurbulentDispersionModel.C | 5 +- .../virtualMassModel/newVirtualMassModel.C | 5 +- .../wallDampingModel/newWallDampingModel.C | 5 +- .../newWallLubricationModel.C | 5 +- .../blendingMethod/newBlendingMethod.C | 5 +- .../diameterModel/newDiameterModel.C | 5 +- .../phaseModel/phaseModel/newPhaseModel.C | 9 +- .../binaryBreakupModel/binaryBreakupModel.C | 5 +- .../breakupModels/breakupModel/breakupModel.C | 5 +- .../coalescenceModel/coalescenceModel.C | 5 +- .../daughterSizeDistributionModel.C | 5 +- .../driftModels/driftModel/driftModel.C | 5 +- .../nucleationModel/nucleationModel.C | 5 +- .../multiphaseSystem/newMultiphaseSystem.C | 28 ++--- .../conductivityModel/newConductivityModel.C | 5 +- .../newFrictionalStressModel.C | 5 +- .../newGranularPressureModel.C | 5 +- .../radialModel/radialModel/newRadialModel.C | 5 +- .../viscosityModel/newViscosityModel.C | 5 +- .../IATE/IATEsources/IATEsource/IATEsource.C | 5 +- .../twoPhaseSystem/newTwoPhaseSystem.C | 28 ++--- .../noiseModels/noiseModel/noiseModelNew.C | 5 +- .../windowModels/windowModel/windowModelNew.C | 5 +- .../pyrolysisModel/pyrolysisModelNew.C | 33 ++--- .../regionModelFunctionObjectNew.C | 5 +- .../filmThermoModel/filmThermoModelNew.C | 5 +- .../filmTurbulenceModelNew.C | 5 +- .../kinematic/force/force/forceNew.C | 5 +- .../injectionModel/injectionModelNew.C | 5 +- .../transferModel/transferModelNew.C | 5 +- .../filmRadiationModelNew.C | 5 +- .../filmViscosityModelNew.C | 5 +- .../heatTransferModel/heatTransferModelNew.C | 5 +- .../phaseChangeModel/phaseChangeModelNew.C | 5 +- .../surfaceFilmModel/surfaceFilmModelNew.C | 35 +++--- .../thermalBaffleModelNew.C | 44 ++++--- .../renumberMethod/renumberMethod.C | 11 +- .../bodies/rigidBody/rigidBody.C | 5 +- src/rigidBodyDynamics/joints/joint/joint.C | 5 +- .../restraint/rigidBodyRestraintNew.C | 5 +- .../rigidBodySolver/newRigidBodySolver.C | 5 +- .../sampledSet/sampledSet/sampledSet.C | 5 +- .../sampledSurface/sampledSurface.C | 5 +- .../sixDoFRigidBodyMotionConstraintNew.C | 17 +-- .../sixDoFRigidBodyMotionRestraintNew.C | 17 +-- .../sixDoFSolver/newSixDoFSolver.C | 5 +- .../barotropicCompressibilityModelNew.C | 11 +- .../basic/basicThermo/basicThermoTemplates.C | 66 ++++------ .../chemistryReductionMethodNew.C | 78 +++++++----- .../chemistryTabulationMethodNew.C | 77 +++++++----- .../basicChemistryModelTemplates.C | 93 ++++++++------ .../radiationModel/radiationModelNew.C | 25 ++-- .../absorptionEmissionModelNew.C | 5 +- .../boundaryRadiationPropertiesPatch.C | 5 +- .../scatterModel/scatterModelNew.C | 5 +- .../sootModel/sootModel/sootModelNew.C | 5 +- .../wallAbsorptionEmissionModelNew.C | 5 +- .../wallTransmissivityModelNew.C | 5 +- .../chemistryReader/chemistryReader.C | 5 +- .../basicSolidChemistryModelNew.C | 83 ++++++------- .../reaction/Reactions/Reaction/Reaction.C | 5 +- .../liquidProperties/liquidProperties.C | 10 +- .../solidProperties/solidPropertiesNew.C | 5 +- .../thermophysicalFunction.C | 5 +- .../thermophysicalProperties.C | 5 +- .../viscosityModel/viscosityModelNew.C | 12 +- .../surfaceTensionModelNew.C | 5 +- 221 files changed, 1214 insertions(+), 988 deletions(-) diff --git a/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModelNew.C b/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModelNew.C index 78bc6b04d0..c8850fb62c 100644 --- a/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModelNew.C +++ b/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModelNew.C @@ -31,14 +31,14 @@ License Foam::autoPtr 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("PDRDragModel")); + const word modelType(dict.get("PDRDragModel")); Info<< "Selecting drag model " << modelType << endl; @@ -46,16 +46,17 @@ Foam::autoPtr Foam::PDRDragModel::New if (!cstrIter.found()) { - FatalErrorInLookup + FatalIOErrorInLookup ( + dict, "PDRDragModel", modelType, *dictionaryConstructorTablePtr_ - ) << exit(FatalError); + ) << exit(FatalIOError); } return autoPtr - (cstrIter()(PDRProperties, turbulence, rho, U, phi)); + (cstrIter()(dict, turbulence, rho, U, phi)); } diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModelNew.C b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModelNew.C index d953556ce0..e758d9d4a4 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModelNew.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModelNew.C @@ -31,13 +31,13 @@ License Foam::autoPtr Foam::XiEqModel::New ( - const dictionary& propDict, + const dictionary& dict, const psiuReactionThermo& thermo, const compressible::RASModel& turbulence, const volScalarField& Su ) { - const word modelType(propDict.get("XiEqModel")); + const word modelType(dict.get("XiEqModel")); Info<< "Selecting flame-wrinkling model " << modelType << endl; @@ -45,15 +45,16 @@ Foam::autoPtr Foam::XiEqModel::New if (!cstrIter.found()) { - FatalErrorInLookup + FatalIOErrorInLookup ( + dict, "XiEqModel", modelType, *dictionaryConstructorTablePtr_ - ) << exit(FatalError); + ) << exit(FatalIOError); } - return autoPtr(cstrIter()(propDict, thermo, turbulence, Su)); + return autoPtr(cstrIter()(dict, thermo, turbulence, Su)); } diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModelNew.C b/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModelNew.C index 030c0c525d..cc246485e4 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModelNew.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModelNew.C @@ -31,13 +31,13 @@ License Foam::autoPtr Foam::XiGModel::New ( - const dictionary& propDict, + const dictionary& dict, const psiuReactionThermo& thermo, const compressible::RASModel& turbulence, const volScalarField& Su ) { - const word modelType(propDict.get("XiGModel")); + const word modelType(dict.get("XiGModel")); Info<< "Selecting flame-wrinkling model " << modelType << endl; @@ -45,15 +45,16 @@ Foam::autoPtr Foam::XiGModel::New if (!cstrIter.found()) { - FatalErrorInLookup + FatalIOErrorInLookup ( + dict, "XiGModel", modelType, *dictionaryConstructorTablePtr_ - ) << exit(FatalError); + ) << exit(FatalIOError); } - return autoPtr(cstrIter()(propDict, thermo, turbulence, Su)); + return autoPtr(cstrIter()(dict, thermo, turbulence, Su)); } diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiModel/XiModelNew.C b/applications/solvers/combustion/PDRFoam/XiModels/XiModel/XiModelNew.C index eec0afa7af..3c11960f93 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiModel/XiModelNew.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiModel/XiModelNew.C @@ -31,7 +31,7 @@ License Foam::autoPtr 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::New const surfaceScalarField& phi ) { - const word modelType(propDict.get("XiModel")); + const word modelType(dict.get("XiModel")); Info<< "Selecting flame-wrinkling model " << modelType << endl; @@ -48,16 +48,17 @@ Foam::autoPtr Foam::XiModel::New if (!cstrIter.found()) { - FatalErrorInLookup + FatalIOErrorInLookup ( + dict, "XiModel", modelType, *dictionaryConstructorTablePtr_ - ) << exit(FatalError); + ) << exit(FatalIOError); } return autoPtr - (cstrIter()(propDict, thermo, turbulence, Su, rho, b, phi)); + (cstrIter()(dict, thermo, turbulence, Su, rho, b, phi)); } diff --git a/applications/solvers/multiphase/driftFluxFoam/mixtureViscosityModels/mixtureViscosityModel/mixtureViscosityModelNew.C b/applications/solvers/multiphase/driftFluxFoam/mixtureViscosityModels/mixtureViscosityModel/mixtureViscosityModelNew.C index 68dbbcc308..956c2817ef 100644 --- a/applications/solvers/multiphase/driftFluxFoam/mixtureViscosityModels/mixtureViscosityModel/mixtureViscosityModelNew.C +++ b/applications/solvers/multiphase/driftFluxFoam/mixtureViscosityModels/mixtureViscosityModel/mixtureViscosityModelNew.C @@ -34,12 +34,12 @@ License Foam::autoPtr Foam::mixtureViscosityModel::New ( const word& name, - const dictionary& viscosityProperties, + const dictionary& dict, const volVectorField& U, const surfaceScalarField& phi ) { - const word modelType(viscosityProperties.get("transportModel")); + const word modelType(dict.get("transportModel")); Info<< "Selecting incompressible transport model " << modelType << endl; @@ -47,16 +47,17 @@ Foam::autoPtr Foam::mixtureViscosityModel::New if (!cstrIter.found()) { - FatalErrorInLookup + FatalIOErrorInLookup ( + dict, "mixtureViscosityModel", modelType, *dictionaryConstructorTablePtr_ - ) << exit(FatalError); + ) << exit(FatalIOError); } return autoPtr - (cstrIter()(name, viscosityProperties, U, phi)); + (cstrIter()(name, dict, U, phi)); } diff --git a/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.C b/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.C index 752e101917..a9ca200ef4 100644 --- a/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.C +++ b/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.C @@ -114,12 +114,13 @@ Foam::autoPtr Foam::relativeVelocityModel::New if (!cstrIter.found()) { - FatalErrorInLookup + FatalIOErrorInLookup ( + dict, "relative velocity", modelType, *dictionaryConstructorTablePtr_ - ) << abort(FatalError); + ) << abort(FatalIOError); } return diff --git a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/massTransferModels/interfaceCompositionModel/interfaceCompositionModelNew.C b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/massTransferModels/interfaceCompositionModel/interfaceCompositionModelNew.C index 7b2d53398b..5826ee3781 100644 --- a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/massTransferModels/interfaceCompositionModel/interfaceCompositionModelNew.C +++ b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/massTransferModels/interfaceCompositionModel/interfaceCompositionModelNew.C @@ -55,12 +55,13 @@ Foam::interfaceCompositionModel::New if (!cstrIter.found()) { - FatalErrorInLookup + FatalIOErrorInLookup ( + dict, "interfaceCompositionModel", modelType, *dictionaryConstructorTablePtr_ - ) << exit(FatalError); + ) << exit(FatalIOError); } return cstrIter()(dict, pair); diff --git a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/interfaceModels/porousModels/porousModel/porousModelNew.C b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/interfaceModels/porousModels/porousModel/porousModelNew.C index c543ccb3f4..cbff7d06c8 100644 --- a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/interfaceModels/porousModels/porousModel/porousModelNew.C +++ b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/interfaceModels/porousModels/porousModel/porousModelNew.C @@ -43,12 +43,13 @@ Foam::autoPtr Foam::porousModel::New if (!cstrIter.found()) { - FatalErrorInLookup + FatalIOErrorInLookup ( + dict, "porousModel", modelType, *dictionaryConstructorTablePtr_ - ) << exit(FatalError); + ) << exit(FatalIOError); } return cstrIter()(dict, mesh); diff --git a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/interfaceModels/surfaceTensionModels/surfaceTensionModel/surfaceTensionModelNew.C b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/interfaceModels/surfaceTensionModels/surfaceTensionModel/surfaceTensionModelNew.C index 88b8ec9a5d..867ebf8114 100644 --- a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/interfaceModels/surfaceTensionModels/surfaceTensionModel/surfaceTensionModelNew.C +++ b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/interfaceModels/surfaceTensionModels/surfaceTensionModel/surfaceTensionModelNew.C @@ -43,12 +43,13 @@ Foam::autoPtr Foam::surfaceTensionModel::New if (!cstrIter.found()) { - FatalErrorInLookup + FatalIOErrorInLookup ( + dict, "surfaceTensionModel", modelType, *dictionaryConstructorTablePtr_ - ) << exit(FatalError); + ) << exit(FatalIOError); } return cstrIter()(dict, pair, true); diff --git a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/phaseModel/phaseModel/phaseModelNew.C b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/phaseModel/phaseModel/phaseModelNew.C index 53368ea105..7ecdf4e57d 100644 --- a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/phaseModel/phaseModel/phaseModelNew.C +++ b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/phaseModel/phaseModel/phaseModelNew.C @@ -34,7 +34,9 @@ Foam::autoPtr Foam::phaseModel::New const word& phaseName ) { - const word modelType(fluid.subDict(phaseName).get("type")); + const dictionary& dict = fluid.subDict(phaseName); + + const word modelType(dict.get("type")); Info<< "Selecting phaseModel for " << phaseName << ": " << modelType << endl; @@ -43,12 +45,13 @@ Foam::autoPtr Foam::phaseModel::New if (!cstrIter.found()) { - FatalErrorInLookup + FatalIOErrorInLookup ( + dict, "phaseModel", modelType, *phaseSystemConstructorTablePtr_ - ) << exit(FatalError); + ) << exit(FatalIOError); } return cstrIter()(fluid, phaseName); diff --git a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/phaseSystem/multiphaseSystem/multiphaseSystemNew.C b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/phaseSystem/multiphaseSystem/multiphaseSystemNew.C index 2d31a1211e..bbf285d8d8 100644 --- a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/phaseSystem/multiphaseSystem/multiphaseSystemNew.C +++ b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/phaseSystem/multiphaseSystem/multiphaseSystemNew.C @@ -32,34 +32,34 @@ Foam::autoPtr 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("type") + phasePropertiesName, + mesh.time().constant(), + mesh, + IOobject::MUST_READ_IF_MODIFIED, + IOobject::NO_WRITE, + false // Do not register + ) ); + const word systemType(dict.get("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(cstrIter()(mesh)); diff --git a/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtures/newtemperaturePhaseChangeTwoPhaseMixture.C b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtures/newtemperaturePhaseChangeTwoPhaseMixture.C index a337a03a1a..f929d81976 100644 --- a/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtures/newtemperaturePhaseChangeTwoPhaseMixture.C +++ b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtures/newtemperaturePhaseChangeTwoPhaseMixture.C @@ -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("phaseChangeTwoPhaseModel") + "phaseChangeProperties", + mesh.time().constant(), + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE, + false // Do not register + ) ); + const word modelType(dict.get("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 diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/newPhaseChangeTwoPhaseMixture.C b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/newPhaseChangeTwoPhaseMixture.C index 6b2085bd8f..b2757042da 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/newPhaseChangeTwoPhaseMixture.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/newPhaseChangeTwoPhaseMixture.C @@ -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("phaseChangeTwoPhaseMixture") + "transportProperties", + U.time().constant(), + U.db(), + IOobject::MUST_READ, + IOobject::NO_WRITE, + false // Do not register + ) ); + const word modelType(dict.get("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(cstrIter()(U, phi)); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C index 7f44ef980d..9b0fa16f03 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C @@ -47,12 +47,13 @@ Foam::autoPtr Foam::dragModel::New if (!cstrIter.found()) { - FatalErrorInLookup + FatalIOErrorInLookup ( + interfaceDict, "dragModel", modelType, *dictionaryConstructorTablePtr_ - ) << exit(FatalError); + ) << exit(FatalIOError); } return cstrIter()(interfaceDict, phase1, phase2); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C index 8ca8fddd58..2001ea0b7d 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C @@ -51,12 +51,13 @@ Foam::autoPtr Foam::heatTransferModel::New if (!cstrIter.found()) { - FatalErrorInLookup + FatalIOErrorInLookup ( + interfaceDict, "heatTransferModel", modelType, *dictionaryConstructorTablePtr_ - ) << exit(FatalError); + ) << exit(FatalIOError); } return cstrIter()(interfaceDict, alpha1, phase1, phase2); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/diameterModels/diameterModel/newDiameterModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/diameterModels/diameterModel/newDiameterModel.C index 1961dd8759..02f85b0259 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/diameterModels/diameterModel/newDiameterModel.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/diameterModels/diameterModel/newDiameterModel.C @@ -46,12 +46,13 @@ Foam::autoPtr Foam::diameterModel::New if (!cstrIter.found()) { - FatalErrorInLookup + FatalIOErrorInLookup ( + dict, "diameterModel", modelType, *dictionaryConstructorTablePtr_ - ) << exit(FatalError); + ) << exit(FatalIOError); } return cstrIter() diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/newAspectRatioModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/newAspectRatioModel.C index 6ce2f952d4..6cb924170d 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/newAspectRatioModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/newAspectRatioModel.C @@ -46,12 +46,13 @@ Foam::aspectRatioModel::New if (!cstrIter.found()) { - FatalErrorInLookup + FatalIOErrorInLookup ( + dict, "aspectRatioModel", modelType, *dictionaryConstructorTablePtr_ - ) << exit(FatalError); + ) << exit(FatalIOError); } return cstrIter()(dict, pair); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C index df30abe530..740449c2ce 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C @@ -45,12 +45,13 @@ Foam::autoPtr Foam::dragModel::New if (!cstrIter.found()) { - FatalErrorInLookup + FatalIOErrorInLookup ( + dict, "dragModel", modelType, *dictionaryConstructorTablePtr_ - ) << exit(FatalError); + ) << exit(FatalIOError); } return cstrIter()(dict, pair, true); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C index 47951c5cc4..55a32689ea 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C @@ -45,12 +45,13 @@ Foam::autoPtr Foam::heatTransferModel::New if (!cstrIter.found()) { - FatalErrorInLookup + FatalIOErrorInLookup ( + dict, "heatTransferModel", modelType, *dictionaryConstructorTablePtr_ - ) << exit(FatalError); + ) << exit(FatalIOError); } return cstrIter()(dict, pair); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/liftModel/newLiftModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/liftModel/newLiftModel.C index 03cc716499..eec6654dbf 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/liftModel/newLiftModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/liftModel/newLiftModel.C @@ -45,12 +45,13 @@ Foam::autoPtr Foam::liftModel::New if (!cstrIter.found()) { - FatalErrorInLookup + FatalIOErrorInLookup ( + dict, "liftModel", modelType, *dictionaryConstructorTablePtr_ - ) << exit(FatalError); + ) << exit(FatalIOError); } return cstrIter()(dict, pair); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/newSwarmCorrection.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/newSwarmCorrection.C index bc159a37b5..39124027d8 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/newSwarmCorrection.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/newSwarmCorrection.C @@ -46,12 +46,13 @@ Foam::swarmCorrection::New if (!cstrIter.found()) { - FatalErrorInLookup + FatalIOErrorInLookup ( + dict, "swarmCorrection", modelType, *dictionaryConstructorTablePtr_ - ) << exit(FatalError); + ) << exit(FatalIOError); } return cstrIter()(dict, pair); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/newTurbulentDispersionModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/newTurbulentDispersionModel.C index 36517c284f..a444eceddc 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/newTurbulentDispersionModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/newTurbulentDispersionModel.C @@ -46,12 +46,13 @@ Foam::turbulentDispersionModel::New if (!cstrIter.found()) { - FatalErrorInLookup + FatalIOErrorInLookup ( + dict, "turbulentDispersionModel", modelType, *dictionaryConstructorTablePtr_ - ) << exit(FatalError); + ) << exit(FatalIOError); } return cstrIter()(dict, pair); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/newVirtualMassModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/newVirtualMassModel.C index ce1c07d5d3..c6b8c84da6 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/newVirtualMassModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/newVirtualMassModel.C @@ -45,12 +45,13 @@ Foam::autoPtr Foam::virtualMassModel::New if (!cstrIter.found()) { - FatalErrorInLookup + FatalIOErrorInLookup ( + dict, "virtualMassModel", modelType, *dictionaryConstructorTablePtr_ - ) << exit(FatalError); + ) << exit(FatalIOError); } return cstrIter()(dict, pair, true); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/newWallLubricationModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/newWallLubricationModel.C index e41854b98f..00438a1e5d 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/newWallLubricationModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/newWallLubricationModel.C @@ -45,12 +45,13 @@ Foam::autoPtr Foam::wallLubricationModel::New if (!cstrIter.found()) { - FatalErrorInLookup + FatalIOErrorInLookup ( + dict, "wallLubricationModel", modelType, *dictionaryConstructorTablePtr_ - ) << exit(FatalError); + ) << exit(FatalIOError); } return cstrIter()(dict, pair); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/conductivityModel/newConductivityModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/conductivityModel/newConductivityModel.C index dccdf6e14e..240a88b888 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/conductivityModel/newConductivityModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/conductivityModel/newConductivityModel.C @@ -43,12 +43,13 @@ Foam::kineticTheoryModels::conductivityModel::New if (!cstrIter.found()) { - FatalErrorInLookup + FatalIOErrorInLookup ( + dict, "conductivityModel", modelType, *dictionaryConstructorTablePtr_ - ) << exit(FatalError); + ) << exit(FatalIOError); } return autoPtr(cstrIter()(dict)); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C index 58f24c8c1a..006dd1ee3a 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C @@ -43,12 +43,13 @@ Foam::kineticTheoryModels::frictionalStressModel::New if (!cstrIter.found()) { - FatalErrorInLookup + FatalIOErrorInLookup ( + dict, "frictionalStressModel", modelType, *dictionaryConstructorTablePtr_ - ) << exit(FatalError); + ) << exit(FatalIOError); } return autoPtr(cstrIter()(dict)); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/granularPressureModel/newGranularPressureModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/granularPressureModel/newGranularPressureModel.C index 599cd01541..cc68c7b7eb 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/granularPressureModel/newGranularPressureModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/granularPressureModel/newGranularPressureModel.C @@ -43,12 +43,13 @@ Foam::kineticTheoryModels::granularPressureModel::New if (!cstrIter.found()) { - FatalErrorInLookup + FatalIOErrorInLookup ( + dict, "granularPressureModel", modelType, *dictionaryConstructorTablePtr_ - ) << exit(FatalError); + ) << exit(FatalIOError); } return autoPtr(cstrIter()(dict)); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/radialModel/newRadialModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/radialModel/newRadialModel.C index 3df0d16c53..254cafa44b 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/radialModel/newRadialModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/radialModel/radialModel/newRadialModel.C @@ -43,12 +43,13 @@ Foam::kineticTheoryModels::radialModel::New if (!cstrIter.found()) { - FatalErrorInLookup + FatalIOErrorInLookup ( + dict, "radialModel", modelType, *dictionaryConstructorTablePtr_ - ) << exit(FatalError); + ) << exit(FatalIOError); } return autoPtr(cstrIter()(dict)); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/viscosityModel/newViscosityModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/viscosityModel/newViscosityModel.C index dc0817013e..e1d2dd18f4 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/viscosityModel/newViscosityModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/viscosityModel/newViscosityModel.C @@ -43,12 +43,13 @@ Foam::kineticTheoryModels::viscosityModel::New if (!cstrIter.found()) { - FatalErrorInLookup + FatalIOErrorInLookup ( + dict, "viscosityModel", modelType, *dictionaryConstructorTablePtr_ - ) << exit(FatalError); + ) << exit(FatalIOError); } return autoPtr(cstrIter()(dict)); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/blendingMethod/newBlendingMethod.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/blendingMethod/newBlendingMethod.C index b94e892fe9..dcd7953611 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/blendingMethod/newBlendingMethod.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/blendingMethod/newBlendingMethod.C @@ -44,12 +44,13 @@ Foam::autoPtr Foam::blendingMethod::New if (!cstrIter.found()) { - FatalErrorInLookup + FatalIOErrorInLookup ( + dict, "blendingMethod", modelType, *dictionaryConstructorTablePtr_ - ) << exit(FatalError); + ) << exit(FatalIOError); } return cstrIter()(dict, phaseNames); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/diameterModel/newDiameterModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/diameterModel/newDiameterModel.C index 1961dd8759..02f85b0259 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/diameterModel/newDiameterModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/diameterModel/newDiameterModel.C @@ -46,12 +46,13 @@ Foam::autoPtr Foam::diameterModel::New if (!cstrIter.found()) { - FatalErrorInLookup + FatalIOErrorInLookup ( + dict, "diameterModel", modelType, *dictionaryConstructorTablePtr_ - ) << exit(FatalError); + ) << exit(FatalIOError); } return cstrIter() diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellSizeAndAlignmentControl/cellSizeAndAlignmentControl/cellSizeAndAlignmentControl.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellSizeAndAlignmentControl/cellSizeAndAlignmentControl/cellSizeAndAlignmentControl.C index 7bc8d847ba..5830bb925e 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellSizeAndAlignmentControl/cellSizeAndAlignmentControl/cellSizeAndAlignmentControl.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellSizeAndAlignmentControl/cellSizeAndAlignmentControl/cellSizeAndAlignmentControl.C @@ -83,12 +83,13 @@ Foam::cellSizeAndAlignmentControl::New if (!cstrIter.found()) { - FatalErrorInLookup + FatalIOErrorInLookup ( + dict, "cellSizeAndAlignmentControl", modelType, *dictionaryConstructorTablePtr_ - ) << exit(FatalError); + ) << exit(FatalIOError); } return autoPtr diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/cellSizeFunction/cellSizeFunction/cellSizeFunction.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/cellSizeFunction/cellSizeFunction/cellSizeFunction.C index 9f262b9b34..d16aaedda8 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/cellSizeFunction/cellSizeFunction/cellSizeFunction.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/cellSizeFunction/cellSizeFunction/cellSizeFunction.C @@ -137,12 +137,13 @@ Foam::autoPtr Foam::cellSizeFunction::New if (!cstrIter.found()) { - FatalErrorInLookup + FatalIOErrorInLookup ( + dict, "cellSizeFunction", modelType, *dictionaryConstructorTablePtr_ - ) << exit(FatalError); + ) << exit(FatalIOError); } return autoPtr diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/cellSizeCalculationType/cellSizeCalculationType.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/cellSizeCalculationType/cellSizeCalculationType.C index 586a53cbc1..86889193dc 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/cellSizeCalculationType/cellSizeCalculationType.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/cellSizeCalculationType/cellSizeCalculationType.C @@ -70,12 +70,13 @@ Foam::autoPtr Foam::cellSizeCalculationType::New if (!cstrIter.found()) { - FatalErrorInLookup + FatalIOErrorInLookup ( + dict, "cellSizeCalculationType", modelType, *dictionaryConstructorTablePtr_ - ) << exit(FatalError); + ) << exit(FatalIOError); } return autoPtr diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/surfaceCellSizeFunction/surfaceCellSizeFunction.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/surfaceCellSizeFunction/surfaceCellSizeFunction.C index 2e9e39567b..b7c8e44fe5 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/surfaceCellSizeFunction/surfaceCellSizeFunction.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/surfaceCellSizeFunction/surfaceCellSizeFunction.C @@ -67,10 +67,7 @@ Foam::autoPtr Foam::surfaceCellSizeFunction::New const scalar& defaultCellSize ) { - const word modelType - ( - dict.get("surfaceCellSizeFunction") - ); + const word modelType(dict.get("surfaceCellSizeFunction")); Info<< indent << "Selecting surfaceCellSizeFunction " << modelType << endl; @@ -78,12 +75,13 @@ Foam::autoPtr Foam::surfaceCellSizeFunction::New if (!cstrIter.found()) { - FatalErrorInLookup + FatalIOErrorInLookup ( + dict, "surfaceCellSizeFunction", modelType, *dictionaryConstructorTablePtr_ - ) << exit(FatalError); + ) << exit(FatalIOError); } return autoPtr diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/faceAreaWeightModel/faceAreaWeightModel/faceAreaWeightModel.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/faceAreaWeightModel/faceAreaWeightModel/faceAreaWeightModel.C index 92b667828c..c17941ef53 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/faceAreaWeightModel/faceAreaWeightModel/faceAreaWeightModel.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/faceAreaWeightModel/faceAreaWeightModel/faceAreaWeightModel.C @@ -41,10 +41,10 @@ defineRunTimeSelectionTable(faceAreaWeightModel, dictionary); Foam::faceAreaWeightModel::faceAreaWeightModel ( const word& type, - const dictionary& relaxationDict + const dictionary& dict ) : - dictionary(relaxationDict), + dictionary(dict), coeffDict_(optionalSubDict(type + "Coeffs")) {} @@ -53,10 +53,10 @@ Foam::faceAreaWeightModel::faceAreaWeightModel Foam::autoPtr Foam::faceAreaWeightModel::New ( - const dictionary& relaxationDict + const dictionary& dict ) { - const word modelType(relaxationDict.get("faceAreaWeightModel")); + const word modelType(dict.get("faceAreaWeightModel")); Info<< nl << "Selecting faceAreaWeightModel " << modelType << endl; @@ -64,15 +64,16 @@ Foam::autoPtr Foam::faceAreaWeightModel::New if (!cstrIter.found()) { - FatalErrorInLookup + FatalIOErrorInLookup ( + dict, "faceAreaWeightModel", modelType, *dictionaryConstructorTablePtr_ - ) << exit(FatalError); + ) << exit(FatalIOError); } - return autoPtr(cstrIter()(relaxationDict)); + return autoPtr(cstrIter()(dict)); } diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/initialPointsMethod/initialPointsMethod/initialPointsMethod.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/initialPointsMethod/initialPointsMethod/initialPointsMethod.C index 5120dffaee..4d5ba9610e 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/initialPointsMethod/initialPointsMethod/initialPointsMethod.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/initialPointsMethod/initialPointsMethod/initialPointsMethod.C @@ -71,7 +71,7 @@ Foam::initialPointsMethod::initialPointsMethod Foam::autoPtr Foam::initialPointsMethod::New ( - const dictionary& initialPointsDict, + const dictionary& dict, const Time& runTime, Random& rndGen, const conformationSurfaces& geometryToConformTo, @@ -79,7 +79,7 @@ Foam::autoPtr Foam::initialPointsMethod::New const autoPtr& decomposition ) { - const word modelType(initialPointsDict.get("initialPointsMethod")); + const word modelType(dict.get("initialPointsMethod")); Info<< nl << "Selecting initialPointsMethod " << modelType << endl; @@ -87,12 +87,13 @@ Foam::autoPtr Foam::initialPointsMethod::New if (!cstrIter.found()) { - FatalErrorInLookup + FatalIOErrorInLookup ( + dict, "initialPointsMethod", modelType, *dictionaryConstructorTablePtr_ - ) << exit(FatalError); + ) << exit(FatalIOError); } return @@ -100,7 +101,7 @@ Foam::autoPtr Foam::initialPointsMethod::New ( cstrIter() ( - initialPointsDict, + dict, runTime, rndGen, geometryToConformTo, diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/relaxationModel/relaxationModel/relaxationModel.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/relaxationModel/relaxationModel/relaxationModel.C index bcb3154d60..c6ff243ae9 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/relaxationModel/relaxationModel/relaxationModel.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/relaxationModel/relaxationModel/relaxationModel.C @@ -42,11 +42,11 @@ defineRunTimeSelectionTable(relaxationModel, dictionary); Foam::relaxationModel::relaxationModel ( const word& type, - const dictionary& relaxationDict, + const dictionary& dict, const Time& runTime ) : - dictionary(relaxationDict), + dictionary(dict), runTime_(runTime), coeffDict_(optionalSubDict(type + "Coeffs")) {} @@ -56,11 +56,11 @@ Foam::relaxationModel::relaxationModel Foam::autoPtr Foam::relaxationModel::New ( - const dictionary& relaxationDict, + const dictionary& dict, const Time& runTime ) { - const word modelType(relaxationDict.get("relaxationModel")); + const word modelType(dict.get("relaxationModel")); Info<< nl << "Selecting relaxationModel " << modelType << endl; @@ -68,15 +68,16 @@ Foam::autoPtr Foam::relaxationModel::New if (!cstrIter.found()) { - FatalErrorInLookup + FatalIOErrorInLookup ( + dict, "relaxationModel", modelType, *dictionaryConstructorTablePtr_ - ) << exit(FatalError); + ) << exit(FatalIOError); } - return autoPtr(cstrIter()(relaxationDict, runTime)); + return autoPtr(cstrIter()(dict, runTime)); } diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/searchableSurfaceFeatures/searchableSurfaceFeatures.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/searchableSurfaceFeatures/searchableSurfaceFeatures.C index 1f041a1953..b7fe54c953 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/searchableSurfaceFeatures/searchableSurfaceFeatures.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/searchableSurfaceFeatures/searchableSurfaceFeatures.C @@ -51,12 +51,13 @@ Foam::searchableSurfaceFeatures::New if (!cstrIter.found()) { - FatalErrorInLookup + FatalIOErrorInLookup ( + dict, "searchableSurfaceFeatures", modelType, *dictConstructorTablePtr_ - ) << exit(FatalError); + ) << exit(FatalIOError); } return autoPtr(cstrIter()(surface, dict)); @@ -82,7 +83,4 @@ Foam::searchableSurfaceFeatures::~searchableSurfaceFeatures() {} -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - - // ************************************************************************* // diff --git a/applications/utilities/mesh/manipulation/createBaffles/faceSelection/faceSelection.C b/applications/utilities/mesh/manipulation/createBaffles/faceSelection/faceSelection.C index a2ce411a90..f64b7c09bc 100644 --- a/applications/utilities/mesh/manipulation/createBaffles/faceSelection/faceSelection.C +++ b/applications/utilities/mesh/manipulation/createBaffles/faceSelection/faceSelection.C @@ -74,12 +74,13 @@ Foam::autoPtr Foam::faceSelection::New if (!cstrIter.found()) { - FatalErrorInLookup + FatalIOErrorInLookup ( + dict, "faceSelection", modelType, *dictionaryConstructorTablePtr_ - ) << exit(FatalError); + ) << exit(FatalIOError); } return autoPtr(cstrIter()(name, mesh, dict)); diff --git a/applications/utilities/miscellaneous/foamHelp/helpTypes/helpType/helpTypeNew.C b/applications/utilities/miscellaneous/foamHelp/helpTypes/helpType/helpTypeNew.C index ba650d5142..870cef7a68 100644 --- a/applications/utilities/miscellaneous/foamHelp/helpTypes/helpType/helpTypeNew.C +++ b/applications/utilities/miscellaneous/foamHelp/helpTypes/helpType/helpTypeNew.C @@ -45,8 +45,7 @@ Foam::autoPtr Foam::helpType::New FatalErrorInFunction << "Valid helpType selections:" << nl << " " - << flatOutput(dictionaryConstructorTablePtr_->sortedToc()) - << endl + << flatOutput(dictionaryConstructorTablePtr_->sortedToc()) << nl << exit(FatalError); } else @@ -55,8 +54,7 @@ Foam::autoPtr Foam::helpType::New << "Unknown helpType type '" << helpTypeName << "'" << nl << nl << "Valid helpType selections:" << nl << " " - << flatOutput(dictionaryConstructorTablePtr_->sortedToc()) - << endl + << flatOutput(dictionaryConstructorTablePtr_->sortedToc()) << nl << abort(FatalError); } } diff --git a/applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/tabulatedWallFunction/tabulatedWallFunctionNew.C b/applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/tabulatedWallFunction/tabulatedWallFunctionNew.C index c0cf895bf4..eca04747cd 100644 --- a/applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/tabulatedWallFunction/tabulatedWallFunctionNew.C +++ b/applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/tabulatedWallFunction/tabulatedWallFunctionNew.C @@ -44,12 +44,13 @@ Foam::tabulatedWallFunctions::tabulatedWallFunction::New if (!cstrIter.found()) { - FatalErrorInLookup + FatalIOErrorInLookup ( + dict, "tabulatedWallFunction", functionName, *dictionaryConstructorTablePtr_ - ) << exit(FatalError); + ) << exit(FatalIOError); } return autoPtr(cstrIter()(dict, mesh)); diff --git a/applications/utilities/surface/surfacePatch/searchableSurfaceModifier/searchableSurfaceModifier.C b/applications/utilities/surface/surfacePatch/searchableSurfaceModifier/searchableSurfaceModifier.C index f2d232b885..5c9a8b3518 100644 --- a/applications/utilities/surface/surfacePatch/searchableSurfaceModifier/searchableSurfaceModifier.C +++ b/applications/utilities/surface/surfacePatch/searchableSurfaceModifier/searchableSurfaceModifier.C @@ -70,12 +70,13 @@ Foam::searchableSurfaceModifier::New if (!cstrIter.found()) { - FatalErrorInLookup + FatalIOErrorInLookup ( + dict, "searchableSurfaceModifier", type, *dictionaryConstructorTablePtr_ - ) << exit(FatalError); + ) << exit(FatalIOError); } return autoPtr(cstrIter()(geometry, dict)); diff --git a/src/ODE/ODESolvers/ODESolver/ODESolverNew.C b/src/ODE/ODESolvers/ODESolver/ODESolverNew.C index 5f849e52b6..ff585f0896 100644 --- a/src/ODE/ODESolvers/ODESolver/ODESolverNew.C +++ b/src/ODE/ODESolvers/ODESolver/ODESolverNew.C @@ -42,8 +42,9 @@ Foam::autoPtr Foam::ODESolver::New if (!cstrIter.found()) { - FatalErrorInLookup + FatalIOErrorInLookup ( + dict, "ODESolver", solverType, *dictionaryConstructorTablePtr_ diff --git a/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C b/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C index 2a255396b0..048c4fac0f 100644 --- a/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C +++ b/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C @@ -102,8 +102,7 @@ Foam::autoPtr Foam::functionObject::New if (!dictionaryConstructorTablePtr_) { FatalErrorInFunction - << "Unknown function type " - << functionType << nl << nl + << "Cannot load function type " << functionType << nl << nl << "Table of functionObjects is empty" << endl << exit(FatalError); } @@ -112,6 +111,8 @@ Foam::autoPtr Foam::functionObject::New if (!cstrIter.found()) { + // FatalError (not FatalIOError) to ensure it can be caught + // as an exception and ignored FatalErrorInLookup ( "function", diff --git a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchFieldNew.C b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchFieldNew.C index 368cd48377..075a4fa49b 100644 --- a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchFieldNew.C +++ b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchFieldNew.C @@ -155,7 +155,7 @@ Foam::autoPtr> Foam::pointPatchField::New if (!patchTypeCstrIter.found()) { FatalIOErrorInFunction(dict) - << "inconsistent patch and patchField types for \n" + << "Inconsistent patch and patchField types for\n" << " patch type " << p.type() << " and patchField type " << patchFieldType << exit(FatalIOError); diff --git a/src/OpenFOAM/interpolations/interpolationTable/tableReaders/tableReader.C b/src/OpenFOAM/interpolations/interpolationTable/tableReaders/tableReader.C index 0cd7f115ca..649ca5cb6d 100644 --- a/src/OpenFOAM/interpolations/interpolationTable/tableReaders/tableReader.C +++ b/src/OpenFOAM/interpolations/interpolationTable/tableReaders/tableReader.C @@ -45,12 +45,13 @@ Foam::autoPtr> Foam::tableReader::New if (!cstrIter.found()) { - FatalErrorInLookup + FatalIOErrorInLookup ( + spec, "reader", readerType, *dictionaryConstructorTablePtr_ - ) << exit(FatalError); + ) << exit(FatalIOError); } return autoPtr>(cstrIter()(spec)); diff --git a/src/TurbulenceModels/turbulenceModels/LES/LESModel/LESModel.C b/src/TurbulenceModels/turbulenceModels/LES/LESModel/LESModel.C index 4b1a77f16d..9696f738a0 100644 --- a/src/TurbulenceModels/turbulenceModels/LES/LESModel/LESModel.C +++ b/src/TurbulenceModels/turbulenceModels/LES/LESModel/LESModel.C @@ -135,34 +135,36 @@ Foam::LESModel::New const word& propertiesName ) { - const word modelType + const IOdictionary modelDict ( - IOdictionary + IOobject ( - IOobject - ( - IOobject::groupName(propertiesName, alphaRhoPhi.group()), - U.time().constant(), - U.db(), - IOobject::MUST_READ_IF_MODIFIED, - IOobject::NO_WRITE, - false // Do not register - ) - ).subDict("LES").get("LESModel") + IOobject::groupName(propertiesName, alphaRhoPhi.group()), + U.time().constant(), + U.db(), + IOobject::MUST_READ_IF_MODIFIED, + IOobject::NO_WRITE, + false // Do not register + ) ); + const dictionary& dict = modelDict.subDict("LES"); + + const word modelType(dict.get("LESModel")); + Info<< "Selecting LES turbulence model " << modelType << endl; auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { - FatalErrorInLookup + FatalIOErrorInLookup ( + dict, "LESModel", modelType, *dictionaryConstructorTablePtr_ - ) << exit(FatalError); + ) << exit(FatalIOError); } return autoPtr diff --git a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.C b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.C index 304a8c232c..53dfebc82a 100644 --- a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.C +++ b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.C @@ -80,12 +80,13 @@ Foam::autoPtr Foam::LESdelta::New if (!cstrIter.found()) { - FatalErrorInLookup + FatalIOErrorInLookup ( + dict, "LESdelta", deltaType, *dictionaryConstructorTablePtr_ - ) << exit(FatalError); + ) << exit(FatalIOError); } return autoPtr(cstrIter()(name, turbulence, dict)); @@ -119,14 +120,15 @@ Foam::autoPtr Foam::LESdelta::New if (!cstrIter.found()) { - FatalErrorInLookup + FatalIOErrorInLookup ( + dict, "LESdelta", deltaType, additionalConstructors ) << " and " << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); + << exit(FatalIOError); } return autoPtr(cstrIter()(name, turbulence, dict)); diff --git a/src/TurbulenceModels/turbulenceModels/LES/LESfilters/LESfilter/LESfilter.C b/src/TurbulenceModels/turbulenceModels/LES/LESfilters/LESfilter/LESfilter.C index eb325db5eb..c3492a45e6 100644 --- a/src/TurbulenceModels/turbulenceModels/LES/LESfilters/LESfilter/LESfilter.C +++ b/src/TurbulenceModels/turbulenceModels/LES/LESfilters/LESfilter/LESfilter.C @@ -52,12 +52,13 @@ Foam::autoPtr Foam::LESfilter::New if (!cstrIter.found()) { - FatalErrorInLookup + FatalIOErrorInLookup ( + dict, "LESfilter", filterType, *dictionaryConstructorTablePtr_ - ) << exit(FatalError); + ) << exit(FatalIOError); } return autoPtr(cstrIter()(mesh, dict)); diff --git a/src/TurbulenceModels/turbulenceModels/RAS/RASModel/RASModel.C b/src/TurbulenceModels/turbulenceModels/RAS/RASModel/RASModel.C index 8c3c255dde..6e2b8c1f7a 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/RASModel/RASModel.C +++ b/src/TurbulenceModels/turbulenceModels/RAS/RASModel/RASModel.C @@ -125,34 +125,36 @@ Foam::RASModel::New const word& propertiesName ) { - const word modelType + const IOdictionary modelDict ( - IOdictionary + IOobject ( - IOobject - ( - IOobject::groupName(propertiesName, alphaRhoPhi.group()), - U.time().constant(), - U.db(), - IOobject::MUST_READ_IF_MODIFIED, - IOobject::NO_WRITE, - false // Do not register - ) - ).subDict("RAS").get("RASModel") + IOobject::groupName(propertiesName, alphaRhoPhi.group()), + U.time().constant(), + U.db(), + IOobject::MUST_READ_IF_MODIFIED, + IOobject::NO_WRITE, + false // Do not register + ) ); + const dictionary& dict = modelDict.subDict("RAS"); + + const word modelType(dict.get("RASModel")); + Info<< "Selecting RAS turbulence model " << modelType << endl; auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { - FatalErrorInLookup + FatalIOErrorInLookup ( + dict, "RASModel", modelType, *dictionaryConstructorTablePtr_ - ) << exit(FatalError); + ) << exit(FatalIOError); } return autoPtr diff --git a/src/TurbulenceModels/turbulenceModels/TurbulenceModel/TurbulenceModel.C b/src/TurbulenceModels/turbulenceModels/TurbulenceModel/TurbulenceModel.C index 81e9040aa1..e106ad1a81 100644 --- a/src/TurbulenceModels/turbulenceModels/TurbulenceModel/TurbulenceModel.C +++ b/src/TurbulenceModels/turbulenceModels/TurbulenceModel/TurbulenceModel.C @@ -87,34 +87,34 @@ Foam::TurbulenceModel::New const word& propertiesName ) { - const word modelType + const IOdictionary dict ( - IOdictionary + IOobject ( - IOobject - ( - IOobject::groupName(propertiesName, alphaRhoPhi.group()), - U.time().constant(), - U.db(), - IOobject::MUST_READ_IF_MODIFIED, - IOobject::NO_WRITE, - false // Do not register - ) - ).get("simulationType") + IOobject::groupName(propertiesName, alphaRhoPhi.group()), + U.time().constant(), + U.db(), + IOobject::MUST_READ_IF_MODIFIED, + IOobject::NO_WRITE, + false // Do not register + ) ); + const word modelType(dict.get("simulationType")); + Info<< "Selecting turbulence model type " << modelType << endl; auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { - FatalErrorInLookup + FatalIOErrorInLookup ( + dict, "simulationType", modelType, *dictionaryConstructorTablePtr_ - ) << exit(FatalError); + ) << exit(FatalIOError); } return autoPtr diff --git a/src/TurbulenceModels/turbulenceModels/laminar/laminarModel/laminarModel.C b/src/TurbulenceModels/turbulenceModels/laminar/laminarModel/laminarModel.C index a2ece6cf6b..de997e1459 100644 --- a/src/TurbulenceModels/turbulenceModels/laminar/laminarModel/laminarModel.C +++ b/src/TurbulenceModels/turbulenceModels/laminar/laminarModel/laminarModel.C @@ -92,7 +92,7 @@ Foam::laminarModel::New const word& propertiesName ) { - IOdictionary modelDict + const IOdictionary modelDict ( IOobject ( @@ -105,12 +105,13 @@ Foam::laminarModel::New ) ); - if (modelDict.found("laminar")) + const dictionary* dictptr = modelDict.findDict("laminar"); + + if (dictptr) { - const word modelType - ( - modelDict.subDict("laminar").get("laminarModel") - ); + const dictionary& dict = *dictptr; + + const word modelType(dict.get("laminarModel")); Info<< "Selecting laminar stress model " << modelType << endl; @@ -118,12 +119,13 @@ Foam::laminarModel::New if (!cstrIter.found()) { - FatalErrorInLookup + FatalIOErrorInLookup ( + dict, "laminarModel", modelType, *dictionaryConstructorTablePtr_ - ) << exit(FatalError); + ) << exit(FatalIOError); } return autoPtr diff --git a/src/combustionModels/combustionModel/combustionModelTemplates.C b/src/combustionModels/combustionModel/combustionModelTemplates.C index 569648e2c8..ce0fc8256e 100644 --- a/src/combustionModels/combustionModel/combustionModelTemplates.C +++ b/src/combustionModels/combustionModel/combustionModelTemplates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2017 OpenFOAM Foundation @@ -75,12 +75,16 @@ Foam::autoPtr Foam::combustionModel::New typedef typename CombustionModel::dictionaryConstructorTable cstrTableType; cstrTableType* cstrTable = CombustionModel::dictionaryConstructorTablePtr_; - const word compCombModelName = - combModelName + '<' + CombustionModel::reactionThermo::typeName + '>'; + const word compCombModelName + ( + combModelName + '<' + CombustionModel::reactionThermo::typeName + '>' + ); - const word thermoCombModelName = + const word thermoCombModelName + ( combModelName + '<' + CombustionModel::reactionThermo::typeName + ',' - + thermo.thermoName() + '>'; + + thermo.thermoName() + '>' + ); auto compCstrIter = cstrTable->cfind(compCombModelName); @@ -88,28 +92,61 @@ Foam::autoPtr Foam::combustionModel::New if (!compCstrIter.found() && !thermoCstrIter.found()) { - FatalErrorInFunction - << "Unknown " << combustionModel::typeName << " type " - << combModelName << endl << endl; - - const wordList names(cstrTable->toc()); - wordList thisCmpts; thisCmpts.append(word::null); thisCmpts.append(CombustionModel::reactionThermo::typeName); thisCmpts.append(basicThermo::splitThermoName(thermo.thermoName(), 5)); wordList validNames; - forAll(names, i) + + List validCmpts2; + validCmpts2.append + ( + // Header + wordList + ({ + word::null, + combustionModel::typeName, + "reactionThermo" + }) + ); + + List validCmpts7; + validCmpts7.append + ( + // Header + wordList + ({ + word::null, + combustionModel::typeName, + "reactionThermo", + "transport", + "thermo", + "equationOfState", + "specie", + "energy" + }) + ); + + for (const word& validName : cstrTable->sortedToc()) { - wordList cmpts(basicThermo::splitThermoName(names[i], 2)); - if (cmpts.size() != 2) + wordList cmpts(basicThermo::splitThermoName(validName, 2)); + + if (cmpts.size() == 2) { - cmpts = basicThermo::splitThermoName(names[i], 7); + validCmpts2.append(cmpts); + } + else + { + cmpts = basicThermo::splitThermoName(validName, 7); + if (cmpts.size() == 7) + { + validCmpts7.append(cmpts); + } } bool isValid = true; - for (label i = 1; i < cmpts.size() && isValid; ++ i) + for (label i = 1; i < cmpts.size() && isValid; ++i) { isValid = isValid && cmpts[i] == thisCmpts[i]; } @@ -120,49 +157,25 @@ Foam::autoPtr Foam::combustionModel::New } } - FatalErrorInFunction - << "Valid " << combustionModel::typeName << " types for this " - << "thermodynamic model are:" << endl << validNames << endl; - List validCmpts2, validCmpts7; - validCmpts2.append(wordList(2, word::null)); - validCmpts2[0][0] = combustionModel::typeName; - validCmpts2[0][1] = "reactionThermo"; - validCmpts7.append(wordList(7, word::null)); - validCmpts7[0][0] = combustionModel::typeName; - validCmpts7[0][1] = "reactionThermo"; - validCmpts7[0][2] = "transport"; - validCmpts7[0][3] = "thermo"; - validCmpts7[0][4] = "equationOfState"; - validCmpts7[0][5] = "specie"; - validCmpts7[0][6] = "energy"; - forAll(names, i) - { - const wordList cmpts2(basicThermo::splitThermoName(names[i], 2)); - const wordList cmpts7(basicThermo::splitThermoName(names[i], 7)); - if (cmpts2.size() == 2) - { - validCmpts2.append(cmpts2); - } - if (cmpts7.size() == 7) - { - validCmpts7.append(cmpts7); - } - } - - FatalErrorInFunction + FatalErrorInLookup + ( + combustionModel::typeName, + combModelName, + *cstrTable + ) << "All " << validCmpts2[0][0] << '/' << validCmpts2[0][1] - << " combinations are:" << endl << endl; - printTable(validCmpts2, FatalErrorInFunction); + << " combinations are:" << nl << nl; - FatalErrorInFunction << endl; + printTable(validCmpts2, FatalErrorInFunction) + << nl; FatalErrorInFunction << "All " << validCmpts7[0][0] << '/' << validCmpts7[0][1] - << "/thermoPhysics combinations are:" << endl << endl; - printTable(validCmpts7, FatalErrorInFunction); + << "/thermoPhysics combinations are:" << nl << nl; - FatalErrorInFunction << exit(FatalError); + printTable(validCmpts7, FatalErrorInFunction) + << exit(FatalError); } return autoPtr diff --git a/src/dynamicMesh/motionSolvers/displacement/displacement/displacementMotionSolver.C b/src/dynamicMesh/motionSolvers/displacement/displacement/displacementMotionSolver.C index 85318e2324..c70fa46256 100644 --- a/src/dynamicMesh/motionSolvers/displacement/displacement/displacementMotionSolver.C +++ b/src/dynamicMesh/motionSolvers/displacement/displacement/displacementMotionSolver.C @@ -91,8 +91,6 @@ Foam::displacementMotionSolver::New const pointIOField& points0 ) { - //const word solverTypeName(solverDict.get("solver")); - Info<< "Selecting motion solver: " << solverTypeName << endl; const_cast(mesh.time()).libs().open @@ -113,12 +111,13 @@ Foam::displacementMotionSolver::New if (!cstrIter.found()) { - FatalErrorInLookup + FatalIOErrorInLookup ( + solverDict, "solver", solverTypeName, *displacementConstructorTablePtr_ - ) << exit(FatalError); + ) << exit(FatalIOError); } return autoPtr diff --git a/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunctionNew.C b/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunctionNew.C index d9b9709a11..e77038bfce 100644 --- a/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunctionNew.C +++ b/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunctionNew.C @@ -31,11 +31,11 @@ License Foam::autoPtr Foam::solidBodyMotionFunction::New ( - const dictionary& SBMFCoeffs, + const dictionary& dict, const Time& runTime ) { - const word motionType(SBMFCoeffs.get("solidBodyMotionFunction")); + const word motionType(dict.get("solidBodyMotionFunction")); Info<< "Selecting solid-body motion function " << motionType << endl; @@ -43,15 +43,16 @@ Foam::autoPtr Foam::solidBodyMotionFunction::New if (!cstrIter.found()) { - FatalErrorInLookup + FatalIOErrorInLookup ( + dict, "solidBodyMotionFunction", motionType, *dictionaryConstructorTablePtr_ - ) << exit(FatalError); + ) << exit(FatalIOError); } - return autoPtr(cstrIter()(SBMFCoeffs, runTime)); + return autoPtr(cstrIter()(dict, runTime)); } diff --git a/src/dynamicMesh/motionSolvers/motionSolver/motionSolver.C b/src/dynamicMesh/motionSolvers/motionSolver/motionSolver.C index d81798baac..da9a810c1e 100644 --- a/src/dynamicMesh/motionSolvers/motionSolver/motionSolver.C +++ b/src/dynamicMesh/motionSolvers/motionSolver/motionSolver.C @@ -134,12 +134,13 @@ Foam::autoPtr Foam::motionSolver::New if (!cstrIter.found()) { - FatalErrorInLookup + FatalIOErrorInLookup ( + solverDict, "solver", solverName, *dictionaryConstructorTablePtr_ - ) << exit(FatalError); + ) << exit(FatalIOError); } return autoPtr(cstrIter()(mesh, solverDict)); diff --git a/src/engine/engineMesh/engineMesh/engineMeshNew.C b/src/engine/engineMesh/engineMesh/engineMeshNew.C index 7c2ad68832..69a0215b93 100644 --- a/src/engine/engineMesh/engineMesh/engineMeshNew.C +++ b/src/engine/engineMesh/engineMesh/engineMeshNew.C @@ -30,39 +30,36 @@ License // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // -Foam::autoPtr Foam::engineMesh::New -( - const Foam::IOobject& io -) +Foam::autoPtr Foam::engineMesh::New(const IOobject& io) { - const word modelType + const IOdictionary dict ( - IOdictionary + IOobject ( - IOobject - ( - "engineGeometry", - io.time().constant(), - io.db(), - IOobject::MUST_READ_IF_MODIFIED, - IOobject::NO_WRITE, - false // Do not register - ) - ).get("engineMesh") + "engineGeometry", + io.time().constant(), + io.db(), + IOobject::MUST_READ_IF_MODIFIED, + IOobject::NO_WRITE, + false // Do not register + ) ); + const word modelType(dict.get("engineMesh")); + Info<< "Selecting engineMesh " << modelType << endl; auto cstrIter = IOobjectConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { - FatalErrorInLookup + FatalIOErrorInLookup ( + dict, "engineMesh", modelType, *IOobjectConstructorTablePtr_ - ) << exit(FatalError); + ) << exit(FatalIOError); } return autoPtr(cstrIter()(io)); diff --git a/src/engine/engineTime/engineTime/engineTimeNew.C b/src/engine/engineTime/engineTime/engineTimeNew.C index 3bd829ed26..b46a7cdbb5 100644 --- a/src/engine/engineTime/engineTime/engineTimeNew.C +++ b/src/engine/engineTime/engineTime/engineTimeNew.C @@ -42,11 +42,11 @@ Foam::autoPtr Foam::engineTime::New { IFstream engineDictFile("."/constantName/dictName); - dictionary engineDict(engineDictFile); + dictionary dict(engineDictFile); const word engineType ( - engineDict.lookupOrDefault("engineType", "crankConRod") + dict.getOrDefault("engineType", "crankConRod") ); Info<< "Selecting engine type " << engineType << endl; @@ -55,12 +55,13 @@ Foam::autoPtr Foam::engineTime::New if (!cstrIter.found()) { - FatalErrorInLookup + FatalIOErrorInLookup ( + dict, "engine", engineType, *dictionaryConstructorTablePtr_ - ) << exit(FatalError); + ) << exit(FatalIOError); } return autoPtr diff --git a/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/SRFModelNew.C b/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/SRFModelNew.C index aaf60ac9f6..a75b1ecc1f 100644 --- a/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/SRFModelNew.C +++ b/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/SRFModelNew.C @@ -34,34 +34,34 @@ Foam::autoPtr Foam::SRF::SRFModel::New const volVectorField& Urel ) { - const word modelType + const IOdictionary dict ( - IOdictionary + IOobject ( - IOobject - ( - "SRFProperties", - Urel.time().constant(), - Urel.db(), - IOobject::MUST_READ_IF_MODIFIED, - IOobject::NO_WRITE, - false // Do not register - ) - ).get("SRFModel") + "SRFProperties", + Urel.time().constant(), + Urel.db(), + IOobject::MUST_READ_IF_MODIFIED, + IOobject::NO_WRITE, + false // Do not register + ) ); + const word modelType(dict.get("SRFModel")); + Info<< "Selecting SRFModel " << modelType << endl; auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { - FatalErrorInLookup + FatalIOErrorInLookup ( + dict, "SRFModel", modelType, *dictionaryConstructorTablePtr_ - ) << exit(FatalError); + ) << exit(FatalIOError); } return autoPtr(cstrIter()(Urel)); diff --git a/src/finiteVolume/cfdTools/general/fvOptions/fvOption.C b/src/finiteVolume/cfdTools/general/fvOptions/fvOption.C index be27d1f8ac..259f150bca 100644 --- a/src/finiteVolume/cfdTools/general/fvOptions/fvOption.C +++ b/src/finiteVolume/cfdTools/general/fvOptions/fvOption.C @@ -88,22 +88,19 @@ Foam::autoPtr Foam::fv::option::New if (!cstrIter.found()) { - FatalErrorInLookup + FatalIOErrorInLookup ( + coeffs, "fvOption", modelType, *dictionaryConstructorTablePtr_ - ) << exit(FatalError); + ) << exit(FatalIOError); } return autoPtr