CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

pimpleFoam RigidBodyMotion restraint issue

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 11, 2020, 06:35
Default pimpleFoam RigidBodyMotion restraint issue
  #1
New Member
 
Max Spencer
Join Date: Dec 2019
Posts: 11
Rep Power: 7
spenceme is on a distinguished road
I am trying to simulate the rigid body motion of a body in a flow of water and am having issues with what appears to be getting the restraints to work properly. I have built my setup from a combination of the wingMotion 2D and the DTCHullMoving tutorials. I'm starting by running a simple foam case to steady state and then moving to pimpleFoam as done in the tutorials.


Pimple starts and runs okay for the first 5-20ms with Co <1. Then on one time step the solution blows up. From the first results, I can see the body is pivoting about the correct point listed in the transform location of the dynamicMeshDict. But the restraints do not seem to be applied. The linear spring restraints should induce motion in the positive X angular direction. Instead the X angular direction is always negative and building regardless of how I change the spring constraints.



(I really need to use the softWall restraints, hence I am using the RigidBodyMotion solver instead of sixDoF, but I am testing with linearSprings for troubleshooting.)

My sequence is:
1) simpleFoam
2) copy the simpleFoam/constant/polymesh over to the pimpleFoam/constant directory
3) mapFields from simpleFoam with -sourceTime latestTime -consistent
4) decomposePar
5) run pimpleFoam

Is there something in my sequence I am missing to get the restraints to properly act on my solid body?

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v1912                                 |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      dynamicMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dynamicFvMesh   dynamicMotionSolverFvMesh;

motionSolverLibs (rigidBodyMeshMotion);

motionSolver    rigidBodyMotion;  //sixDoFRigidBodyMotion

rho             rhoInf;
rhoInf          1000;

rigidBodyMotionCoeffs 
{

accelerationRelaxation 0.4;

rho             rhoInf;
rhoInf          1000;

report        on;

bodies
{
    hull
    {
        type            rigidBody;
        parent          root;

        centreOfMass    (0.6 0.3 0.06);
        mass            5;
        inertia         (40 0 0 921 0 921);  //(Ixx Ixy Ixz Iyy Iyz Izz)
        transform       (1 0 0 0 1 0 0 0 1) (0.23 0.016 0.05);

        joint
        {
        type    composite;
        joints
        (
//        {
//            type Pz;
//        }
        {
            type Rx;
        }
        {
            type Ry;
        }
        {
            type Rz;
        }
        );
        }

        patches         (motorBikeGroup);
        innerDistance   0.001;
        outerDistance   .5;
//    mergeWith    pivot;
    }
/*
    pivot
    {
    type        masslessBody;
//    parent        root;
    transform     (1 0 0 0 1 0 0 0 1) (0.23 0.016 0.05);
    joint
    {
        type    composite;
        joints
        (
        {
            type Pz;
        }
        {
            type Rx;
        }
        {
            type Ry;
        }
        {
            type Rz;
        }
        );
    }
    mergeWith    hull;
    }
*/
}

solver
{
    type Newmark;
}

}

restraints
{
/*
    lowerWall_restraint_brush_front
    {
        type        softWall;
    body        hull;        
    anchor          (0.03 0.312 0.017);
        refAttachmentPt (0.03 0.312 0.007);
        wallNormal      (0 0 1);
        psi        2.0;
        C        0.01;
    }
    
    lowerWall_restraint_brush_rear
    {
        type        softWall;
    body        hull;        
    anchor          (1.528 0.312 0.017);
        refAttachmentPt (1.528 0.312 0.007);
        wallNormal      (0 0 1);
        psi        20;
        C        0.01;
    }
    
    lowerWall_restraint_bumper
    {
        type        softWall;
    body        hull;        
    anchor          (0.23 0.016 0.0122);
        refAttachmentPt (0.23 0.016 0.0022);
        wallNormal      (0 0 1);
        psi        20;
        C        0.01;
    }
*/
    vertical_spring_front
    {
    body        hull;
        type        linearSpring;
    anchor        (1.52473 0.313032 0.10731892);
        refAttachmentPt    (1.52473 0.313032 0.00731892);
    stiffness    500000;
    damping        1;
        restLength    0.05;
    }

    vertical_spring_rear
    {
    body        hull;
        type        linearSpring;
    anchor        (0.0295147 0.311627 0.10751479);
        refAttachmentPt    (0.0295147 0.311627 0.00751479);
    stiffness    500000;
    damping        1;
        restLength    0.05;
    }

}


// ************************************************************************* //
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v1912                                 |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application     pimpleFoam;

startFrom       latestTime;

//startTime       0;

stopAt          endTime;

endTime         0.1;

deltaT          1e-5;

writeControl    adjustable;

writeInterval   5e-3;

purgeWrite      0;

writeFormat     ascii;

writePrecision  10;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable true;

adjustTimeStep  yes;

maxCo           0.9;  //0.9

functions
{
/*    
    rigidBodyState
    {
        type           rigidBodyState;
        libs           ("librigidBodyState.so");
        angleFormat    degrees;
    }
*/

    #include "ensightWrite"
}

// ************************************************************************* //
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v1912                                 |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solvers
{
    "pcorr.*"
    {
        solver           GAMG;
        tolerance        0.01;
        relTol           0;
        smoother         GaussSeidel;
    }

    p
    {
        $pcorr;
        tolerance        1e-7;
        relTol           0.001;
    }

    pFinal
    {
        $p;
        tolerance        1e-7;
        relTol           0;
    }

    "(U|k|omega)"
    {
        solver          smoothSolver;
        smoother        symGaussSeidel;
        tolerance       1e-06;
        relTol          0.01;
    }

    "(U|k|omega)Final"
    {
        $U;
        tolerance       1e-06;
        relTol          0;
    }

    cellDisplacement
    {
        solver          GAMG;
        tolerance       1e-5;
        relTol          0;
        smoother        GaussSeidel;
    }
}

PIMPLE
{
    correctPhi          yes;
    nOuterCorrectors    50;
    nCorrectors         1;
    nNonOrthogonalCorrectors 3;
    residualControl
    {
        "(U|p|k|omega)"            
        {
            tolerance    2e-4;
            relTol        0;
        }
    }
}

relaxationFactors
{
    fields
    {
        p               1; //.3
    pFinal        1;
    }
    equations
    {
        "(U|k|omega)"   1;
        "(U|k|omega)Final" 1.0;
    }
}

cache
{
    grad(U);
}

// ************************************************************************* //
spenceme is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
pimpleFoam runs slower than rhoPimpleFoam Kosuke Seto OpenFOAM Running, Solving & CFD 3 May 27, 2023 15:12
pisoFoam and pimpleFoam are unstable in foam-extend 4.0/4.1 (misunderstanding ?) Kombinator OpenFOAM Running, Solving & CFD 4 January 14, 2021 05:10
Merge time folder for pimpleFoam case run in two separate PCs Ruonin OpenFOAM Post-Processing 1 April 24, 2019 07:59
rhoCentralFoam inviscid airfoil issue (Foam::error::printStack(Foam::Ostream&) at ??) kmkb21 OpenFOAM Running, Solving & CFD 1 March 1, 2018 02:07
Prism Layer - Core Mesh Boundary Issue InfernoxCJC STAR-CCM+ 7 November 21, 2017 16:46


All times are GMT -4. The time now is 23:24.