openfoam-adapter
openfoam-adapter copied to clipboard
Implement restart from reference configuration
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)
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.
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, 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.
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.
Alright, so, how do we test this?
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.
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:
- run athe perpendicular flap completely
- select
startTime = 0.7
(as it allows to see it quite clear) - run a few time-steps
- open ParaView and select
Point Gaussian
visualization
Doing this with both options (enabled and disabled) should deliver different results.
I added a note on solid solvers. If the solid solver operates only in reference coordinates, the option is a bit misleading.
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.