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

Use of a laplacian mesh motion solver with the 6DoF or rigidBodyMotion libraries

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Bloerb

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 10, 2019, 08:20
Default Use of a laplacian mesh motion solver with the 6DoF or rigidBodyMotion libraries
  #1
Member
 
Join Date: Sep 2018
Posts: 53
Rep Power: 8
tecmul is on a distinguished road
Hi all,
I'm trying to simulate the motion of multiple rigid bodies in a flow. The mesh motion solvers in the 6DoF and rigidBodyDynamics libraries aren't suitable for my geometry, I need velocityLaplacian or displacementLaplacian. This is has been done in these tutorials:

http://www.tfd.chalmers.se/~hani/kur...usUrquhart.pdf
http://www.tfd.chalmers.se/~hani/kur...Minghao_Wu.pdf

What they do is set the mesh motion solver to displacementLaplacian in the dynamicMeshDict file and apply a sixDoFRigidBodyDisplacement boundary condition to the patches corresponding to the rigid bodies in the pointMotionU file. However, from OpenFOAM 5 onward, the 6DoFDisplacement boundary condition has been removed. Apparently the condition was buggy in parallel: https://bugs.openfoam.org/view.php?id=2487

The reason for the removal is given here:
https://github.com/OpenFOAM/OpenFOAM...4de84638ad6933

Quote:
These legacy boundary conditions are no longer needed and have been superseded by the more flexible sixDoFRigidBodyMotion and rigidBodyMotion solvers. See tutorials:

incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_pimpleDyMFoam
multiphase/interDyMFoam/RAS/DTCHull
multiphase/interDyMFoam/RAS/floatingObject
The thing is, I can't figure out how to use the Laplacian mesh motion solvers in OpenFOAM 6 without using these boundary conditions. None of the tutorials do something like this as far as I'm aware. Is it even possible without a lot of coding?
tecmul is offline   Reply With Quote

Old   September 10, 2019, 15:05
Default
  #2
Senior Member
 
Join Date: Sep 2013
Posts: 353
Rep Power: 21
Bloerb will become famous soon enough
Here is an example with the rigidBody 6dof solver. This is essentially the same solver, there are however differences to the 6dof solver you are using. Which might be irrelevant. Nevertheless an example for that solver:

Code:
dynamicFvMesh       dynamicMotionSolverFvMesh;
motionSolverLibs   ("librigidBodyMeshMotion.so");
motionSolver        rigidBodyMotionSolver;
meshSolver          
{

   // replace this with your solver
    solver displacementLayeredMotion;
    regions
    {
        rotorZone
        {
            interpolationScheme linear;
            boundaryField
            {
                rotor
                {
                    type            follow;
                    patch           rotor; 
                }
                stator
                {
                    type            fixedValue;
                    value           uniform (0 0 0);
                }
            }
        }
    }
}


report              on;
rho                 rhoInf;
rhoInf              1000;
g                   (0 0 0);

solver
{
    type  Newmark;
    beta  0.5;
    gamma 0.25;
}

accelerationRelaxation 0.3;
//accelerationDamping    0.0;
nIter                  1;
/*
ramp table
(
    (0   0)
    (0.1 0)
);
*/

bodies
{
    rotor
    {
        type            sphere;
        parent          root;
        mass            8.15;
        radius          0.0399; 
        centreOfMass    (0 0 0);
        transform       (1 0 0 0 1 0 0 0 1) (0 0 0);

        joint
        {
                type  composite;
                joints
                (
                    { type Px; }
                    { type Py; }
                );
        }

        patches         (rotor);
        //innerDistance   0;
        //outerDistance   0.00029526;
    }
}
    
restraints
{
    linearSpring
    {
        type            linearSpring;
        anchor          (0 0 0);
        restLength      0;
        body            rotor;
        refAttachmentPt (0 0 0);
        stiffness       125000;
        damping         404;
    }  
}
Bloerb is offline   Reply With Quote

Old   September 11, 2019, 10:07
Default
  #3
Member
 
Join Date: Sep 2018
Posts: 53
Rep Power: 8
tecmul is on a distinguished road
This works like a charm, thanks a lot.
One question, how did you learn how to do this? A tutorial? Reading the source code? Asking someone else?
tecmul is offline   Reply With Quote

Old   September 11, 2019, 10:13
Default
  #4
Senior Member
 
Join Date: Sep 2013
Posts: 353
Rep Power: 21
Bloerb will become famous soon enough
Reading the source code of the rigid body library and most importantly many years of experience
tecmul likes this.
Bloerb is offline   Reply With Quote

Old   June 26, 2020, 07:45
Default How to modify oscillatingDisplacement input values to only Displacement values
  #5
New Member
 
sreekanth
Join Date: Dec 2019
Posts: 13
Rep Power: 6
neko2650 is on a distinguished road
Hello,


My case is similar to the study done by http://www.tfd.chalmers.se/~hani/kur...usUrquhart.pdf



From the above report in section 1.4.3 the author used oscillatingDisplacement for floatingObject


Code:


floatingObject
{
type            oscillatingDisplacement;
amplitude       (0.03 0 0);
omega           6;
value           uniform (0 0 0);
}


In my case I would like to provide displacement from a text file (for example earthquake time history data for base excitation).


Is there a way to do it and how to import data or txt file into pointfields file. Any suggestions will be helpful.



Thanks in advance
neko2650 is offline   Reply With Quote

Old   June 26, 2020, 08:19
Default
  #6
Member
 
Join Date: Sep 2018
Posts: 53
Rep Power: 8
tecmul is on a distinguished road
Quote:
Originally Posted by neko2650 View Post
Is there a way to do it and how to import data or txt file into pointfields file. Any suggestions will be helpful.
Sure, you can modify the oscillatingDisplacement class by adding a member of type interpolationTable. Then you can specify the address of the file you want it to read from in the same way you specify omega or amplitude.

If the member variable is called, for example, basePosition, then to lookup a value from the file at time "t", you can write:
Code:
scalar value = basePosition(t);
Look into code that makes use of the interpolationTable class for clear examples.
tecmul is offline   Reply With Quote

Old   June 26, 2020, 09:58
Default
  #7
New Member
 
sreekanth
Join Date: Dec 2019
Posts: 13
Rep Power: 6
neko2650 is on a distinguished road
Thank you for immediate response.
I tried looking for examples in tutorials for type interpolationTable but didnt found but I found an example usage in API
URL: https://cpp.openfoam.org/v5/classFoa...tionTable.html

Code:
 
readerType      csv;     
fileName        "$FOAM_CASE/constant/p0vsTime.csv";     
hasHeaderLine   true;   // skip first line     
timeColumn      0;      // time is in column 0     
valueColumns    (1);    // value starts in column 1
I have a small doubt regarding
Quote:
Sure, you can modify the oscillatingDisplacement class by adding a member of type interpolationTable.
Here how can I modify oscillatingDisplacement class i.e should I add the above lines in

Code:
floatingObject
{
 type            oscillatingDisplacement;
...
}
or do I need to modify src file and generate a custom for example MyoscillatingDisplacement class file
neko2650 is offline   Reply With Quote

Old   June 26, 2020, 10:07
Default
  #8
Member
 
Join Date: Sep 2018
Posts: 53
Rep Power: 8
tecmul is on a distinguished road
You need to modify the original header and source files and compile them as a new boundary condition. Once that's done, the lines fileName, hasHeaderLine... are added in the pointDisplacement file under whichever patch is supposed to move.

If you can't find examples for interpolationTable, try the timeFunction1 class, it provides similar functionality.
tecmul is offline   Reply With Quote

Old   February 11, 2022, 11:59
Default
  #9
Senior Member
 
TWB
Join Date: Mar 2009
Posts: 414
Rep Power: 19
quarkz is on a distinguished road
Quote:
Originally Posted by Bloerb View Post
Here is an example with the rigidBody 6dof solver. This is essentially the same solver, there are however differences to the 6dof solver you are using. Which might be irrelevant. Nevertheless an example for that solver:

Code:
dynamicFvMesh       dynamicMotionSolverFvMesh;
motionSolverLibs   ("librigidBodyMeshMotion.so");
motionSolver        rigidBodyMotionSolver;
meshSolver          
{

   // replace this with your solver
    solver displacementLayeredMotion;
    regions
    {
        rotorZone
        {
            interpolationScheme linear;
            boundaryField
            {
                rotor
                {
                    type            follow;
                    patch           rotor; 
                }
                stator
                {
                    type            fixedValue;
                    value           uniform (0 0 0);
                }
            }
        }
    }
}


report              on;
rho                 rhoInf;
rhoInf              1000;
g                   (0 0 0);

solver
{
    type  Newmark;
    beta  0.5;
    gamma 0.25;
}

accelerationRelaxation 0.3;
//accelerationDamping    0.0;
nIter                  1;
/*
ramp table
(
    (0   0)
    (0.1 0)
);
*/

bodies
{
    rotor
    {
        type            sphere;
        parent          root;
        mass            8.15;
        radius          0.0399; 
        centreOfMass    (0 0 0);
        transform       (1 0 0 0 1 0 0 0 1) (0 0 0);

        joint
        {
                type  composite;
                joints
                (
                    { type Px; }
                    { type Py; }
                );
        }

        patches         (rotor);
        //innerDistance   0;
        //outerDistance   0.00029526;
    }
}
    
restraints
{
    linearSpring
    {
        type            linearSpring;
        anchor          (0 0 0);
        restLength      0;
        body            rotor;
        refAttachmentPt (0 0 0);
        stiffness       125000;
        damping         404;
    }  
}
Hi all, I have a problem involving 6dof with wing deformation. So the wing is undergoing a prescribed folding deformation. At the same time, it is constrained to pitch up or down through 6dof. So can I use the above approach to model this?

Btw, I have written the prescribed folding deformation based on the oscillatingDisplacement code.

Thanks.
quarkz is offline   Reply With Quote

Reply

Tags
6dof, displacementlaplacian, rigidbodydisplacement, sixdof, velocitylaplacian


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
Coupling a mesh motion based solver with sixDoFSolidBodyMotion saifullahkhalid OpenFOAM 0 April 23, 2019 09:00
Difficulty in calculating angular velocity of Savonius turbine simulation alfaruk CFX 14 March 17, 2017 07:08
How to let the mesh motion solver just solve a small region near a moving boundary? zhajingjing OpenFOAM Running, Solving & CFD 9 April 28, 2016 05:15
[snappyHexMesh] No layers in a small gap bobburnquist OpenFOAM Meshing & Mesh Conversion 6 August 26, 2015 10:38
fluent add additional zones for the mesh file SSL FLUENT 2 January 26, 2008 12:55


All times are GMT -4. The time now is 07:55.