Can someone explain how to use faceCenters and faceNodes in OpenFOAM configuration file when using FSI module?
I tested a simple FSI case. The fluid is at the hydrostatic state. I transfer the stress at each node from OpenFOAM to a python-solid solver since my solid solver is a node-based finite difference solver.
The problem is the results are unexpected if I use the following setup (faceCenters) in preciceDict for OpenFOAM
However, if I change it to faceCenters, the results are what I want. That puzzles me. My understanding is I should use faceNodes instead of faceCenters since I want the stress at the nodes.
From the figures attached, we can see that the stress in the correct one figure shows the pattern of hydrostatic pressure as expected; however, the stress using faceNodes is in a mess.
Hope someone can tell me what could be wrong with my configuration or my understanding.
to make it short: you need to use the faceCenters for Stress data (or Force data). The location type is solely indicating where the individual data sets lives in the OpenFOAM discretization and almost only the displacement based data sets use faceNodes. The location type selected on the OpenFOAM side has nothing to do with the discretization of other simulation participants (the mapping is handled by preCICE anyway).
Hi @DavidSCN,
This helpfully clarify the usage of locations. Now I understand that because ‘force’ and ‘stress’ are located at ‘faceCenters’, we always use faceCenters when writing them.
Now it totally makes sense to me that the ‘stress’ data was transferred to solid solver incorrectly since I used a wrong ‘locations’ in OpenFOAM. I’m still confused with data exchange. Are the data always exchanged at nodes? Say, no matter what kinds of data (stress at nodes, velocity at cell center, etc. ) are obtained from OpenFOAM, preCICE will interpolate and map them to the nodes of the other participant?
A safeguard for valid location types for different data is definitely helpful, especially for new users.
OpenFOAM provides the data at the location you specified and delivers it to preCICE (here faceCenters). preCICE maps then the data to the location given by the other participant. If you like, you can export the coupling meshes in preCICE (add <export:vtk ... /> in the participant config) and inspect the location of the coupling data and the actual mesh given by OpenFOAM.