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 |
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 |
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; Code:
object1 Kind Regards, tyoung |
Hi tyoung,
Quote:
OK, the correct definition should be this: Code:
dynamicFvMesh dynamicMotionSolverFvMesh; Therefore, in OpenFOAM 2.3.0/x, you should be using this: Code:
sixDoFRigidBodyMotionCoeffs Best regards, Bruno |
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; Code:
sidimensions [0 1 0 0 0 0 0]; tyoung |
Hi tyoung, OK, I've done some code diving and here's what I've figured out:
Bruno |
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 |
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 |
Quote:
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 |
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
Best regards, Bruno |
Hi Tyoung,
How have you solved it? I have the same problem for two bodies. Thanks. |
Regarding Multiple floating-objects in openFOAM
Dear all foam users,
After reading this thread, I sweep all files regarding to motion objects in OpenFOAM. Here, I will explain how to do it with the last released version. I use ''overInterDyMFoam'' solver. This Solver is connected to ''dynamicMotionSolverListFvMesh''. when you are interested in simulation of multiple objects, you need to use this way, either floating sixdofrigidbodymotion or another prescribed kinds. In constructors part of ''dynamicMotionSolverListFvMesh.C'' we have: /////////////////////////////////////////// label i = 0; if (dict.found("solvers")) { const dictionary& solvertDict = dict.subDict("solvers"); motionSolvers_.setSize(solvertDict.size()); for (const entry& dEntry : solvertDict) { if (dEntry.isDict()) { IOobject io(ioDict); io.readOpt() = IOobject::NO_READ; io.writeOpt() = IOobject::AUTO_WRITE; io.rename(dEntry.dict().dictName()); IOdictionary IOsolverDict ( io, dEntry.dict() ); motionSolvers_.set ( i++, motionSolver::New(*this,IOsolverDict) ); } } motionSolvers_.setSize(i); } else { motionSolvers_.setSize(1); motionSolvers_.set(i++, motionSolver::New(*this)); } } /////////////////////////////////////////// As you can see, after opening ''solvers'' part in ''dynamicMeshDict'' file (i.e. '' if (dict.found("solvers")) the code executes ''motionSolver::New(*this, IOsolverDict)'' This line is called from the selector part of ''motionSolver.C'' ///////////////////////////////////// Foam::autoPtr<Foam::motionSolver> Foam::motionSolver::New ( const polyMesh& mesh, const IOdictionary& solverDict ) { // The change from "solver" to "motionSolver" has not been // applied consistently. Accept both without complaint. const word solverName ( solverDict.getCompat<word>("motionSolver", {{"solver", -1612}}) ); Info<< "Selecting motion solver: " << solverName << nl; const_cast<Time&>(mesh.time()).libs().open ( solverDict, "motionSolverLibs", dictionaryConstructorTablePtr_ ); if (!dictionaryConstructorTablePtr_) { FatalErrorInFunction << "solver table is empty" << exit(FatalError); } auto cstrIter = dictionaryConstructorTablePtr_->cfind(solverName); if (!cstrIter.found()) { FatalIOErrorInLookup ( solverDict, "solver", solverName, *dictionaryConstructorTablePtr_ ) << exit(FatalIOError); } return autoPtr<motionSolver>(cstrIter()(mesh, solverDict)); } //////////////////////////////////// Now, you can see "motionSolverLibs" and ''solver'' are looked up here! .............................. Therefore, for multiple objects simulation you need to create ''dynamicMeshDict'' file as following: //////////////////////////// dynamicFvMesh dynamicOversetFvMesh; solvers { Obj1 { motionSolverLibs (sixDoFRigidBodyMotion); solver sixDoFRigidBodyMotion; sixDoFRigidBodyMotionCoeffs { patches (patch1); ... } } Obj2 { motionSolverLibs (sixDoFRigidBodyMotion); solver sixDoFRigidBodyMotion; sixDoFRigidBodyMotionCoeffs { patches (patch2); ... } } Obj3 { solver multiSolidBodyMotionSolver; multiSolidBodyMotionSolverCoeffs { movingZone1 { solidBodyMotionFunction rotatingMotion; rotatingMotionCoeffs { .... } } movingZone2 { solidBodyMotionFunction linearMotion; linearMotionCoeffs { .... } } } } //////////////////////////// I hope this help anyone. :) |
Multiple floating body simulation
Quote:
Could you share a sample dynamicmeshdict file for reference. I am trying to work with the floating body tutorial using overinterdymfoam. Iam trying to create two bodies and give motion to the two. In between why is there a movingzone1 and movingzone2 are those necessary for the problem iam trying to work on? With regards, Sachin M |
Multiple floating body simulation
Does anyone know how the transform is defined inside the dynamicmeshdict in floatingobject tutorial.
|
Quote:
Hello, I have tried to implement my dinamycMeshDict file like this in OpenFoam 8, but I get this error: [0] --> FOAM FATAL ERROR: [0] Unknown dynamicFvMesh type dynamicMotionSolverListFvMesh Valid dynamicFvMesh types are : 7 ( dynamicInkJetFvMesh dynamicInterpolatedFvMesh dynamicMotionSolverFvMesh dynamicRefineFvMesh movingConeTopoFvMesh rawTopoChangerFvMesh staticFvMesh ) So looks like this dynamicFvMesh type is not implemented in OpenFoam 8 and what is worst, none of this types seems to work for multiple body motion. Is it possible to simulate multiple solid bodies in this version or they just removed this feature? Im trying to simulate 2 vertical axis wind turbines with 6DoF, but none of the solutions I have found (multiSolidBodyMotionFvMesh, dynamicMultiMotionSolverFvMesh, dynamicMotionSolverListFvMesh) work for this version. Please, let me know if you know how to implement the dynamicMeshDict file. Thank you. |
Is there any updates on this? I am stuck with a very similar problem in which I want to simulate two floating objects with overset Mesh method.
I tried using both sixDOF and rigidBody Motion but none of them worked for me. |
I am also facing the same problem in openfoam 7.
|
Quote:
|
Quote:
|
Quote:
|
All times are GMT -4. The time now is 01:37. |