Problems with building an adapter between 'sixDOFmotion solver' and 'CalculiX'

Hi preCICE users and code developers,

I am working on multiphase, elastic, and rigid body motion problem using interDyFoam, Calculix, and precice. The simplified model shows in the figure. The elastic material is basically used for restraining the rigid body motion under wave. But, the rigid body is much bigger than elastic body in the real case, so I decide to use sixDOFRigidBodyMotion solver to solve rigid body motion, and use calculiX to solve elastic contact problem.

Overall, I try to build an adapter between sixDOFRigidBodyMotion solver and calculiX, I guess it may be counted as a structure-structure adapter. The adapter provides an interface that transfers displacement from sixDOFrigidbody solver to Calculix, and receives forces to update rigid body accelerations serially. Out of this loop, another FSI between interDyFoam and sixDOFrigidBodyMotion solver will present, see the workflow pic.

There are two questions I met when I followed the adapter building steps:

  1. sixDOFrigidbodymotion solver is basically a library, there is no main function in its .C file. I can only find its simulation loop, where and how should I insert the preCICE API?Do I need to write another member function in the sixDOFrigidbodymotion class and call in interFoam?
    Currently, I write API code inside sixDOFrigidbodymotion.C file right above the simulation loop, but it looks wired. And give error as
sixDoFRigidBodyMotion/sixDoFRigidBodyMotion.C:302:5: error: expected unqualified-id before ‘delete’
    delete[] coords;
  1. I may need to write codes to create an interface patch in the sixDOFRigidbody side to map the force received from calculix to the rigid body’s center of mass. Could someone give some hints on how to deal with this?

Many thanks,
Yujia
pre1

1 Like

Hi Yujia,

That’s an interesting case that you try to realize. Thanks for the detailed description. I think I got it.

Here, I am lacking a bit OpenFOAM know-how, but I am not sure whether you can really run the rigid-body solver in OpenFOAM as a stand-alone solver. I thought it’s just some feature you can use in fluid solvers to do rigid-body FSI. So it would be two solvers you want to couple: interDyFoam and CalculiX, where you use the rigid-body FSI feature within interDyFoam and a structure-structure coupling between both. But I could be wrong.

I have a different suggestion. Why don’t you solve the whole structure directly in CalculiX? I guess you could use a very coarse mesh in the rigig-body part of the domain (maybe even only a single element?) and simply use a non-homogeneous material with infinity stiffness in the rigid part. Maybe you get an ill-conditioned problem then, but might be sth to ask in the CalculiX Forum. In contrast to the solution above, this suggestion should be much easier to simply try out.

1 Like

Hi uekerman,

Thank you for your reply.

I guess you could use a very coarse mesh in the rigid-body part of the domain (maybe even only a single element?

I suppose not be able to treat it this way, since the rigid object motions at the free surface. And I cannot calculate correct pressure distribution at the surface without grids. and I cannot set the moment of inertia in CalculiX to correctly calculate the object translation and rotation. I made a simple free decay test for a small floating box with free surface, using preCICE_FSI coupling, the fluid force distributed at the object surface highly depends on the grid number and really low efficiency. If I get it right.

Overall, I may need to propose a methodology that provides an interface between a rigid body and elastic body, the data transfer at the interface based on preCICE serial coupling. The main workflow looks like

  1. pointDisplacement0 at interface patch nodes writes to buffer and will be read by solid-mesh-nodes
  2. Solid solver simulates contact behavior, writes forces0 at the interface to buffer. The surface force will directly transfer to rigidBodyMotion solver to solve rigid body motion, then update the dynamic mesh.
  3. So as to the pointDisplacement at the patch will be updated due to the mesh motion.

Could you please give any advice about this idea?

Current status:

  1. In openfoam-adapter master folder, create a module called RIGID basing on FSI, change the namespace name from FSI to RIGID and corresponding settings, update Make/file, Make/Options, recompile the library as libpreciceAdapterFunctionObjectRigid.so under $FOAM_USER_LIBBIN. xxx.so file is called at system/controlDict/functionObject.
  2. Stuck at reading Forces at interface node from CalculiX side to sixDOFRigidBodyMotion solver. I guess IOobject will work, still trying.

Thank you for your time and help,

Yujia

@YujiaWei2020 You are genius man you have solved this problem. Which i was facing last few days. Thanks man for solution. :slightly_smiling_face:

3 Likes