Skip to content

Preserve adaptive timestep across output blocks#185

Open
AhmedSalih3d wants to merge 3 commits into
BeforeLidDrivenCavityExamplefrom
codex/investigate-outputtimes-impact-on-simulation-results
Open

Preserve adaptive timestep across output blocks#185
AhmedSalih3d wants to merge 3 commits into
BeforeLidDrivenCavityExamplefrom
codex/investigate-outputtimes-impact-on-simulation-results

Conversation

@AhmedSalih3d

Copy link
Copy Markdown
Owner

Motivation

  • Output scheduling was resetting the integrator timestep at each OutputTimes boundary, making the I/O cadence influence the numerical solution instead of only the logging/export behavior.

Description

  • Continue from the last adaptive timestep by initializing dt from SimMetaData.CurrentTimeStep when entering SimulationLoop instead of always using the CFL baseline.
  • Recompute the half-step dt₂ inside the inner time-stepping loop so it follows any adaptive dt changes within the block.
  • Store the updated adaptive timestep back into SimMetaData.CurrentTimeStep after each solver iteration so the next output block resumes with the same timestep.

Testing

  • Ran julia --project=. -e 'using SPHExample' which precompiled and loaded the package successfully.
  • Ran git diff --check and there were no whitespace/format issues.
  • Ran julia --project=. -e 'using Pkg; Pkg.test()' which exercised the test suite and produced an error in the existing time-stepping test: the test calls Δt(pos, vel, acc, sc, ker) but only Δt(max_acceleration, SimulationConstants, SPHKernel) is defined, so the failure is in the test API usage rather than this change.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant