openfoam-adapter icon indicating copy to clipboard operation
openfoam-adapter copied to clipboard

Implement restart from reference configuration

Open davidscn opened this issue 2 years ago • 3 comments

Closes #223

With this, we can restart the 'initial' simulation by resetting the deformation accumulated throughout the simulation. It would be important to check how other (structural) codes handle the restart: If they define also the 'deformed' interface mesh when restarting, the reset here would be undesired. Do we have solver which behave this way? I only checked deal.II for now, and the functionality used there is entirely based on the initial configuration.

TODO list:

  • [ ] I updated the documentation in docs/
  • [ ] I added a changelog entry in changelog-entries/ (create directory if missing)

davidscn avatar Mar 11 '22 14:03 davidscn

I only checked deal.II for now, and the functionality used there is entirely based on the initial configuration.

I would indeed expect this behavior from the restart of a CSM solver. Same mesh, "only" different displacement values.

uekerman avatar Mar 12 '22 09:03 uekerman

Hi,

It would be important to check how other (structural) codes handle the restart: If they define also the 'deformed' interface mesh when restarting, the reset here would be undesired. Do we have solver which behave this way?

I ran a test using FOAM and CalculiX. I exported and visualized the initial meshes (init) after the restart; both were 'deformed' meshes. I realized it because my initial configuration (i.e. the initial run, not the restart) had a y-dead=true for the mappings which caused issues after the restart unless removed. This might therefore cause a conflict with CalculiX's restart feature.

AndresPedemonteFIUBA avatar Apr 01 '22 18:04 AndresPedemonteFIUBA

@AndresPedemonteFIUBA, thanks for pointing this out, I know (cf also with the source code comment in ccx as pointed out by @boris-martin) and I'm not sure how to handle or change the behavior properly. Creating transparency and enabling the reference restart optional in a first step is probably a good idea.

davidscn avatar Apr 02 '22 11:04 davidscn

Discussing with @davidscn: This is important, but changing the default could be surprising for users that already have adapted to the current behavior. Let's make it an optional feature (disabled by default) and reconsider in a future, breaking release.

This needs further work (applying the review comments, documenting, testing). Will postpone merging for several days by default.

MakisH avatar Sep 19 '22 08:09 MakisH

Alright, so, how do we test this?

MakisH avatar Sep 27 '22 16:09 MakisH

You can just run a simulation and restart from a particular time stamp and export the precice interface. You don't need to execute the actual coupling to test this.

davidscn avatar Sep 27 '22 16:09 davidscn

Yes, sorry I had the option in the interface config instead of the FSI config, I changed it now to match the docs.

Also the changed default switched the logic, I also fixed that in the code now.

How to test:

  1. run athe perpendicular flap completely
  2. select startTime = 0.7 (as it allows to see it quite clear)
  3. run a few time-steps
  4. open ParaView and select Point Gaussian visualization

Doing this with both options (enabled and disabled) should deliver different results.

davidscn avatar Sep 27 '22 19:09 davidscn

I added a note on solid solvers. If the solid solver operates only in reference coordinates, the option is a bit misleading.

davidscn avatar Sep 28 '22 12:09 davidscn

To document this: I disabled the option for solid solvers and made it only available for fluid solvers. All solid solvers I tested (solids4foam and solid-openfoam) use only the reference configuration. If one wants to restart a simulation using either of these solid solvers, one has to select restartFromDeformed false on the Fluid side and nothing on the solid side.

davidscn avatar Sep 29 '22 15:09 davidscn