Repository navigation
Conversation
UNFILED 33, with the ruling of 2026-11-14 extended to boundary values: in a model with reference quantities a nonzero plain number on a field with units is ambiguous and is refused, for essential and natural conditions, with a message showing the quantity form. Zero means the same in any units, and a field without units keeps its plain numbers. The older path that divided plain numbers by the field's scaling coefficient is gone: on a field with units it no longer receives one, and on a field without units its coefficient is 1. A quantity's model value follows the model's scaling switch: in SI when uw.use_nondimensional_scaling(False), as the field then runs. A lone uw.expression (or sympy expression) is one entry (33c). From the review of #1264: the units rule is in the add_essential_bc and add_dirichlet_bc docstrings, and the degC tests check the recorded value and read it back after a solve. test_0817, test_0818 and test_1450 give their walls as quantities. Underworld development team with AI support from Claude Code
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes for users: in a model with reference quantities, a boundary value on a field with units is given with units (
uw.quantity(5, "mm/yr")). A nonzero plain number there is refused as ambiguous, and the message shows the quantity form. Zero, and values on fields without units, are unchanged. A loneuw.expressionis accepted as a boundary value.UNFILED 33 (a) to (c), with the ruling of 2026-11-14 extended to boundary values: "a bare number used as a viscosity in a unit-aware environment is ambiguous and should be refused". A boundary value on a field with units has the same ambiguity. By the units desk (a Claude session). Runs were on a 96-thread Linux workstation (single system image; Intel Xeon Gold 6240R, AVX-512; MPICH), on development 7091a93.
Why a plain number was ambiguous
A full serial run with a probe on
add_conditionlogged what plain numbers meant on development:The same
0.5could mean three things.The change
uw.quantity(v, "<the field's units>"). Zero means the same in any units, and stays accepted. So do infinity andNonefor a free component, and symbolic values.scaling_coefficientis removed. On a field with units it no longer receives a plain number, and on a field without units the coefficient is 1. One gate remains, with a refinement thattest_0817showed. With the model's scaling switched off (uw.use_nondimensional_scaling(False)), fields run unscaled, in SI. So a quantity's model value is its SI magnitude there, and its non-dimensional value otherwise.uw.expression, or a sympy expression, given as the value is one entry. Before, it raised "Unknown quantity type" or "Unsupported BC conds".add_essential_bcandadd_dirichlet_bcdocstrings;What it breaks, counted first
The probe found 13 nonzero plain numbers on fields with units, in 3 test files:
test_0817,test_0818andtest_1450. They now give their walls as quantities. A static scan of the docs found two more candidates:Ex_Convection_Annulus_Recorded's 1.0 is on a temperature field without units;(1.0, 0.0)is in its section without reference quantities.Both are legal, and both run on this branch (below).
Tests
tests/test_0774_boundary_condition_quantities_in_a_units_model.pygains:Without this branch, the refusal and the lone-expression tests fail.
Regression runs
tests/test_*.pyexcept tier C, 6 xdist workers, on f943846: 4567 passed, and 4 failed, alltest_1086_mmpde_seam_matches_serial, whose spawned runs time out under load. Run alone on f943846: 20 passed.scripts/test.sh --parallel-only --p 2on f943846: all passed.Ex_Convection_Annulus_Recordedand tutorial 13 both run to the end on f943846 (exit 0).Checklist (UW3 Style Charter)
level_*andtier_*markers (S8)Underworld development team with AI support from Claude Code