Skip to content

Clarify field support for solvers in README#392

Open
MakisH wants to merge 6 commits intodevelopfrom
clarify-fields
Open

Clarify field support for solvers in README#392
MakisH wants to merge 6 commits intodevelopfrom
clarify-fields

Conversation

@MakisH
Copy link
Member

@MakisH MakisH commented Jan 29, 2026

Replaces the list of fields that the adapter can read/write, with more detailed tables (one per module). The tables clarify which field can be written/read on which mesh locations, and whether mesh connectivity is provided.

It also mentions fields added with #380.

The tables need to be cross-checked. I am, in particular, unsure about the support of mesh connectivity.

The CI is currently failing for unrelated reasons:

Some fields are only supported by some types of solvers.
For example, solid OpenFOAM solvers cannot write force, because that is computed assuming a flow solver.

There are probably more like this, we need to check and document.
@MakisH MakisH self-assigned this Jan 29, 2026
@MakisH
Copy link
Member Author

MakisH commented Jan 30, 2026

Overall, it would be easier to add a table with fields as rows and as columns:

  • Points (column group)
    • Read
    • Write
  • Faces (column group)
    • Read
    • Write
  • Cells (column group)
    • Read
    • Write

and then have X or similar to mark what is supported, or Fluid/Solid if only one of them is possible.

We should then also add the missing documentation from #380.

@MakisH MakisH marked this pull request as ready for review February 13, 2026 14:59
@MakisH MakisH requested a review from davidscn February 16, 2026 15:19
@vidulejs
Copy link
Collaborator

In Adapter.C, line 178, it says FSI with meshConnectivity is unsupported and will throw an error.

    // If the FSI module is enabled, create it, read the
    // FSI-specific options and configure it.
    if (FSIenabled_)
    {
        // Check for unsupported FSI with meshConnectivity
        for (uint i = 0; i < interfacesConfig_.size(); i++)
        {
            if (interfacesConfig_.at(i).meshConnectivity == true)
            {
                adapterInfo(
                    "You have requested mesh connectivity (most probably for nearest-projection mapping) "
                    "and you have enabled the FSI module. "
                    "Mapping with connectivity information is not implemented for FSI, only for CHT-related fields. "
                    "error");
                return;
            }
        }

Copy link
Member

@davidscn davidscn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didnt check all the Cs in the FF module

#### FF

The fluid-fluid coupling module supports reading and writing `Pressure`, `Velocity`, `PressureGradient`, `VelocityGradient`, `FlowTemperature`, `FlowTemperatureGradient`, `Alpha`, `AlphaGradient` and the face flux `Phi`.
The fluid-fluid coupling module supports reading and writing `Pressure`, `Velocity`, `PressureGradient` (surface-normal gradient), `PressureGradientFull` (full pressure gradient), `VelocityGradient`, `FlowTemperature`, `FlowTemperatureGradient`, `Alpha`, `AlphaGradient`, `Phi` (face flux), `DragForce`, `ExplicitMomentum`, `ImplicitMomentum`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it would make sense to put the last three fields into the context of CFD-DEM, I am not sure how convenient such fields would be beyond that. Having them under fluid-fluid is also somewhat questionable.

Comment on lines +29 to +32
| Heat flux | N*, F | N, F* | `Heat-Flux` |
| Heat transfer coefficient | N*, F | N, F* | `Heat-Transfer-Coefficient` |
| Sink temperature | N*, F | N, F* | `Sink-Temperature` |
| Temperature | N*, F, C | N, F*, C | `Temperature` |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know where the confusion here stems from: the connectivity element in the OpenFOAM adapter was initially added with nearest-projection mappings in mind, for the above data fields, the following holds

  • all these fields are mapped consistent
  • for a consistent mapping, the write side needs to provide connectivity
  • the fields in OpenFOAM itself live on the face centers, so one would read them on the face centers.
  • the adapter generally only allows the definition of connectivity between face nodes

That said, for reading data, connectivity is not relevant, one would configure the face centers and leave the connectivity definition to the writing side. Internally, we only support reading on F (and C) for reading data and not N. Putting the F* on the read side is pointless (the connectivity is never used), but also doesnt work in terms of the adapter.

So correct would be

| Heat flux | N*, F | F | `Heat-Flux` |

See also: https://github.com/precice/tutorials/tree/develop/flow-over-heated-plate-nearest-projection

Copy link
Collaborator

@vidulejs vidulejs Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only saw your review now. I was also confused about mesh connectivity on F* on read side.

In Adapter.C, line 100, we allow mesh connectivity for faceNodes only.

                if (interfaceConfig.meshConnectivity && (interfaceConfig.locationsType == "faceCenters" || interfaceConfig.locationsType == "volumeCenters" || interfaceConfig.locationsType == "volumeCentres"))
                {
                    DEBUG(adapterInfo("Mesh connectivity is not supported for faceCenters or volumeCenters. \n"
                                      "Please configure the desired interface with the locationsType faceNodes. \n"
                                      "Have a look in the adapter documentation for detailed information.",
                                      "error"));
                    return;
                }

Also in Interface.C we only do
precice_.setMeshTriangles(meshName_, triVertIDs); if location is faceNodes.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But then F* on write side is also impossible to configure.


| Field | Write | Read | Config prefix |
| --- | --- | --- | --- |
| Displacement: absolute | N*, F* | N*, F* | `Displacement` |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| Displacement: absolute | N*, F* | N*, F* | `Displacement` |
| Displacement: absolute | N*, [F*](https://github.com/precice/openfoam-adapter/issues/153) | N*, F* | `Displacement` |

Should we link here to the issue? For Displacement, N* and F* on the read side is technically correct, but would be similar pointless as discussed above.

Comment on lines +42 to +43
| Force | F* (flow) | F* | `Force` |
| Stress | F* (flow) | F* | `Stress` |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| Force | F* (flow) | F* | `Force` |
| Stress | F* (flow) | F* | `Stress` |
| Force | F (flow) | F | `Force` |
| Stress | F (flow) | | `Stress` |

What does flow here mean? I think reading Stress is not supported.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I want to emphasize is that writing forces for an OpenFOAM structure solver (e.g., solidDisplacementFoam or solids4Foam) is not supported.

Displacement reading and writing is supported both for flow (compressible or incompressible) and structure solvers.
Force and stress writing in only supported for flow solvers, reading for both.

### Module: Fluid-fluid coupling
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think all F* in the following table need to be a F

| Momentum: explicit | F*, C | F*, C | `ExplicitMomentum` |
| Momentum: implicit | F*, C | F*, C | `ImplicitMomentum` |
| Phase flux | F* | F* | `Phi` |
| Phase fraction | F*, C | F*, C | `Alpha` |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| Phase fraction | F*, C | F*, C | `Alpha` |
| Volume fraction | F*, C | F*, C | `Alpha` |

or is Phase clear here?

@davidscn
Copy link
Member

In Adapter.C, line 178, it says FSI with meshConnectivity is unsupported and will throw an error.

I think this has similar historical reasons: we started with conventional FSI, i.e., reading displacement and writing forces. In such cases, the solid solver needs to provide the connectivity, so there was no real point in conisdering this scenario. Since we now also have solid solvers in OpenFOAM, it could make sense to allow the displacement with connectivity case.

Co-authored-by: David Schneider <david.schneider@ipvs.uni-stuttgart.de>
@vidulejs vidulejs mentioned this pull request Feb 19, 2026
2 tasks
@vidulejs
Copy link
Collaborator

I've created a new PR to fix the outdated mesh connectivity statements in all of the modules.

#393

@MakisH
Copy link
Member Author

MakisH commented Feb 20, 2026

Self-reminder: Check and update the documentation with a clarification:

  • Mesh connectivity only makes sense for the writing side
  • If a field supports connectivity, this is only for the nodes
  • Temperature is available on the face centers, but if connectivity is requested (i.e., on the nodes only), we interpolate from the faces to the nodes

This is already there, but maybe we can make it easier/clearer earlier.

@davidscn
Copy link
Member

Mesh connectivity only makes sense for the writing side

for consistent data, for coservative data, it makes only sense for the reading side

@vidulejs
Copy link
Collaborator

Let's wrap this PR up.

  1. Mesh connectivity (*) is only relevant for the Write side currently. Even though we had allowed mesh connectivity on Read, there is actually no implementation on the adapter side (comment). We do not currently distinguish between read and write in isLocationTypeSupported either.

  2. Mesh connectivity (*) is impossible for anything other than locations: faceNodes. There is a global block in Adapter.C, which will throw an error if it's anything other than Face Nodes. In Interface.C, we provide preCICE with the mesh connectivity data only in this case.

  3. FSI now allows mesh connectivity since PR 393.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants