Skip to content

Sync old/new-time state before ComputeDt to fix Boussinesq forcing - #209

Merged
asalmgren merged 1 commit into
AMReX-Fluids:developmentfrom
cgilet:boussRestart
Aug 20, 2026
Merged

asalmgren merged 1 commit into
AMReX-Fluids:developmentfrom
cgilet:boussRestart

Conversation

@cgilet

@cgilet cgilet commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

use of uninitialized tracer_o on restart and regrid.

ComputeDt calls compute_vel_forces_on_level, which uses both the old and new tracer fields for m_use_boussinesq. Previously, immediately after a restart (old-time fields aren't saved to checkpoints) or a regrid (new LevelData arrays start uninitialized) ComputeDt could read bad tracer_o data. Moving the fillpatch + copy-new-to-old block to the top of Advance and InitialIterations ensures old and new are both good before ComputeDt.

Note this changes the adaptive dt for boussinesq. However, the dt is now computed with the same velocity forcing that is used to compute the advective velocity.

This also ensures that copy_from_*_temperature checks m_use_temperature before trying to copy an mf that might not be defined.

and thus the computed dt on restart and regrid.

ComputeDt calls compute_vel_forces_on_level, which uses both the
old and new tracer fields for m_use_boussinesq. Previously,
immediately after a restart (old-time fields aren't saved to
checkpoints) or a regrid (new LevelData arrays start uninitialized)
ComputeDt could read bad tracer_o data. Moving the fillpatch +
copy-new-to-old block to the top of Advance and InitialIterations
ensures old and new are both good before ComputeDt.

Note this changes the adaptive dt for boussinesq. However, the dt is
now computed with the same velocity forcing that is used to compute
the advective velocity.

This also ensures that copy_from_*_temperature checks
m_use_temperature before trying to copy an mf that might not be
defined.
@cgilet
cgilet requested a review from asalmgren August 20, 2026 01:08
@asalmgren
asalmgren merged commit ea33e5b into AMReX-Fluids:development Aug 20, 2026
12 checks passed
@asalmgren
asalmgren deleted the boussRestart branch August 20, 2026 18:39
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