Question about data mapping from solid solver to fluid solver

Hi all,
I’m trying to simulate a multiphase FSI case (water seeping into soil). The soil part is removed in fluid mesh and it’s 0.1m wide and 0.2m high. For solid part, the cell size in x direction on the interface is 0.01m, which is two times of fluid cell size. The water level is 0.1m above the soil’s top surface. The pressure on the interface should be 981Pa. However, the solid solver didn’t get the right Pressure.

The BC for fluid part and preciceDict are as follows:

alpha.water

/--------------------------------- C++ -----------------------------------
| ========= | |
| \ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \ / O peration | Version: 1.5-dev |
| \ / A nd | Web: http://www.OpenFOAM.org |
| \/ M anipulation | |
*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object alpha.water;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 0 0 0 0 0 0];

internalField uniform 0;

boundaryField
{
inlet
{
type zeroGradient;
}
outlet
{
type zeroGradient;
}
“wall.”
{
type zeroGradient;
}
seepageTest
{
type zeroGradient;
}
frontAndBack
{
type zeroGradient;
}
atmosphere
{
type inletOutlet;
inletValue uniform 0;
value uniform 0;
}
}

// ************************************************************************* //

pointDisplacement

FoamFile
{
version 2.0;
format ascii;
class pointVectorField;
object pointDisplacement;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 1 0 0 0 0 0];

internalField uniform (0 0 0);

boundaryField
{
inlet
{
type slip;
}

outlet
{
    type            slip;
}

seepageTest
{
    type            fixedValue;
    value           $internalField;
}

   
atmosphere
{
    type            slip;
}

"wall."
{
    type            slip;
}

frontAndBack
{
    type            slip;
}

}

// ************************************************************************* //

p_rgh

/--------------------------------- C++ -----------------------------------
| ========= | |
| \ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \ / O peration | Version: 1.5-dev |
| \ / A nd | Web: http://www.OpenFOAM.org |
| \/ M anipulation | |
*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p_rgh;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [1 -1 -2 0 0 0 0];

internalField uniform 0;

boundaryField
{
“wall.”
{
type fixedFluxPressure;
value uniform 0;
}
seepageTest
{
type fixedFluxPressure;
value uniform 0;
}
frontAndBack
{
type fixedFluxPressure;
value uniform 0;
}
outlet
{
type fixedFluxPressure;
value uniform 0;
}
inlet
{
type fixedFluxPressure;
value uniform 0;
}
atmosphere
{
type totalPressure;
U U;
phi phi;
rho rho;
psi none;
gamma 1;
p0 uniform 0;
value uniform 0;
}
}

// ************************************************************************* //

U

/--------------------------------- C++ -----------------------------------
| ========= | |
| \ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \ / O peration | Version: 1.7.x |
| \ / A nd | Web: www.OpenFOAM.com |
| \/ M anipulation | |
*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
location “0”;
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 1 -1 0 0 0 0];

internalField uniform (0 0 0);

boundaryField
{
inlet
{
type fixedValue;
value uniform (0 0 0);
}
atmosphere
{
type pressureInletOutletVelocity;
value uniform (0 0 0);
}
“wall.”
{
type fixedValue;
value uniform (0 0 0);
}
seepageTest
{
type fixedValue;
value $internalField;
}
frontAndBack
{
type fixedValue;
value uniform (0 0 0);
}
outlet
{
type fixedValue;
value uniform (0 0 0);
}
}

// ************************************************************************* //

preciceDict

FoamFile
{
version 2.0;
format ascii;
class dictionary;
location “system”;
object preciceDict;
}

preciceConfig “…/precice-config.xml”;

participant Fluid;

modules (FSI);

interfaces
{
Interface1
{
mesh Fluid-Mesh;
patches (seepageTest);
locations faceCenters;

readData
(

);

writeData
(
  Pressure
);

};

Interface2
{
mesh Fluid-Mesh;
patches (seepageTest);
locations faceNodes;

readData
(
  Displacement
  Velocity
);

writeData
(

);

};

};

FSI
{
rho rho [1 -3 0 0 0 0 0] 1;
}

Hi @Stan,

may I ask you upload your preciceDict as well? I cannot open the vtu files you uploaded since the file content is inlined in your post.

In your preDict, interface1 and interface2 use the same mesh. Should it be FluidFaceMesh and FluidNodeMesh respectively?

1 Like

Hi @Michael, thanks for your hint. I set it wrong since I used to adopt only one Fluid-Mesh for faceCenters to read and write data. I’ll modify the setting and check the precice-output again.

Sorry for deleting the previous wrong results since there are some mistakes in case setting. After modifing the case setting for our solid solver and modifying the preciceDict according to @Michael , the case works fine even though the pressures are still smaller than expected (due to mapping?). I’m refering to Mapping Configuration and the topic How does precice use meshes for mapping and communication, however, I have a few more questions to ask.

  1. In partitioned-pipe case, the locations where to exchange Pressure and ‘Velocity’ are not defined.
    preciceDict_partitioned-pipe.txt (437 Bytes)
    For Pressure and Velocity, should we exchange these kind of data on faceCenters or faceNodes?
  2. At present, I exchange Pressure on faceCenters, Displacement and Velocity on faceNodes.
    precice-config.xml (3.0 KB)
    preciceDict.txt (735 Bytes)
    preCICE-output in solid part:
    Fluid-Mesh-Centers-Solid.dt1.txt (5.1 KB)
    Fluid-Mesh-Nodes-Solid.dt1.txt (10.8 KB)
    Solid-Mesh-Solid.dt1.txt (5.6 KB)
    For preCICE-output in solid part, Fluid-Mesh-Centers-Solid.dt*.vtk contains the coordinates of fluid cell face centers and pressures. The pressures in this file are interpolated by the pressures in Fluid-Mesh-Centers-Fluid.dt1_r*.vtu, right? For Fluid-Mesh-Nodes-Solid.dt*.vtk, it contains the coordinates of fluid cell nodes but all the variables are zero, why? Additionally, for Solid-Mesh-Solid.dt*.vtk, it includes the coordinates of all solid face nodes, pressures (mapped from Fluid-Mesh-Centers-Fluid.dt1_r* or Fluid-Mesh-Centers-Solid.dt1?)
    preCICE-output in fluid part:
    Fluid-Mesh-Centers-Fluid.dt1_r0.txt (2.0 KB)
    Fluid-Mesh-Centers-Fluid.dt1_r1.txt (2.0 KB)
    Fluid-Mesh-Nodes-Fluid.dt1_r0.txt (3.2 KB)
    Fluid-Mesh-Nodes-Fluid.dt1_r1.txt (3.2 KB)
    Solid-Mesh-Fluid.dt1_r0.txt (3.1 KB)
    Solid-Mesh-Fluid.dt1_r1.txt (2.9 KB)
    For preCICE-output in fluid part, Fluid-Mesh-Centers-Fluid.dt1_r* contains all the pressures on faceCenters and Fluid-Mesh-Nodes-Fluid.dt1_r* contains all the displacements and velocities on fluid faceNodes. The pressures here are directly obtained from OpenFOAM by interpolation from volume center to face certer, and the displacements and velocities here are interpolated from the data in Solid-Mesh-Fluid.dt1_r*, right?
  3. In fluid part, there are repetitive points and data in files such as Solid-Mesh-Fluid.dt1_r0 and Solid-Mesh-Fluid.dt1_r1. Is it a kind of method preCICE handling data mapping or anything wrong in my case setting?
  4. AFAIK, OpenFOAM stores and calculates variables at volume centers. I also wonder if it is OpenFOAM itself or preCICE that does the interpolation from face centers to volume centers (or from face nodes to volume centers) when I read variables from solid solver by faceCenters (or faceNodes). If it is preCICE, since preCICE only has the values on the interface, the data at the volume centers seems to be the extrapolation from the face centers or face nodes, which may be not so accurate. If it is OpenFOAM, since it has both the data of inner cells and the values on the interface, the value at the volume center can be interpolated well.
    If my understanding is wrong, please point it out. Any suggestions will be appreciated!

Best,
Stan

IIRC the default is faceCenters. Anyway, this would be the right thing to specify if you want to specify the location.

That’s unfortunately not supposed to work.

As you probably already know, the suffix _r<N> indicates the rank working on this portion of the mesh. There can be overlaps in this regions and is related to the way preCICE handles the partitioning.

I guess you are referring here to the configuration you set in the preciceDict file. This is handled in the OpenFOAM adapter and has nothing to do with preCICE itself. preCICE doesn’t ‘know’ such things at all, as it is only a vertex cloud from the preCICE perspective.

1 Like

Hi @DavidSCN ,
Sorry for the late reply.

You mean the original adapter, right? I’ve added Pressure and Velocity into FSI module to make it work with Displacement, Pressure and Velocity. The Displacment and Velocity calculated on the solid part seem to be succefully passed to OpenFOAM on faceNodes in my case.

It’s clear to me.

Thanks again for the detailed explaination!