-
-
Notifications
You must be signed in to change notification settings - Fork 109
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
perpendicular-flap/solid-fenics
: Regression
#573
Comments
I also observed a regression in the system tests, which however affects both the OpenFOAM-CalculiX and SU2-FEniCS combinations: precice/precice#2052 (comment) That one could be something in preCICE or in the tutorials repository. But I see that you have isolated the impact of the FEniCS adapter version here. |
It seems like #554 might actually be the issue here. The reference for the FEniCS code uses the non-UFL variant in the update_fields method and the UFL variant of from fenics import Function, FunctionSpace, UnitIntervalMesh, project
mesh = UnitIntervalMesh(5)
V = FunctionSpace(mesh,'P',1)
u = Function(V)
v = Function(V)
u.vector()[:]=[1,2,3,4,5,6]
u_sqrd_ufl = u*u
v.assign(project(u_sqrd_ufl, V))
print(v.vector()[:]) # [ 0.83333333 3.83333333 8.83333333 15.83333333 24.83333333 35.83333333]
u_sqrd = u.vector()*u.vector()
v.vector()[:] = u_sqrd[:]
print(v.vector()[:]) # [1 4 9 16 25 36] |
I found the issue, for the behaviour. One parameter was wrong: - v_new = update_v(u, u_old, v_old, a_old)
+ v_new = update_v(a_new, u_old, v_old, a_old) But after this correction, the pressure starts to oscillate after a few iterations resulting in a crash after a few iterations. Reducing the time step size was also no help, since this led to an even earlier crash. Running the simulation with the ufl variant of So, we should revert the changes from #554. |
Thanks for investigating. The source code you are pointing to above is clearly buggy. Let's fix this first in an independent commit. Can you create a PR that only contains the fixed version For the second issue the solution is not so clear. #554 fixes a crash for subcycling. This means we would re-introduce this problem, if we revert #554. What if we only set |
It did before adding the changes of precice/fenics-adapter#172. #554 merely circumvented the modification of checkpoints, as the approach in #554 creates new dof vectors every time the fields are updated instead of working with the objects used for checkpointing. The simulation crashed because the checkpoints were accidentally overwritten with new values. Since we use deep copies now, this will not happen. To be certain that reverting changes of #554 will not lead to crashes again, I tested it without the changes of #554 and it worked. |
I investigated the bug now a while to understand it better and came to the following conclusion: The following error - v_new = update_v(u, u_old, v_old, a_old)
+ v_new = update_v(a_new, u_old, v_old, a_old) actually hides the obviously faulty implementation in #554. If I fix the error above, but leave the assignment as it is, I get the following displacement: Additionally, the simulation crashes after approx. 2.5s. Reverting #554 via #578 looks to me like the correct approach. I think we still need a better test coverage to avoid similar problems in the future. The systemtests mentioned by @MakisH should definitely help here. |
There seems to be a regression in
perpendicular-flap/solid-fenics
when looking at the tip displacement:#554 is a candidate. Maybe the issue is related to checkpointing and how the values are updated here. If I remember correctly, we only checked the results with the fake fluid solver. Here, no checkpointing is needed.
edit: I used
fenicsprecice==v2.1.0
for these results. However, withfenicsprecice==v2.2.0rc1
it is also possible to reproduce the results.The text was updated successfully, but these errors were encountered: