Conversation
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.
|
Overall, it would be easier to add a table with fields as rows and as columns:
and then have We should then also add the missing documentation from #380. |
|
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;
}
} |
davidscn
left a comment
There was a problem hiding this comment.
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`. |
There was a problem hiding this comment.
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.
| | 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` | |
There was a problem hiding this comment.
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
writeside 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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
But then F* on write side is also impossible to configure.
|
|
||
| | Field | Write | Read | Config prefix | | ||
| | --- | --- | --- | --- | | ||
| | Displacement: absolute | N*, F* | N*, F* | `Displacement` | |
There was a problem hiding this comment.
| | 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.
| | Force | F* (flow) | F* | `Force` | | ||
| | Stress | F* (flow) | F* | `Stress` | |
There was a problem hiding this comment.
| | 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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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` | |
There was a problem hiding this comment.
| | Phase fraction | F*, C | F*, C | `Alpha` | | |
| | Volume fraction | F*, C | F*, C | `Alpha` | |
or is Phase clear here?
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>
|
I've created a new PR to fix the outdated mesh connectivity statements in all of the modules. |
|
Self-reminder: Check and update the documentation with a clarification:
This is already there, but maybe we can make it easier/clearer earlier. |
for consistent data, for coservative data, it makes only sense for the reading side |
|
Let's wrap this PR up.
|
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: