Reject zero-thickness superconducting TF at input validation - #4535
Open
dallonby wants to merge 1 commit into
Open
Reject zero-thickness superconducting TF at input validation#4535dallonby wants to merge 1 commit into
dallonby wants to merge 1 commit into
Conversation
Build.calculate_radial_build only derives dr_tf_inboard from the winding pack and case thicknesses when dr_tf_wp_with_insulation (ixc = 140) is an iteration variable. If a user supplies the winding pack thickness as a plain input instead, dr_tf_inboard silently stays at its default of 0: the TF coil vanishes from the radial build and the run fails far downstream with unexplained radial-build inconsistency and multi-GPa TF stresses. Add a check_process validation that a superconducting TF has a positive dr_tf_inboard when neither ixc = 13 nor ixc = 140 is active, with an actionable message. Stellarators (which calculate dr_tf_inboard during the model run) and IFE are excluded. Test-suite change, per CONTRIBUTING: the parser tests in tests/unit/core/test_input.py run init_process on minimal input snippets and relied on config validation not examining the TF geometry; their fixture scaffold now sets a valid dr_tf_inboard. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Closes #4534
Overview
Adds a
check_processvalidation so that the silent zero-thickness-TF failure mode described in the issue becomes an immediate, actionable input error instead of an unexplained downstream solver failure.Changes
process/core/init.py: after the existing ixc 13/140 mutual-exclusion check, raiseProcessValidationErrorwheni_tf_supis superconducting, neither ixc 13 nor ixc 140 is active, anddr_tf_inboard <= 0. The message tells the user the three ways to fix their file. Stellarators (istell != 0, which calculatedr_tf_inboardduring the model run) and IFE are excluded.tests/unit/core/test_init.py: five tests — the rejected configuration, plus accepted configurations for explicit thickness, ixc 140 active, resistive TF, and stellarator.tests/unit/core/test_input.py(test-suite change, per CONTRIBUTING): the parser tests runinit_processon minimal input snippets (e.g. justepsvmc = 1.0) and relied on config validation never examining the TF geometry; their shared fixture scaffold now sets a validdr_tf_inboardso the parser tests keep testing parsing. No expected values change.Behavioural impact
Valid configurations are unaffected (all seven shipped regression inputs pass: they each set ixc 13/140 or
dr_tf_inboard, or are stellarator/IFE). The only newly-rejected configurations are ones that previously produced a machine with no inboard TF coil.Verification
Found during an independent audit of v3.4.2.
🤖 Generated with Claude Code