sixDoFRigidBodyMotion: Corrected handling of acceleration update in first time-step
Resolves bug-report https://bugs.openfoam.org/view.php?id=2551
This commit is contained in:
parent
5a4a34e1f0
commit
3cf57145d1
1 changed files with 6 additions and 4 deletions
|
|
@ -2,7 +2,7 @@
|
||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
|
|
@ -272,7 +272,7 @@ void Foam::sixDoFRigidBodyMotion::updateAcceleration
|
||||||
const vector& tauGlobal
|
const vector& tauGlobal
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
static bool first = false;
|
static bool first = true;
|
||||||
|
|
||||||
// Save the previous iteration accelerations for relaxation
|
// Save the previous iteration accelerations for relaxation
|
||||||
vector aPrevIter = a();
|
vector aPrevIter = a();
|
||||||
|
|
@ -289,8 +289,10 @@ void Foam::sixDoFRigidBodyMotion::updateAcceleration
|
||||||
a() = aRelax_*a() + (1 - aRelax_)*aPrevIter;
|
a() = aRelax_*a() + (1 - aRelax_)*aPrevIter;
|
||||||
tau() = aRelax_*tau() + (1 - aRelax_)*tauPrevIter;
|
tau() = aRelax_*tau() + (1 - aRelax_)*tauPrevIter;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
first = false;
|
{
|
||||||
|
first = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue