Active moving horizontal plate(OpenFOAM+CalculiX)

Hello

Hope you are all well.

I’m using openfoam’s overset mesh solver “overPimpleDyMFoam” to achieve fluid-structure coupling of horizontal plates in a flow field.

My case is this: the head of the horizontal plate moves up and down actively, and the tail of the plate can swing freely in the flow field

The grid file looks like this:

I first simulated the non-overset mesh situation using the PimpleDyMFoam solver, and the results looked correct. But when you use the overPimpleDyMFoam solver, the calculix solver calculates a very large force.

Would really appreciate any help.

Here are all my files
https://drive.google.com/file/d/1ofzyCa-KsVJoP3EGKQIJyZrlpWbJ66Me/view?usp=sharing
I tried to derive the results of each iteration step and found that the force in the first time step was very large.

      <export:vtu every-n-time-windows="1" directory="./precice-result" every-iteration="1" normals="0"/>

I tried running only openfoam


functions
{
    //preCICE_Adapter
    //{
    //     type preciceAdapterFunctionObject;
    //     libs ("libpreciceAdapterFunctionObject.so");
    //}
}
  • The result looks correct because the mesh doesn’t move

Results are as follows

Similarly, if I start the precice-openfoam-calculix coupling by fixing all degrees of freedom of all nodes in calculix, the result is also correct.

*BOUNDARY
Nall, 1,1
 
*BOUNDARY
*Nall, 2,3

However, if the x and z degrees of freedom of all nodes are fixed and all nodes are given a displacement function,.

*BOUNDARY
Nall, 1,1
 
*BOUNDARY,AMPLITUDE=MyAmplitude
*Nall, 2, 2 ,1
 
*BOUNDARY
Nall, 3

The openfoam terminal will output an error

    zone:0 nCells:12288  voxels:(156 156 1) bb:(-1.47245e-06 -1.47245e-06 -1.47245e-06) (1 0.410001 1)
    zone:1 nCells:12120  voxels:(156 156 1) bb:(0.149999 0.119999 -1.17712e-06) (0.750001 0.280001 1)
Overset analysis : nCells : 24408
    calculated   : 23516
    interpolated : 616 (interpolated from local:616  mixed local/remote:0  remote:0)
    hole         : 276

forces Forces write:
    Sum of forces
        Total    : (1.28018 0 0)
        Pressure : (0 0 0)
        Viscous  : (1.28018 0 0)
    Sum of moments
        Total    : (0 0.64009 -0.256036)
        Pressure : (0 0 0)
        Viscous  : (0 0.64009 -0.256036)


Courant Number mean: 0.163625 max: 0.823893
Time = 0.0005

DICPCG:  Solving for cellDisplacementx, Initial residual = 0, Final residual = 0, No Iterations 0
DICPCG:  Solving for cellDisplacementy, Initial residual = 1, Final residual = 2.00145e-16, No Iterations 1
[0]PETSC ERROR: ------------------------------------------------------------------------
[0]PETSC ERROR: Caught signal number 8 FPE: Floating Point Exception,probably divide by zero

This is the log file of OF and ccx

ccx log.txt (7.1 KB)
OFlog.txt (10.5 KB)

However, as can be seen from the output of the first iteration step of precice, the initial state is correct, the forces and displacements of the first iteration step of the solid and fluid appear to be correct.
Fluid-Mesh-Fluid.init.txt (12.2 KB)
Fluid-Mesh-Fluid.it1.txt (18.1 KB)
Solid-Mesh-Fluid.init.txt (16.3 KB)
Solid-Mesh-Fluid.it1.txt (22.5 KB)

            </DataArray>
         </Cells>
         <PointData Scalars="Rank " Vectors="Displacement Force ">
            <DataArray type="UInt32" Name="Rank" NumberOfComponents="1" format="ascii">
               0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
            </DataArray>
            <DataArray type="Float64" Name="Displacement" NumberOfComponents="3" format="ascii">
               6.92202e-311 4.6801e-311 4.6801e-311  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  0 1.25e-05 0  
            </DataArray>
            <DataArray type="Float64" Name="Force" NumberOfComponents="3" format="ascii">
               **17.7465 -0.00329648 0  19.7678 -0.171797 0  17.7465 0.00744945 0  19.7678 0.303624 0  23.3511 -0.518046 0  21.8297 -0.239513 0  21.8297 0.270005 0  23.3512 0.6537 0  -11.4843 -0.0298418 0  -0.928967 -0.0332703 0  -2.06451 -0.0364896 0  -1.84385 -0.0376827 0  -1.8342 -0.0384044 0  -1.80401 -0.0388428 0  -1.78361 -0.039142 0  -1.77047 -0.0393555 0  -1.76014 -0.0395108 0  -1.75305 -0.0396259 0  -1.74754 -0.0397122 0  -1.74342 -0.0397774 0  -1.74022 -0.0398273 0  -1.73761 -0.039866 0  -1.73556 -0.0398967 0  -1.73391 -0.0399215 0  -1.73249 -0.0399423 0  -1.73128 -0.0399604 0  -1.73028 -0.039977 0  -1.72943 -0.039993 0  -1.72862 -0.0400092 0  -1.72786 -0.040026 0  -1.72718 -0.0400439 0  -1.72654 -0.0400633 0  -1.7259 -0.0400845 0  -1.72525 -0.0401077 0  -1.72461 -0.040133 0  -1.72396 -0.0401607 0  -1.72328 -0.0401907 0  -1.72257 -0.040223 0  -1.72186 -0.0402577 0  -1.72112 -0.0402946 0  -1.72033 -0.0403338 0  -1.71948 -0.0403751 0  -1.7186 -0.0404183 0  -1.71771 -0.0404633 0  -1.71679 -0.0405097 0  -1.7158 -0.0405575 0  -1.71476 -0.0406062 0  -1.71369 -0.0406555 0  -1.7126 -0.040705 0  -1.71147 -0.0407544 0  -1.71029 -0.0408031 0  -1.70909 -0.0408505 0  -1.70787 -0.040896 0  -1.70662 -0.0409391 0  -1.70533 -0.0409789 0  -1.70405 -0.0410145 0  -1.70282 -0.0410447 0  -1.70158 -0.0410685 0  -1.70032 -0.0410847 0  -1.69914 -0.0410918 0  -1.6981 -0.0410876 0  -1.69718 -0.04107 0  -1.69638 -0.0410368 0  -1.69585 -0.0409849 0  -1.69574 -0.0409106 0  -1.69604 -0.0408092 0  -1.69705 -0.0406753 0  -1.69918 -0.0405024 0  -1.70259 -0.0402807 0  -1.70891 -0.0400021 0  -1.71751 -0.0396498 0  -1.733 -0.0392069 0  -1.75773 -0.0387084 0  -1.75946 -0.0377294 0  -1.9901 -0.0391126 0  -0.760942 -0.0238 0  -12.0926 -0.128279 0  -11.2134 -0.175088 0  -0.106436 0.00472572 0  -11.2134 0.130692 0  -12.0926 0.0672072 0  -0.76094 0.0261074 0  -1.99009 0.0342058 0  -1.75946 0.0339511 0  -1.75772 0.0346795 0  -1.733 0.035106 0  -1.7175 0.0354415 0  -1.70891 0.0356853 0  -1.70258 0.0358569 0  -1.69918 0.0359736 0  -1.69705 0.0360459 0  -1.69604 0.0360829 0  -1.69573 0.0360913 0  -1.69585 0.0360764 0  -1.69638 0.0360424 0  -1.69718 0.0359924 0  -1.6981 0.0359292 0  -1.69914 0.035855 0  -1.70032 0.0357717 0  -1.70157 0.0356808 0  -1.70281 0.0355838 0  -1.70405 0.0354818 0  -1.70532 0.0353757 0  -1.70661 0.0352664 0  -1.70786 0.0351547 0  -1.70908 0.0350414 0  -1.71029 0.034927 0  -1.71147 0.034812 0  -1.7126 0.0346969 0  -1.71369 0.0345821 0  -1.71476 0.0344681 0  -1.7158 0.0343551 0  -1.71678 0.0342434 0  -1.71771 0.0341333 0  -1.7186 0.0340251 0  -1.71948 0.0339188 0  -1.72033 0.0338146 0  -1.72112 0.0337126 0  -1.72186 0.0336129 0  -1.72257 0.0335155 0  -1.72328 0.0334205 0  -1.72396 0.0333276 0  -1.72461 0.0332368 0  -1.72525 0.033148 0  -1.7259 0.0330609 0  -1.72654 0.0329751 0  -1.72717 0.0328904 0  -1.72786 0.0328062 0  -1.72862 0.0327218 0  -1.72942 0.0326366 0  -1.73028 0.0325496 0  -1.73128 0.0324598 0  -1.73249 0.0323658 0  -1.7339 0.0322657 0  -1.73555 0.0321572 0  -1.7376 0.0320379 0  -1.74021 0.0319044 0  -1.74342 0.0317519 0  -1.74754 0.0315742 0  -1.75304 0.0313628 0  -1.76014 0.0311069 0  -1.77047 0.0307897 0  -1.7836 0.0303858 0  -1.80401 0.0298584 0  -1.8342 0.0291377 0  -1.84384 0.0281332 0  -2.06451 0.0264226 0  -0.928965 0.0245707 0  -11.4843 0.00559322 0  -11.0787 -0.02138 0  -0.430781 -0.00580164 0  -11.0787 -0.0163064 0  -8.58403 -0.0969777 0  2.57148 -0.171521 0  1.35101 -0.160022 0  1.58456 -0.161766 0  1.59162 -0.161222 0  1.62084 -0.16098 0  1.64046 -0.16077 0  1.65291 -0.160626 0  1.66284 -0.160534 0  1.66966 -0.160477 0  1.675 -0.160448 0  1.67903 -0.160436 0  1.68217 -0.160436 0  1.68469 -0.160442 0  1.68661 -0.160451 0  1.68808 -0.16046 0  1.68925 -0.160466 0  1.69012 -0.160467 0  1.69068 -0.160461 0  1.69099 -0.160448 0  1.69113 -0.160425 0  1.69112 -0.160392 0  1.69089 -0.160348 0  1.69049 -0.160293 0  1.68996 -0.160226 0  1.68931 -0.160146 0  1.68851 -0.160054 0  1.68757 -0.159948 0  1.68653 -0.15983 0  1.68536 -0.159698 0  1.68406 -0.159553 0  1.68263 -0.159394 0  1.6811 -0.159221 0  1.67948 -0.159035 0  1.67773 -0.158836 0  1.67585 -0.158624 0  1.67384 -0.158398 0  1.67172 -0.15816 0  1.6695 -0.157908 0  1.66715 -0.157645 0  1.66465 -0.157369 0  1.66201 -0.157081 0  1.65925 -0.156781 0  1.65633 -0.156471 0  1.65324 -0.156149 0  1.64999 -0.155818 0  1.64658 -0.155476 0  1.64295 -0.155126 0  1.63906 -0.154767 0  1.63495 -0.1544 0  1.63062 -0.154027 0  1.62596 -0.153648 0  1.6209 -0.153264 0  1.61543 -0.152877 0  1.60953 -0.152489 0  1.60302 -0.152102 0  1.59574 -0.151719 0  1.58763 -0.151342 0  1.57836 -0.150978 0  1.56746 -0.150631 0  1.55471 -0.15031 0  1.53841 -0.150026 0  1.51905 -0.149797 0  1.49209 -0.149643 0  1.45512 -0.149595 0  1.43971 -0.149669 0  1.20441 -0.149845 0  2.37638 -0.15051 0  -8.60668 -0.167357 0  -8.12096 -0.0164045 0  2.79548 -0.000318558 0  -8.12096 -0.0104092 0  -8.60667 0.137032 0  2.37639 0.153114 0  1.20442 0.149828 0  1.43972 0.150531 0  1.45513 0.150771 0  1.4921 0.151191 0  1.51907 0.151666 0  1.53842 0.152179 0  1.55472 0.152717 0  1.56747 0.153267 0  1.57837 0.153825 0  1.58764 0.154385 0  1.59575 0.154945 0  1.60304 0.155503 0  1.60954 0.156057 0  1.61545 0.156605 0  1.62091 0.157146 0  1.62598 0.157679 0  1.63063 0.158204 0  1.63497 0.15872 0  1.63907 0.159226 0  1.64296 0.159722 0  1.64659 0.160207 0  1.65 0.160682 0  1.65325 0.161145 0  1.65634 0.161596 0  1.65926 0.162035 0  1.66202 0.162462 0  1.66466 0.162876 0  1.66716 0.163277 0  1.66951 0.163666 0  1.67173 0.164041 0  1.67385 0.164402 0  1.67586 0.16475 0  1.67775 0.165085 0  1.67949 0.165405 0  1.68112 0.165712 0  1.68264 0.166005 0  1.68407 0.166284 0  1.68537 0.166549 0  1.68654 0.166801 0  1.68758 0.167038 0  1.68852 0.167263 0  1.68932 0.167475 0  1.68998 0.167674 0  1.6905 0.16786 0  1.6909 0.168035 0  1.69113 0.168199 0  1.69115 0.168353 0  1.691 0.168498 0  1.69069 0.168634 0  1.69013 0.168763 0  1.68926 0.168888 0  1.6881 0.169009 0  1.68662 0.16913 0  1.6847 0.169253 0  1.68218 0.169382 0  1.67905 0.169522 0  1.67501 0.169678 0  1.66967 0.169856 0  1.66285 0.170067 0  1.65292 0.170316 0  1.64048 0.170619 0  1.62085 0.170984 0  1.59163 0.171341 0  1.58457 0.172122 0  1.35102 0.169531 0  2.57149 0.187159 0  -8.58402 0.0652325 0  -8.19054 -0.197719 0  3.14395 0.0112459 0  -8.19054 0.164001 0**  
            </DataArray>
         </PointData> 
      </Piece>
   </UnstructuredGrid> 
</VTKFile>

I combine the efforts of the first iteration of the fluid and the solid, and I find that the resultant force of the first iteration of the fluid in the X and Y directions is equal to the resultant force of the first iteration of the fluid in the X and Y directions, respectively.
V1
It appears that the result of precice openfoam calculix in the first iteration step is correct, and the problem may arise when the fluid-structure coupling interface uses displacement to move the fluid mesh.

Courant Number mean: 0.163625 max: 0.823893
Time = 0.0005

DICPCG:  Solving for cellDisplacementx, Initial residual = 0, Final residual = 0, No Iterations 0
DICPCG:  Solving for cellDisplacementy, Initial residual = 1, Final residual = 2.00145e-16, No Iterations 1
[0]PETSC ERROR: ------------------------------------------------------------------------
[0]PETSC ERROR: Caught signal number 8 FPE: Floating Point Exception,probably divide by zero

Hi @daxiangxiang,

not sure how much I can help here, maybe one of the @calculix-users can help better (consider joining the group since you are one).

Are the nodes at the head of the CalculiX fixed, or are they moving freely?

Even though, I guess that the problem starts from the forces computed by OpenFOAM.

Any new thoughts/observations since you last wrote?

HI @Makis

Are the nodes at the head of the CalculiX fixed, or are they moving freely?

The head node is fixed

I am trying to debug the openfoam adapter and observe the interpolation of the fluid-structure interface, by using precice’s tool Export configuration(https://precice.org/configuration-export.html).

The results of the first iteration substep are exported, and the results appear to be correct, as are the number of nodes and coordinates at the flu-structure interface.

I have anther question to ask you:

  1. Can the openfoam-adapter program use “vscode” software to debug? I want to break points in the program and look at some variable values.
    I am currently using the release version and using “cout” to output some variable values. I have included the path to openfoam in vscode software, but using the openfoam adapter will report an error: the fvMesh.H file cannot be found.
    This is my c_cpp_properties.json file, and I have included the path to openfoam
            "includePath": [
                "${workspaceFolder}/**",
                "/usr/lib/openfoam/openfoam2112/src/**"
            ],

If I use vscode debug, do I need to modify some files?
2. May I ask what the preciceAdapterFunctionObject in the preciceAdapterFunctionObject.C file does and can it implement DebugSwitches functions similar to OF software?

namespace Foam
{
namespace functionObjects
{
defineTypeNameAndDebug(preciceAdapterFunctionObject, 0);
addToRunTimeSelectionTable(functionObject, preciceAdapterFunctionObject, dictionary);
}
}

The debugging-related question is unrelated to the original question, please start a new thread with that. :slight_smile:

Hi @Makis
As for the openfoam adapter, I still have some questions to consult you. Because there are still some problems in the overpimpledymfoam example.
I have modified part of the openfoam adapter source code to debug visual variables.:
The interface.c program of void preciceAdapter: : interface: : readCouplingData () function can be read into the buffer displacement data dataBuffer_.
The faceToPointInterpolate in the displacement.c program interpolates face center data to face nodes.
As shown in the figure below, I successfully found these variables.

My question is:

FaceToPointInterpolate function will be the center of the face after data interpolation to surface nodes, how do openfoam adapter (pointDisplacementFluidPatch) read the face of the node data transmission to the openfoam? My goal is to see the data passed to the openfoam interface, what should I do?

After the openfoam adapter read the coupling displacement, the bb size of zone 0 suddenly increased. This is my log file:
log.txt (30.8 KB)

Courant Number mean: 0.00163625 max: 0.00823893
Time = 5e-06

DICPCG:  Solving for cellDisplacementx, Initial residual = 0, Final residual = 0, No Iterations 0
DICPCG:  Solving for cellDisplacementy, Initial residual = 1, Final residual = 3.40149e-17, No Iterations 1
inverseDistance : detected 2 mesh regions
    zone:0 nCells:12288  voxels:(156 156 1) bb:(-1.1809e+09 -6.08826e+14 -1.1809e+09) (1.1809e+09 5.72073e+14 1.1809e+09)
    zone:1 nCells:12120  voxels:(156 156 1) bb:(0.149999 0.119999 -1.17712e-06) (0.750001 0.280001 1)
[0]PETSC ERROR: ------------------------------------------------------------------------
[0]PETSC ERROR: Caught signal number 8 FPE: Floating Point Exception,probably divide by zero
[0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger

I still couldn’t find the problem, so I wanted to find the displacement data passed to openfoam.

The adapter reads the displacement either from the face centers (cellDisplacement) or from the face nodes (pointDisplacement), depending on where the interface mesh is located. This you can configure in your preciceDict: Configure the OpenFOAM adapter | preCICE - The Coupling Library

The reading happens here: https://github.com/precice/openfoam-adapter/blob/master/FSI/Displacement.C#L94-L142

Have you tried exporting the interface mesh? Export configuration | preCICE - The Coupling Library

Hi @Makis

The precice Export (https://precice.org/configuration-export.html) can only export data at the interface. My purpose is to find the data that the openfoam adapter transfers to openfoam so that I can determine whether the problem is the openfoam setup or the openfoam adapter.
I read the openfoam adapter reference paper(https://repository.tudelft.nl/islandora/object/uuid:70beddde-e870-4c62-9a2f-8758b4e49123?collection=education) carefully,which mentioned: During runtime, the dynamic mesh is updated by the solver by calling the function fvMesh.update()
My understanding is this: The last step in the openfoam adapter source code calls the openfoam fvmesh::movepoints() function,
Question:
where is the key code for calling fvmesh::movepoints() in openfoam adapter, In other words: How does the openfoam adapter transfer openfoam values.

Derek’s thesis describes the FSI module in more detail, as it was in 2019. The reference paper where you can read more about the adapter in general is OpenFOAM-preCICE: Coupling OpenFOAM with External Solvers for Multi-Physics Simulations | OpenFOAM® Journal

Displacements are read here:

The adapter uses movePoints() for reading checkpoints:

Hi @Makis
I may not have described my problem clearly.
I learned from the article that the displacement value passing path is like this:

First, the openfoam adapter reads the displacement value, this process uses the following procedures:

 ///////////Displacement.c
            forAll(cellDisplacement_->boundaryField()[patchID], i)  
            {

                for (unsigned int d = 0; d < dim; ++d)
                    cellDisplacement_->boundaryFieldRef()[patchID][i][d] = buffer[i * dim + d];
            }

Then, the openfoam adapter interpolates the displacement value from surface center to the surface node, this process uses the following procedures:

 pointDisplacementFluidPatch = interpolationObjects_[j]->faceToPointInterpolate(cellDisplacement_->boundaryField()[patchID]);

But, finally, how does the openfoam adapter transfer node displacement values to openfoam?
Some guesses: In the source code, there is no related function found, the openfoam solver seems to call the fvmesh::update() function to update the mesh, the checkPoint function transfer the displacement value to openfoam?

Both cellDisplacement_ and pointDisplacementFluidPatch / pointDisplacement_ are C++ references to the respective fields in the OpenFOAM Objects Registry. So, by overwriting cellDisplacement_ / pointDisplacement_, the adapter overwrites the values that OpenFOAM uses.

OpenFOAM solvers compute different things with these fields and I don’t recall from the top of my head how OpenFOAM updates the mesh. The fvmesh::update() sounds like the right trail to follow.

Hi @daxiangxiang ,

I’m trying to do overset with precice-openfoam-fenics and also faced some problems with the coupling. Have you succeeded in your case? Could you share your code files?

Best regards,

Hi , Ken

There are still problems with overset grid cases that I’m still trying to fix, but I haven’t been debugging overset grids lately, and I’m still trying non-overset grids.