From 40618a3a8690cacc1d4c59b0d0ed6b9b5be7bbe1 Mon Sep 17 00:00:00 2001 From: Johan Roenby Date: Thu, 19 Jul 2018 23:36:42 +0200 Subject: [PATCH] BUG: First occurence of alpha1.prevIter() causes crash (closes #911) - in interIsoFoam/alphaEqn.H changed to alpha1.prevIter() to alpha1.storePrevIter(). --- .../solvers/multiphase/interIsoFoam/alphaEqn.H | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/applications/solvers/multiphase/interIsoFoam/alphaEqn.H b/applications/solvers/multiphase/interIsoFoam/alphaEqn.H index c79afea75d..360b9097a1 100644 --- a/applications/solvers/multiphase/interIsoFoam/alphaEqn.H +++ b/applications/solvers/multiphase/interIsoFoam/alphaEqn.H @@ -2,31 +2,32 @@ if (pimple.nCorrPIMPLE() > 1) { // If nOuterCorrectors > 1 then for all but the first loop the advection - // of alpha is done using an average, 0.5*phi+0.5*phiNew where phi is - // the flux at the beginning of the time step and phiNew is the flux - // estimate at the end of the time step from the previous outer + // of alpha is done using an average, 0.5*phi+0.5*phiNew where phi is + // the flux at the beginning of the time step and phiNew is the flux + // estimate at the end of the time step from the previous outer // iteration. Similarly we use 0.5*U + 0.5*UNew in later iterations. if (pimple.firstIter()) { - // To recalculate the alpha1 update in subsequent iterations, we - // must store its current value before overwriting with the new + // To recalculate the alpha1 update in subsequent iterations, we + // must store its current value before overwriting with the new // value - alpha1.prevIter(); + alpha1.storePrevIter(); // Storing initial phi and U for use in later outer iterations. phi.storePrevIter(); U.storePrevIter(); } else { - // Resetting alpha1 to value before advection in first PIMPLE + // Resetting alpha1 to value before advection in first PIMPLE // iteration. alpha1 = alpha1.prevIter(); + // Setting U and phi with which to advect interface. U = 0.5*U.prevIter() + 0.5*U; phi = 0.5*phi.prevIter() + 0.5*phi; } } - + // Updating alpha1 advector.advect(); #include "rhofs.H"