From ad789e23bf30148420bbb0153cb64c4523db9186 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Thu, 18 May 2017 16:30:08 +0100 Subject: [PATCH] BUG: sixDoFRigidBodyMotion: Corrected handling of acceleration update in first time-step Resolves bug-report https://bugs.openfoam.org/view.php?id=2551 --- .../sixDoFRigidBodyMotion/sixDoFRigidBodyMotion.C | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion.C b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion.C index 4db21f51a3..53b0d33146 100644 --- a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion.C +++ b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion.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 @@ -273,7 +273,7 @@ void Foam::sixDoFRigidBodyMotion::updateAcceleration const vector& tauGlobal ) { - static bool first = false; + static bool first = true; // Save the previous iteration accelerations for relaxation vector aPrevIter = a(); @@ -290,8 +290,10 @@ void Foam::sixDoFRigidBodyMotion::updateAcceleration a() = aRelax_*a() + (1 - aRelax_)*aPrevIter; tau() = aRelax_*tau() + (1 - aRelax_)*tauPrevIter; } - - first = false; + else + { + first = false; + } }