Skip to content

Commit 435042f

Browse files
author
Daniels Vidulejs
committed
Clarify write side in readme and add error message
1 parent 4bbb2e5 commit 435042f

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

docs/config.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ Explicitly setting `locations volumeCenters;` in preciceDict is required for vol
302302
303303
When reading on the OpenFOAM side, the Generic module automatically detects the boundary condition type of the coupled patch to apply the received data. The boundary condition must be respected, therefore the data received is applied either as a `fixedValue` or `fixedGradient` boundary condition, determined by the type set in the `0/` files.
304304
305-
Additionally, the Robin or mixed boundary condition is now supported for surface coupling. The OpenFOAM boundary type `mixed` must be set for the coupled patch in the `0/` files like so:
305+
Additionally, the Robin or mixed boundary condition is now supported for scalar surface coupling. The OpenFOAM boundary type `mixed` or `mixedCoded` must be set for the coupled patch in the `0/` files like so:
306306
307307
```cpp
308308
// File 0/T
@@ -318,7 +318,11 @@ boundaryField
318318
}
319319
```
320320

321-
Any of the three fields `refValue`, `refGradient`, and `valueFraction` can be written or read using the adapter (the initial values will be overwritten by the adapter). To do so, specify the `operation` for each coupling data in `preciceDict` as `ref-value`, `ref-gradient`, or `value-fraction`. Be careful when using the `value-fraction` operation, as it is not a physical quantity and must be within the range of (0, 1). Please note that if you intend to use the `mixed` boundary condition for a heat transfer problem, the `valueFraction` is not the same as the heat transfer coefficient and it's not possible to explicitly set the heat transfer coefficient as a parameter.
321+
Any of the three fields `refValue`, `refGradient`, and `valueFraction` can be read from another participant (the initial values will be overwritten by the adapter). To do so, specify the `operation` for each coupling data in `preciceDict` as `ref-value`, `ref-gradient`, or `value-fraction`. Be careful when using the `value-fraction` operation, as it is not a physical quantity and must be within the range of [0, 1].
322+
323+
These three operations are only supported for the read side. To write coupling data from a mixed boundary patch, just use the standard `value` or `surface-normal-gradient` operation. The `valueFraction` field of the mixed boundary condition is not exposed by the adapter for writing.
324+
325+
Please note that if you intend to use the `mixed` boundary condition for a heat transfer problem, the `valueFraction` is not the same as the heat transfer coefficient and it's not possible to explicitly set the heat transfer coefficient as a parameter.
322326

323327
Limitations:
324328

module-generic/ReadWrite.C

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,13 @@ std::size_t preciceAdapter::Generic::ScalarFieldCoupler::write(double* buffer, b
160160
return bufferIndex;
161161
}
162162

163+
if (fieldConfig_.operation == "ref-value" || fieldConfig_.operation == "ref-gradient" || fieldConfig_.operation == "value-fraction")
164+
{
165+
adapterInfo(
166+
"Generic module: The mixed boundary condition operations (ref-value, ref-gradient, and value-fraction) are only supported for the read side. If you wish to write these fields, just use the value or surface-normal-gradient operations instead.",
167+
"error");
168+
}
169+
163170
if (this->locationType_ == LocationType::volumeCenters)
164171
{
165172
if (cellSetNames_.empty())

0 commit comments

Comments
 (0)