From 4bd59d64db473a4f2a3654dc93081d958559dcad Mon Sep 17 00:00:00 2001 From: Will Bainbridge Date: Thu, 17 May 2018 17:42:33 +0100 Subject: [PATCH 1/3] pimpleLoop: Fixed bug when convergence occurs on last iteration Resolves bug report https://bugs.openfoam.org/view.php?id=2940 --- .../pimpleControl/pimpleLoop/pimpleLoop.C | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleLoop/pimpleLoop.C b/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleLoop/pimpleLoop.C index 29c4b0339..4d0051ed2 100644 --- a/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleLoop/pimpleLoop.C +++ b/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleLoop/pimpleLoop.C @@ -71,6 +71,18 @@ bool Foam::pimpleLoop::loop(correctorConvergenceControl& convergence) // Handle quit conditions first { + // If converged on the last iteration then end the correction loop + if (converged_) + { + Info<< control_.algorithmName() << ": Converged in " + << corrPimple_ - 1 << " iterations" << endl; + + corrPimple_ = 0; + converged_ = false; + + return false; + } + // If all corrections have been completed then end the correction loop if (corrPimple_ > nCorrPimple_) { @@ -80,17 +92,6 @@ bool Foam::pimpleLoop::loop(correctorConvergenceControl& convergence) << nCorrPimple_ << " iterations" << endl; } - corrPimple_ = 0; - - return false; - } - - // If converged on the last iteration then end the correction loop - if (converged_) - { - Info<< control_.algorithmName() << ": Converged in " - << corrPimple_ - 1 << " iterations" << endl; - corrPimple_ = 0; converged_ = false; From ceebbf8740e026227990e236725af1ad54138daf Mon Sep 17 00:00:00 2001 From: Will Bainbridge Date: Mon, 21 May 2018 09:01:51 +0100 Subject: [PATCH 2/3] semiPermeableBaffle: Spelling corrections --- .../semiPermeableBaffleMassFractionFvPatchScalarField.H | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/semiPermeableBaffle/derivedFvPatchFields/semiPermeableBaffleMassFraction/semiPermeableBaffleMassFractionFvPatchScalarField.H b/src/semiPermeableBaffle/derivedFvPatchFields/semiPermeableBaffleMassFraction/semiPermeableBaffleMassFractionFvPatchScalarField.H index f4de0c69a..59b9b6dce 100644 --- a/src/semiPermeableBaffle/derivedFvPatchFields/semiPermeableBaffleMassFraction/semiPermeableBaffleMassFractionFvPatchScalarField.H +++ b/src/semiPermeableBaffle/derivedFvPatchFields/semiPermeableBaffleMassFraction/semiPermeableBaffleMassFractionFvPatchScalarField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2017 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -49,12 +49,12 @@ Description Y_{i,n} | mass fraction on the neighbour patch [] \endvartable - A species that the baffle is permable to will, therefore, have a + A species that the baffle is permeable to will, therefore, have a coefficient greater than zero, whilst a species that does not transfer will have a coefficient equal to zero. This condition calculates the species flux. The fluxes are summed up by the - velocity consition to generate the net mass transfer across the baffle. + velocity condition to generate the net mass transfer across the baffle. This mass-fraction condition then generates a corrective diffusive flux to ensure that the correct amounts of the permeable species are transferred. From 9dcdf23a6b94a8d792d94664ccfd0d7948a5c905 Mon Sep 17 00:00:00 2001 From: Will Bainbridge Date: Mon, 21 May 2018 11:05:55 +0100 Subject: [PATCH 3/3] waveSuperposition: Corrected copy construction of heightAboveWave flag Resolves bug report https://bugs.openfoam.org/view.php?id=2930 --- src/waves/waveSuperposition/waveSuperposition.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/waves/waveSuperposition/waveSuperposition.C b/src/waves/waveSuperposition/waveSuperposition.C index 2e3fe8e3b..b096c1fef 100644 --- a/src/waves/waveSuperposition/waveSuperposition.C +++ b/src/waves/waveSuperposition/waveSuperposition.C @@ -198,7 +198,7 @@ Foam::waveSuperposition::waveSuperposition(const waveSuperposition& waves) ramp_(waves.ramp_, false), scale_(waves.scale_, false), crossScale_(waves.crossScale_, false), - heightAboveWave_(false) + heightAboveWave_(waves.heightAboveWave_) {}