Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BDF/EXT time-stepper #134

Merged
merged 18 commits into from
Feb 26, 2024
Merged

BDF/EXT time-stepper #134

merged 18 commits into from
Feb 26, 2024

Conversation

jcallaham
Copy link
Collaborator

@jcallaham jcallaham commented Feb 21, 2024

Add a BDF solver with an equal-order extrapolation estimate for the nonlinear term. This results in a semi-implicit solver that only needs one linear system solve per time step. The scheme is based on the time-stepping in Nek5000.

This solver is slower to solve an individual time step compared to IPCS (because it uses a mixed formulation instead of split velocity/pressure systems), but typically faster overall since it can take larger time steps. For example, on the cylinder (single core on my laptop, medium-resolution mesh), the BDF3 solver takes about 14.5 sec wall clock time per unit of simulation time, compared to about 54.3 sec per unit of sim time for IPCS (about a 4x speedup). We can probably improve on this further by using a stabilized formulation like SUPG so that we can use equal-order elements and have a smaller mixed linear system to solve.

Profiling

Time to run each environment to tf=1.0, using approximately the maximum stable time step for each method and the default mesh for each environment. Times reported are wall clock times.

Cylinder Pinball Cavity Step
IPCS (nproc=1) 0:57 3:34
IPCS (nproc=4) 0:48 1:50
IPCS (nproc=8) 0:43 1:30
IPCS (nproc=32) 1:15 1:43 1:10:30 13:13
BDF3 (nproc=1) 0:22 1:34
BDF3 (nproc=4) 0:15 0:43
BDF3 (nproc=8) 0:15 0:40
BDF3 (nproc=32) 0:25 0:47 12:13 3:57
Max speedup 2.9x 2.3x 5.8x 3.3x

Looks like ~3x speedup on average, maybe more for larger problems. The mixed element systems do lead to larger linear system solves, but hopefully that can be somewhat mitigated with SUPG stabilization or linear velocity elements.

Changes

  • Add new time-stepper (semi-implicit BDF/EXT scheme of order k=1, 2, 3).
  • Add ScaledDirichletBC to represent time-varying BCs more easily. IPCS now uses time-varying BCs instead of B vectors.
  • Use exact ODE solution to update damped actuators (also gets rid of "inertia" parameter - now rolled into "damping" as a single time scale. See docstring for DampedActuator). No longer need to specify integration type.
  • Minor changes to Actuator interface
  • Add a common base class for Firedrake Navier-Stokes timesteppers
  • Some cleanup of the "flow.py" codes

TODO

  • Benchmark IPCS on cylinder
  • Fix other flow configs
  • Can IPCS use ScaledDirichletBC as well?
  • Test SUPG stabilization for linear velocity elements? (See SUPG stabilization and equal-order elements #135)
  • Test preconditioners for time-stepping solve
  • Fix checkpoint loading
  • Test Step environment w/ random forcing

@jcallaham jcallaham marked this pull request as ready for review February 22, 2024 19:23
@jcallaham jcallaham changed the title [WIP] BDF/EXT time-stepper BDF/EXT time-stepper Feb 24, 2024
Copy link
Collaborator

@cl126162 cl126162 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked changes and everything works fine

@cl126162 cl126162 merged commit 605766e into main Feb 26, 2024
6 checks passed
@jcallaham jcallaham mentioned this pull request Mar 2, 2024
@jcallaham jcallaham deleted the jc/bdf-solver branch March 2, 2024 11:00
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.

2 participants