diff --git a/applications/solvers/electromagnetics/mhdFoam/createPhiB.H b/applications/solvers/electromagnetics/mhdFoam/createPhiB.H index 401917f55..02b48f8d2 100644 --- a/applications/solvers/electromagnetics/mhdFoam/createPhiB.H +++ b/applications/solvers/electromagnetics/mhdFoam/createPhiB.H @@ -9,7 +9,7 @@ IOobject phiBHeader surfaceScalarField* phiBPtr = nullptr; -if (phiBHeader.headerOk()) +if (phiBHeader.typeHeaderOk(true)) { Info<< "Reading face flux "; diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/residualControlsFluid.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/residualControlsFluid.H deleted file mode 120000 index f2ec2a0ce..000000000 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/residualControlsFluid.H +++ /dev/null @@ -1 +0,0 @@ -../../fluid/residualControlsFluid.H \ No newline at end of file diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/residualControlsFluid.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/residualControlsFluid.H new file mode 100644 index 000000000..fa95ed86e --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/residualControlsFluid.H @@ -0,0 +1,56 @@ +// Residual control used +if (residualControlUsed) +{ + bool UConv = false; + bool p_rghConv = false; + bool EConv = false; + + // Check which field is not used for control + { + if (UTol == -1 || !momentumPredictor) + { + UConv = true; + } + + if (p_rghTol == -1) + { + p_rghConv = true; + } + + if (ETol == -1) + { + EConv = true; + } + } + + // Get the last initial residual of the solvers + if (momentumPredictor && !UConv) + { + if (UTol > cmptMax(solvPerfU.initialResidual())) + { + UConv = true; + } + } + + if (!p_rghConv) + { + if (p_rghTol > solvPerfp_rgh.initialResidual()) + { + p_rghConv = true; + } + } + + if (!EConv) + { + if (ETol > solvPerfE.initialResidual()) + { + EConv = true; + } + } + + // Check if each field is converged + if (UConv && p_rghConv && EConv) + { + resReachedFluid = true; + } +} diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/createSolidFields.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/createSolidFields.H index 82261f535..857f97f24 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/createSolidFields.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/createSolidFields.H @@ -79,7 +79,7 @@ IOobject::AUTO_WRITE ); - if (betavSolidIO.headerOk()) + if (betavSolidIO.typeHeaderOk(true)) { betavSolid.set ( diff --git a/applications/solvers/heatTransfer/thermoFoam/setAlphaEff.H b/applications/solvers/heatTransfer/thermoFoam/setAlphaEff.H index 73a157fc1..e7da9c6af 100644 --- a/applications/solvers/heatTransfer/thermoFoam/setAlphaEff.H +++ b/applications/solvers/heatTransfer/thermoFoam/setAlphaEff.H @@ -11,7 +11,7 @@ IOobject turbulencePropertiesHeader false ); -if (turbulencePropertiesHeader.headerOk()) +if (turbulencePropertiesHeader.typeHeaderOk(true)) { autoPtr turbulence ( diff --git a/applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/createFields.H b/applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/createFields.H index d2be5bdd0..77287eed8 100644 --- a/applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/createFields.H +++ b/applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/createFields.H @@ -81,7 +81,7 @@ IOobject Hheader autoPtr HPtr; -if (Hheader.headerOk()) +if (Hheader.typeHeaderOk(true)) { Info<< "\nReading field H\n" << endl; @@ -99,7 +99,7 @@ IOobject HdotGradHheader autoPtr HdotGradHPtr; -if (HdotGradHheader.headerOk()) +if (HdotGradHheader.typeHeaderOk(true)) { Info<< "Reading field HdotGradH" << endl; diff --git a/applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/createNonInertialFrameFields.H b/applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/createNonInertialFrameFields.H index abaede938..731a8196d 100644 --- a/applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/createNonInertialFrameFields.H +++ b/applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/createNonInertialFrameFields.H @@ -11,7 +11,13 @@ autoPtr linearAccelerationPtr; - if (linearAccelerationHeader.headerOk()) + if + ( + linearAccelerationHeader.typeHeaderOk + ( + true + ) + ) { Info<< " Reading " << linearAccelerationHeader.name() << endl; @@ -33,7 +39,7 @@ autoPtr angularVelocityPtr; - if (angularVelocityHeader.headerOk()) + if (angularVelocityHeader.typeHeaderOk(true)) { Info<< " Reading " << angularVelocityHeader.name() << endl; @@ -55,7 +61,13 @@ autoPtr angularAccelerationPtr; - if (angularAccelerationHeader.headerOk()) + if + ( + angularAccelerationHeader.typeHeaderOk + ( + true + ) + ) { Info<< " Reading " << angularAccelerationHeader.name() << endl; @@ -77,7 +89,13 @@ autoPtr centreOfRotationPtr; - if (centreOfRotationHeader.headerOk()) + if + ( + centreOfRotationHeader.typeHeaderOk + ( + true + ) + ) { Info<< " Reading " << centreOfRotationHeader.name() << endl; diff --git a/applications/solvers/multiphase/VoF/createAlphaFluxes.H b/applications/solvers/multiphase/VoF/createAlphaFluxes.H index 2bf716cc5..72da18386 100644 --- a/applications/solvers/multiphase/VoF/createAlphaFluxes.H +++ b/applications/solvers/multiphase/VoF/createAlphaFluxes.H @@ -7,7 +7,7 @@ IOobject alphaPhi10Header IOobject::AUTO_WRITE ); -const bool alphaRestart = alphaPhi10Header.headerOk(); +const bool alphaRestart = alphaPhi10Header.typeHeaderOk(); // MULES flux from previous time-step surfaceScalarField alphaPhi10 diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/phaseModel/phaseModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/phaseModel/phaseModel.C index 1751e404a..a1990a88c 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/phaseModel/phaseModel.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/phaseModel/phaseModel.C @@ -123,7 +123,7 @@ Foam::phaseModel::phaseModel IOobject::NO_READ ); - if (phiHeader.headerOk()) + if (phiHeader.typeHeaderOk(true)) { Info<< "Reading face flux field " << phiName << endl; diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.C index 6e5aac34d..0aa04c362 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.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 @@ -55,7 +55,7 @@ Foam::MovingPhaseModel::phi(const volVectorField& U) const IOobject::NO_READ ); - if (phiHeader.headerOk()) + if (phiHeader.typeHeaderOk(true)) { Info<< "Reading face flux field " << phiName << endl; diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.C index dab711fb2..87a249277 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.C @@ -121,7 +121,7 @@ Foam::phaseModel::phaseModel IOobject::NO_READ ); - if (phiHeader.headerOk()) + if (phiHeader.typeHeaderOk(true)) { Info<< "Reading face flux field " << phiName << endl; diff --git a/applications/test/CompactIOList/Test-CompactIOList.C b/applications/test/CompactIOList/Test-CompactIOList.C index 12d64c6bd..2024e663e 100644 --- a/applications/test/CompactIOList/Test-CompactIOList.C +++ b/applications/test/CompactIOList/Test-CompactIOList.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 @@ -87,7 +87,8 @@ int main(int argc, char *argv[]) ( format, IOstream::currentVersion, - IOstream::UNCOMPRESSED + IOstream::UNCOMPRESSED, + true ); Info<< "Written old format faceList in = " @@ -149,7 +150,8 @@ int main(int argc, char *argv[]) ( format, IOstream::currentVersion, - IOstream::UNCOMPRESSED + IOstream::UNCOMPRESSED, + true ); Info<< "Written new format faceList in = " diff --git a/applications/test/IOField/Make/files b/applications/test/IOField/Make/files new file mode 100644 index 000000000..74e614dea --- /dev/null +++ b/applications/test/IOField/Make/files @@ -0,0 +1,3 @@ +Test-IOField.C + +EXE = $(FOAM_USER_APPBIN)/Test-IOField diff --git a/applications/test/IOField/Make/options b/applications/test/IOField/Make/options new file mode 100644 index 000000000..6a9e9810b --- /dev/null +++ b/applications/test/IOField/Make/options @@ -0,0 +1,2 @@ +/* EXE_INC = -I$(LIB_SRC)/cfdTools/include */ +/* EXE_LIBS = -lfiniteVolume */ diff --git a/applications/test/IOField/Test-IOField.C b/applications/test/IOField/Test-IOField.C new file mode 100644 index 000000000..d49acaf8f --- /dev/null +++ b/applications/test/IOField/Test-IOField.C @@ -0,0 +1,189 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2017 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Application + Test-IOField + +Description + Test the processor-local reading of IOField (used in the lagrangian libs) + +\*---------------------------------------------------------------------------*/ + +#include "IOField.H" +#include "argList.H" +#include "polyMesh.H" +#include "Time.H" + +using namespace Foam; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +void write(const IOobject& io, const label sz) +{ + IOField