Skip to content

Make pedestal model and internal boundary conditions mutually exclusive. - #2444

Merged
copybara-service[bot] merged 1 commit into
mainfrom
test_977401745
Sep 19, 2026
Merged

copybara-service[bot] merged 1 commit into
mainfrom
test_977401745

Conversation

@copybara-service

Copy link
Copy Markdown

Make pedestal model and internal boundary conditions mutually exclusive.

Internal boundary conditions (IBC) represent prescribed or modeled edge boundary conditions. Previously, when both a pedestal model and user-defined IBC were active, _calc_coeffs_full attempted to .merge() them. If the IBC region extended inward past the pedestal top, this caused discontinuous profiles and unphysical wells/spikes (e.g. cold IBC values pinning the edge, then pedestal model the pedestal, but a wide IBC still pinning values inboard).

This change refactors IBC construction and makes IBC and pedestal models mutually exclusive. It makes the pragmatic assumption that a profile_conditions IBC should be used for the edge region only, and therefore either one of pedestal or profile_conditions IBC should be active at a given time. There is no real use-case for internal IBC.

Introduces: internal_boundary_conditions.builder.build_internal_boundary_conditions, serving as a single source of truth for constructing the active InternalBoundaryConditions object and resolving mutual exclusivity.

Removes redundant hacky logic in transport_coefficients_builder related to two_point_mask construction. The two_point_mask is extracted from the IBC with the existing method.

@copybara-service
copybara-service Bot force-pushed the test_977401745 branch 6 times, most recently from ee80423 to 055d3f6 Compare September 11, 2026 16:42
Internal boundary conditions (IBC) represent prescribed or modeled edge boundary conditions. Previously, when both a pedestal model and user-defined IBC were active, `_calc_coeffs_full` attempted to `.merge()` them. If the IBC region extended inward past the pedestal top, this caused discontinuous profiles and unphysical wells/spikes (e.g. cold IBC values pinning the edge, then pedestal model the pedestal, but a wide IBC still pinning values inboard).

This change refactors IBC construction and makes IBC and pedestal models mutually exclusive. It makes the pragmatic assumption that a profile_conditions IBC should be used for the edge region only, and therefore either one of pedestal or profile_conditions IBC should be active at a given time. There is no real use-case for internal IBC.

Introduces: `internal_boundary_conditions.builder.build_internal_boundary_conditions`, serving as a single source of truth for constructing the active `InternalBoundaryConditions` object and resolving mutual exclusivity.

Removes redundant hacky logic in transport_coefficients_builder related to two_point_mask construction. The two_point_mask is extracted from the IBC with the existing method.

PiperOrigin-RevId: 984468634
@copybara-service
copybara-service Bot merged commit c0fae2d into main Sep 19, 2026
3 checks passed
@copybara-service
copybara-service Bot deleted the test_977401745 branch September 19, 2026 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant