OpenFOAM-OpenFOAM FSI coupling

Hello everyone,

I have a CFD code and a CSM code both based on OpenFOAM.I would like to couple them to solve a simple problem like the “cylinderFlap” which comes with preCICE and that is using OpenFOAM and deal.II. Basically to do FSI.

As far as I know, I identified some of the steps to adapt the latter to my problem:

  • Copy the fluid case to a solid case. Modify the geometry and boundary conditions of the new solid case. First of all, I can try a one-way coupling by imposing the motion of the flap. But eventually I want a full coupling.
  • Possibly write or modify an adapter for the OpenFOAM CSM solver as it is not a standard solver.
  • Adapt preCICE config files including the one for each solver and the general config file at the root of the case.

As I am new to preCICE, I don’t know where I am going with these config files. I found limited literature online that was always very specific to the tutorials of preCICE. Moreover, I am aware of the CHT test case with two OpenFOAM solvers but the two geometries are “independant” in the sense that the slab is not comprised within the channel flow and therefore only has one contact patch.
So my questions are:

  1. Do you have some remarks on this post ?
  2. Is there a better test case that I can start from ?
  3. Are there resources that list the main step to “plug” OpenFOAM" correctly for a fluid and for a solid ?
  4. Has anybody already done something with two OpenFOAM solvers before ?

Thank you.

Hello @dashqua,

It’s very nice that you ask here before going down an unsure path alone!

A few remarks:

  • The OpenFOAM adapter configuration format is ready to be changed to an OpenFOAM dictionary (probably today): https://github.com/precice/openfoam-adapter/pull/105

  • Moreover, I am aware of the CHT test case with two OpenFOAM solvers but the two geometries are “independant” in the sense that the slab is not comprised within the channel flow and therefore only has one contact patch.

    Also in the “cylinderFlap” scenario, the Fluid part (OpenFOAM) defines all the interface of the beam as one patch. In any case, the adapter can also work with multiple patches: you just add more elements in the list.

  • Possibly write or modify an adapter for the OpenFOAM CSM solver as it is not a standard solver.

    The idea of the official adapter is that you can use it for more general problems (thus the multi-component architecture). What you actually want is to also add the “read forces” and “write displacements” in the FSI module, is this correct? Then, you can definitely start from the existing code, the (empty) methods are there. I would be very happy to help you with any questions in the process.

  • Is there a better test case that I can start from ?

    Starting from a combination of the “flow-over-plate” and “cylinderFlap” sounds reasonable. We don’t have anything where OpenFOAM is used as a structure (i.e. deformation) solver.

  • Are there resources that list the main step to “plug” OpenFOAM" correctly for a fluid and for a solid ?

    I am not sure I understand this. The most detailed resource we have is the Flow over a heated plate tutorial. What information are you missing?

  • Has anybody already done something with two OpenFOAM solvers before ?

    Not for FSI with preCICE, as I know of. I have also (experimentally) coupled two pimpleFoam, as well as two laplacianFoam.

Are you writing your own solid solver (in OpenFOAM), or are you using something that exists already? I think it would be reasonable to just start by sketching something directly into the solid solver body and then move to the official adapter.

It is wonderful that you move to a dictionary !

Well, as it is written in your Master’s thesis, I want to fulfill the interaction conditions (on stress tensor and velocity) but for both CFD and CSM solvers.

I have not looked into the code of preCICE yet but will do it this week. Since the code is evolving quick, I also don’t want to miss new features by branching …

The CSM code is available here: https://github.com/jibranhaider/explicitSolidDynamics/

My last question was if there was any ressource that explains how to “plug” preCICE to the OF solver, in other words how to go from the two sole solvers to the full coupling. At the moment, I am studying the slides of your presentation in the " 2nd German OpenFoam User meeting" (21.02.2018) where you show the changes in the solver.

Everything we have is described in the OpenFOAM adapter wiki (in particular the pages “Configuration” and “Tutorial for CHT: Flow over a heated plate”). However, I would be very interested to know which points you found confusing or unclear. Our documentation is definitely something we can constantly improve. Feel free to also directly edit the wiki, or ask for advice beforehand. Also feel free to ask here (preferably in separate, question-answer style threads).

That presentation was a bit old indeed. We are finalizing a dedicated paper, but you can also find newer version of this talk on my webpage.

Hey @dashqua

I am also working on a OpenFOAM internal FSI. I just did a pull request:
https://github.com/precice/openfoam-adapter/pull/121

Its a first draft to couple an OF fluid solver to an OF solid mechanics solver.
At the moment you can only use it with some limitations:

  • You can only couple total displacements (calculated by solid) to total displacements (used to move fluid) or incremental displacements (calculated by solid) to incremental displacements (used to move fluid). No combination of these is possible.
  • Displacements are only coupled at the vertices (pointDisplacement)
  • You need to write a boundary condition for the solid mechanics solver: e.g. ForceDisplacement, that is like the traction ones but reads the “Force” field that is calculated in the adapter.

Maybe this helps you to get started.
If you have any questions, dont hesitate to ask!

Cheers

3 Likes

Hi @JSeuffert,

This sounds very interesting, I will take a look at it. (I am not very comfortable with playing with commits and more advanced stuff of Github so I may take time to come back).

Thanks for your contribution !

Cheers

Hi everybody !
I have started working on the implementation of this FSI case scanario with two OpenFOAM solvers.

At the moment I want to adapt cylinderFlap/OpenFOAM-deal.ii in such a way that the structural part is not solved by deal.ii anymore, but by a “in-house” OpenFOAM solver called solidFoam. In the latter, the structural displacement vector field “uN” moves the domain nodes (pointVectorField) in a Total Lagrangian fashion.

I don’t mind starting with a “one-way” coupling where for instance only the fluid flow is impacted by a (pre-computed) flap motion. However I would be happy to achieve full-coupling.

So I suppose I don’t have to change the configuration of the Fluid in the test case. Here the changes I have listed:

  • Recreate a blockMesh geometry of the flap for the Solid :white_check_mark:
  • Recreate a Solid test case where I am able to run a simulation that is purely structural (i.e. using only solidFoam) :white_check_mark:
  • Include precice functionObjects and library in controlDict :white_check_mark:
  • Configure openfoam-adapter yml configuration file in Solid (Fluid’s one is untouched)
    Remark: I don’t use preciceDict because at some point a message log was asking for a YML file so I supposed the feature is not 100% operational at the moment
  • Reconfigure precice xml configuration file

The advantage of using OF for the structural solver is that we have access to many options for interpolating fields like forces on the mesh faces, which is why I decided to use “Solid-Mesh-Faces”.

The following is precice-config.xml:

<?xml version="1.0"?>
<log>
    <sink filter="%Severity% > debug and %Rank% = 0" format="---[precice] %ColorizedSeverity% %Message%" enabled="true"/>
</log>

<solver-interface dimensions="3">

<data:vector name="Force"/>
<data:vector name="Displacement"/>

<mesh name="Fluid-Mesh-Centers">
    <use-data name="Force"/>
<mesh name="Solid-Mesh-Nodes">
    <use-data name="Displacement"/>
</mesh>
<mesh name="Solid-Mesh-Faces">
    <use-data name="Force"/>
</mesh>

<participant name="Fluid">
    <use-mesh name="Fluid-Mesh-Centers" provide="yes"/>
    <use-mesh name="Fluid-Mesh-Nodes" provide="yes"/>
    <use-mesh name="Solid-Mesh-Nodes" from="Solid"/>
    <use-mesh name="Solid-Mesh-Faces" from="Solid"/>
    <read-data name="Displacement" mesh="Fluid-Mesh-Nodes"/>
    <write-data name="Force" mesh="Fluid-Mesh-Centers"/>
    <!--export:vtk directory="coupling_data" /-->
    <mapping:rbf-thin-plate-splines direction="write" from="Fluid-Mesh-Centers" to="Solid-Mesh-Faces" constraint="conservative" z-dead="true"/>
    <mapping:rbf-thin-plate-splines direction="read" from="Solid-Mesh-Nodes" to="Fluid-Mesh-Nodes" constraint="consistent"/>
</participant>

<participant name="Solid">
    <use-mesh name="Solid-Mesh-Nodes" provide="yes"/>
    <use-mesh name="Solid-Mesh-Faces" provide="yes"/>
    <read-data name="Force"  mesh="Solid-Mesh-Faces"/>
    <write-data name="Displacement" mesh="Solid-Mesh-Nodes"/>
    <!--watch-point mesh="Solid-Mesh-Nodes" name="flap_tip" coordinate="0.6;0.2;0." /-->
</participant>

<m2n:sockets from="Fluid" to="Solid"/>

<coupling-scheme:serial-implicit>
    <time-window-size value="0.005"/>
    <max-time value="10"/>
    <participants first="Fluid" second="Solid"/>
    <exchange data="Force" mesh="Solid-Mesh-Faces" from="Fluid" to="Solid"/>
    <exchange data="Displacement" mesh="Solid-Mesh-Nodes" from="Solid" to="Fluid" initialize="0"/>

    <max-iterations value="100"/>
    <absolute-convergence-measure limit="1e-6" data="Displacement" mesh="Solid-Mesh-Nodes"/>
    <relative-convergence-measure limit="1e-4" data="Force" mesh="Solid-Mesh-Faces"/>
    <extrapolation-order value="2"/>

    <acceleration:IQN-ILS>
        <data name="Displacement" mesh="Solid-Mesh-Nodes"/>
        <preconditioner type="residual-sum"/>
        <filter type="QR1" limit="1e-6"/>
        <initial-relaxation value="0.1"/>
        <max-used-iterations value="50"/>
        <time-windows-reused value="10"/>
    </acceleration:IQN-ILS>
</coupling-scheme:serial-implicit>

</solver-interface>

The following is precice-adapter-config.yml for the Solid

participant: Solid

precice-config-file: precice-config.xml

FSIenabled: true

interfaces:
- mesh: Solid-Mesh-Faces
  patches:
  - wetsurface
  write-data: Force

- mesh: Solid-Mesh-Nodes
  patches:
  - wetsurface
  read-data: Displacement

#FSI
#{
#  rho rho [1 -3 0 0 0 0 0] 1000;

What is happening at the moment:
I run the solvers using the (slightly modified) Allrun script and the Solid solver works as if it was alone, and the Fluid solver crashed with this error message:

---[preciceAdapter] [DEBUG]   Number of processes: 1
---[preciceAdapter] [DEBUG]   MPI rank: 0
---[preciceAdapter] [DEBUG]   preCICE solver interface was created.
---[preciceAdapter] [DEBUG] Configuring preCICE...
---[precice] ERROR:  Tag <time-window-size> is unknown

The Solid.log contains at the beginning:

---[preciceAdapter] [DEBUG] Configuring the FSI module...
---[preciceAdapter] [DEBUG]     user-defined solver type : none
---[preciceAdapter] [DEBUG]     pointDisplacement field name : pointDisplacement
---[preciceAdapter] [DEBUG] Determining the solver type...
---[preciceAdapter] [DEBUG] Did not find the transportProperties dictionary.
---[preciceAdapter] [DEBUG] Did not find the turbulenceProperties dictionary.
---[preciceAdapter] [DEBUG] Did not find the thermophysicalProperties dictionary.
---[preciceAdapter] [DEBUG] Destroying the FSI module...
--> FOAM Warning :
    From function bool Foam::functionObjectList::read()
    in file db/functionObjects/functionObjectList/functionObjectList.C at line 746
    Caught FatalError
--> FOAM FATAL ERROR:
ESC[31mError in the preCICE adapter: ESC[0m
Could not determine the solver type, or this is not a compatible solver: neither transport, nor turbulence properties are provided.


    From function void adapterInfo(std::__cxx11::string, std::__cxx11::string)
    in file Utilities.C at line 32.


Time step =1
Time increment = 5.782326e-06 s
Time = 5.78233e-06 s

My feeling is that I mainly need to make preCice understand what are the displacement vector values so the simulation could (hopefully) be done in a similar way than with deal.ii.

I can prepare a Github repo to show all the files of the test case and in particular the xml/yml and the geometry.

Hi @dashqua,

good progress! And multiple points to discuss.

Configure openfoam-adapter yml configuration file in Solid (Fluid’s one is untouched)
Remark: I don’t use preciceDict because at some point a message log was asking for a YML file so I supposed the feature is not 100% operational at the moment

Where did you see this? If you are using the latest adapter and tutorials, you should not see any such mention anywhere. It is fully operational by now and only preciceDict is read by the adapter.

---[precice] ERROR: Tag <time-window-size> is unknown

This was renamed in preCICE v2 (see changes). It looks like you are still using an old preCICE version. Keep in mind that all the tutorials are now ported to the latest versions. If you need preCICE v1.x, you can still get the previous state (but please upgrade).

--> FOAM FATAL ERROR:
ESC[31mError in the preCICE adapter: ESC[0m
Could not determine the solver type, or this is not a compatible solver: neither transport, nor >turbulence properties are provided.

This is expected since you are using a quite different OpenFOAM solver. I cannot say without looking at your solvers, but try setting the solverType in your preciceDict (similar option in the older precice-adapter-config.yml). If none of them work, we would need to look at the code of solidFoam and maybe modify the adapter.

Hi @MakisH,

I understand that this mention of the error with the tag is due to a outdated version of precice so:
I uninstalled libprecice1*bionic.deb and installed libprecice2_2.0.1_bionic.deb. Nevertheless, I still have the same error (in my modified case or with the initial OpenFOAM-deal.ii case). I pulled from the remote directory of tutorial but I should be missing something else in the update process.
I am looking forward to have your feedback on this, meanwhile I take a look at setting the solverType.

Could you upload here the complete log of the Fluid and the Solid solvers? Near the beginning there must be a version message, such as:

---[precice]  This is preCICE version 2.0.1
---[precice]  Revision info: v2.0.0-9-g44aec5f

Okay, here is the test case at the moment: https://gofile.io/?c=aKjB6m

Here is Fluid.log

/*---------------------------------------------------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  6
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
Build  : 6-47517f2ebb1b
Exec   : pimpleFoam -case Fluid
Date   : Mar 06 2020
Time   : 09:47:23
Host   : "debian"
PID    : 4248
I/O    : uncollated
Case   : ./Fluid
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 10)
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Selecting dynamicFvMesh dynamicMotionSolverFvMesh
Selecting motion solver: displacementLaplacian
Selecting motion diffusion: quadratic
Selecting motion diffusion: inverseDistance

PIMPLE: Convergence criteria found
        U: tolerance 5e-05
        p: tolerance 0.0005


PIMPLE: No corrector convergence criteria found
        Calclations will do 50 corrections

Reading field p

Reading field U

Reading/calculating face flux field phi

Selecting incompressible transport model Newtonian
Selecting turbulence model type laminar
Selecting laminar stress model Stokes
No MRF models present

No finite volume options present
Constructing face velocity Uf

Courant Number mean: 0 max: 0

Starting time loop

---[preciceAdapter] The preciceAdapter was loaded.
Registered objects:
26
(
solutionControl
points
neighbour
faceDiffusivity
MRFProperties
pointMesh
pointDisplacement
faces
U
turbulenceProperties
fvSchemes
fvOptions
faceZones
fvSolution
Uf
nu
phi
owner
data
cellZones
boundary
dynamicMeshDict
p
cellDisplacement
pointZones
transportProperties
)

---[preciceAdapter] Reading the adapter's YAML configuration file ./Fluid/precice-adapter-config.yml...
---[preciceAdapter] [DEBUG] Checking the adapter's YAML configuration file...
---[preciceAdapter] [DEBUG]   participant : Fluid
---[preciceAdapter] [DEBUG]   precice-config-file : precice-config.xml
---[preciceAdapter] [DEBUG]   interfaces :
---[preciceAdapter] [DEBUG]   - mesh      : Fluid-Mesh-Centers
---[preciceAdapter] [DEBUG]     locations : faceCenters
---[preciceAdapter] [DEBUG]     Provide mesh connectivity : 0
---[preciceAdapter] [DEBUG]     patches   :
---[preciceAdapter] [DEBUG]       flap
---[preciceAdapter] [DEBUG]     write-data :
---[preciceAdapter] [DEBUG]       Force
---[preciceAdapter] [DEBUG]   - mesh      : Fluid-Mesh-Nodes;
---[preciceAdapter] [DEBUG]     locations : faceCenters
---[preciceAdapter] [DEBUG]     Provide mesh connectivity : 0
---[preciceAdapter] [DEBUG]     patches   :
---[preciceAdapter] [DEBUG]       flap
---[preciceAdapter] [DEBUG]     read-data :
---[preciceAdapter] [DEBUG]       Displacement
---[preciceAdapter] [DEBUG]     subcycling : 1
---[preciceAdapter] [DEBUG]     prevent early exit : 1
---[preciceAdapter] [DEBUG]     evaluate boundaries : 1
---[preciceAdapter] [DEBUG]     disable checkpointing : 0
---[preciceAdapter] [DEBUG]     CHT module enabled : 0
---[preciceAdapter] [DEBUG]     FSI module enabled : 1
---[preciceAdapter] [DEBUG] Configuring the FSI module...
---[preciceAdapter] [DEBUG]     user-defined solver type : none
---[preciceAdapter] [DEBUG]     pointDisplacement field name : pointDisplacement
---[preciceAdapter] [DEBUG] Determining the solver type...
---[preciceAdapter] [DEBUG] Found the transportProperties dictionary.
---[preciceAdapter] [DEBUG] Found the turbulenceProperties dictionary.
---[preciceAdapter] [DEBUG] Did not find the thermophysicalProperties dictionary.
---[preciceAdapter] [DEBUG] This is an incompressible flow solver, as turbulence and transport properties are provided.
---[preciceAdapter] [DEBUG] Checking the timestep type (fixed vs adjustable)...
---[preciceAdapter] [DEBUG]   Timestep type: fixed.
---[preciceAdapter] [DEBUG] Creating the preCICE solver interface...
---[preciceAdapter] [DEBUG]   Number of processes: 1
---[preciceAdapter] [DEBUG]   MPI rank: 0
---[preciceAdapter] [DEBUG]   preCICE solver interface was created.
---[preciceAdapter] [DEBUG] Configuring preCICE...
---[precice] ERROR:  Tag <time-window-size> is unknown

Here is Solid.log ( that I cut to the beginning so it does not show timesteps information).

/*---------------------------------------------------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  6
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
Build  : 6-47517f2ebb1b
Exec   : solidFoam -case Solid
Date   : Mar 06 2020
Time   : 09:47:23
Host   : "debian"
PID    : 4249
I/O    : uncollated
Case   : ./Solid
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 10)
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Reading dictionaries ...
Reading data from dictionaries ...
Creating mesh parameters ...
Creating mesh coordinate fields ...
Creating mesh normal fields ...
Creating linear momentum fields ...
Creating strain measure fields ...
Creating constitutive model ...
>>energy Algorithm
>>energy Algorithm OK
Creating fields for wave speeds ...
Creating fields for gradient ...
Creating fields for reconstruction ...
Creating fields for riemann solver ...
Creating fields for the constrained procedure ...
Creating fields for angular momentum ...
Creating fields for post-processing ...
Creating variables for time ...
Printing data ...

Printing material properties ...
Constitutive model = neoHookean
Density = 1100 [1 -3 0 0 0 0 0]
Young's modulus = 17000000 [1 -1 -2 0 0 0 0]
Poisson's ratio = 0.45 [0 0 0 0 0 0 0]
Lame's first parameter lambda = 52758621 [1 -1 -2 0 0 0 0]
Lame's second parameter mu = 5862069 [1 -1 -2 0 0 0 0]
Bulk modulus kappa = 56666667 [1 -1 -2 0 0 0 0]
Linear pressure wave speed = 242.1171 [0 1 -1 0 0 0 0]
Linear shear wave speed = 73.001052 [0 1 -1 0 0 0 0]

Printing global momentums ...
Global linear momentum = (0 0 0)
Global angular momentum = (0 0 0)

Centroid of geometry = (0.425 0.2 -1.4076841e-18)
---[preciceAdapter] The preciceAdapter was loaded.
Registered objects:
45
(
rhsAm
S_t
lm_b
points
F
neighbour
controlDict
AinvLocal
J
Up
xN
rhsLm
S_lm
pointMesh
t_M
faces
x
Ainv
fvSchemes
faceZones
lm
fvSolution
energyAlgorithm
P_M
(S|magSf)
owner
lmN
data
lm_M
cellZones
boundary
(sqrt(((((nu*E)|((1+nu)*(1-(2*nu))))+(2*(E|(2*(1+nu)))))|rho))|stretch)
n
p
uN
P
((0.5*(lm_M+lm_M))+((0.5*S_t)&((P_M&(S|magSf))-t_M)))
(P_M&(S|magSf))
mechanicalProperties
((0.5*(t_M+(P_M&(S|magSf))))+((0.5*S_lm)&(lm_M-lm_M)))
t_b
H
pointZones
stretch
Us
)

---[preciceAdapter] Reading the adapter's YAML configuration file ./Solid/precice-adapter-config.yml...
---[preciceAdapter] [DEBUG] Checking the adapter's YAML configuration file...
---[preciceAdapter] [DEBUG]   participant : Solid
---[preciceAdapter] [DEBUG]   precice-config-file : precice-config.xml
---[preciceAdapter] [DEBUG]   interfaces :
---[preciceAdapter] [DEBUG]   - mesh      : Solid-Mesh-Faces
---[preciceAdapter] [DEBUG]     locations : faceCenters
---[preciceAdapter] [DEBUG]     Provide mesh connectivity : 0
---[preciceAdapter] [DEBUG]     patches   :
---[preciceAdapter] [DEBUG]       wetsurface
---[preciceAdapter] [DEBUG]     write-data :
---[preciceAdapter] [DEBUG]       Force
---[preciceAdapter] [DEBUG]   - mesh      : Solid-Mesh-Nodes
---[preciceAdapter] [DEBUG]     locations : faceCenters
---[preciceAdapter] [DEBUG]     Provide mesh connectivity : 0
---[preciceAdapter] [DEBUG]     patches   :
---[preciceAdapter] [DEBUG]       wetsurface
---[preciceAdapter] [DEBUG]     read-data :
---[preciceAdapter] [DEBUG]       Displacement
---[preciceAdapter] [DEBUG]     subcycling : 1
---[preciceAdapter] [DEBUG]     prevent early exit : 1
---[preciceAdapter] [DEBUG]     evaluate boundaries : 1
---[preciceAdapter] [DEBUG]     disable checkpointing : 0
---[preciceAdapter] [DEBUG]     CHT module enabled : 0
---[preciceAdapter] [DEBUG]     FSI module enabled : 1
---[preciceAdapter] [DEBUG] Configuring the FSI module...
---[preciceAdapter] [DEBUG]     user-defined solver type : none
---[preciceAdapter] [DEBUG]     pointDisplacement field name : pointDisplacement
---[preciceAdapter] [DEBUG] Determining the solver type...
---[preciceAdapter] [DEBUG] Did not find the transportProperties dictionary.
---[preciceAdapter] [DEBUG] Did not find the turbulenceProperties dictionary.
---[preciceAdapter] [DEBUG] Did not find the thermophysicalProperties dictionary.
---[preciceAdapter] [DEBUG] Destroying the FSI module...
--> FOAM Warning :
    From function bool Foam::functionObjectList::read()
    in file db/functionObjects/functionObjectList/functionObjectList.C at line 746
    Caught FatalError
--> FOAM FATAL ERROR:
Error in the preCICE adapter:
Could not determine the solver type, or this is not a compatible solver: neither transport, nor turbulence properties are provided.


    From function void adapterInfo(std::__cxx11::string, std::__cxx11::string)
    in file Utilities.C at line 32.


Time step =1
Time increment = 5.782326e-06 s
Time = 5.78233e-06 s

I have linked the CSM solver I am using on a post above, but what you need to know is that the node displacements are ensured by a field called “uN”.

Indeed, the configuration error appears before preCICE reports the version. Could you then upload your wmake.log and ldd.log? Better upload them as files, not inline (they are quite long).

Of course, here they are.

EDIT: I rebuilt the openfoam-adapter with libprecice2 and i join here the new log files. I will check the test case again.

EDIT2: I reran the same test case. The Fluid.log and Solid.log do not change. I also included

FSI
{
    ...
    solverType incompressible;
}

in Solid’s preciceDict but nothing changed.

Also, I went through the configuration page and stoppped on the boundary conditions here
As the available cases only use OpenFOAM for the fluid participant, I suppose I have to adapt my boundary conditions according to this paragraph ?
Do you know if I have to do something similar for the structural part ?

EDIT: The test case is now available in a repo here.

From what I see in your ldd.log, it seems that the adapter links to libprecice.so.1.6.1 which exists in /usr/local/lib:

libprecice.so.1.6.1 => /usr/local/lib/libprecice.so.1.6.1 (0x00007fe28582b000)

Try running make uninstall in your preCICE build/ directory. If this does not work, then delete all the relevant files under /usr/local (mainly look into lib/, include/, share/).

EDIT2: I reran the same test case. The Fluid.log and Solid.log do not change. I also included

FSI
{
   ...
   solverType incompressible;
}

in Solid’s preciceDict but nothing changed.

Remember that you are currently using an old version of the OpenFOAM adapter, which does not read preciceDict, only precice-adapter-config.yml. Please update to the latest state.

Also, I went through the configuration page and stoppped on the boundary conditions here
As the available cases only use OpenFOAM for the fluid participant, I suppose I have to adapt my boundary conditions according to this paragraph ?
Do you know if I have to do something similar for the structural part ?

Yes, you need to adapt your boundary conditions according to what you read. I assume you want to read forces. This is actually not yet implemented in the adapter, but you can see how @JSeuffert implemented this in FSI: OF solid mechanics and OF fluid mechanics by JSeuffert · Pull Request #121 · precice/openfoam-adapter · GitHub

Initially I installed/reinstalled libprecice using the debian package and not from the sources. What I will do:

  1. Uninstall the package with apt
  2. remove relevant files that you mentioned
  3. reinstall libprecice (the newest version of course) with apt
  4. pull newest sources of openfoam-adapter and reinstall it
  5. Check @JSeuffert’s implementation

I do not compile the sources myself cause I had issues when I tried, and installing from the debian package did not result in any issue because I was able to run the test cases available on github.
I come back and let you know.

Hey @dashqua,

wow, you did already some nice progress!
When you (hopefully without a lot of effort) get precice 2.0.1 to work, then indeed as @Makis already pointed out, you have to add the read forces / write displacement options in the adapter (see my pull request).

I just had a short look at the solidFoam solver.
If I understood it right I think it should work if you add two things in the solver:

  • a volVectorField “Forces” in the createFields where precice writes the forces coming from the fluid part to the interface patch
  • a boundary condition (something like “forceTraction”) that is based on the “tractionTraction” boundary but uses the “Forces” field to calculate the traction at the solid patch

Cheers,
Julian

3 Likes

Hey @JSeuffert,

I have created a new “loadingType_” in the tractionTraction boundary condition so that the traction tensor “t_C” gets the value of “Forces”:

else if (loadingType_ == "FSI")
{
  // lookup for Forces
  const volVectorField& Forces = db().lookupObject<volVectorField>("Forces");
  const fvMesh& mesh = Forces.mesh();
  // hardcoding at the moment
  forAll( mesh.boundary(), patch) // loop over patches
  {
    const word& patchName = mesh.boundary()[patch].name();
    // if the patch is wetsurface
    if ( patchName == "wetsurface" )
    {
        forAll( mesh.boundary()[patch], facei) // loop over faces
        {
          // values of Forces at correct patch
          vector tmp ( Forces.boundaryField()[patch][facei] ) ;
          t_C[facei] = tmp; // t_C receives the values of Forces
        }
    }

I think I should start seeing some interesting results from now on. I am now trying to make it run. Here is the test case I am using.