Finish steady state coupling upon convergence

Hi there,

I’m trying to set up a steady-state flow-over-heated-plate case with FEniCSx and OpenFOAM. I use explicit coupling, as it is done in this tutorial, just with a 2D domain.

I increased themax-time-windows value in the preCICE config to get a converged solution, the results look good. My problem is that preCICE can’t finish properly, because the OpenFOAM solver stops upon convergence:

(...)
---[precice] e[0m Time window completed
---[precice] e[0m iteration: 1, time-window: 2023 of 3000, time: 2022, time-window-size: 1, max-timestep-length: 1, ongoing: yes, time-window-complete: yes, 
Time = 2023

DILUPBiCG:  Solving for Ux, Initial residual = 9.794287e-07, Final residual = 9.794287e-07, No Iterations 0
DILUPBiCG:  Solving for Uy, Initial residual = 9.422523e-07, Final residual = 9.422523e-07, No Iterations 0
DILUPBiCG:  Solving for h, Initial residual = 9.559519e-07, Final residual = 9.559519e-07, No Iterations 0
DICPCG:  Solving for p_rgh, Initial residual = 1.431039e-05, Final residual = 1.347849e-07, No Iterations 94
time step continuity errors : sum local = 5.428658e-08, global = 7.887407e-12, cumulative = 0.02528319
rho min/max : 0.9758943 0.9999998
ExecutionTime = 187.66 s  ClockTime = 454 s


SIMPLE solution converged in 2023 iterations

---[precice] e[0m Time window completed
---[precice] e[0m iteration: 1, time-window: 2024 of 3000, time: 2023, time-window-size: 1, max-timestep-length: 1, ongoing: yes, time-window-complete: yes, 
--> FOAM Warning : 
    From void adapterInfo(std::string, std::string)
    in file Utilities.C at line 17
    e[36mWarning in the preCICE adapter: e[0m
The solver exited before the coupling was complete.

End

---[precice] e[0m Implicitly finalizing in destructor
---[precice] e[0m Synchronize participants and close communication channels

The solid participant (which doesn’t check for convergence by default) is not finalizing properly, the logs look like this:

(...)
---[precice] e[0m iteration: 1, time-window: 2023 of 3000, time: 2022, time-window-size: 1, max-timestep-length: 1, ongoing: yes, time-window-complete: yes, 
---[precice] e[0m Time window completed
---[precice] e[0m iteration: 1, time-window: 2024 of 3000, time: 2023, time-window-size: 1, max-timestep-length: 1, ongoing: yes, time-window-complete: yes, 

Ist there any way to improve this behavior?

The complete setup can be found here: dolfinx-openfoam/steady_state at main · nemocrys/dolfinx-openfoam · GitHub

There was a potential workaround mentioned in another thread that suggests using an implicit coupling after all. I think there had been another thread that discussed your approach and the wish for an “early exit” option, but I could not find it now. Maybe somebody else remembers it.

1 Like

Thanks for this hint! Unfortunately implicit doesn’t work here because of the somewhat loose coupling, where the solid temperature (also at the interface) converges much faster that the fluid temperature.

For my case a special steady-state coupling scheme would be great, where one / both solvers let preCICE know when they’re converged. Once both solvers gave their okay preCICE terminates the simulation normally. I assume that at the moment there is no development planned in this direction?

1 Like

There is no way (yet) to tell preCICE via the API to end the simulation. Such a functionality should not be tooo complicated to add though.
If you just need a clean access for your case now, the two workarounds are obvious probably:

  • Switch off the steady-state check in OpenFOAM (or set it to a finer value), or
  • Decrease max-time-windows
1 Like

Thank you, the workarounds will be good enough for now.

Maybe I’ll come back to that issue later in my project, if you plan to improve on that please let me know :slight_smile:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.