Skip to content
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog-entries/392.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Added a table of supported fields per read/write in `README.md` [#392](https://github.com/precice/openfoam-adapter/pull/392)
86 changes: 56 additions & 30 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,58 @@ This preCICE adapter is a plug-in (function object) for OpenFOAM, which can work

## What can it do?

This adapter can read/write the following fields in a surface coupling setup:

- Temperature (read + write)
- Temperature surface-normal gradient (read + write)
- Heat flux (read + write)
- Sink temperature (read + write)
- Heat transfer coefficient (read + write)
- Force (read + write)
- Stress (write)
- Displacement (read + write)
- Displacement delta (read)
- Pressure (read + write)
- Pressure surface-normal gradient (read + write)
- Velocity (read + write)
- Velocity surface-normal gradient (read + write)
- Phase fraction (alpha) (read + write)
- Phase fraction (alpha) gradient (read + write)
- Phase flux (phi) (read + write)

In addition, the adapter supports the following fields in a volume coupling setup:

- Temperature (write)
- Pressure (write)
- Velocity (read + write)

All features of preCICE are supported, including implicit coupling and nearest-projection mapping. Even though OpenFOAM is 3D, this adapter can also work in the 2D mode of preCICE, defining only one layer of interface nodes (automatically).
This adapter has been demonstrated on different use cases (conjugate heat transfer, fluid-structure interaction, fluid-fluid coupling), both in 2D (3D with one layer of cells in the z-axis) and 3D, and both for flow and solid OpenFOAM-based solvers (see [tutorials](https://precice.org/tutorials.html)).
The fields to read/write are provided by different adapter modules that one needs to [configure](https://precice.org/adapter-openfoam-config.html) and are currently the following.

Legend on locations to read/write:

- **N:** Mesh nodes (surface coupling)
- **F:** Face centers (surface coupling)
- **C:** cell centers (volume coupling)
- ***:** mesh connectivity supported (for e.g., nearest-projection mapping)

### Module: Conjugate heat transfer

| Field | Write | Read | Config prefix |
| --- | --- | --- | --- |
| 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` |
Comment on lines +29 to +32
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.


All fields are supported for both flow (compressible/incompressible) and basic (e.g., laplacianFoam) solvers.

### Module: Fluid-structure interaction

| 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.

| Displacement: relative | N*, F* | N*, F* | `DisplacementDelta` |
| Force | F* (flow) | F* | `Force` |
| Stress | F* (flow) | F* | `Stress` |
Comment on lines +42 to +43
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


| Field | Write | Read | Config prefix |
| --- | --- | --- | --- |
| Drag force | F*, C | F*, C | `DragForce` |
| 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?

| Phase fraction gradient | F* | F* | `AlphaGradient` |
| Pressure | F*, C | F*, C | `Pressure` |
| Pressure: full gradient | F*, C* | F* | `PressureGradientFull` (TODO: read-only) |
| Pressure: surface-normal gradient | F* | F* | `PressureGradient` |
| Temperature | F* | F* | `FlowTemperature` |
| Temperature surface-normal gradient | F* | F* | `FlowTemperatureGradient` |
| Velocity | F*, C | F*, C | `Velocity` |
| Velocity surface-normal gradient | F* | F* | `VelocityGradient` |

All fields assume a flow solver.

## Try

Expand Down Expand Up @@ -70,6 +96,10 @@ The volume coupling functionality was contributed by Tina Vladimirova, in the co

The adapter is [easily extensible](https://precice.org/adapter-openfoam-extend.html).

{% disclaimer %}
This offering is not approved or endorsed by OpenCFD Limited, producer and distributor of the OpenFOAM software via www.openfoam.com, and owner of the OPENFOAM® and OpenCFD® trade marks.
{% enddisclaimer %}

### Related literature

[^1]: Chourdakis, G., Schneider, D., & Uekermann, B. (2023). OpenFOAM-preCICE: Coupling OpenFOAM with External Solvers for Multi-Physics Simulations. OpenFOAM® Journal, 3, 1–25.<br/>
Expand All @@ -92,7 +122,3 @@ URL: https://mediatum.ub.tum.de/node?id=1696254&change_language=en

[^7]: Tina Vladimirova. Design, implementation, and validation of a volume coupling extension for the OpenFOAM-preCICE adapter. IDP report, School of Computation, Information and Technology, Technical University of Munich, 2023.<br/>
URL: https://mediatum.ub.tum.de/1734883

{% disclaimer %}
This offering is not approved or endorsed by OpenCFD Limited, producer and distributor of the OpenFOAM software via www.openfoam.com, and owner of the OPENFOAM® and OpenCFD® trade marks.
{% enddisclaimer %}
2 changes: 1 addition & 1 deletion docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ solver displacementLaplacian;

#### 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.


Similarly to the CHT module, you need a `fixedValue` boundary condition of the respective primary field in order to read and apply values, and a `fixedGradient` boundary condition of the respective gradient field in order to read and apply gradients.

Expand Down
Loading