I am adapting FEniCSx for FSI problems using the ALE formulation. I am having difficulties transferring data from the fluid mesh to the solid mesh and vice versa.
Say, I know fluid velocity (fluid_velo) and pressure (fluid_pres) and want to calculate the force vector on the fluid-solid boundary.
Traceback (most recent call last):
File "/home/chenna/Documents/myCode/fenics/FSI/channel-thickbeam/channel-thickbeam-FSI.py", line 622, in <module>
solid_force_temp = dolfinx.fem.assemble_vector(dolfinx.fem.form(force_on_solid))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/petsc/lib/python3/dist-packages/dolfinx/fem/forms.py", line 249, in form
return _create_form(form)
^^^^^^^^^^^^^^^^^^
File "/usr/lib/petsc/lib/python3/dist-packages/dolfinx/fem/forms.py", line 244, in _create_form
return _form(form)
^^^^^^^^^^^
File "/usr/lib/petsc/lib/python3/dist-packages/dolfinx/fem/forms.py", line 229, in _form
f = ftype(
^^^^^^
RuntimeError: Incompatible mesh. entity_maps must be provided.
With ds_solid(2), I get a different error.
I would appreciate any help with this. Thanks in advance!
Without a definition of the parent mesh, and how you have extracted the fluid and solid components, it is hard to give you any further guidance. You can for instance have a look at:
for inspiration on how to couple data between parts of the mesh.
Each mesh has its own tags for the fluid-solid interface.
The fluid mesh is shown in the figure below. The respective FE spaces and variables are defined separately for each domain.
I can solve for the fluid velocity and pressure. Next, I want to calculate the force on the interface in terms of solid DOFs so I can add the array to the RHS of the solid problem.
Continuing on, I realised that I needed to calculate the force on the fluid mesh first and then interpolate it onto the boundaries of the solid domain.
I am calculating the force using the following code once fluid_velo and fluid_pres are available.
I get the fluid_force_temp. I would like to know
(i) How do I export this in VTK format? I use 6-noded triangles for the velocity field and 3-noded for the pressure as a mixed element.
(ii) The correct type (like fem.Function) I should use for fluid_force_temp in order to map this force data to the solid domain using the code suggested for interpolating on the boundary.
This will assemble the force into a dolfinx function that you can then output, and in a way that you can transfer it between meshes with interpolation.
With your help, I calculated the force and exported it in VTK format.
While the mapping from the fluid mesh to the solid mesh also seems to work fine, there is an issue with the forces. The distribution of forces should be smoother but the values of force components are much higher at mid-nodes (see the attached figure). I checked velocity and pressure profiles. They are smoother.
I tried various options, interpolating pressure from P1 to P2, using pressure and viscous terms separately, etc., but the behaviour persists. I suspect the issue might be in evaluating the integral, but I don’t know how to check further and fix it.
The force vector I got earlier was correct but my interpretation was wrong and there was a bug in the boundary conditions. I fixed everything. The FSI code is working now.