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

Multiple Floating Objects with 6DoF in OF 2.3.0

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree8Likes
  • 2 Post By tyoung
  • 2 Post By wyldckat
  • 4 Post By wyldckat

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 29, 2014, 15:14
Post Multiple Floating Objects with 6DoF in OF 2.3.0
  #1
New Member
 
Teng
Join Date: May 2011
Location: UK
Posts: 5
Rep Power: 10
tyoung is on a distinguished road
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
tyoung is offline   Reply With Quote

Old   November 1, 2014, 14:10
Default
  #2
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,942
Blog Entries: 42
Rep Power: 121
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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
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
__________________

Last edited by wyldckat; November 1, 2014 at 17:22. Reason: fixed typo
wyldckat is offline   Reply With Quote

Old   November 1, 2014, 17:09
Default
  #3
New Member
 
Teng
Join Date: May 2011
Location: UK
Posts: 5
Rep Power: 10
tyoung is on a distinguished road
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 and chun like this.

Last edited by wyldckat; November 1, 2014 at 17:52. Reason: Added [CODE][/CODE]
tyoung is offline   Reply With Quote

Old   November 1, 2014, 17:59
Default
  #4
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,942
Blog Entries: 42
Rep Power: 121
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi tyoung,

Quote:
Originally Posted by tyoung View Post
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
waku2005 and dupeng like this.
__________________
wyldckat is offline   Reply With Quote

Old   November 1, 2014, 18:46
Default
  #5
New Member
 
Teng
Join Date: May 2011
Location: UK
Posts: 5
Rep Power: 10
tyoung is on a distinguished road
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
tyoung is offline   Reply With Quote

Old   November 2, 2014, 07:23
Default
  #6
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,942
Blog Entries: 42
Rep Power: 121
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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, kkpal, minh khang and 1 others like this.
__________________
wyldckat is offline   Reply With Quote

Old   November 2, 2014, 10:57
Default
  #7
New Member
 
Teng
Join Date: May 2011
Location: UK
Posts: 5
Rep Power: 10
tyoung is on a distinguished road
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
tyoung is offline   Reply With Quote

Old   February 21, 2015, 09:07
Talking Any results
  #8
Member
 
Thaw Tar's Avatar
 
Thaw Tar
Join Date: Apr 2013
Location: Yangon, Myanmar
Posts: 34
Rep Power: 8
Thaw Tar is on a distinguished road
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
Thaw Tar is offline   Reply With Quote

Old   December 22, 2016, 00:19
Talking
  #9
New Member
 
Shilong. Liu
Join Date: Dec 2016
Posts: 1
Rep Power: 0
ShilongLiu is on a distinguished road
Quote:
Originally Posted by tyoung View Post
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
ShilongLiu is offline   Reply With Quote

Old   December 22, 2016, 09:39
Default
  #10
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,942
Blog Entries: 42
Rep Power: 121
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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
__________________
wyldckat is offline   Reply With Quote

Reply

Tags
of 2.3.0, sixdofrigidbodymotion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple floating objects CKH OpenFOAM Running, Solving & CFD 14 February 20, 2019 09:08
how to set periodic boundary conditions Ganesh FLUENT 14 November 26, 2018 11:26
Floating objects in water flow: which tools and how much effort ? TomGratte1 Main CFD Forum 0 December 29, 2013 10:43
Linking two floating objects chatluthier FLOW-3D 3 December 12, 2011 11:31
OpenFOAM static build on Cray XT5 asaijo OpenFOAM Installation 9 April 6, 2011 12:21


All times are GMT -4. The time now is 08:30.