dynamicMotionSolverListFvMesh incompatible with displacementMotionSolvers
A case to reproduce the problem can be found here:
https://github.com/isoAdvector/floatingBodyVolumeNonPreservationCase
The README file explains the problem and provides a derivation to show the incompatibility.
I recommend either removing the dynamicMotionSolverListFvMesh class completely (there are no tutorials using it) or if there are actually some relevant use cases of it then at least introduce a fatalError if it is used in combination with multiple displacementMotionSolvers.
To implement a dynamicMesh class working with multiple displacementMotionSolvers one could access their common points0 field and their different pointDisplacements directly in the mesh class update() function. Something along these lines:
// Accumulated displacement
pointField disp(points().size(), Zero);
// First accummulate all non-floaterMotion displacements
forAll(motionSolvers_, i)
{
if (isA<displacementMotionSolver>(motionSolvers_[i]))
{
displacementMotionSolver& p0Solver =
dynamic_cast<displacementMotionSolver&>
(
motionSolvers_[i]
);
p0Solver.solve();
disp += p0Solver.pointDisplacement();
}
}
// Moving mesh with accummulated point displacement, disp
const pointIOField& points0 = lookupObject<pointIOField>("points0");
fvMesh::movePoints(points0 + disp);
I have verified that a solution along these lines works in the floatStepper library (not yet pushed to github).
Best, Johan