FSI ( Openfoam + my solver using python)

I want to couple OpenFOAM with my Python code. My problem statement is to simulate vortex-induced vibration for long flexible pipe. I want to model multiple 2D OpenFOAM cases to obtain the force. I am choosing multiple 2D cases to reduce computational costs. I want to use overset mesh and the PimpleFoam solver. My in-house Python code, based on FEM, provides deflection at each time step, which displaces the overset mesh.

  1. Is Precice useful for this case?
  2. Is it better to use multiple 2D planes cross-sections in a flexible pipe or a single 3D pipe?
  3. What tutorials would be helpful to me?
    image

Hi Aman,

Yes, preCICE in general can do this: you have a clear separation between the flow and the structure domains.

Both should be possible, the 2D cross-sections should be computationally cheaper, but more complicated to model. The single 3D pipe should be easy to model in OpenFOAM for the flow, and I hope in your in-house Python code for the structure.

General rule of thumb: It is important to choose tools you already know or have good documentation and some community. preCICE itself is easy, the complicated part are the simulation codes (OpenFOAM, your in-house solver, etc).

Sounds like our elastic tube tutorials could be helpful:

I assume that turbulence modelling in important for you. You might encounter this issue regarding checkpointing. In that case, please help me reproduce it:

What do you need the overset mesh for?

Thank you for your response. The 2D overset mesh will displace according to displacement data from the FEM solver, while the background mesh will remain fixed.

I have one more query: Like multiple solver couplings, as mentioned in the multiple perpendicular flap tutorial? Can I use multiple couplings to create, let’s say, 20 2D cases of OpenFOAM (representing forces) and couple them with a single Python solver (representing displacement)?

The OpenFOAM cases will run simultaneously, providing forces, which will then be transferred to the FEM code to generate displacement. This displacement will in turn displace the 20 meshes of OpenFOAM simultaneously, and so on.

Sounds a bit complicated (maybe unnecessarily complicated), but yet, this is possible. You would need to configure 21 different participants, though, which will be cumbersome (people have tried making scripts to generate such configuration files, using jinja2).

Maybe try running a few tutorials first to get more ideas on what is common and easy and what is not.

Okk . Thanks ,i will try.

Hi, makis, I have uploaded the case may reproduce the problem.
https://github.com/precice/openfoam-adapter/issues/158

Hello Makis and Aman, I am also working on the same problem. So far, I have used OpenFOAM to solve both the fluid and structure equations for both morphing and overset meshes. However, I now want to use OpenFOAM to solve the fluid equations while using preCICE to handle the structural displacement.
Is this possible? If so, could you please guide me on how to achieve it?

Hi shri , kindly explain me what you want to do

@Shri please open a new thread describing what you want to simulate. See some tutorials that might be similar to what you are trying to do: Perpendicular flap | preCICE - The Coupling Library

hello aman & Makis, first of all, thank you for your response. I am currently working on vortex-induced vibration phenomena using OpenFOAM7. In my steup, the fluid and structure equations are solved using pimpleFoam and the sixDOFRigidBodyMotion respectively. However, I now need to modify the structure equation, which is not possible directly within OpenFoam. To address this, I am considering coupling OpenFOAM with Python so that the fluid equations can be solved in OpenFOAM while the structural equation is solved in Python. Is it possible to implement such a coupling, and if so, how can it be achieved?

Yes it is possible and I also did the similar thing using openfoam and python using precice . Perpendicular flap example helped me in this.Kindly ping me in prasadaman333@gmail.com