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/)
-   -   Applying restraints in openfoam (https://www.cfd-online.com/Forums/openfoam-solving/224339-applying-restraints-openfoam.html)

Taghi February 14, 2020 09:16

Applying restraints in openfoam
 
Hi foamers.
I am trying to attach a rope to the object in floating object sample in blueCFD 2017_2 (OF 5).
I've added some lines to "dynamicMeshDict.sixDoF" file as below but it has no effect on the original tutorial answer.
Does anyone have any Idea how to apply these kind of restrains?
Code:

dynamicFvMesh      dynamicMotionSolverFvMesh;

motionSolverLibs    ("libsixDoFRigidBodyMotion.so");

motionSolver        sixDoFRigidBodyMotion;

sixDoFRigidBodyMotionCoeffs
{
    patches        (floatingObject);
    innerDistance  0.05;
    outerDistance  0.35;

    centreOfMass    (0.5 0.45 0.35);

    // Cuboid dimensions
    Lx              0.3;
    Ly              0.2;
    Lz              0.5;

    // Density of the solid
    rhoSolid        999;

    // Cuboid mass
    mass            #calc "$rhoSolid*$Lx*$Ly*$Lz";

    // Cuboid moment of inertia about the centre of mass
    momentOfInertia #codeStream
    {
        codeInclude
        #{
            #include "diagTensor.H"
        #};

        code
        #{
            scalar sqrLx = sqr($Lx);
            scalar sqrLy = sqr($Ly);
            scalar sqrLz = sqr($Lz);
            os  <<
                $mass
              *diagTensor(sqrLy + sqrLz, sqrLx + sqrLz, sqrLx + sqrLy)/12.0;
        #};
    };

    report          on;
    accelerationRelaxation 0.7;
    //accelerationDamping 0;

    solver
    {
        type Newmark;
    }

    constraints
    {
        // fixedPoint
        // {
        //    sixDoFRigidBodyMotionConstraint point;
        //    centreOfRotation (0.5 0.45 0.1);
        // }

        fixedLine
        {
            sixDoFRigidBodyMotionConstraint line;
            centreOfRotation (0.5 0.45 0.1);
            direction (0 1 0);
        }

        fixedAxis
        {
            sixDoFRigidBodyMotionConstraint axis;
            axis (0 1 0);
        }
    }
    restraints
{
    chain
    {
        sixDoFRigidBodyMotionRestraint  linearSpringDamper;
        refAttachmentPt    (0 0 0);
        anchor              table
        (
            (0        (0.3 0.2 0.5))
            (2        (0.3 0.2 0.5))
            (6        (0.3 0.2 0.5))
            (8        (0.3 0.2 0.5))

        );
        psi                10;
        wn                  8.28;
        numberOfChains      4;
        restLength          0.6245;
    }
}
}


Yann February 17, 2020 03:17

Hello Taghi,


Have you checked your allRun script and dynamicMeshDict file to see if there is any reference to the "dynamicMeshDict.sixDoF" file somewhere?


AFAIK, solvers only check for the constant/dynamicMeshDict, unless specified otherwise.


My best bet is that your dynamicMeshDict.sixDoF is simply not used at all in the tutorial you're running, but it's here to offer another setup for dynamic mesh. Replace your current dynamicMeshDict file with the content of your dynamicMeshDict.sixDoF file and see if it solves your problem.


Cheers,
Yann

Taghi February 27, 2020 12:09

Tnx a zillion times
"dynamicMeshDict.sixDoF" was meant to be replaced to "dynamicMeshDict".
problem solved


All times are GMT -4. The time now is 16:02.