View Issue Details

IDProjectCategoryView StatusLast Update
0002551OpenFOAMBugpublic2017-05-18 16:33
Reportermorefool Assigned Tohenry  
PrioritynormalSeveritytrivialReproducibilityalways
Status resolvedResolutionfixed 
Summary0002551: Foam::sixDoFRigidBodyMotion::updateAcceleration implementation does not fit the specification
Descriptionthe implementation reads

void Foam::sixDoFRigidBodyMotion::updateAcceleration
(
    const vector& fGlobal,
    const vector& tauGlobal
)
{
    static bool first = false;

    // Save the previous iteration accelerations for relaxation
    vector aPrevIter = a();
    vector tauPrevIter = tau();

    // Calculate new accelerations
    a() = fGlobal/mass_;
    tau() = (Q().T() & tauGlobal);
    applyRestraints();

    // Relax accelerations on all but first iteration
    if (!first)
    {
        a() = aRelax_*a() + (1 - aRelax_)*aPrevIter;
        tau() = aRelax_*tau() + (1 - aRelax_)*tauPrevIter;
    }

    first = false;
}

where the accelerations is always relaxed. However, according to the comments, the accelerations are relaxed on all but the first iteration and it would be implemented as

void Foam::sixDoFRigidBodyMotion::updateAcceleration
(
    const vector& fGlobal,
    const vector& tauGlobal
)
{
    static bool first = true;

    // Save the previous iteration accelerations for relaxation
    vector aPrevIter = a();
    vector tauPrevIter = tau();

    // Calculate new accelerations
    a() = fGlobal/mass_;
    tau() = (Q().T() & tauGlobal);
    applyRestraints();

    // Relax accelerations on all but first iteration
    if (!first)
    {
        a() = aRelax_*a() + (1 - aRelax_)*aPrevIter;
        tau() = aRelax_*tau() + (1 - aRelax_)*tauPrevIter;
    }
    else
    {
        first = false;
    }
}
TagsNo tags attached.

Activities

henry

2017-05-18 16:33

manager   ~0008159

Thanks for the bug-report and proposed correction.

Resolved in OpenFOAM-4.x by commit e4bbb069411349c9ec02829e0ec21c0c8f297034

Resolved in OpenFOAM-dev by commit 3cf57145d112e082f4db22b897ad10a74f46d4bf

Issue History

Date Modified Username Field Change
2017-05-16 02:51 morefool New Issue
2017-05-18 16:33 henry Assigned To => henry
2017-05-18 16:33 henry Status new => resolved
2017-05-18 16:33 henry Resolution open => fixed
2017-05-18 16:33 henry Fixed in Version => 4.x
2017-05-18 16:33 henry Note Added: 0008159