CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Massless 6DOF Simulation (https://www.cfd-online.com/Forums/openfoam-solving/166609-massless-6dof-simulation.html)

Mojtaba.a February 13, 2016 07:43

Massless 6DOF Simulation
 
Hello,
My question is as simple as it appears. Whenever I use zero mass in my 6DOF simulations, the solver (namely pimpleDyMFoam) blows up at the start of the process with Floating point exception. However zero mass in a sixDOF problem isn't impossible. Here is my DynamicMeshDict:

Code:

dynamicFvMesh      dynamicMotionSolverFvMesh;

motionSolverLibs ("libsixDoFRigidBodyMotion.so");

solver            sixDoFRigidBodyMotion;

sixDoFRigidBodyMotionCoeffs
{
    patches        (cylinder);
    innerDistance  1;
    outerDistance  20;

    mass            0;
    momentOfInertia (0.01 0.01 0.01);
    centreOfMass    (0 0 0);
    orientation
    (
        1 0 0
        0 1 0
        0 0 1
    );
    velocity        (0 0 0);
    acceleration    (0 0 0);
    angularMomentum (0 0 0);
    torque          (0 0 0);
    g              (0 0 0);
    rhoName        rhoInf;
    rhoInf          1;
    report          on;
    accelerationRelaxation 0.3;
    value          uniform (0 0 0);

    solver
    {
        type symplectic;
    }

    constraints
    {
    transverse
    {
        sixDoFRigidBodyMotionConstraint line;
        tolerance 1e-6;
        relaxationFactor 0.7;
        refPoint (0 0 0);
        direction (0 1 0);
    }

    noRotation
    {
        sixDoFRigidBodyMotionConstraint orientation;
        orientation (1 0 0 0 1 0 0 0 1);
    }

        zAxis
        {
            sixDoFRigidBodyMotionConstraint axis;
            axis                (0 0 1);
        }

    }

    restraints
    {
    translationSpring&Damper
    {
        sixDoFRigidBodyMotionRestraint linearSpring;
        anchor          (0 -10 0);
        refAttachmentPt (0 0 0);
        stiffness      0;
        damping        0;
        restLength      10;
    }
    }
}

It doesn't have any problems with a non-zero mass. Well This means that mass parameter is in a denominator somewhere in the main code. So I checked the code and found this:

Code:

void Foam::::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;
}

This is the only place where mass in in the denominator. From Newton's Second law a = F/m.
Any Ideas how I can solve a 6DOF problem with zero mass?

Mojtaba.a February 14, 2016 07:54

The only workaround I have found so far is to set very low amounts of mass and accelerationRelaxation:

Quote:

mass 0.001;

accelerationRelaxation 0.001;


All times are GMT -4. The time now is 21:04.