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/)
-   -   Multiple Floating Objects with 6DoF in OF 2.3.0 (https://www.cfd-online.com/Forums/openfoam-solving/143636-multiple-floating-objects-6dof-2-3-0-a.html)

tyoung October 29, 2014 15:14

Multiple Floating Objects with 6DoF in OF 2.3.0
 
Hi Foamers,

I am trying to model multiple floating objects in OpenFOAM. I started my case by using the floatingObject tutorial and managed to get two objects floating in 2.2.0. However, there is a problem when I try to model the similar case in 2.3.0 as the settings for dynamic motion are slightly different.

My problem is that, in the dynamicMeshDict for 2.3.0:

dynamicFvMesh dynamicMotionSolverFvMesh;
motionSolverLibs ("libsixDoFRigidBodyMotion.so");
solver sixDoFRigidBodyMotion;

sixDoFRigidBodyMotionCoeffs
{
patches (object1);
..................
}

sixDoFRigidBodyMotionCoeffs
{
patches (object2);
..................
}

Writing 2 separate sixDoFRigidBodyMotionCoeffs, one for each of the objects in the same dynamicMeshDict does not seems to work, only one object is picked up for the dynamic motion. Even putting two of the patches together (one after another) under one sixDoFRigidBodyMotionCoeffs doesn't help either. Would be grateful if anyone know how to get two (or even more) objects to run under sixDoFRigidBodyMotion in 2.3.0 simultaneously.

Kind Regards,
tyoung

wyldckat November 1, 2014 14:10

Greetings tyoung,

AFAIK, not even OpenFOAM 2.3.x supports multi-body mesh motion with the sixDoFRigidBodyMotion library.

Most dynamic mesh capabilities in OpenFOAM usually only handle one body that distorts the mesh somehow. Nonetheless, there is at least one class that demonstrates how code can be created for supporting more than one object... let me see if I can find it... OK, I found "multiSolidBodyMotion": https://github.com/OpenFOAM/OpenFOAM...MotionFvMesh.H
:eek: Actually, it's the class "solidBodyMotionFunctions::multiMotion" I was looking for: https://github.com/OpenFOAM/OpenFOAM.../multiMotion.H

Mmm... I re-read your post and you mentioned that you got it to work fine in OpenFOAM 2.2.0. Perhaps you were using "multiSolidBodyMotion" or "solidBodyMotion"?
I ask this because the algorithm in sixDoFRigidBodyMotion was re-written in in OpenFOAM 2.3.0 so that it would be more realistic: http://www.openfoam.org/version2.3.0/mesh-motion.php

Best regards,
Bruno

tyoung November 1, 2014 17:09

Hi Bruno,

Thank you so much for your reply.

I am still fairly new to OpenFoam and my first case which I ran in 2.2.0 is actually modified from another thread in this forum http://www.cfd-online.com/Forums/ope...g-objects.html. The things that I have changed from that case is my own mesh, the centre of mass, moment of inertia and mass. My case ran alright for a short period of time (only for mesh observation).

I assumed my case is alright as I can see both sets of Centre of mass, Linear velocity, Angular velocity, one for each objects being solved on the log file. However, after reading what you have mentioned, I believe my solution might not be right after all.

This is how my dynamicMeshDict for 2.2.0 looks like:

Code:

dynamicFvMesh dynamicMotionSolverFvMesh;

motionSolverLibs ("libfvMotionSolvers.so");

solver displacementLaplacian;

displacementLaplacianCoeffs
{
diffusivity inverseDistance (object1);
diffusivity inverseDistance (object2);
}

And my pointDisplacement for the floating objects in the 0 folder:

Code:

object1
{
type sixDoFRigidBodyDisplacement;
centreOfMass (0 -0.04 0);
momentOfInertia (5 5 5);
mass 19.5;
rhoInf 1;
report on;
value uniform (0 0 0);
}

object2
{
type sixDoFRigidBodyDisplacement;
centreOfMass (1.54 -0.04 0);
momentOfInertia (5 5 5);
mass 19.5;
rhoInf 1;
report on;
value uniform (0 0 0);
}

It sounds like modifying the multiSolidBodyMotion function you mentioned to do similar function of internal motion of a mesh calculated from boundary motion (with 6DoF) a bit too complicated for a new user like myself. I am hoping to model two floating objects subjected to water waves generated from the inlet boundary. Anyway I am grateful for your clarification.

Kind Regards,
tyoung

wyldckat November 1, 2014 17:59

Hi tyoung,

Quote:

Originally Posted by tyoung (Post 516954)
Code:

object1
{
type sixDoFRigidBodyDisplacement;
centreOfMass (0 -0.04 0);
momentOfInertia (5 5 5);
mass 19.5;
rhoInf 1;
report on;
value uniform (0 0 0);
}

object2
{
type sixDoFRigidBodyDisplacement;
centreOfMass (1.54 -0.04 0);
momentOfInertia (5 5 5);
mass 19.5;
rhoInf 1;
report on;
value uniform (0 0 0);
}


Of course! How could I have forgotten about this :( Since I hadn't seen something like this in the past, I never thought it would be possible to do this in such a way!

OK, the correct definition should be this:
Code:

dynamicFvMesh dynamicMotionSolverFvMesh;

motionSolverLibs ("libfvMotionSolvers.so");

solver displacementLaplacian;

displacementLaplacianCoeffs
{
diffusivity inverseDistance (object1 object2);
}

this way is the correct way to define the various patches that are affected by this diffusivity calculation.

Therefore, in OpenFOAM 2.3.0/x, you should be using this:
Code:

sixDoFRigidBodyMotionCoeffs
{
patches (object1 object2);
..................
}

And yes, in OpenFOAM it is used a space for separating 2 items in a list or vector ;).

Best regards,
Bruno

tyoung November 1, 2014 18:46

Hi Bruno,

Thanks for the quick reply. For OpenFOAM 2.3.0/x (sorry for my poor C++), I would like to know how do you assign the centre of mass, moment of inertia and mass under the same sixDoFRigidBodyMotionCoeffs for each of the objects as they are located in different positions (different centre of mass).

FYI, in OpenFOAM 2.3.0/x, the dynamicMeshDict for single floating object looks like this(below), where you assign the centre of mass, moment of inertia and mass in the dynamicMeshDict instead of in the pointDisplacement in the 0 folder (For OF 2.2.0, it's the other way round)


Code:

dynamicFvMesh      dynamicMotionSolverFvMesh;
motionSolverLibs    ("libsixDoFRigidBodyMotion.so");
solver              sixDoFRigidBodyMotion;

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

    centreOfMass    (0.5 0.5 0.5);
    momentOfInertia (0.08622222 0.08622222 0.144);
    mass            9.6;
    report          on;
    accelerationRelaxation 0.7;
}

and the pointDisplacement in the 0 folder:

Code:

sidimensions      [0 1 0 0 0 0 0];

internalField  uniform (0 0 0);

boundaryField
{
    stationaryWalls
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    atmosphere
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    floatingObject
    {
        type            calculated;
        value          uniform (0 0 0);
    }
}

Regards
tyoung

wyldckat November 2, 2014 07:23

Hi tyoung,

OK, I've done some code diving and here's what I've figured out:
  1. You can still use the same mechanism in 2.3 that you used in OpenFOAM 2.2. The only change needed is that you need an additional library loaded into memory. This should perhaps do the trick:
    Code:

    dynamicFvMesh dynamicMotionSolverFvMesh;

    motionSolverLibs
    (
        "libfvMotionSolvers.so"
        "libsixDoFRigidBodyMotion.so"
    );

    solver displacementLaplacian;

    displacementLaplacianCoeffs
    {
        diffusivity inverseDistance (object1 object2);
    }

    And then use the same boundary conditions you used in 2.2.
  2. The reason for this solution is because the class "sixDoFRigidBodyDisplacementPointPatchVectorFi eld" was moved from the library "libfvMotionSolvers.so" to "libsixDoFRigidBodyMotion.so".
  3. The new functionality they've implemented into OpenFOAM 2.3.0/x is by having the mesh motion solver to be able to directly solve the mesh motion, instead of forcing the patches to move themselves. Problem is that this suffers from the same problem that most of the other mesh motion solvers have got: it's not possible to handle more than one mesh motion solver at a time.
    • More specifically, if you look at the source code for this new motion solver, you'll see very similar code to the code used directly on the patches. Problem is that each patch is handled independently with its own instance of "sixDoFRigidBodyDisplacementPointPatchVectorField" , while the code in the mesh motion class "sixDoFRigidBodyMotionSolver" was designed to only handle a single object-body.
    • A possible solution for this would be to create a new class that is based on "sixDoFRigidBodyMotionSolver" and that can then handle more than one body. At first glance, it doesn't seem something hard to do, but it does take somewhere between 4 to 8h of development and testing in total, time which I personally don't have :(
      The best I can do is to suggest that you compare the source code in stitchMesh with the one present here: https://github.com/wyldckat/stitchMeshMultiPatch - this should give you an idea of what needs to done to get a similar capability.
Good luck! Best regards,
Bruno


tyoung November 2, 2014 10:57

Hi Bruno,

Once again thank you so much for all your suggestions and explanations. They really give me a good insight of the changes in 2.3.0 from 2.2.0. For now, I managed to get my code running based on your first recommendation in 2.3.0. I will look into the results later on to see if everything is alright. Other than that, I will also try to look at the alternative method you have recommended (if I could do it) to see if the newer motion solver further improves anything. :)

Regards,
tyoung

Thaw Tar February 21, 2015 09:07

Any results
 
Hi tyoung,

Have you got any results of multiple objects simulation using openfoam's native sixDofRigidBodyDisplacement solver?

Actually, I am trying to do vortex induced vibration of multiple cylinders.
But I am too lazy and too new to OpenFOAM. So, I do not want to create a new multiBody motion solver. So, I want to know whether your results using native sixDofRigidBodyDisplacement are right or now.

Regards
thaw tar

ShilongLiu December 22, 2016 00:19

Quote:

Originally Posted by tyoung (Post 517013)
Hi Bruno,

Once again thank you so much for all your suggestions and explanations. They really give me a good insight of the changes in 2.3.0 from 2.2.0. For now, I managed to get my code running based on your first recommendation in 2.3.0. I will look into the results later on to see if everything is alright. Other than that, I will also try to look at the alternative method you have recommended (if I could do it) to see if the newer motion solver further improves anything. :)

Regards,
tyoung

Hi Tyoung,
As mentioned in your last reply, you said you have got the code running based on Bruno's first recommendation, here you mean using the multiSolidBodyMotion? Did it work? Now I am doing the similar model like you in v3.0 and come with the same problem. Thank you

wyldckat December 22, 2016 09:39

Greetings to all!

@ShilongLiu: Many thanks for bumping up this thread! I had plans to come looking for it, but this made my life easier :)

A feature for multi-body support was introduced less than a month ago in OpenFOAM-dev: https://github.com/OpenFOAM/OpenFOAM...32cfbaec38a6e2
This feature should also be available in the next stable release version 5.0 (if I'm not mistaken).

Best regards,
Bruno


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