precice / precice/tutorials

elastic-tube-1d: Solvers do not support subcycling in implicit coupling

Open
#240 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug good first issue
Dominant language
C
Stars
142
Forks
167
Avg merge
20h 24m
Merged PRs (30d)
11

Description

Looking at the FluidSolver.py, I noticed that a few things are a bit uncommon in the time loop:

https://github.com/precice/tutorials/blob/95eea58160af574f8f1ab4ace248d5be53d8e140/elastic-tube-1d/fluid-python/FluidSolver.py#L127-L156

It looks like the checkpointing assumes that the solver time step is equal to the coupling time window. More specifically, whenever preCICE does not ask the solver to read a checkpoint, the solver writes a checkpoint of the current solution. However, this also means that the checkpoint will be updated at every solver time step and the solver will not return to the right state when subcycling.

Two more problems:

  • There is no checkpointing of the time itself, we only have a time_it += 1.
  • We are essentially tricking preCICE, telling it that we read/wrote checkpoints at different points that we actually do. This makes the code difficult to follow.

The SolidSolver.py, as well as the C++ solvers, also have the same flaw.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the referenced FluidSolver.py time loop at lines 127-156, then compare its checkpointing with SolidSolver.py and the C++ solvers. Reproduce a subcycling case and trace solver time and checkpoint state across coupling windows. Done means all affected solvers restore the correct state without claiming checkpoint operations at points where they did not occur.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.