diff --git a/src/finiteVolume/cfdTools/general/pimpleControl/pimpleControl.C b/src/finiteVolume/cfdTools/general/pimpleControl/pimpleControl.C index b5a03156ed..367c09f716 100644 --- a/src/finiteVolume/cfdTools/general/pimpleControl/pimpleControl.C +++ b/src/finiteVolume/cfdTools/general/pimpleControl/pimpleControl.C @@ -93,7 +93,7 @@ bool Foam::pimpleControl::criteriaSatisfied() if (debug) { - Info<< dictName_ << "loop statistics:" << endl; + Info<< algorithmName_ << "loop statistics:" << endl; Info<< " " << variableName << " iter " << corr_ << ": ini res = " @@ -122,23 +122,33 @@ Foam::pimpleControl::pimpleControl(fvMesh& mesh) { read(); - if (residualControl_.size() > 0) + if (nOuterCorr_ > 1) { - Info<< dictName_ << ": max iterations = " << nOuterCorr_ << endl; - forAll(residualControl_, i) + Info<< nl; + if (!residualControl_.empty()) { - Info<< " field " << residualControl_[i].name << token::TAB - << ": relTol " << residualControl_[i].relTol - << ", absTol " << residualControl_[i].absTol - << nl; + Info<< algorithmName_ << ": max iterations = " << nOuterCorr_ + << endl; + forAll(residualControl_, i) + { + Info<< " field " << residualControl_[i].name << token::TAB + << ": relTol " << residualControl_[i].relTol + << ", absTol " << residualControl_[i].absTol + << nl; + } + Info<< endl; + } + else + { + Info<< algorithmName_ << ": no residual control data found. " << nl + << "Calculations will employ " << nOuterCorr_ + << " corrector loops" << nl << endl; } - Info<< endl; } else { - Info<< "No " << dictName_ << " residual control data found. " - << "Calculations will employ a fixed number of corrector loops" - << nl << endl; + Info<< nl << algorithmName_ << ": Operating solver in PISO mode" << nl + << endl; } } diff --git a/src/finiteVolume/cfdTools/general/pimpleControl/pimpleControl.H b/src/finiteVolume/cfdTools/general/pimpleControl/pimpleControl.H index f6aa6223dc..a7007bd0ff 100644 --- a/src/finiteVolume/cfdTools/general/pimpleControl/pimpleControl.H +++ b/src/finiteVolume/cfdTools/general/pimpleControl/pimpleControl.H @@ -102,6 +102,9 @@ public: // Access + //- Current corrector index + inline label corr() const; + //- Maximum number of PIMPLE correctors inline label nOuterCorr() const; diff --git a/src/finiteVolume/cfdTools/general/pimpleControl/pimpleControlI.H b/src/finiteVolume/cfdTools/general/pimpleControl/pimpleControlI.H index 7163ec64e1..4c761dfe23 100644 --- a/src/finiteVolume/cfdTools/general/pimpleControl/pimpleControlI.H +++ b/src/finiteVolume/cfdTools/general/pimpleControl/pimpleControlI.H @@ -25,6 +25,12 @@ License // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +inline Foam::label Foam::pimpleControl::corr() const +{ + return corr_; +} + + inline Foam::label Foam::pimpleControl::nOuterCorr() const { return nOuterCorr_; @@ -51,7 +57,7 @@ inline bool Foam::pimpleControl::loop() if (criteriaSatisfied()) { - Info<< dictName_ << "loop converged in " << corr_ << " iterations" + Info<< algorithmName_ << ": converged in " << corr_ << " iterations" << endl; return false; } @@ -64,13 +70,21 @@ inline bool Foam::pimpleControl::loop() if (corr_ < nOuterCorr_) { - Info<< dictName_ << " iteration " << corr_ + 1 << endl; + if (nOuterCorr_ != 1) + { + Info<< algorithmName_ << ": iteration " << corr_ + 1 << endl; + } + return true; } else { - Info<< dictName_ << " loop not converged within " << nOuterCorr_ - << " iterations" << endl; + if ((!residualControl_.empty()) && (nOuterCorr_ != 1)) + { + Info<< algorithmName_ << ": not converged within " + << nOuterCorr_ << " iterations" << endl; + } + return false; } } diff --git a/src/finiteVolume/cfdTools/general/simpleControl/simpleControl.C b/src/finiteVolume/cfdTools/general/simpleControl/simpleControl.C index b20efd658c..b0cb59e927 100644 --- a/src/finiteVolume/cfdTools/general/simpleControl/simpleControl.C +++ b/src/finiteVolume/cfdTools/general/simpleControl/simpleControl.C @@ -66,7 +66,7 @@ bool Foam::simpleControl::criteriaSatisfied() if (debug) { - Info<< dictName_ << " solution statistics:" << endl; + Info<< algorithmName_ << " solution statistics:" << endl; Info<< " " << variableName << ": abs tol = " << residual << " (" << residualControl_[fieldI].absTol << ")" @@ -88,9 +88,11 @@ Foam::simpleControl::simpleControl(fvMesh& mesh) { read(); + Info<< nl; + if (residualControl_.size() > 0) { - Info<< dictName_ << " convergence criteria" << endl; + Info<< algorithmName_ << ": convergence criteria" << nl; forAll(residualControl_, i) { Info<< " field " << residualControl_[i].name << token::TAB @@ -101,7 +103,7 @@ Foam::simpleControl::simpleControl(fvMesh& mesh) } else { - Info<< "No " << dictName_ << " convergence criteria found. " + Info<< algorithmName_ << ": no convergence criteria found. " << "Calculations will run for " << mesh_.time().endTime().value() << " steps." << nl << endl; } diff --git a/src/finiteVolume/cfdTools/general/simpleControl/simpleControlI.H b/src/finiteVolume/cfdTools/general/simpleControl/simpleControlI.H index b7f053da37..d06f94b33f 100644 --- a/src/finiteVolume/cfdTools/general/simpleControl/simpleControlI.H +++ b/src/finiteVolume/cfdTools/general/simpleControl/simpleControlI.H @@ -37,8 +37,8 @@ inline bool Foam::simpleControl::loop() { if (criteriaSatisfied()) { - Info<< dictName_ << " solution converged in " << time.timeName() - << " iterations" << nl << endl; + Info<< nl << algorithmName_ << " solution converged in " + << time.timeName() << " iterations" << nl << endl; // Set to finalise calculation time.writeAndEnd(); diff --git a/src/finiteVolume/cfdTools/general/solutionControl/solutionControl.C b/src/finiteVolume/cfdTools/general/solutionControl/solutionControl.C index cc1e8725df..55fa22435b 100644 --- a/src/finiteVolume/cfdTools/general/solutionControl/solutionControl.C +++ b/src/finiteVolume/cfdTools/general/solutionControl/solutionControl.C @@ -104,11 +104,11 @@ Foam::label Foam::solutionControl::applyToField(const word& fieldName) const // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::solutionControl::solutionControl(fvMesh& mesh, const word& dictName) +Foam::solutionControl::solutionControl(fvMesh& mesh, const word& algorithmName) : mesh_(mesh), residualControl_(), - dictName_(dictName), + algorithmName_(algorithmName), nNonOrthCorr_(0), momentumPredictor_(true), transonic_(false) diff --git a/src/finiteVolume/cfdTools/general/solutionControl/solutionControl.H b/src/finiteVolume/cfdTools/general/solutionControl/solutionControl.H index 55ae5d679d..4933555063 100644 --- a/src/finiteVolume/cfdTools/general/solutionControl/solutionControl.H +++ b/src/finiteVolume/cfdTools/general/solutionControl/solutionControl.H @@ -67,7 +67,7 @@ protected: List residualControl_; //- The dictionary name, e.g. SIMPLE, PIMPLE - const word dictName_; + const word algorithmName_; // Solution controls @@ -112,7 +112,7 @@ public: // Constructors //- Construct from mesh - solutionControl(fvMesh& mesh, const word& dictName); + solutionControl(fvMesh& mesh, const word& algorithmName); //- Destructor diff --git a/src/finiteVolume/cfdTools/general/solutionControl/solutionControlI.H b/src/finiteVolume/cfdTools/general/solutionControl/solutionControlI.H index bc4b6963de..b123cbfb67 100644 --- a/src/finiteVolume/cfdTools/general/solutionControl/solutionControlI.H +++ b/src/finiteVolume/cfdTools/general/solutionControl/solutionControlI.H @@ -27,7 +27,7 @@ License inline const Foam::dictionary& Foam::solutionControl::dict() const { - return mesh_.solutionDict().subDict(dictName_); + return mesh_.solutionDict().subDict(algorithmName_); }