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
Sending zero displacements in a serial-implicit coupling crashes precice (perpendicular-flap tutorial) #1558
Comments
Welcome back @mennodeij! Some more details (from the zip): The coupling scheme is configured using <coupling-scheme:serial-implicit>
<time-window-size value=" 0.1000000000000000E-01" />
<max-time value=" 0.5000000000000000E+01" />
<participants first="Fluid" second="Solid" />
<exchange data="Displacement" mesh="Solid-Mesh-Node" from="Solid" to="Fluid" />
<relative-convergence-measure limit=" 0.1000000000000000E-02" data="Displacement" mesh="Solid-Mesh-Node" />
<exchange data="Force" mesh="Solid-Mesh-Node" from="Fluid" to="Solid" />
<max-iterations value="10" />
<acceleration:IQN-ILS>
<initial-relaxation value=" 0.1000000000000000E+00" />
<max-used-iterations value="100" />
<time-windows-reused value="15" />
<data name="Displacement" mesh="Solid-Mesh-Node" />
<!--data name="Force" mesh="Solid-Mesh-Node" /-->
<filter type="QR2" limit="1e-2" />
<preconditioner type="residual-sum" />
</acceleration:IQN-ILS>
</coupling-scheme:serial-implicit> The assertion hit is inside The warning is located here precice/src/acceleration/BaseQNAcceleration.cpp Lines 183 to 188 in 91a2cde
|
Looks like another (useful!) instance of #1496 (or related to it) |
Ok, I hope it helps to make serial-implicit with IQN more robust. |
This issue has been mentioned on preCICE Forum on Discourse. There might be relevant details there: https://precice.discourse.group/t/openfoam-calculix-fsi-unable-to-converge/1349/4 |
A few recent changes in develop (coming up in v3.0.0, as well as in v2.5.1) have probably fixed this issue. @mennodeij could you please confirm? (edit: actually, no, the issue still persists, but I am not sure we can do something about it) Just to clarify different cases:
If I hack the OpenFOAM adapter to always write zero displacement, disregarding the forces I read, I get the following warnings from the second participant, followed by a crash (perpedicular-flap, fluid-openfoam, solid-openfoam, serial-implicit with IQN, using only the Displacement for the acceleration):
But I think this is expected behavior, no? preCICE tells you that something is wrong, but you may have reasons to continue. Here is the config: <coupling-scheme:serial-implicit>
<time-window-size value="0.01" />
<max-time value="5" />
<participants first="Fluid" second="Solid" />
<exchange data="Force" mesh="Solid-Mesh" from="Fluid" to="Solid" />
<exchange data="Displacement" mesh="Solid-Mesh" from="Solid" to="Fluid" />
<max-iterations value="50" />
<relative-convergence-measure limit="5e-3" data="Displacement" mesh="Solid-Mesh" />
<relative-convergence-measure limit="5e-3" data="Force" mesh="Solid-Mesh" />
<acceleration:IQN-ILS>
<data name="Displacement" mesh="Solid-Mesh" />
<!-- <data name="Force" mesh="Solid-Mesh" /> -->
<preconditioner type="residual-sum" />
<filter type="QR2" limit="1e-2" />
<initial-relaxation value="0.5" />
<max-used-iterations value="100" />
<time-windows-reused value="15" />
</acceleration:IQN-ILS>
</coupling-scheme:serial-implicit> and here is the modified OpenFOAM adapter forAll(cellDisplacement_->boundaryField()[patchID], i)
{
for (unsigned int d = 0; d < dim; ++d)
buffer[bufferIndex++] = 0;
// cellDisplacement_->boundaryField()[patchID][i][d];
} With v2.5.0, there is an error+exit instead of warnings+crash:
A parallel-implicit scheme works anyway. @uekerman @Fujikawas do you think we can still improve something here, while still allowing simulations to continue? |
Thanks for the detailed analysis, everybody! If the QN system runs empty, we could do an underrelaxation step again. This was the original idea in #1510 But probably beyond v3.0.0 |
I think we can still do better. The problem you describe above stems from the preconditioner and not from the QN and I would consider it more of a bug on how we treat the scaling in the preconditioner. You can easily verify this by selecting The problem is that we divide here by zero precice/src/acceleration/impl/ResidualSumPreconditioner.cpp Lines 55 to 56 in 7fc70b7
(and similarly in other preconditioner) if the residual is already zero in the very first iteration. |
Using a preconditioner when there is only one data vector in the acceleration is anyway useless. Maybe we could forbid this or switch off automatically. |
Yes, switching off automatically sounds like a good idea as configuration changes become otherwise more intrusive when trying different configurations. The problem above would persist though. |
So, do we want to somehow address this for v3.0, or postpone it to v3.1? I get the impressions from the discussion that there is more juice to squeeze out of this fruit and we should not rush it. |
You mean that it would also happen if multiple data fields are used in acceleration and all of them are zero, right? Should probably be not too complicated to extend the preconditioners by alternative ways how to treat the case when But let's move indeed to v3.1 |
Describe your setup
Operating system (e.g. Linux distribution and version): Linux Rocky 8.0
preCICE Version: 2.5.0
Describe the problem
I am developing a new fsi adapter and due to programming error on my side, the coupling data was lagging behind 1 coupling step. This resulted in sending zero displacement to the fluid-solver once too often. When using a parallel-implicit coupling, there was no problem, but when using a serial-implicit coupling, precice crashes with a vague warning message and core-dump due to std::dequeue failure (see below).
NOTES:
Error message
Step To Reproduce
Expected behaviour
If sending zero displacement should be possible, that needs to be fixed.
Otherwise, I would have liked to get more explanation on "The coupling residual equals almost zero", especially while the line above says that the residual is infinity. Furthermore, a better explanation on why sending zero displacement is not suitable for the serial implicit coupling.
Additional context
None.
The text was updated successfully, but these errors were encountered: