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.
Is Precice useful for this case?
Is it better to use multiple 2D planes cross-sections in a flexible pipe or a single 3D pipe?
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:
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.