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

Calculating rather than prescribing solid body motion using immersed boundary method?

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By courant_numero_uno
  • 1 Post By courant_numero_uno

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 25, 2019, 19:47
Default Calculating rather than prescribing solid body motion using immersed boundary method?
  #1
New Member
 
Join Date: Sep 2019
Posts: 17
Rep Power: 6
courant_numero_uno is on a distinguished road
Hello,


I am using foam-extend-4.0. I have a simulation working using the movingCylinderInChannelIco tutorial, which uses the immersed boundary method. The dynamicMeshDict uses immersedBoundarySolidBodyMotionFvMesh:


Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | foam-extend: Open Source CFD                    |
|  \\    /   O peration     | Version:     4.0                                |
|   \\  /    A nd           | Web:         http://www.foam-extend.org         |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      dynamicMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

// dynamicFvMesh   staticFvMesh;
dynamicFvMesh   immersedBoundarySolidBodyMotionFvMesh;

immersedBoundarySolidBodyMotionFvMeshCoeffs
{
    motionFunctions
    (
        cylinder
        {
//             solidBodyMotionFunction     translation;
//             translationCoeffs
//             {
//                 velocity (0.1 0 0);
//             }

            solidBodyMotionFunction     linearOscillation;
            linearOscillationCoeffs
            {
                amplitude    (0 0.3 0);
                period       1.5;
            }
        }
    );
}


// ************************************************************************* //
However, I would like to calculate the motion of the cylinder rather than define it. Specifically, to simulate vibrations using a spring restraint. For example, I have a dynamicMeshDict using dynamicMotionSolverFvMesh, which works:


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

//staticFvMeshCoeffs
//{
//}

motionSolverLibs ( "libsixDoFRigidBodyMotion.so" );

solver          sixDoFRigidBodyMotion;

//diffusivity     quadratic inverseDistance 1 ( cylinder );

sixDoFRigidBodyMotionCoeffs
{
    patches         ( cylinder );
    
    innerDistance   0.05;
    
    outerDistance   0.7;
    
    
    centreOfMass    ( 0 0 0 );
    mass            75.362562415;
    g               ( 0 0 -9.8065 );
    momentOfInertia ( 2.7874e+08 5.8901e+08 6.6762e+08 );
    velocity        ( 0 0 0 );
    rho             rhoInf;
    rhoInf          1.225;
    accelerationRelaxation 0.5;
    //accelerationDamping 0.95;
    report          on;
    reportToFile    on;
    solver
    {
        type            Newmark;
    }
    constraints
    {
        onlymoveiny
        {
            sixDoFRigidBodyMotionConstraint     line;
            direction                            (0 1 0);
        }
        
        norotation
        {
            sixDoFRigidBodyMotionConstraint     orientation;
        }
        

    }
    restraints
    {
        spring
        {
            sixDoFRigidBodyMotionRestraint        linearSpring;
            anchor                                (0 1.8 0);
            refAttachmentPt                        (0 0 0);
            stiffness                            40000;
            damping                                3.47246454;
            restLength                            1.8;
        }
    }
}

/*
dynamicFvMesh      dynamicMotionSolverFvMesh;

motionSolverLibs ("libsixDoFRigidBodyMotion.so");

motionSolver    sixDoFRigidBodyMotion;

diffusivity        quadratic inverseDistance 1 ( cylinder );

patches         (cylinder);
innerDistance   0.3;
outerDistance   1;

mass            4;
centreOfMass    (0 0 0);
momentOfInertia (1.958864357 3.920839234 2.057121362);
orientation
(
    0.9953705935 0.09611129781 0
    -0.09611129781 0.9953705935 0
    0 0 1
);


g               (0 -9.81 0);
rho             rhoInf;
rhoInf          1;
report          on;

solver
{
    type symplectic;
}

constraints
{
    fixedLine
    {
        sixDoFRigidBodyMotionConstraint fixedAxis;
        axis (0 1 0)
    }

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

restraints
{
    verticalSpring
    {
        sixDoFRigidBodyMotionRestraint linearSpring;

        anchor          (0 1.8 0);
        refAttachmentPt (0 0 0);
        stiffness       4000;
        damping         2;
        restLength      1.8;
    }
}

*/ 


// ************************************************************************* //
Is it possible to implement restraints and solid body motion solvers into the immersed boundary method? How would I accomplish this?


Thanks!
andrewbickerdike likes this.
courant_numero_uno is offline   Reply With Quote

Old   October 12, 2019, 11:26
Default
  #2
New Member
 
Join Date: Sep 2019
Posts: 17
Rep Power: 6
courant_numero_uno is on a distinguished road
To answer my own question, there is a good tutorial here:


http://www.tfd.chalmers.se/~hani/kur...eirsson/OF.pdf


Though I had some issues with the code which I posted about here:

OpenFOAM Immersed Boundary Method - forceBased motion class creation


Additionally, this tutorial seems to encounter issues with the forces jumping sporadically.. believe this issue is due to the way the code uses loops. In my code, I implemented an "acceleration relaxation/damping" which sort of helps mitigate the sudden jumping, but I'm still working on getting it to run smoothly.
andrewbickerdike likes this.
courant_numero_uno is offline   Reply With Quote

Old   November 22, 2021, 09:28
Default
  #3
New Member
 
Andrew Bickerdike
Join Date: Feb 2021
Posts: 6
Rep Power: 5
andrewbickerdike is on a distinguished road
Hi,

Did you manage to get this code working?

Thanks.
andrewbickerdike 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
Solid body motion on boundary and not entire mesh twinturbotom OpenFOAM Running, Solving & CFD 1 June 5, 2020 07:02
Question about adaptive timestepping Guille1811 CFX 25 November 12, 2017 17:38
Difficulty in calculating angular velocity of Savonius turbine simulation alfaruk CFX 14 March 17, 2017 06:08
Drawing 3d body and immersed boundary method (IBM) quarkz Main CFD Forum 0 December 16, 2011 17:59
Immersed Boundary Ghost Cell Method thehexman Main CFD Forum 1 February 5, 2010 06:10


All times are GMT -4. The time now is 15:44.