Skip to content

Add cachingDelay option to postpone preconditioner caching - #172

Open
greole wants to merge 1 commit into
devfrom
feature/delay-precond-caching
Open

greole wants to merge 1 commit into
devfrom
feature/delay-precond-caching

Conversation

@greole

@greole greole commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Adds a cachingDelay option to the preconditioner dictionary. For the first cachingDelay times a preconditioner is built for a system matrix, it is rebuilt on every solve. After that, the regular caching period applies. This is useful when the matrix changes strongly in the first solves, e.g. during initial transients, so caching an early preconditioner would hurt convergence.

preconditioner
{
    preconditioner BJ;
    caching        10;
    cachingDelay   5;
}
  • Preconditioner::caching_period(d) returns 0 while the delay is active, and the configured caching value otherwise.
  • The build count is stored per matrix as preconditionerGenerations in the existing _gkoSolverProperties dictionary.
  • cachingDelay defaults to 0, so existing setups are unchanged.
  • README option table updated.

Testing

  • Not compiled or run locally yet; needs a build with OpenFOAM sourced and a case run with verbose 1 to check the "Postpone preconditioner caching" log messages.

The first cachingDelay preconditioner generations are always regenerated,
afterwards the regular caching period is applied.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant