CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (https://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   oscillating cylinder dynamic mesh (https://www.cfd-online.com/Forums/openfoam-pre-processing/131044-oscillating-cylinder-dynamic-mesh.html)

Scabbard June 16, 2014 08:54

Quote:

Originally Posted by Maimouna (Post 497209)
Hi Scabbard,

of course, I need your help. I'm struggling on that for long time. If you don't mind please we can shear your idea and I would be really grateful.

My email address is: may78may@hotmail.com

Best regards
Maimouna

Code:

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

dynamicFvMesh      dynamicMotionSolverFvMesh;

motionSolverLibs ("libsixDoFRigidBodyMotion.so");

solver            sixDoFRigidBodyMotion;

sixDoFRigidBodyMotionCoeffs
{
    patches        (CYLINDER);
    innerDistance  1; // motion area
    outerDistance  2; // dynamic mesh area

    mass            9.97; // mass
    centreOfMass    (0 0 0.29);
    momentOfInertia (0.055 0.055 1);
    g              (0 0 -9.81);
    orientation
    (
        1 0 0
        0 1 0
        0 0 1
    );
    angularMomentum (0 0 0);
    rhoName        rhoInf;
    rhoInf          1000;
    report          on;

    constraints
    {
        maxIteration 500;

        noRotate1
        {
            sixDoFRigidBodyMotionConstraint axis;
            axis            (0 0 1);
        }
        noRotate2
        {
            sixDoFRigidBodyMotionConstraint axis;
            axis            (1 0 0);
        }
        noRotate3
        {
            sixDoFRigidBodyMotionConstraint axis;
            axis            (0 1 0);
        }
        zPlane
        {
            sixDoFRigidBodyMotionConstraint plane;
            normal          (0 0 1);
        }
    }

    restraints
    {
        verticalSpring1
        {
            sixDoFRigidBodyMotionRestraint linearSpring;

            anchor          (2 0 0);//spring attached point on bottom
            refAttachmentPt (1 0 0.384);//spring attached point on cylinder
            stiffness      2.3225;
            damping        0.109;
            restLength      1;//?
        }
        verticalSpring2
      {
            sixDoFRigidBodyMotionRestraint linearSpring;

            anchor          (0 -2 0);//spring attached point on bottom
            refAttachmentPt (0 -1 0.384);//spring attached point on cylinder
            stiffness      2.3225;
            damping        0.109;
            restLength      1;//?
        }
        verticalSpring3
      {
            sixDoFRigidBodyMotionRestraint linearSpring;

            anchor          (-2 0 0);//spring attached point on bottom
            refAttachmentPt (-1 0 0.384);//spring attached point on cylinder
            stiffness      2.3225;
            damping        0.109;
            restLength      1;//?
        }
        verticalSpring4
      {
            sixDoFRigidBodyMotionRestraint linearSpring;

            anchor          (0 2 0);//spring attached point on bottom
            refAttachmentPt (0 1 0.384);//spring attached point on cylinder
            stiffness      2.3225;
            damping        0.109;
            restLength      1;//?
        }
}


// ************************************************************************* //

Hi Maimouna,

here is my dynamicMeshDict

the only one which I am not sure is the restLength.
I have 4 verticalSpring attached on the cylinder

Best wishes,
Scabbard

Maimouna June 16, 2014 09:38

Dear Scabbard,

many thanks. What about pointDisplacement file and motionU?

Scabbard June 16, 2014 10:19

Quote:

Originally Posted by Maimouna (Post 497228)
Dear Scabbard,

many thanks. What about pointDisplacement file and motionU?

Hi Maimouna,

Do not need to put motionU in to the 0, MotionScale will be automatically generated.

Best wishes,
Scabbard

Maimouna June 16, 2014 10:47

In my case, I deleated pointDisplacement and pointMotionU, but it gives me this error message

Quote:

Create time

Create mesh for time = 0

Selecting dynamicFvMesh dynamicMotionSolverFvMesh
Selecting motion solver: sixDoFRigidBodyMotion
--> FOAM Warning :
From function dlOpen(const fileName&, const bool)
in file POSIX.C at line 1179
dlopen error : libsixDoFRigidBodyMotion.so: cannot open shared object file: No such file or directory
--> FOAM Warning :
From function dlLibraryTable::open(const fileName&, const bool)
in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 99
could not load "libsixDoFRigidBodyMotion.so"
--> FOAM Warning :
From function dlLibraryTable::open(const dictionary&, const word&, const TablePtr&)
in file /home/maimouna/OpenFOAM/OpenFOAM-2.2.2/src/OpenFOAM/lnInclude/dlLibraryTableTemplates.C at line 67
Could not open library "libsixDoFRigidBodyMotion.so"



--> FOAM FATAL ERROR:
solver table is empty

From function motionSolver::New(const polyMesh& mesh)
in file motionSolver/motionSolver/motionSolver.C at line 117.

FOAM exiting



What does it mean? What's the problem?

Regards





Scabbard June 16, 2014 10:50

Quote:

Originally Posted by Maimouna (Post 497245)
In my case, I deleated pointDisplacement and pointMotionU, but it gives me this error message

[/COLOR]


What does it mean? What's the problem?

Regards





Hi Maimouna,

which version of OpenFoam are you using?

Best wishes,
Scabbard

Maimouna June 16, 2014 10:55

Dear Scabbard, I'm using OpenFOAM-2.2.2.

Scabbard June 16, 2014 10:57

Quote:

Originally Posted by Maimouna (Post 497247)
Dear Scabbard, I'm using OpenFOAM-2.2.2.

Could you send your case to me, so I can test whether it can run on Openfoam

Best wishes,
Scabbard

Maimouna June 16, 2014 11:07

1 Attachment(s)
Dear Scabbard,

I attached you my case.

With million of thanks.

Scabbard June 16, 2014 11:23

Quote:

Originally Posted by Maimouna (Post 497251)
Dear Scabbard,

I attached you my case.

With million of thanks.

Seems like you use anther mesh tools which I do not have.

Best wishes,
Scabbard

Maimouna June 16, 2014 11:31

Dear Scabbard,

what mesh tools you used in your case?

Scabbard June 16, 2014 11:37

Quote:

Originally Posted by Maimouna (Post 497256)
Dear Scabbard,

what mesh tools you used in your case?

Hi Maimouna,

ICEM is the tools which I use, because your polyMesh only have the boundary so
I can not run the case

Best wishes,
Scabbard

Maimouna June 16, 2014 11:43

Dear Scabbard,

my running case is following these steps
./Allclean
./Allprepare
pimpleDyMFoam

Scabbard June 16, 2014 11:51

Quote:

Originally Posted by Maimouna (Post 497260)
Dear Scabbard,

my running case is following these steps
./Allclean
./Allprepare
pimpleDyMFoam

Hi Maimouna

It is seems like I do not have the gmsh.

Best wishes,
Scabbard

Maimouna June 16, 2014 11:58

Quote:

Hi Maimouna

It is seems like I do not have the gmsh.

Best wishes,
Scabbard
Dear Scabbard,

no worries, I'll try to solve the problem.

Best wishes
Maimouna

Maimouna September 15, 2014 11:11

Naturally vibration of the circular cylinder
 
Dear OpenFOAM user,

I'm trying to let the cylinder moves in both x and y direction. I'm using for that OF230 and pimpleDyMFoam solver. It's moves in x direction itself and y direction itself. Now, I'm trying to keep it moves in x and y direction naturally at the same time. This is my dynamisMeshDict file
Code:

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

dynamicFvMesh      dynamicMotionSolverFvMesh;

motionSolverLibs ("libsixDoFRigidBodyMotion.so");

solver            sixDoFRigidBodyMotion;

sixDoFRigidBodyMotionCoeffs
{
// D = 1m (r=0.5); L=1m
// Volume of cylinder V = D^2*pi/4 * L = 1^2*pi/4 * 1 = 0.25*pi
    patches        (cylinder);
    innerDistance  0.35;  //??
    outerDistance  2.5;  //??

    mass            9.97;    // m = 9.97 => rho_cylinder = m/V = 12.6946 [kg/m^3] ??only??
    centreOfMass    (4 0 0.5); //was (0 0 0.29); (Overall domain bounding box (0 -4 0) (16 4 1))
    momentOfInertia  (1.4539 1.4539 1.24625);//J = m*(1/12*(3*r^2 + L^2)  1/12*(3*r^2 + L^2)  r^2/2)
                                            //J = m*(0.14583  0.14583  0.125)
    g              (0 -9.81 0); //was (0 0 -9.81);
    orientation
    (
        1 0 0
        0 1 0
        0 0 1
    );
    angularMomentum (0 0 0);
    rhoName        rhoInf;
    rhoInf          1;  // rho_cylinder is very small for this
    report          on;

    constraints
    {
        maxIteration 500;

        noRotate1
        {
            sixDoFRigidBodyMotionConstraint axis;
            axis            (0 0 1);
        }
        noRotate2
        {
            sixDoFRigidBodyMotionConstraint axis;
            axis            (1 0 0);
        }
        noRotate3
        {
            sixDoFRigidBodyMotionConstraint axis;
            axis            (0 1 0);
        }

      // xLine
      // {
      //    sixDoFRigidBodyMotionConstraint line;
      //    direction      (1 0 0);
      // }
 
      // yLine
      // {
      //    sixDoFRigidBodyMotionConstraint line;
      //    direction      (0 1 0);
      // }

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

        zPlane
        {
            sixDoFRigidBodyMotionConstraint plane;
            normal          (0 0 1);
      }
    }

    restraints  //motion is constrained to z=const plane, so linear springs are neaded only for x and y direction.
    {
        horisontalSpring
        {
            sixDoFRigidBodyMotionRestraint linearSpring;

            anchor          (4 0 0.5); // was (0.2 0 0);//?
            refAttachmentPt (4 0 0.5); // was (0.092 0 0.384);//spring attached point on cylinder
            stiffness      4000;//?
            damping        2;//?
            restLength      0;//??
        }

        verticalSpring
      {
            sixDoFRigidBodyMotionRestraint linearSpring;

            anchor          (4 0 0.5);
            refAttachmentPt (4 0 0.5);
            stiffness      4000;//?
            damping        2;//?
            restLength      0;//??
        }


    //spring
      //  {
      //      sixDoFRigidBodyMotionRestraint linearSpring;
 
      //      anchor          (4 0 0.5); // was (0.2 0 0);//?
      //      refAttachmentPt (4 0 0.5); // was (0.092 0 0.384);//spring attached point on cylinder
      //      stiffness      4000; //2.3225;// you should calculate it for your problem
      //      damping        2; //0.001;// this may be 0 or calculated for your problem
    //      restLength      0;
    //  }
 
    }
}


// ************************************************************************* //

Could you please check it for me. What's wrong? How to make cylinder moves in both directions? Are there any constraints problem? What about spring stiffness and damping, are they ok? What else?

Any answer would be welcomed?

Thanks in advanced and regards.

Maimouna

alirezahd September 27, 2014 07:40

Quote:

Originally Posted by Maimouna (Post 497209)
Hi Scabbard,

of course, I need your help. I'm struggling on that for long time. If you don't mind please we can shear your idea and I would be really grateful.

My email address is: may78may@hotmail.com

Best regards
Maimouna

hi dear Maimouna
i did the oscillation on cylinder using OF 2.0.1 everything seems ok but i cant valid my result by comparing the lift coeffs. i've downloaded your case but you said it works on OF versions (2.2.2 and 2.3.0) so unfortunately i couldn't run your file and compare it.
my problem is how to define measure of omega in ponitDisplacement file. according to the papers lock in occurs in 0.9<F<1.1 that F=f0/fs where f0 is the forced oscillation frequency and fs refers to the Strouhal frequency for
the fixed cylinder.
in my case Re=100 u=0.004016 d=0.025 St@Re100=0.165 so fs=0.0265 for F=1 f0=fs then omega is 2*pi*0.0265=0.166
is it right way or not? or problem is in my code?
Thanks and Regards,
alireza heidari.

Maimouna September 27, 2014 12:05

Dear Alireza,

what's the problem in my case? What's the error you get?

Could you please send me your case to have a look? My email: may78may@hotmail.com.

Kind regards

wyldckat September 28, 2014 15:11

Greetings to all!

@Maimouna: It's possible that you've stumbled upon a bug that was present in OpenFOAM 2.3.0 and that might have been already been fixed in 2.3.x. I'm referring to this bug report: http://www.openfoam.org/mantisbt/view.php?id=1284

You might want to try OpenFOAM 2.2.2, since on that bug report it states how a certain feature use to work in 2.2.2, but no longer worked in 2.3.0.

In addition, have a look into the tutorial "mesh/moveDynamicMesh/simpleHarmonicMotion" in 2.2.2. It's a very simple tutorial and it makes it a lot easier to test the parameters for restraints, stiffness and so on. The difference is that this motion is based on gravity+springs only and controlled in the file "0/pointDisplacement".

This tutorial is no longer present in OpenFOAM 2.3... or at least I can't find it :( ... then again, it might be this tutorial: "multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox" - although it's not controlled in the same way :(

Best regards,
Bruno

Maimouna October 1, 2014 09:43

Dear Bruno,

lots of thanks for your post. Regarding what you posted #58, I swiched my case from OF-2.3.0 to OF-2.2.2. My pointDisplacement file is
Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.2.2                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      pointVectorField;
    location    "0.01";
    object      pointDisplacement;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 1 0 0 0 0 0];

internalField  uniform (0 0 0);

boundaryField
{
    cylinder
    {
        type            sixDoFRigidBodyDisplacement;
        mass            9.97;
        centreOfMass    (4 0 0.5);
        momentOfInertia (1.4539 1.4539 1.24625);
        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);
        rhoName        rhoInf;
        rhoInf          1;
        g              (0 -9.81 0);
        report          on;
        constraints
        {
            maxIterations  500;

      /* noRotate1
        {
            sixDoFRigidBodyMotionConstraint fixedAxis;
            axis            (0 0 1);
        }

        noRotate2
      {
            sixDoFRigidBodyMotionConstraint fixedAxis;
            axis            (1 0 0);
        }

        noRotate3
        {
            sixDoFRigidBodyMotionConstraint fixedAxis;
            axis            (0 1 0);
        }*/

      fixedLine1
        {
            sixDoFRigidBodyMotionConstraint fixedLine;
            tolerance        1e-9;
            relaxationFactor 0.7;
            fixedLineCoeffs
            {
              refPoint        (4 0 0.5);
              direction      (1 1 0);
            }
        }
 
        fixedLine2
        {
            sixDoFRigidBodyMotionConstraint fixedLine;
            tolerance        1e-9;
            relaxationFactor 0.7;
            fixedLineCoeffs
            {
              refPoint        (4 0 0.5);
              direction      (1 1 0);
            }
        }
    }

        restraints
        {
          horizontalSpring
        {
            sixDoFRigidBodyMotionRestraint linearSpring;

            linearSpringCoeffs

            {
            anchor          (4 0 0.5); // was (0.2 0 0);//?
            refAttachmentPt (4 0 0.5); // was (0.092 0 0.384);//spring attached point on cylinder
            stiffness      4000; //2.3225;
            damping        2; //0.109;
            restLength      0;//??
            }

          }
   
        verticalSpring
      {
            sixDoFRigidBodyMotionRestraint linearSpring;

            linearSpringCoeffs
            {
            anchor          (4 0 0.5);
            refAttachmentPt (4 0 0.5);
            stiffness      4000;//?
            damping        2;//?
            restLength      0; //1;//??
          }
      }

      /*axialSpring
            {
                sixDoFRigidBodyMotionRestraint linearAxialAngularSpring;

                linearAxialAngularSpringCoeffs
                {
                    axis            (0 0 1);
                    stiffness      700;
                    damping        0.5;
                    referenceOrientation $orientation;
                }
            }*/
 
    }
        omega        1.14040;
        amplitude    (0 0.25 0);
        value          uniform (0 0 0);
    }

    top
    {
        type            empty;
    }

    bottom
    {
        type            empty;
    }

    ".*"
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
}


// ************************************************************************* //

and my dynamicMeshDict file is
Code:

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

dynamicFvMesh      dynamicMotionSolverFvMesh;

motionSolverLibs ("libfvMotionSolvers.so");

solver            displacementLaplacian;

displacementLaplacianCoeffs
{
    diffusivity      inverseDistance (cylinder);
}


// ************************************************************************* //

Could you please check that two files for me please to make cylinder move as shown in https://www.youtube.com/watch?v=oJNMrFnNaeg. I'm looking for oscillating in both direction. Any idea please? Any additions and/ or corrections in that files?

Thanks and regards.

Maimouna

wyldckat October 5, 2014 14:11

1 Attachment(s)
Hi Maimouna,

I'll write this post as a diary of my progress while examining your files and the case at hand. I'm using the case from post #48 as a base, then replaced the files you indicated in the post above. I used OpenFOAM 2.2.x, but should also with 2.2.2... at least I hope so.
  1. Unpacked your case and replaced the files.
  2. Did some cleaning up, removing backup files "*~" and fixed indentation inside some files.
  3. Then opened the files for the tutorial case "mesh/moveDynamicMesh/simpleHarmonicMotion" from OpenFOAM 2.2.x.
  4. Then searched for the source code of the linear spring:
    Code:

    find $FOAM_SRC -name "*linearSpring*"
    With that I found the file "linearSpring.H" and this in particular:
    Code:

            //- Anchor point, where the spring is attached to an immovable
            //  object
            point anchor_;

            //- Reference point of attachment to the solid body
            point refAttachmentPt_;

            //- Spring stiffness coefficient (N/m)
            scalar stiffness_;

            //- Damping coefficient (Ns/m)
            scalar damping_;

            //- Rest length - length of spring when no forces are applied to it
            scalar restLength_;

    Seems pretty clear what each coefficient stands for.
  5. Then I started comparing the "pointDisplacement" field set-up between cases and removed all what seemed excessive to me, since I was still trying to figure things out. Then boosted the U inlet to 100.0 m/s and simplified the BCs to the usual fixed value + zeroGradient inlet and outlet. Oh, and I relaxed a lot the damping and stiffness, so that I could clearly see where the cylinder were floating to. The case I ended up is attached as "freeOscillatingCylinder_v0.1.tar.gz". You'll notice I reduced the time settings to simulate 0.1 s only, saving each 0.01. Quick and dirty results gets us faster through the trial-and-error phase.
I think that now you can start working towards your desired test case. Study the files inside the attached case.
Run the attached case to get a feeling of how my thinking in trying to isolate-and-conquer each setting, one at a time.


Then start from this case to do small changes. First gradually change and test the "horizontalSpring" parameters to suit your case. Then try adding back the "verticalSpring". Then reduce the inlet speed from 100 to 10 and later to 1.

Always run in between changes, to see the results. This way you'll slowly but steadily find how to properly configure your case.

Only when things seem to be working properly, should you start turning on the additional features, such as the functions objects and the long run times.

Best regards,
Bruno


All times are GMT -4. The time now is 10:51.