You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DDt timestep helper passes a raw pint Quantity to uw.non_dimensionalise, which returns its magnitude unscaled #701
systems/ddt.py::_as_float (used by every DDt flavour's update_pre_solve through the _dt bookkeeping, and by the BDF coefficient update) carries a TODO(BUG): a raw pint.Quantity reaching uw.non_dimensionalise() is not scaled by the active reference quantities, and the helper then takes .magnitude. Measured with set_reference_quantities(length=1000 km, time=1 Myr) and an SLCN solver stepped with timestep=100 kyr: DuDt._dt = 100.0 kiloyear, and the DDt's runtime constant delta_t.sym = 100.0 where the non-dimensional value is 0.1. The semi-Lagrangian solvers do not read that constant (they pass their own non-dimensional delta_t into the kernels), and the composing solvers of #688 non-dimensionalise before writing it, so no current solve is wrong; a solver that composes DDt.time_derivative() while passing a quantity straight to update_pre_solve would be. The fix belongs in uw.non_dimensionalise (accept a raw quantity) or in one shared timestep helper used by the solvers and the DDt alike (solvers._nondimensionalise_timestep does it right). Found by the review of #688.
Fixed in 4f65d0f on #688 (branch feature/navier-stokes-supg): ddt._as_float now non-dimensionalises a quantity through uw.non_dimensionalise instead of taking its magnitude; tests/test_1057_ddt_transport_plugin.py::test_dimensional_timestep_reaches_the_manager_non_dimensional covers the UW quantity, the raw Pint quantity and an SLCN step under reference scales, with the no-scales magnitude as the negative control. Reopen if #688 does not land.
Activity
lmoresi commentedon Sep 7, 2026
Fixed in 4f65d0f on #688 (branch feature/navier-stokes-supg):
ddt._as_floatnow non-dimensionalises a quantity throughuw.non_dimensionaliseinstead of taking its magnitude;tests/test_1057_ddt_transport_plugin.py::test_dimensional_timestep_reaches_the_manager_non_dimensionalcovers the UW quantity, the raw Pint quantity and an SLCN step under reference scales, with the no-scales magnitude as the negative control. Reopen if #688 does not land.🤖 Generated with Claude Code
https://claude.ai/code/session_018T2VHUGaZiQVJ95qQ4DiSL
DDt: a quantity timestep is non-dimensionalised before it reaches the…
Navier-Stokes with Eulerian SUPG momentum transport, and a partition-…