From 9801c257880fac5198edc6e33c30fa93c541be15 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Thu, 20 Apr 2017 09:14:48 +0100 Subject: [PATCH] The "Coeffs" sub-dictionary is now optional for most model parameters except turbulence and lagrangian which will also be updated shortly. For example in the nonNewtonianIcoFoam offsetCylinder tutorial the viscosity model coefficients may be specified in the corresponding "Coeffs" sub-dictionary: transportModel CrossPowerLaw; CrossPowerLawCoeffs { nu0 [0 2 -1 0 0 0 0] 0.01; nuInf [0 2 -1 0 0 0 0] 10; m [0 0 1 0 0 0 0] 0.4; n [0 0 0 0 0 0 0] 3; } BirdCarreauCoeffs { nu0 [0 2 -1 0 0 0 0] 1e-06; nuInf [0 2 -1 0 0 0 0] 1e-06; k [0 0 1 0 0 0 0] 0; n [0 0 0 0 0 0 0] 1; } which allows a quick change between models, or using the simpler transportModel CrossPowerLaw; nu0 [0 2 -1 0 0 0 0] 0.01; nuInf [0 2 -1 0 0 0 0] 10; m [0 0 1 0 0 0 0] 0.4; n [0 0 0 0 0 0 0] 3; if quick switching between models is not required. To support this more convenient parameter specification the inconsistent specification of seedSampleSet in the streamLine and wallBoundedStreamLine functionObjects had to be corrected from // Seeding method. seedSampleSet uniform; //cloud; //triSurfaceMeshPointSet; uniformCoeffs { type uniform; axis x; //distance; // Note: tracks slightly offset so as not to be on a face start (-1.001 -0.05 0.0011); end (-1.001 -0.05 1.0011); nPoints 20; } to the simpler // Seeding method. seedSampleSet { type uniform; axis x; //distance; // Note: tracks slightly offset so as not to be on a face start (-1.001 -0.05 0.0011); end (-1.001 -0.05 1.0011); nPoints 20; } which also support the "Coeffs" form // Seeding method. seedSampleSet { type uniform; uniformCoeffs { axis x; //distance; // Note: tracks slightly offset so as not to be on a face start (-1.001 -0.05 0.0011); end (-1.001 -0.05 1.0011); nPoints 20; } } --- .../dragModels/PDRDragModel/PDRDragModel.C | 4 +- .../XiModels/XiEqModels/XiEqModel/XiEqModel.C | 4 +- .../XiModels/XiGModels/XiGModel/XiGModel.C | 4 +- .../PDRFoam/XiModels/XiModel/XiModel.C | 4 +- .../SCOPE/SCOPELaminarFlameSpeed.C | 4 +- .../mixtureViscosityModels/plastic/plastic.C | 6 +- .../relativeVelocityModel.C | 4 +- .../phaseChangeTwoPhaseMixtures/Kunz/Kunz.C | 2 +- .../Merkle/Merkle.C | 2 +- .../SchnerrSauer/SchnerrSauer.C | 2 +- .../phaseChangeTwoPhaseMixture.C | 6 +- .../diameterModel/newDiameterModel.C | 8 +- .../diameterModel/diameterModel.C | 4 +- .../diameterModel/newDiameterModel.C | 8 +- .../HrenyaSinclairConductivity.C | 6 +- .../JohnsonJacksonFrictionalStress.C | 6 +- .../JohnsonJacksonSchaefferFrictionalStress.C | 6 +- .../Schaeffer/SchaefferFrictionalStress.C | 6 +- .../HrenyaSinclair/HrenyaSinclairViscosity.C | 6 +- .../HrenyaSinclairConductivity.C | 6 +- .../JohnsonJacksonFrictionalStress.C | 6 +- .../JohnsonJacksonSchaefferFrictionalStress.C | 6 +- .../Schaeffer/SchaefferFrictionalStress.C | 6 +- .../HrenyaSinclair/HrenyaSinclairViscosity.C | 6 +- .../diameterModel/diameterModel.C | 4 +- .../diameterModel/newDiameterModel.C | 8 +- .../cellSizeFunction/cellSizeFunction.C | 4 +- .../automatic/automatic.C | 4 +- .../fieldFromFile/fieldFromFile.C | 9 +- .../surfaceCellSizeFunction.C | 4 +- .../faceAreaWeightModel/faceAreaWeightModel.C | 4 +- .../initialPointsMethod/initialPointsMethod.C | 4 +- .../relaxationModel/relaxationModel.C | 4 +- .../generation/snappyHexMesh/snappyHexMesh.C | 2 +- .../tabulatedWallFunction.C | 4 +- .../visualization/streamlines.cfg | 4 +- src/OpenFOAM/db/dictionary/dictionary.C | 20 +++- src/OpenFOAM/db/dictionary/dictionary.H | 4 + .../reactionRateFlameArea.C | 4 +- .../relaxation/relaxation.C | 13 ++- .../combustionModel/combustionModel.C | 6 +- .../dynamicInkJetFvMesh/dynamicInkJetFvMesh.C | 4 +- .../dynamicRefineFvMesh/dynamicRefineFvMesh.C | 6 +- .../solidBodyMotionFunction.C | 6 +- .../motionSolvers/motionSolver/motionSolver.C | 8 +- .../general/SRF/SRFModel/SRFModel/SRFModel.C | 6 +- .../cfdTools/general/fvOptions/fvOption.C | 7 +- .../cfdTools/general/fvOptions/fvOptionIO.C | 9 +- .../porosityModel/porosityModel.C | 16 +-- .../advectionDiffusionPatchDistMethod.C | 4 +- .../field/streamLine/streamLine.C | 8 +- .../field/streamLine/streamLine.H | 5 +- .../wallBoundedStreamLine.C | 9 +- .../wallBoundedStreamLine.H | 11 +- .../displacementSBRStressFvMotionSolver.C | 4 +- .../trimModel/trimModel/trimModel.C | 4 +- .../extrudeModel/extrudeModel/extrudeModel.C | 4 +- .../displacementMeshMoverMotionSolver.C | 6 +- .../decompositionConstraint.C | 7 +- .../geomDecomp/geomDecomp.C | 4 +- .../manualDecomp/manualDecomp.C | 8 +- .../multiLevelDecomp/multiLevelDecomp.C | 6 +- .../structuredDecomp/structuredDecomp.C | 4 +- .../liquidFilmThermo/liquidFilmThermo.C | 2 +- src/renumber/SloanRenumber/SloanRenumber.C | 9 +- .../CuthillMcKeeRenumber.C | 9 +- .../manualRenumber/manualRenumber.C | 4 +- .../springRenumber/springRenumber.C | 4 +- .../structuredRenumber/structuredRenumber.C | 4 +- src/renumber/zoltanRenumber/zoltanRenumber.C | 4 +- .../sampledSet/sampledSet/sampledSet.C | 4 +- .../laminarFlameSpeed/Gulders/Gulders.C | 4 +- .../laminarFlameSpeed/GuldersEGR/GuldersEGR.C | 4 +- .../RaviPetersen/RaviPetersen.C | 4 +- .../binaryAbsorptionEmission.C | 4 +- .../constantAbsorptionEmission.C | 4 +- .../greyMeanAbsorptionEmission.C | 6 +- .../greyMeanSolidAbsorptionEmission.C | 6 +- .../wideBandAbsorptionEmission.C | 6 +- .../constantScatter/constantScatter.C | 4 +- .../liquidProperties/liquidProperties.C | 5 +- .../solidProperties/solidPropertiesNew.C | 2 +- .../linearValveFvMesh/linearValveFvMesh.C | 4 +- .../linearValveLayersFvMesh.C | 4 +- .../mixerFvMesh/mixerFvMesh.C | 4 +- .../movingConeTopoFvMesh.C | 2 +- .../viscosityModels/BirdCarreau/BirdCarreau.C | 10 +- .../viscosityModels/Casson/Casson.C | 6 +- .../CrossPowerLaw/CrossPowerLaw.C | 10 +- .../HerschelBulkley/HerschelBulkley.C | 10 +- .../viscosityModels/powerLaw/powerLaw.C | 6 +- .../strainRateFunction/strainRateFunction.C | 9 +- .../constant/dynamicMeshDict | 53 ++++----- .../movingCone/constant/dynamicMeshDict | 11 +- .../constant/dynamicMeshDict | 19 ++-- .../movingCone/constant/dynamicMeshDict | 11 +- .../mixerVesselAMI2D/constant/dynamicMeshDict | 19 ++-- .../movingCone/constant/dynamicMeshDict | 11 +- .../constant/dynamicMeshDict | 18 +-- .../propeller/constant/dynamicMeshDict | 20 ++-- .../constant/dynamicMeshDict | 105 +++++++++--------- .../motorBike/motorBike/system/controlDict | 3 +- .../motorBike/motorBike/system/streamLines | 4 +- .../simpleFoam/motorBike/system/streamLines | 4 +- .../motorBike/system/wallBoundedStreamLines | 44 ++++---- .../pitzDailyExptInlet/system/controlDict | 6 +- .../mixerVessel/constant/dynamicMeshDict | 21 ++-- .../SnakeRiverCanyon/constant/dynamicMeshDict | 17 ++- .../sloshingTank2D/constant/dynamicMeshDict | 33 +++--- .../RAS/DTCHull/constant/dynamicMeshDict | 105 +++++++++--------- .../DTCHull/constant/dynamicMeshDict.sixDoF | 79 +++++++------ .../floatingObject/constant/dynamicMeshDict | 2 +- .../constant/dynamicMeshDict.sixDoF | 2 +- .../mixerVesselAMI/constant/dynamicMeshDict | 19 ++-- .../constant/dynamicMeshDict | 59 +++++----- .../sloshingCylinder/constant/dynamicMeshDict | 42 +++---- .../sloshingTank2D/constant/dynamicMeshDict | 33 +++--- .../constant/dynamicMeshDict | 33 +++--- .../sloshingTank3D/constant/dynamicMeshDict | 33 +++--- .../constant/dynamicMeshDict | 33 +++--- .../constant/dynamicMeshDict | 15 +-- .../testTubeMixer/constant/dynamicMeshDict | 70 ++++++------ .../damBreak/constant/dynamicMeshDict | 21 ---- .../laminar/damBreak/constant/dynamicMeshDict | 21 ---- .../propeller/constant/dynamicMeshDict | 33 +++--- .../mixerVesselAMI2D/constant/dynamicMeshDict | 19 ++-- .../oscillatingBox/constant/dynamicMeshDict | 18 ++- 127 files changed, 713 insertions(+), 847 deletions(-) delete mode 100644 tutorials/multiphase/interFoam/laminar/damBreak/damBreak/constant/dynamicMeshDict delete mode 100644 tutorials/multiphase/interMixingFoam/laminar/damBreak/constant/dynamicMeshDict diff --git a/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModel.C b/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModel.C index 49f36d330..2b2cd7c4f 100644 --- a/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModel.C +++ b/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -79,7 +79,7 @@ Foam::PDRDragModel::~PDRDragModel() bool Foam::PDRDragModel::read(const dictionary& PDRProperties) { - PDRDragModelCoeffs_ = PDRProperties.subDict(type() + "Coeffs"); + PDRDragModelCoeffs_ = PDRProperties.optionalSubDict(type() + "Coeffs"); PDRDragModelCoeffs_.lookup("drag") >> on_; diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModel.C b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModel.C index a6301ba97..7e3b2536b 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModel.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -67,7 +67,7 @@ Foam::XiEqModel::~XiEqModel() bool Foam::XiEqModel::read(const dictionary& XiEqProperties) { - XiEqModelCoeffs_ = XiEqProperties.subDict(type() + "Coeffs"); + XiEqModelCoeffs_ = XiEqProperties.optionalSubDict(type() + "Coeffs"); return true; } diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModel.C b/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModel.C index 12bd71306..217242b24 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModel.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -67,7 +67,7 @@ Foam::XiGModel::~XiGModel() bool Foam::XiGModel::read(const dictionary& XiGProperties) { - XiGModelCoeffs_ = XiGProperties.subDict(type() + "Coeffs"); + XiGModelCoeffs_ = XiGProperties.optionalSubDict(type() + "Coeffs"); return true; } diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiModel/XiModel.C b/applications/solvers/combustion/PDRFoam/XiModels/XiModel/XiModel.C index 0bb0cd1e0..958072890 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiModel/XiModel.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiModel/XiModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -85,7 +85,7 @@ Foam::XiModel::~XiModel() bool Foam::XiModel::read(const dictionary& XiProperties) { - XiModelCoeffs_ = XiProperties.subDict(type() + "Coeffs"); + XiModelCoeffs_ = XiProperties.optionalSubDict(type() + "Coeffs"); return true; } diff --git a/applications/solvers/combustion/PDRFoam/laminarFlameSpeed/SCOPE/SCOPELaminarFlameSpeed.C b/applications/solvers/combustion/PDRFoam/laminarFlameSpeed/SCOPE/SCOPELaminarFlameSpeed.C index 947c62132..afdebbd2c 100644 --- a/applications/solvers/combustion/PDRFoam/laminarFlameSpeed/SCOPE/SCOPELaminarFlameSpeed.C +++ b/applications/solvers/combustion/PDRFoam/laminarFlameSpeed/SCOPE/SCOPELaminarFlameSpeed.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -80,7 +80,7 @@ Foam::laminarFlameSpeedModels::SCOPE::SCOPE dict.lookup("fuelFile") ) )() - ).subDict(typeName + "Coeffs") + ).optionalSubDict(typeName + "Coeffs") ), LFL_(readScalar(coeffsDict_.lookup("lowerFlamabilityLimit"))), UFL_(readScalar(coeffsDict_.lookup("upperFlamabilityLimit"))), diff --git a/applications/solvers/multiphase/driftFluxFoam/mixtureViscosityModels/plastic/plastic.C b/applications/solvers/multiphase/driftFluxFoam/mixtureViscosityModels/plastic/plastic.C index 5eb7e0f9c..c09651347 100644 --- a/applications/solvers/multiphase/driftFluxFoam/mixtureViscosityModels/plastic/plastic.C +++ b/applications/solvers/multiphase/driftFluxFoam/mixtureViscosityModels/plastic/plastic.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2014 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -56,7 +56,7 @@ Foam::mixtureViscosityModels::plastic::plastic ) : mixtureViscosityModel(name, viscosityProperties, U, phi), - plasticCoeffs_(viscosityProperties.subDict(modelName + "Coeffs")), + plasticCoeffs_(viscosityProperties.optionalSubDict(modelName + "Coeffs")), plasticViscosityCoeff_ ( "coeff", @@ -117,7 +117,7 @@ bool Foam::mixtureViscosityModels::plastic::read { mixtureViscosityModel::read(viscosityProperties); - plasticCoeffs_ = viscosityProperties.subDict(typeName + "Coeffs"); + plasticCoeffs_ = viscosityProperties.optionalSubDict(typeName + "Coeffs"); plasticCoeffs_.lookup("k") >> plasticViscosityCoeff_; plasticCoeffs_.lookup("n") >> plasticViscosityExponent_; diff --git a/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.C b/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.C index b6e7fbae0..103ad496b 100644 --- a/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.C +++ b/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -126,7 +126,7 @@ Foam::autoPtr Foam::relativeVelocityModel::New ( cstrIter() ( - dict.subDict(modelType + "Coeffs"), + dict.optionalSubDict(modelType + "Coeffs"), mixture ) ); diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Kunz/Kunz.C b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Kunz/Kunz.C index 74c0ec248..32d3fe430 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Kunz/Kunz.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Kunz/Kunz.C @@ -102,7 +102,7 @@ bool Foam::phaseChangeTwoPhaseMixtures::Kunz::read() { if (phaseChangeTwoPhaseMixture::read()) { - phaseChangeTwoPhaseMixtureCoeffs_ = subDict(type() + "Coeffs"); + phaseChangeTwoPhaseMixtureCoeffs_ = optionalSubDict(type() + "Coeffs"); phaseChangeTwoPhaseMixtureCoeffs_.lookup("UInf") >> UInf_; phaseChangeTwoPhaseMixtureCoeffs_.lookup("tInf") >> tInf_; diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Merkle/Merkle.C b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Merkle/Merkle.C index 853884b79..ade26e86a 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Merkle/Merkle.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Merkle/Merkle.C @@ -97,7 +97,7 @@ bool Foam::phaseChangeTwoPhaseMixtures::Merkle::read() { if (phaseChangeTwoPhaseMixture::read()) { - phaseChangeTwoPhaseMixtureCoeffs_ = subDict(type() + "Coeffs"); + phaseChangeTwoPhaseMixtureCoeffs_ = optionalSubDict(type() + "Coeffs"); phaseChangeTwoPhaseMixtureCoeffs_.lookup("UInf") >> UInf_; phaseChangeTwoPhaseMixtureCoeffs_.lookup("tInf") >> tInf_; diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.C b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.C index 7f7771cec..07fe4a233 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.C @@ -151,7 +151,7 @@ bool Foam::phaseChangeTwoPhaseMixtures::SchnerrSauer::read() { if (phaseChangeTwoPhaseMixture::read()) { - phaseChangeTwoPhaseMixtureCoeffs_ = subDict(type() + "Coeffs"); + phaseChangeTwoPhaseMixtureCoeffs_ = optionalSubDict(type() + "Coeffs"); phaseChangeTwoPhaseMixtureCoeffs_.lookup("n") >> n_; phaseChangeTwoPhaseMixtureCoeffs_.lookup("dNuc") >> dNuc_; diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.C b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.C index b9a5e69bf..c4fe701a2 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,7 +43,7 @@ Foam::phaseChangeTwoPhaseMixture::phaseChangeTwoPhaseMixture ) : incompressibleTwoPhaseMixture(U, phi), - phaseChangeTwoPhaseMixtureCoeffs_(subDict(type + "Coeffs")), + phaseChangeTwoPhaseMixtureCoeffs_(optionalSubDict(type + "Coeffs")), pSat_("pSat", dimPressure, lookup("pSat")) {} @@ -77,7 +77,7 @@ bool Foam::phaseChangeTwoPhaseMixture::read() { if (incompressibleTwoPhaseMixture::read()) { - phaseChangeTwoPhaseMixtureCoeffs_ = subDict(type() + "Coeffs"); + phaseChangeTwoPhaseMixtureCoeffs_ = optionalSubDict(type() + "Coeffs"); lookup("pSat") >> pSat_; return true; diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/diameterModels/diameterModel/newDiameterModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/diameterModels/diameterModel/newDiameterModel.C index b58f00291..ef872df0c 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/diameterModels/diameterModel/newDiameterModel.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/diameterModels/diameterModel/newDiameterModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -56,7 +56,11 @@ Foam::autoPtr Foam::diameterModel::New << exit(FatalError); } - return cstrIter()(dict.subDict(diameterModelType + "Coeffs"), phase); + return cstrIter() + ( + dict.optionalSubDict(diameterModelType + "Coeffs"), + phase + ); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/diameterModel/diameterModel.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/diameterModel/diameterModel.C index a956565b4..d7eaa2f08 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/diameterModel/diameterModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/diameterModel/diameterModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -61,7 +61,7 @@ void Foam::diameterModel::correct() bool Foam::diameterModel::read(const dictionary& phaseProperties) { - diameterProperties_ = phaseProperties.subDict(type() + "Coeffs"); + diameterProperties_ = phaseProperties.optionalSubDict(type() + "Coeffs"); return true; } diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/diameterModel/newDiameterModel.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/diameterModel/newDiameterModel.C index b58f00291..ef872df0c 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/diameterModel/newDiameterModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/diameterModel/newDiameterModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -56,7 +56,11 @@ Foam::autoPtr Foam::diameterModel::New << exit(FatalError); } - return cstrIter()(dict.subDict(diameterModelType + "Coeffs"), phase); + return cstrIter() + ( + dict.optionalSubDict(diameterModelType + "Coeffs"), + phase + ); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C index 5abe9f356..a1794a782 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -56,7 +56,7 @@ Foam::kineticTheoryModels::conductivityModels::HrenyaSinclair::HrenyaSinclair ) : conductivityModel(dict), - coeffDict_(dict.subDict(typeName + "Coeffs")), + coeffDict_(dict.optionalSubDict(typeName + "Coeffs")), L_("L", dimensionSet(0, 1, 0, 0, 0), coeffDict_) {} @@ -103,7 +103,7 @@ Foam::kineticTheoryModels::conductivityModels::HrenyaSinclair::kappa bool Foam::kineticTheoryModels::conductivityModels::HrenyaSinclair::read() { - coeffDict_ <<= dict_.subDict(typeName + "Coeffs"); + coeffDict_ <<= dict_.optionalSubDict(typeName + "Coeffs"); L_.readIfPresent(coeffDict_); diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.C index ab6d3d354..6b110d373 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -57,7 +57,7 @@ JohnsonJackson ) : frictionalStressModel(dict), - coeffDict_(dict.subDict(typeName + "Coeffs")), + coeffDict_(dict.optionalSubDict(typeName + "Coeffs")), Fr_("Fr", dimensionSet(1, -1, -2, 0, 0), coeffDict_), eta_("eta", dimless, coeffDict_), p_("p", dimless, coeffDict_), @@ -130,7 +130,7 @@ Foam::kineticTheoryModels::frictionalStressModels::JohnsonJackson::nu bool Foam::kineticTheoryModels::frictionalStressModels::JohnsonJackson::read() { - coeffDict_ <<= dict_.subDict(typeName + "Coeffs"); + coeffDict_ <<= dict_.optionalSubDict(typeName + "Coeffs"); Fr_.read(coeffDict_); eta_.read(coeffDict_); diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJacksonSchaeffer/JohnsonJacksonSchaefferFrictionalStress.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJacksonSchaeffer/JohnsonJacksonSchaefferFrictionalStress.C index 3b69aa8a6..67517beb0 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJacksonSchaeffer/JohnsonJacksonSchaefferFrictionalStress.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJacksonSchaeffer/JohnsonJacksonSchaefferFrictionalStress.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2016-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -57,7 +57,7 @@ JohnsonJacksonSchaeffer::JohnsonJacksonSchaeffer ) : frictionalStressModel(dict), - coeffDict_(dict.subDict(typeName + "Coeffs")), + coeffDict_(dict.optionalSubDict(typeName + "Coeffs")), Fr_("Fr", dimensionSet(1, -1, -2, 0, 0), coeffDict_), eta_("eta", dimless, coeffDict_), p_("p", dimless, coeffDict_), @@ -190,7 +190,7 @@ JohnsonJacksonSchaeffer::nu bool Foam::kineticTheoryModels::frictionalStressModels:: JohnsonJacksonSchaeffer::read() { - coeffDict_ <<= dict_.subDict(typeName + "Coeffs"); + coeffDict_ <<= dict_.optionalSubDict(typeName + "Coeffs"); Fr_.read(coeffDict_); eta_.read(coeffDict_); diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C index be2555958..eeabe622e 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -55,7 +55,7 @@ Foam::kineticTheoryModels::frictionalStressModels::Schaeffer::Schaeffer ) : frictionalStressModel(dict), - coeffDict_(dict.subDict(typeName + "Coeffs")), + coeffDict_(dict.optionalSubDict(typeName + "Coeffs")), phi_("phi", dimless, coeffDict_) { phi_ *= constant::mathematical::pi/180.0; @@ -178,7 +178,7 @@ Foam::kineticTheoryModels::frictionalStressModels::Schaeffer::nu bool Foam::kineticTheoryModels::frictionalStressModels::Schaeffer::read() { - coeffDict_ <<= dict_.subDict(typeName + "Coeffs"); + coeffDict_ <<= dict_.optionalSubDict(typeName + "Coeffs"); phi_.read(coeffDict_); phi_ *= constant::mathematical::pi/180.0; diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C index 415bb3145..6607b1644 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -56,7 +56,7 @@ Foam::kineticTheoryModels::viscosityModels::HrenyaSinclair::HrenyaSinclair ) : viscosityModel(dict), - coeffDict_(dict.subDict(typeName + "Coeffs")), + coeffDict_(dict.optionalSubDict(typeName + "Coeffs")), L_("L", dimensionSet(0, 1, 0, 0, 0), coeffDict_) {} @@ -100,7 +100,7 @@ Foam::kineticTheoryModels::viscosityModels::HrenyaSinclair::nu bool Foam::kineticTheoryModels::viscosityModels::HrenyaSinclair::read() { - coeffDict_ <<= dict_.subDict(typeName + "Coeffs"); + coeffDict_ <<= dict_.optionalSubDict(typeName + "Coeffs"); L_.readIfPresent(coeffDict_); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C index 5abe9f356..a1794a782 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -56,7 +56,7 @@ Foam::kineticTheoryModels::conductivityModels::HrenyaSinclair::HrenyaSinclair ) : conductivityModel(dict), - coeffDict_(dict.subDict(typeName + "Coeffs")), + coeffDict_(dict.optionalSubDict(typeName + "Coeffs")), L_("L", dimensionSet(0, 1, 0, 0, 0), coeffDict_) {} @@ -103,7 +103,7 @@ Foam::kineticTheoryModels::conductivityModels::HrenyaSinclair::kappa bool Foam::kineticTheoryModels::conductivityModels::HrenyaSinclair::read() { - coeffDict_ <<= dict_.subDict(typeName + "Coeffs"); + coeffDict_ <<= dict_.optionalSubDict(typeName + "Coeffs"); L_.readIfPresent(coeffDict_); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.C b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.C index ab6d3d354..6b110d373 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -57,7 +57,7 @@ JohnsonJackson ) : frictionalStressModel(dict), - coeffDict_(dict.subDict(typeName + "Coeffs")), + coeffDict_(dict.optionalSubDict(typeName + "Coeffs")), Fr_("Fr", dimensionSet(1, -1, -2, 0, 0), coeffDict_), eta_("eta", dimless, coeffDict_), p_("p", dimless, coeffDict_), @@ -130,7 +130,7 @@ Foam::kineticTheoryModels::frictionalStressModels::JohnsonJackson::nu bool Foam::kineticTheoryModels::frictionalStressModels::JohnsonJackson::read() { - coeffDict_ <<= dict_.subDict(typeName + "Coeffs"); + coeffDict_ <<= dict_.optionalSubDict(typeName + "Coeffs"); Fr_.read(coeffDict_); eta_.read(coeffDict_); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJacksonSchaeffer/JohnsonJacksonSchaefferFrictionalStress.C b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJacksonSchaeffer/JohnsonJacksonSchaefferFrictionalStress.C index 3b69aa8a6..67517beb0 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJacksonSchaeffer/JohnsonJacksonSchaefferFrictionalStress.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJacksonSchaeffer/JohnsonJacksonSchaefferFrictionalStress.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2016-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -57,7 +57,7 @@ JohnsonJacksonSchaeffer::JohnsonJacksonSchaeffer ) : frictionalStressModel(dict), - coeffDict_(dict.subDict(typeName + "Coeffs")), + coeffDict_(dict.optionalSubDict(typeName + "Coeffs")), Fr_("Fr", dimensionSet(1, -1, -2, 0, 0), coeffDict_), eta_("eta", dimless, coeffDict_), p_("p", dimless, coeffDict_), @@ -190,7 +190,7 @@ JohnsonJacksonSchaeffer::nu bool Foam::kineticTheoryModels::frictionalStressModels:: JohnsonJacksonSchaeffer::read() { - coeffDict_ <<= dict_.subDict(typeName + "Coeffs"); + coeffDict_ <<= dict_.optionalSubDict(typeName + "Coeffs"); Fr_.read(coeffDict_); eta_.read(coeffDict_); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C index be2555958..eeabe622e 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -55,7 +55,7 @@ Foam::kineticTheoryModels::frictionalStressModels::Schaeffer::Schaeffer ) : frictionalStressModel(dict), - coeffDict_(dict.subDict(typeName + "Coeffs")), + coeffDict_(dict.optionalSubDict(typeName + "Coeffs")), phi_("phi", dimless, coeffDict_) { phi_ *= constant::mathematical::pi/180.0; @@ -178,7 +178,7 @@ Foam::kineticTheoryModels::frictionalStressModels::Schaeffer::nu bool Foam::kineticTheoryModels::frictionalStressModels::Schaeffer::read() { - coeffDict_ <<= dict_.subDict(typeName + "Coeffs"); + coeffDict_ <<= dict_.optionalSubDict(typeName + "Coeffs"); phi_.read(coeffDict_); phi_ *= constant::mathematical::pi/180.0; diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C index 415bb3145..6607b1644 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -56,7 +56,7 @@ Foam::kineticTheoryModels::viscosityModels::HrenyaSinclair::HrenyaSinclair ) : viscosityModel(dict), - coeffDict_(dict.subDict(typeName + "Coeffs")), + coeffDict_(dict.optionalSubDict(typeName + "Coeffs")), L_("L", dimensionSet(0, 1, 0, 0, 0), coeffDict_) {} @@ -100,7 +100,7 @@ Foam::kineticTheoryModels::viscosityModels::HrenyaSinclair::nu bool Foam::kineticTheoryModels::viscosityModels::HrenyaSinclair::read() { - coeffDict_ <<= dict_.subDict(typeName + "Coeffs"); + coeffDict_ <<= dict_.optionalSubDict(typeName + "Coeffs"); L_.readIfPresent(coeffDict_); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/diameterModel/diameterModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/diameterModel/diameterModel.C index 55225147a..d7eaa2f08 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/diameterModel/diameterModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/diameterModel/diameterModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -61,7 +61,7 @@ void Foam::diameterModel::correct() bool Foam::diameterModel::read(const dictionary& phaseProperties) { - diameterProperties_ = phaseProperties.subDict(type() + "Coeffs"); + diameterProperties_ = phaseProperties.optionalSubDict(type() + "Coeffs"); return true; } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/diameterModel/newDiameterModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/diameterModel/newDiameterModel.C index b58f00291..ef872df0c 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/diameterModel/newDiameterModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/diameterModel/newDiameterModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -56,7 +56,11 @@ Foam::autoPtr Foam::diameterModel::New << exit(FatalError); } - return cstrIter()(dict.subDict(diameterModelType + "Coeffs"), phase); + return cstrIter() + ( + dict.optionalSubDict(diameterModelType + "Coeffs"), + phase + ); } 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 c0db55e55..3e6860c7a 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 @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -58,7 +58,7 @@ Foam::cellSizeFunction::cellSizeFunction defaultCellSize ) ), - coeffsDict_(subDict(type + "Coeffs")), + coeffsDict_(optionalSubDict(type + "Coeffs")), defaultCellSize_(defaultCellSize), regionIndices_(regionIndices), sideMode_(), diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/automatic/automatic.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/automatic/automatic.C index 025ba5885..5f85fc260 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/automatic/automatic.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/automatic/automatic.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -107,7 +107,7 @@ Foam::automatic::automatic surface, defaultCellSize ), - coeffsDict_(cellSizeCalcTypeDict.subDict(typeName + "Coeffs")), + coeffsDict_(cellSizeCalcTypeDict.optionalSubDict(typeName + "Coeffs")), surfaceName_(surface.searchableSurface::name()), readCurvature_(Switch(coeffsDict_.lookup("curvature"))), curvatureFile_(coeffsDict_.lookup("curvatureFile")), diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/fieldFromFile/fieldFromFile.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/fieldFromFile/fieldFromFile.C index 6d6b56e7b..c4f2014ca 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/fieldFromFile/fieldFromFile.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/fieldFromFile/fieldFromFile.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -58,10 +58,13 @@ Foam::fieldFromFile::fieldFromFile surface, defaultCellSize ), - coeffsDict_(cellSizeCalcTypeDict.subDict(typeName + "Coeffs")), + coeffsDict_(cellSizeCalcTypeDict.optionalSubDict(typeName + "Coeffs")), fileName_ ( - cellSizeCalcTypeDict.subDict(typeName + "Coeffs").lookup("fieldFile") + cellSizeCalcTypeDict.optionalSubDict + ( + typeName + "Coeffs" + ).lookup("fieldFile") ), cellSizeMultipleCoeff_ ( 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 cac183702..33d7267d7 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 @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -46,7 +46,7 @@ Foam::surfaceCellSizeFunction::surfaceCellSizeFunction : dictionary(surfaceCellSizeFunctionDict), surface_(surface), - coeffsDict_(subDict(type + "Coeffs")), + coeffsDict_(optionalSubDict(type + "Coeffs")), defaultCellSize_(defaultCellSize), refinementFactor_ ( 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 6388c0c6c..0aa043cb1 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/faceAreaWeightModel/faceAreaWeightModel/faceAreaWeightModel.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/faceAreaWeightModel/faceAreaWeightModel/faceAreaWeightModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -46,7 +46,7 @@ faceAreaWeightModel::faceAreaWeightModel ) : dictionary(relaxationDict), - coeffDict_(subDict(type + "Coeffs")) + coeffDict_(optionalSubDict(type + "Coeffs")) {} 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 110078415..d7b93caba 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/initialPointsMethod/initialPointsMethod/initialPointsMethod.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/initialPointsMethod/initialPointsMethod/initialPointsMethod.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -56,7 +56,7 @@ initialPointsMethod::initialPointsMethod geometryToConformTo_(geometryToConformTo), cellShapeControls_(cellShapeControls), decomposition_(decomposition), - detailsDict_(subDict(type + "Coeffs")), + detailsDict_(optionalSubDict(type + "Coeffs")), minimumSurfaceDistanceCoeffSqr_ ( sqr 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 e47cbf4aa..c06c5ed96 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/relaxationModel/relaxationModel/relaxationModel.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/relaxationModel/relaxationModel/relaxationModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -48,7 +48,7 @@ relaxationModel::relaxationModel : dictionary(relaxationDict), runTime_(runTime), - coeffDict_(subDict(type + "Coeffs")) + coeffDict_(optionalSubDict(type + "Coeffs")) {} diff --git a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C index e9d308d3a..277189151 100644 --- a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C +++ b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C @@ -138,7 +138,7 @@ autoPtr createRefinementSurfaces const word scsFuncName = shapeDict.lookup("surfaceCellSizeFunction"); const dictionary& scsDict = - shapeDict.subDict(scsFuncName + "Coeffs"); + shapeDict.optionalSubDict(scsFuncName + "Coeffs"); const scalar surfaceCellSize = readScalar(scsDict.lookup("surfaceCellSizeCoeff")); diff --git a/applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/tabulatedWallFunction/tabulatedWallFunction.C b/applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/tabulatedWallFunction/tabulatedWallFunction.C index 9079b1194..aa881bdc9 100644 --- a/applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/tabulatedWallFunction/tabulatedWallFunction.C +++ b/applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/tabulatedWallFunction/tabulatedWallFunction.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -49,7 +49,7 @@ Foam::tabulatedWallFunctions::tabulatedWallFunction::tabulatedWallFunction : dict_(dict), mesh_(mesh), - coeffDict_(dict.subDict(name + "Coeffs")), + coeffDict_(dict.optionalSubDict(name + "Coeffs")), invertedTableName_(dict.lookup("invertedTableName")), invertedTable_(invertedTableName_, mesh_, dict, true) {} diff --git a/etc/caseDicts/postProcessing/visualization/streamlines.cfg b/etc/caseDicts/postProcessing/visualization/streamlines.cfg index 891b4c6d0..7d9e242c7 100644 --- a/etc/caseDicts/postProcessing/visualization/streamlines.cfg +++ b/etc/caseDicts/postProcessing/visualization/streamlines.cfg @@ -19,8 +19,8 @@ lifeTime 10000; nSubCycle 5; cloudName particleTracks; -seedSampleSet uniform; -uniformCoeffs + +seedSampleSet { type uniform; axis x; diff --git a/src/OpenFOAM/db/dictionary/dictionary.C b/src/OpenFOAM/db/dictionary/dictionary.C index 49cbbbb23..5fa7be826 100644 --- a/src/OpenFOAM/db/dictionary/dictionary.C +++ b/src/OpenFOAM/db/dictionary/dictionary.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -755,6 +755,24 @@ Foam::dictionary Foam::dictionary::subOrEmptyDict } +const Foam::dictionary& Foam::dictionary::optionalSubDict +( + const word& keyword +) const +{ + const entry* entryPtr = lookupEntryPtr(keyword, false, true); + + if (entryPtr) + { + return entryPtr->dict(); + } + else + { + return *this; + } +} + + Foam::wordList Foam::dictionary::toc() const { wordList keys(size()); diff --git a/src/OpenFOAM/db/dictionary/dictionary.H b/src/OpenFOAM/db/dictionary/dictionary.H index 95339b483..2507da908 100644 --- a/src/OpenFOAM/db/dictionary/dictionary.H +++ b/src/OpenFOAM/db/dictionary/dictionary.H @@ -419,6 +419,10 @@ public: const bool mustRead = false ) const; + //- Find and return a sub-dictionary if found + // otherwise return this dictionary + const dictionary& optionalSubDict(const word&) const; + //- Return the table of contents wordList toc() const; diff --git a/src/combustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameArea.C b/src/combustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameArea.C index 4e767ca3a..1208979f7 100644 --- a/src/combustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameArea.C +++ b/src/combustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameArea.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -44,7 +44,7 @@ Foam::reactionRateFlameArea::reactionRateFlameArea const combustionModel& combModel ) : - coeffDict_(dict.subDict(modelType + "Coeffs")), + coeffDict_(dict.optionalSubDict(modelType + "Coeffs")), mesh_(mesh), combModel_(combModel), fuel_(dict.lookup("fuel")), diff --git a/src/combustionModels/FSD/reactionRateFlameAreaModels/relaxation/relaxation.C b/src/combustionModels/FSD/reactionRateFlameAreaModels/relaxation/relaxation.C index c714bc5cd..3ae9d31c2 100644 --- a/src/combustionModels/FSD/reactionRateFlameAreaModels/relaxation/relaxation.C +++ b/src/combustionModels/FSD/reactionRateFlameAreaModels/relaxation/relaxation.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -56,9 +56,12 @@ Foam::reactionRateFlameAreaModels::relaxation::relaxation ) : reactionRateFlameArea(modelType, dict, mesh, combModel), - correlation_(dict.subDict(typeName + "Coeffs").subDict(fuel_)), - C_(readScalar(dict.subDict(typeName + "Coeffs").lookup("C"))), - alpha_(readScalar(dict.subDict(typeName + "Coeffs").lookup("alpha"))) + correlation_(dict.optionalSubDict(typeName + "Coeffs").subDict(fuel_)), + C_(readScalar(dict.optionalSubDict(typeName + "Coeffs").lookup("C"))), + alpha_ + ( + readScalar(dict.optionalSubDict(typeName + "Coeffs").lookup("alpha")) + ) {} @@ -148,7 +151,7 @@ bool Foam::reactionRateFlameAreaModels::relaxation::read { if (reactionRateFlameArea::read(dict)) { - coeffDict_ = dict.subDict(typeName + "Coeffs"); + coeffDict_ = dict.optionalSubDict(typeName + "Coeffs"); coeffDict_.lookup("C") >> C_; coeffDict_.lookup("alpha") >> alpha_; correlation_.read diff --git a/src/combustionModels/combustionModel/combustionModel.C b/src/combustionModels/combustionModel/combustionModel.C index 3094e4bdf..1ed899200 100644 --- a/src/combustionModels/combustionModel/combustionModel.C +++ b/src/combustionModels/combustionModel/combustionModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -62,7 +62,7 @@ Foam::combustionModel::combustionModel turbulencePtr_(), mesh_(mesh), active_(lookupOrDefault("active", true)), - coeffs_(subDict(modelType + "Coeffs")), + coeffs_(optionalSubDict(modelType + "Coeffs")), modelType_(modelType), phaseName_(phaseName) {} @@ -86,7 +86,7 @@ bool Foam::combustionModel::read() if (regIOobject::read()) { this->lookup("active") >> active_; - coeffs_ = subDict(modelType_ + "Coeffs"); + coeffs_ = optionalSubDict(modelType_ + "Coeffs"); return true; } else diff --git a/src/dynamicFvMesh/dynamicInkJetFvMesh/dynamicInkJetFvMesh.C b/src/dynamicFvMesh/dynamicInkJetFvMesh/dynamicInkJetFvMesh.C index a26ea293d..737e27877 100644 --- a/src/dynamicFvMesh/dynamicInkJetFvMesh/dynamicInkJetFvMesh.C +++ b/src/dynamicFvMesh/dynamicInkJetFvMesh/dynamicInkJetFvMesh.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -55,7 +55,7 @@ Foam::dynamicInkJetFvMesh::dynamicInkJetFvMesh(const IOobject& io) IOobject::NO_WRITE, false ) - ).subDict(typeName + "Coeffs") + ).optionalSubDict(typeName + "Coeffs") ), amplitude_(readScalar(dynamicMeshCoeffs_.lookup("amplitude"))), frequency_(readScalar(dynamicMeshCoeffs_.lookup("frequency"))), diff --git a/src/dynamicFvMesh/dynamicRefineFvMesh/dynamicRefineFvMesh.C b/src/dynamicFvMesh/dynamicRefineFvMesh/dynamicRefineFvMesh.C index 1ef7aadb3..e8045134c 100644 --- a/src/dynamicFvMesh/dynamicRefineFvMesh/dynamicRefineFvMesh.C +++ b/src/dynamicFvMesh/dynamicRefineFvMesh/dynamicRefineFvMesh.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -191,7 +191,7 @@ void Foam::dynamicRefineFvMesh::readDict() IOobject::NO_WRITE, false ) - ).subDict(typeName + "Coeffs") + ).optionalSubDict(typeName + "Coeffs") ); List> fluxVelocities = List> @@ -1202,7 +1202,7 @@ bool Foam::dynamicRefineFvMesh::update() IOobject::NO_WRITE, false ) - ).subDict(typeName + "Coeffs") + ).optionalSubDict(typeName + "Coeffs") ); label refineInterval = readLabel(refineDict.lookup("refineInterval")); diff --git a/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunction.C b/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunction.C index fd2fb3a9d..e57fc35ee 100644 --- a/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunction.C +++ b/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunction.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -44,7 +44,7 @@ Foam::solidBodyMotionFunction::solidBodyMotionFunction : SBMFCoeffs_ ( - SBMFCoeffs.subDict + SBMFCoeffs.optionalSubDict ( word(SBMFCoeffs.lookup("solidBodyMotionFunction")) + "Coeffs" ) @@ -63,7 +63,7 @@ Foam::solidBodyMotionFunction::~solidBodyMotionFunction() bool Foam::solidBodyMotionFunction::read(const dictionary& SBMFCoeffs) { - SBMFCoeffs_ = SBMFCoeffs.subDict(type() + "Coeffs"); + SBMFCoeffs_ = SBMFCoeffs.optionalSubDict(type() + "Coeffs"); return true; } diff --git a/src/dynamicMesh/motionSolvers/motionSolver/motionSolver.C b/src/dynamicMesh/motionSolvers/motionSolver/motionSolver.C index a63733847..85c846604 100644 --- a/src/dynamicMesh/motionSolvers/motionSolver/motionSolver.C +++ b/src/dynamicMesh/motionSolvers/motionSolver/motionSolver.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -85,7 +85,7 @@ Foam::motionSolver::motionSolver : IOdictionary(stealRegistration(dict), dict), mesh_(mesh), - coeffDict_(dict.subDict(type + "Coeffs")) + coeffDict_(dict.optionalSubDict(type + "Coeffs")) {} @@ -104,7 +104,7 @@ Foam::autoPtr Foam::motionSolver::New const IOdictionary& solverDict ) { - const word solverTypeName(solverDict.lookup("solver")); + const word solverTypeName(solverDict.lookup("motionSolver")); Info<< "Selecting motion solver: " << solverTypeName << endl; @@ -227,7 +227,7 @@ bool Foam::motionSolver::read() { if (regIOobject::read()) { - coeffDict_ = subDict(type() + "Coeffs"); + coeffDict_ = optionalSubDict(type() + "Coeffs"); return true; } diff --git a/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/SRFModel.C b/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/SRFModel.C index 3e1c92a10..9d7d2c251 100644 --- a/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/SRFModel.C +++ b/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/SRFModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -61,7 +61,7 @@ Foam::SRF::SRFModel::SRFModel mesh_(Urel_.mesh()), origin_("origin", dimLength, lookup("origin")), axis_(lookup("axis")), - SRFModelCoeffs_(subDict(type + "Coeffs")), + SRFModelCoeffs_(optionalSubDict(type + "Coeffs")), omega_(dimensionedVector("omega", dimless/dimTime, Zero)) { // Normalise the axis @@ -89,7 +89,7 @@ bool Foam::SRF::SRFModel::read() axis_ /= mag(axis_); // Re-read sub-model coeffs - SRFModelCoeffs_ = subDict(type() + "Coeffs"); + SRFModelCoeffs_ = optionalSubDict(type() + "Coeffs"); return true; } diff --git a/src/finiteVolume/cfdTools/general/fvOptions/fvOption.C b/src/finiteVolume/cfdTools/general/fvOptions/fvOption.C index be200396e..446c917a4 100644 --- a/src/finiteVolume/cfdTools/general/fvOptions/fvOption.C +++ b/src/finiteVolume/cfdTools/general/fvOptions/fvOption.C @@ -52,12 +52,7 @@ Foam::fv::option::option modelType_(modelType), mesh_(mesh), dict_(dict), - coeffs_ - ( - dict.found(modelType + "Coeffs") - ? dict.subDict(modelType + "Coeffs") - : dict - ), + coeffs_(dict.optionalSubDict(modelType + "Coeffs")), active_(dict_.lookupOrDefault("active", true)), fieldNames_(), applied_() diff --git a/src/finiteVolume/cfdTools/general/fvOptions/fvOptionIO.C b/src/finiteVolume/cfdTools/general/fvOptions/fvOptionIO.C index 5308fa623..88730167b 100644 --- a/src/finiteVolume/cfdTools/general/fvOptions/fvOptionIO.C +++ b/src/finiteVolume/cfdTools/general/fvOptions/fvOptionIO.C @@ -54,14 +54,7 @@ bool Foam::fv::option::read(const dictionary& dict) { dict.readIfPresent("active", active_); - if (dict.found(modelType_ + "Coeffs")) - { - coeffs_ = dict.subDict(modelType_ + "Coeffs"); - } - else - { - coeffs_ = dict; - } + coeffs_ = dict.optionalSubDict(modelType_ + "Coeffs"); return true; } diff --git a/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.C b/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.C index 635b864c4..adc20bb5c 100644 --- a/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.C +++ b/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.C @@ -97,12 +97,7 @@ Foam::porosityModel::porosityModel name_(name), mesh_(mesh), dict_(dict), - coeffs_ - ( - dict.found(modelType + "Coeffs") - ? dict.subDict(modelType + "Coeffs") - : dict - ), + coeffs_(dict.optionalSubDict(modelType + "Coeffs")), active_(true), zoneName_(cellZoneName), cellZoneIDs_(), @@ -234,14 +229,7 @@ bool Foam::porosityModel::read(const dictionary& dict) { dict.readIfPresent("active", active_); - if (dict.found(type() + "Coeffs")) - { - coeffs_ = dict.subDict(type() + "Coeffs"); - } - else - { - coeffs_ = dict; - } + coeffs_ = dict.optionalSubDict(type() + "Coeffs"); dict.lookup("cellZone") >> zoneName_; cellZoneIDs_ = mesh_.cellZones().findIndices(zoneName_); diff --git a/src/finiteVolume/fvMesh/wallDist/patchDistMethods/advectionDiffusion/advectionDiffusionPatchDistMethod.C b/src/finiteVolume/fvMesh/wallDist/patchDistMethods/advectionDiffusion/advectionDiffusionPatchDistMethod.C index 78f25810e..9e0826340 100644 --- a/src/finiteVolume/fvMesh/wallDist/patchDistMethods/advectionDiffusion/advectionDiffusionPatchDistMethod.C +++ b/src/finiteVolume/fvMesh/wallDist/patchDistMethods/advectionDiffusion/advectionDiffusionPatchDistMethod.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -56,7 +56,7 @@ Foam::patchDistMethods::advectionDiffusion::advectionDiffusion ) : patchDistMethod(mesh, patchIDs), - coeffs_(dict.subDict(type() + "Coeffs")), + coeffs_(dict.optionalSubDict(type() + "Coeffs")), pdmPredictor_ ( patchDistMethod::New diff --git a/src/functionObjects/field/streamLine/streamLine.C b/src/functionObjects/field/streamLine/streamLine.C index a05a0ad94..1ed8a2ff8 100644 --- a/src/functionObjects/field/streamLine/streamLine.C +++ b/src/functionObjects/field/streamLine/streamLine.C @@ -372,19 +372,17 @@ bool Foam::functionObjects::streamLine::read(const dictionary& dict) ); cloudName_ = dict.lookupOrDefault("cloudName", "streamLine"); - dict.lookup("seedSampleSet") >> seedSet_; meshSearchPtr_.reset(new meshSearch(mesh_)); - const dictionary& coeffsDict = dict.subDict(seedSet_ + "Coeffs"); sampledSetPtr_ = sampledSet::New ( - seedSet_, + "seedSampleSet", mesh_, meshSearchPtr_(), - coeffsDict + dict.subDict("seedSampleSet") ); - coeffsDict.lookup("axis") >> sampledSetAxis_; + sampledSetAxis_ = sampledSetPtr_->axis(); scalarFormatterPtr_ = writer::New(dict.lookup("setFormat")); vectorFormatterPtr_ = writer::New(dict.lookup("setFormat")); diff --git a/src/functionObjects/field/streamLine/streamLine.H b/src/functionObjects/field/streamLine/streamLine.H index 07a124c48..b16f4109a 100644 --- a/src/functionObjects/field/streamLine/streamLine.H +++ b/src/functionObjects/field/streamLine/streamLine.H @@ -55,8 +55,7 @@ Description nSubCycle 5; cloudName particleTracks; - seedSampleSet uniform; - uniformCoeffs + seedSampleSet { type uniform; axis x; //distance; @@ -81,7 +80,7 @@ Usage seedSampleSet| Seeding method (see below)| yes | \endtable - Where \c seedSampleSet is typically one of + Where \c seedSampleSet \c type is typically one of \plaintable uniform | uniform particle seeding cloud | cloud of points diff --git a/src/functionObjects/field/wallBoundedStreamLine/wallBoundedStreamLine.C b/src/functionObjects/field/wallBoundedStreamLine/wallBoundedStreamLine.C index 23892ba77..3a65c2d57 100644 --- a/src/functionObjects/field/wallBoundedStreamLine/wallBoundedStreamLine.C +++ b/src/functionObjects/field/wallBoundedStreamLine/wallBoundedStreamLine.C @@ -469,18 +469,15 @@ bool Foam::functionObjects::wallBoundedStreamLine::read(const dictionary& dict) "cloudName", "wallBoundedStreamLine" ); - dict.lookup("seedSampleSet") >> seedSet_; - - const dictionary& coeffsDict = dict.subDict(seedSet_ + "Coeffs"); sampledSetPtr_ = sampledSet::New ( - seedSet_, + "seedSampleSet", mesh_, meshSearchMeshObject::New(mesh_), - coeffsDict + dict.subDict("seedSampleSet") ); - coeffsDict.lookup("axis") >> sampledSetAxis_; + sampledSetAxis_ = sampledSetPtr_->axis(); scalarFormatterPtr_ = writer::New(dict.lookup("setFormat")); vectorFormatterPtr_ = writer::New(dict.lookup("setFormat")); diff --git a/src/functionObjects/field/wallBoundedStreamLine/wallBoundedStreamLine.H b/src/functionObjects/field/wallBoundedStreamLine/wallBoundedStreamLine.H index 0d19e4542..619d4ed86 100644 --- a/src/functionObjects/field/wallBoundedStreamLine/wallBoundedStreamLine.H +++ b/src/functionObjects/field/wallBoundedStreamLine/wallBoundedStreamLine.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -56,8 +56,7 @@ Description nSubCycle 5; cloudName particleTracks; - seedSampleSet patchSeed; - patchSeedCoeffs + seedSampleSet { type patchSeed; patches (wall); @@ -81,10 +80,10 @@ Usage seedSampleSet| Seeding method (see below)| yes | \endtable - Where \c seedSampleSet is typically one of + Where \c seedSampleSet \c type is typically one of \plaintable - uniform | uniform particle seeding - cloud | cloud of points + uniform | uniform particle seeding + cloud | cloud of points patchSeed | seeding via patch faces triSurfaceMeshPointSet | points according to a tri-surface mesh \endplaintable diff --git a/src/fvMotionSolver/fvMotionSolvers/displacement/SBRStress/displacementSBRStressFvMotionSolver.C b/src/fvMotionSolver/fvMotionSolvers/displacement/SBRStress/displacementSBRStressFvMotionSolver.C index f4a9e6068..149dffec6 100644 --- a/src/fvMotionSolver/fvMotionSolvers/displacement/SBRStress/displacementSBRStressFvMotionSolver.C +++ b/src/fvMotionSolver/fvMotionSolvers/displacement/SBRStress/displacementSBRStressFvMotionSolver.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -57,7 +57,7 @@ Foam::displacementSBRStressFvMotionSolver::displacementSBRStressFvMotionSolver const IOdictionary& dict ) : - displacementMotionSolver(mesh, dict, dict.lookup("solver")), + displacementMotionSolver(mesh, dict, typeName), fvMotionSolver(mesh), cellDisplacement_ ( diff --git a/src/fvOptions/sources/derived/rotorDiskSource/trimModel/trimModel/trimModel.C b/src/fvOptions/sources/derived/rotorDiskSource/trimModel/trimModel/trimModel.C index 9126ee841..bfd9f3d93 100644 --- a/src/fvOptions/sources/derived/rotorDiskSource/trimModel/trimModel/trimModel.C +++ b/src/fvOptions/sources/derived/rotorDiskSource/trimModel/trimModel/trimModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -60,7 +60,7 @@ Foam::trimModel::~trimModel() void Foam::trimModel::read(const dictionary& dict) { - coeffs_ = dict.subDict(name_ + "Coeffs"); + coeffs_ = dict.optionalSubDict(name_ + "Coeffs"); } diff --git a/src/mesh/extrudeModel/extrudeModel/extrudeModel.C b/src/mesh/extrudeModel/extrudeModel/extrudeModel.C index f6a2a1328..cb041871f 100644 --- a/src/mesh/extrudeModel/extrudeModel/extrudeModel.C +++ b/src/mesh/extrudeModel/extrudeModel/extrudeModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -44,7 +44,7 @@ Foam::extrudeModel::extrudeModel nLayers_(dict.lookupOrDefault