Skip to content

SDC2 evaluates time-dependent sources at the end of the step #3395

Description

@zingale

Locations: Source/driver/Castro_advance_sdc.cpp:64,106,134-137 and
Source/problems/Castro_problem_source.cpp:19.

Finding

The driver computes node_time = time + dt_sdc[m] * dt, but the second-order
branch passes cur_time to do_old_sources at every node. cur_time is the
full timestep's endpoint. The problem source receives this time unchanged.

State-dependent sources may still use the correct staged state, but explicitly
time-dependent forcing is sampled at the wrong time. In particular, the cached
node-zero source is evaluated at the endpoint instead of the initial time. This
reduces temporal accuracy even on a single level. The fourth-order source branch
already passes node_time.

Reproducible numerical evidence

For a spatially uniform source S(t)=t, a step starting at zero should add
h*h/2. Both Lobatto node evaluations instead return h, so SDC2 adds h*h,
regardless of additional sweeps. Over a fixed interval this becomes a
first-order endpoint quadrature error.

This is an algebraic check of the source times, not a full manufactured-source
simulation.

Proposed fix

Pass node_time to the second-order source evaluation. Keep the time used to
retrieve staged state data distinct from the physical source time. Audit any
source that internally FillPatches before changing that argument; the true-SDC
diffusion contribution is already built separately as MOL fluxes.

Validation after fixing

Add a manufactured uniform time-dependent energy source to a copy of a suitable
existing problem. Check both Lobatto and Radau with SDC2, and verify exact
integration of a linear-in-time source to roundoff. Also test time-independent
sources and diffusion to catch ghost-fill regressions.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions