Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Displacement reading: Allow mesh motion solvers without a pointDisplacement field #241

Merged
merged 3 commits into from Aug 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 11 additions & 7 deletions FSI/Displacement.C
Expand Up @@ -107,14 +107,18 @@ void preciceAdapter::FSI::Displacement::read(double* buffer, const unsigned int
for (unsigned int d = 0; d < dim; ++d)
cellDisplacement_->boundaryFieldRef()[patchID][i][d] = buffer[i * dim + d];
}
// Get a reference to the displacement on the point patch in order to overwrite it
vectorField& pointDisplacementFluidPatch(
refCast<vectorField>(
pointDisplacement_->boundaryFieldRef()[patchID]));

// Overwrite the node based patch using the interpolation objects and the cell based vector field
// Afterwards, continue as usual
pointDisplacementFluidPatch = interpolationObjects_[j]->faceToPointInterpolate(cellDisplacement_->boundaryField()[patchID]);
if (pointDisplacement_ != nullptr)
{
// Get a reference to the displacement on the point patch in order to overwrite it
vectorField& pointDisplacementFluidPatch(
refCast<vectorField>(
pointDisplacement_->boundaryFieldRef()[patchID]));

// Overwrite the node based patch using the interpolation objects and the cell based vector field
// Afterwards, continue as usual
pointDisplacementFluidPatch = interpolationObjects_[j]->faceToPointInterpolate(cellDisplacement_->boundaryField()[patchID]);
}
}
else if (this->locationType_ == LocationType::faceNodes)
{
Expand Down
1 change: 1 addition & 0 deletions changelog-entries/241.md
@@ -0,0 +1 @@
- Enabled mesh motion solvers that do not register a pointDisplacement field (such as the RBFMeshMotionSolver from solids4foam) to work with the adapter [#241](https://github.com/precice/openfoam-adapter/pull/241)
52 changes: 38 additions & 14 deletions docs/config.md
Expand Up @@ -181,7 +181,7 @@ interface
* For `readData(Displacement)` or `DisplacementDelta`, you need the following:
* `type movingWallVelocity` for the interface (e.g. `flap`) in `0/U`,
* `type fixedValue` for the interface (e.g. `flap`) in the `0/pointDisplacement`, and
* `solver displacementLaplacian` in the `constant/dynamicMeshDict`.
* `solver displacementLaplacian` in the `constant/dynamicMeshDict`. The solver [`RBFMeshMotionSolver` from solids4foam is also known to work](https://github.com/precice/openfoam-adapter/pull/241), currently (August 2022) with the develop branch of the OpenFOAM adapter and the nextRelease branch of solids4foam.

```c++
// File 0/U
Expand Down Expand Up @@ -332,7 +332,7 @@ Some optional parameters can allow the adapter to work with more solvers, whose
The adapter tries to automatically determine the solver type,
based on the dictionaries that the solver uses.
However, you may manually specify the solver type to be `basic`,
`incompressible` or `compressible` for a CHT or FSI simulation:
`incompressible` or `compressible` for a CHT simulation:

```c++
CHT
Expand All @@ -341,6 +341,15 @@ CHT
};
```

or the `incompressible`, `compressible`, or `solid` (e.g., for solids4Foam) for an FSI simulation:

```c++
FSI
{
solverType solid;
}
```

This will force the adapter use the boundary condition implementations
for the respective type.

Expand All @@ -354,21 +363,36 @@ file (the values correspond to the default values):
```c++
CHT
{
# Temperature field
nameT T1;
# Thermal conductivity
nameKappa k1;
# Density
nameRho rho1;
# Heat capacity for constant pressure
nameCp Cp1;
# Prandtl number
namePr Pr1;
# Turbulent thermal diffusivity
nameAlphat alphat1;
// Temperature field
nameT T1;
// Thermal conductivity
nameKappa k1;
// Density
nameRho rho1;
// Heat capacity for constant pressure
nameCp Cp1;
// Prandtl number
namePr Pr1;
// Turbulent thermal diffusivity
nameAlphat alphat1;
};
```

Similarly for FSI simulations:

```c++
FSI
{
// Displacement fields
namePointDisplacement pointD;
nameCellDisplacement D;
// Force field on the solid
forceFieldName solidForce;
}
```

Use the option `namePointDisplacement unused;` for solvers that do not create a pointDisplacement field, such as the RBFMeshMotionSolver.

#### Debugging

The adapter also recognizes a few more parameters, which are mainly used in debugging or development.
Expand Down