Transitioning to preCICE for coupling OpenFOAM and a lagrangian python structural code

Hello,
I’m considering using preCICE for a coupled FSI problem. I have a solid model of few degrees of freedom, which given the forces, yields the shape of the structure after energy minimization. I’ve written a small python code that includes the solid model, and then calls the fluid solver.

For the fluid part, I use OpenFOAM v8. The approach right now is quasi-static, i.e. I have OpenFOAM solve a stationary problem of external flow, then the python code extracts the force information with boundary probes, and calculates the new solid solution minimizing energy. After this, a new OpenFOAM case is set up automatically with the new shape and boundary conditions, and so on with as many steps as needed.

I did it this way since the problem is not too dynamic (similar to a cantilevered plate), and it was quick.

Using preCICE would be a big step forward in the complexity of the coupling, and for what I’ve read it seems to be suited for what I need to simulate. However, I was wondering:

-since my solid model is Lagrangian, I would need the stresses field at some specific points, which I know to correspond to given points in the undeformed configuration of the solid. Can preCICE give the stress field at specific points (similar to OF boundary probes)?
-can preCICE be used incrementally, so starting just by using it to extract forces for example, and then adding more and more features?

I ask these because I would like to reuse as much of my python code as possible, and avoid rewriting from scratch, which is always bug prone.

Thanks in advance!

Welcome, @gcorsi!

Your case sounds to me very similar to the one mentioned in this talk: https://www.youtube.com/watch?v=3FP8y1Zjqns

Maybe shorter video: https://www.youtube.com/watch?v=fDuXA46mYk8

(edit: after reading your description again, it sounds to me like you are addresing a very classical ALE simulation. So, definitely possible!)

To your questions:

since my solid model is Lagrangian, I would need the stresses field at some specific points, which I know to correspond to given points in the undeformed configuration of the solid. Can preCICE give the stress field at specific points (similar to OF boundary probes )?

Would these points stay the same during the simulation, or would they change during the simulation? If they stay the same, then this is a very classical preCICE case. You just define your coupling mesh on the points you need.

can preCICE be used incrementally, so starting just by using it to extract forces for example, and then adding more and more features?

Yes. The usual development storyline would be that you start with a uni-directional, explicit coupling of one field, and gradually adding anything else that you need. You can start from this tutorial and replace one of the solid solvers with your own.

1 Like

Thanks a lot for your answer @Makis,

yes, the points don’t change, they are chosen once at the beginning of each run (the grid of an STL basically). I never remesh the solid afterwards.

Great! I’ll definitely check out the tutorial then, and try to implement some preCICE in my solver, starting with a one-way coupling. I guess using preCICE to extract the force in place of some boundaryProbes could be a good first step.

Thanks again

1 Like

What if the points are changing? As the solid is moving, the mesh points (both fluid and solid) should change as well. How do you get the stresses from the fluid.

What I mean when I say that points don’t change, is that the solid mesh is never remeshed. That is, the points stay the same in the reference configuration, but they move over time. No points are removed from, or added to, the interface mesh.

Hopefully this is what @Makis meant as well!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.

Exactly as @gcorsi added. I am talking about the usual Arbitrary Lagrangian-Eulerian approach, without remeshing. preCICE will eventually also support remeshing, but this is a larger feature that is currently under development.

1 Like