halbux/sparselizard

FSI coupling with an external solver

j8asic opened this issue · 3 comments

Hi, congrats on a clean and excellent library!
I'd like to try to couple my flow solver to the Sparselizard structure solver. How can I impose fluid forces or pressures onto the structure each time step? And how can I read displacements and velocities on the structure each time step?

Hi,
Have a look at the fluid-structure interaction example online (https://github.com/halbux/sparselizard/blob/master/examples/nonlinear-fsi-micropillar-2d/main.cpp). Line 107 specifically:

fsi += integral(fsinterface, umesh, ( p * -normal(fsinterface) - on(fluid, mu*( grad(v) + transpose(grad(v)) ) ) * -normal(fsinterface) ) * tf(u) );

adds pressure and viscous forces loading to the structure. The question then is how to import the velocity computed with your solver to field v I guess?

"And how can I read displacements and velocities on the structure each time step?":

--> "Read" = ? Do you want to know how to export the field in sparselizard to some format to reimport in your solver? One easy way to do that is to call the 'u.interpolate' function at all x,y,z positions you want. Is that what you want?

I am interested to have a discussion with you on how to provide the easiest possible interface to import data from and export to other solvers (this is not trivial since we probably don't use the same set of shape functions).

Alex

Alex thanks for the info! I've made an adapter for coupling library preCICE (precice.org) and for fun I'd like to couple it with Sparselizard. So each solver sends are receives some data over registered nodes, each time step. Let's say that in my case this is the answer to "the easiest possible interface to import data from and export to other solvers".

  • I get the example, but I don't get the "lower level" idea - how can I apply discrete values of force onto specific nodes, each time step?
  • Less important, can I get the displacements right on the nodes or I must use 'u.interpolate'? But if interpolate is fast, then I don't really care...

Hi, sorry for the late reply I am intensively working on mesh-adaptivity (available within a month or two max I hope, https://youtu.be/pDPgp_hT6PQ, can be of interest for FSI!):

  1. applying forces on each node assumes the shape functions are nodal (Lagrange) shape functions. This is not generally true and for sparselizard they are not (the ones used are higherarchical shape functions allowing to combine different interpolation orders in a clean way (p-adaptivity)). You can however first define a field based on imported nodal data then use it as a force on your structure.
  2. Use u.interpolate at the node coordinates for now

In any case you have a good point to add an easy to use interface to sparselizard to couple it with other softwares in s straightforward way. This is noted and I will added it latest this summer. (thanks for this nice suggestion!)

Alexandre