Skip to content

VlasovAmpereOneSpecies: total_energy jumps after the first step with the control variate (and is offset at t=0 with full-f weights) #767

Closed

Description

@spossann

Bug: with WeightsParameters(control_variate=True), the total_energy scalar of VlasovAmpereOneSpecies jumps after the first time step. A second, smaller offset at t=0 also appears with full-f weights.

  1. Control variate. kinetic_energy (KineticEnergyPIC, models/scalars.py) sums weights * |v|^2. At t=0 it is computed with the full-f weights, and after the first step (once update_weights has run in VlasovAmpereCoupling) with the delta-f weights. The two values are energies of different quantities, so total_energy is not comparable across the first step, and energy conservation cannot be checked with the control variate.
  2. Full-f weights. total_energy is conserved from step to step to about 1e-9 (Crank-Nicolson coupling, pcg tolerance 1e-12), but its value at t=0 differs from the later values by about 2e-4 relative. Not investigated yet; probably the initial diagnostic, not the time stepping.

Both were found in #734: its e2e test test_gpu_VlasovAmpereOneSpecies.py uses full-f weights for this reason, and checks the t=0 value only loosely (check_reference).

Expected: the kinetic energy diagnostic uses the same weights (full f, i.e. delta-f weights plus the background contribution) at every time, and total_energy at t=0 matches the conserved value.

🤖 Generated with Claude Code

Activity

  1. spossann commented on Oct 14, 2026

    @spossann
    MemberAuthor

    fixed in #738

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions