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
- Recreate a Solid test case where I am able to run a simulation that is purely structural (i.e. using only solidFoam)
- Include precice functionObjects and library in controlDict
- 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.