Skip to content

fix: improve finite difference method logic for cases where r_i is no… - #71

Merged
BramVloedgraven merged 7 commits into
mainfrom
fix/fd-method-non-linear-radii-grid
Aug 5, 2026
Merged

fix: improve finite difference method logic for cases where r_i is no…#71
BramVloedgraven merged 7 commits into
mainfrom
fix/fd-method-non-linear-radii-grid

Conversation

@BramVloedgraven

Copy link
Copy Markdown
Collaborator

…t centered between neighbours r_{i-1} and r_{i+1}.

…t centered between neighbours r_{i-1} and r_{i+1}.

Signed-off-by: BramVloedgraven <bram.vloedgraven@dep.nl>
Copilot AI review requested due to automatic review settings July 30, 2026 12:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

This PR updates the finite-difference discretization to better handle non-centered radii grids, and refreshes the associated validation artifacts.

Changes:

  • Rename internal interstitial radii storage to _inter_radii_grid and update dependent call sites.
  • Rework surface-area grid construction and the second-derivative finite-difference factor to align with the new discretization.
  • Update unit tests and refresh golden CSV temperature-solution outputs to match the new numerical results.

Reviewed changes

Copilot reviewed 133 out of 133 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/cable/test_cable.py Updates surface-area grid test to use the new instance-based construction and boundary definition.
cable_thermal_model/model/cables/cable.py Renames interstitial radii field, changes surface-area grid construction, and updates the second-derivative common factor.
cable_thermal_model/model/cables/cable_air.py Updates references to the renamed _inter_radii_grid field in boundary-condition assembly.
cable_thermal_model/model/cables/cable_trefoil_circuit_single_pipe.py Updates _calculate_inter_rhos call to use _inter_radii_grid.
cable_thermal_model/validation/cable_analysis.py Updates validation heat-flow computation to use _inter_radii_grid.
test_results/test_compute_temperature_solution/y_y_y_y_y_GPLK10_10kV3x185Al_c1_single.csv Update expected temperature solution snapshot after discretization change.
test_results/test_compute_temperature_solution/y_y_y_y_n_GPLK10_10kV3x185Al_c1_single.csv Update expected temperature solution snapshot after discretization change.
test_results/test_compute_temperature_solution/y_y_y_n_y_GPLK10_10kV3x185Al_c1_single.csv Update expected temperature solution snapshot after discretization change.
test_results/test_compute_temperature_solution/y_y_y_n_n_YMeKrvaslqwd12_20kV1x630Alrm+as50_c1_trefoil_top.csv Update expected temperature solution snapshot after discretization change.
test_results/test_compute_temperature_solution/y_y_y_n_n_YMeKrvaslqwd12_20kV1x630Alrm+as50_c1_trefoil_right.csv Update expected temperature solution snapshot after discretization change.
test_results/test_compute_temperature_solution/y_y_y_n_n_YMeKrvaslqwd12_20kV1x630Alrm+as50_c1_trefoil_left.csv Update expected temperature solution snapshot after discretization change.
test_results/test_compute_temperature_solution/y_y_y_n_n_GPLK10_10kV3x185Al_c1_single.csv Update expected temperature solution snapshot after discretization change.
test_results/test_compute_temperature_solution/y_y_n_y_y_GPLK10_10kV3x185Al_c1_single.csv Update expected temperature solution snapshot after discretization change.
test_results/test_compute_temperature_solution/y_y_n_y_n_GPLK10_10kV3x185Al_c1_single.csv Update expected temperature solution snapshot after discretization change.
test_results/test_compute_temperature_solution/y_y_n_n_y_GPLK10_10kV3x185Al_c1_single.csv Update expected temperature solution snapshot after discretization change.
test_results/test_compute_temperature_solution/y_y_n_n_n_YMeKrvaslqwd12_20kV1x630Alrm+as50_c1_trefoil_top.csv Update expected temperature solution snapshot after discretization change.
test_results/test_compute_temperature_solution/y_y_n_n_n_YMeKrvaslqwd12_20kV1x630Alrm+as50_c1_trefoil_right.csv Update expected temperature solution snapshot after discretization change.
test_results/test_compute_temperature_solution/y_y_n_n_n_YMeKrvaslqwd12_20kV1x630Alrm+as50_c1_trefoil_left.csv Update expected temperature solution snapshot after discretization change.
test_results/test_compute_temperature_solution/y_y_n_n_n_GPLK10_10kV3x185Al_c1_single.csv Update expected temperature solution snapshot after discretization change.
test_results/test_compute_temperature_solution/y_n_y_y_y_GPLK10_10kV3x185Al_c1_single.csv Update expected temperature solution snapshot after discretization change.
test_results/test_compute_temperature_solution/y_n_y_y_n_YMeKrvaslqwd12_20kV1x630Alrm+as50_c1_trefoil_right.csv Update expected temperature solution snapshot after discretization change.
test_results/test_compute_temperature_solution/y_n_y_y_n_YMeKrvaslqwd12_20kV1x630Alrm+as50_c1_trefoil_left.csv Update expected temperature solution snapshot after discretization change.
test_results/test_compute_temperature_solution/y_n_y_y_n_GPLK10_10kV3x185Al_c1_single.csv Update expected temperature solution snapshot after discretization change.
test_results/test_compute_temperature_solution/y_n_y_n_y_GPLK10_10kV3x185Al_c1_single.csv Update expected temperature solution snapshot after discretization change.
test_results/test_compute_temperature_solution/y_n_y_n_n_YMeKrvaslqwd12_20kV1x630Alrm+as50_c1_trefoil_right.csv Update expected temperature solution snapshot after discretization change.
test_results/test_compute_temperature_solution/y_n_y_n_n_YMeKrvaslqwd12_20kV1x630Alrm+as50_c1_trefoil_left.csv Update expected temperature solution snapshot after discretization change.
test_results/test_compute_temperature_solution/y_n_y_n_n_GPLK10_10kV3x185Al_c1_single.csv Update expected temperature solution snapshot after discretization change.
test_results/test_compute_temperature_solution/y_n_n_y_y_GPLK10_10kV3x185Al_c1_single.csv Update expected temperature solution snapshot after discretization change.
test_results/test_compute_temperature_solution/y_n_n_y_n_YMeKrvaslqwd12_20kV1x630Alrm+as50_c1_trefoil_right.csv Update expected temperature solution snapshot after discretization change.
test_results/test_compute_temperature_solution/y_n_n_y_n_YMeKrvaslqwd12_20kV1x630Alrm+as50_c1_trefoil_left.csv Update expected temperature solution snapshot after discretization change.
test_results/test_compute_temperature_solution/y_n_n_y_n_GPLK10_10kV3x185Al_c1_single.csv Update expected temperature solution snapshot after discretization change.
test_results/test_compute_temperature_solution/y_n_n_n_y_GPLK10_10kV3x185Al_c1_single.csv Update expected temperature solution snapshot after discretization change.
test_results/test_compute_temperature_solution/y_n_n_n_n_GPLK10_10kV3x185Al_c1_single.csv Update expected temperature solution snapshot after discretization change.
test_results/test_compute_temperature_solution/n_y_y_y_y_GPLK10_10kV3x185Al_c1_single.csv Update expected temperature solution snapshot after discretization change.
test_results/test_compute_temperature_solution/n_y_y_y_n_GPLK10_10kV3x185Al_c1_single.csv Update expected temperature solution snapshot after discretization change.
test_results/test_compute_temperature_solution/n_y_y_n_y_GPLK10_10kV3x185Al_c1_single.csv Update expected temperature solution snapshot after discretization change.
test_results/test_compute_temperature_solution/n_y_y_n_n_GPLK10_10kV3x185Al_c1_single.csv Update expected temperature solution snapshot after discretization change.
test_results/test_compute_temperature_solution/n_y_n_y_y_GPLK10_10kV3x185Al_c1_single.csv Update expected temperature solution snapshot after discretization change.
test_results/test_compute_temperature_solution/n_y_n_y_n_GPLK10_10kV3x185Al_c1_single.csv Update expected temperature solution snapshot after discretization change.
test_results/test_compute_temperature_solution/n_y_n_n_y_GPLK10_10kV3x185Al_c1_single.csv Update expected temperature solution snapshot after discretization change.
test_results/test_compute_temperature_solution/n_y_n_n_n_GPLK10_10kV3x185Al_c1_single.csv Update expected temperature solution snapshot after discretization change.
test_results/test_compute_temperature_solution/n_n_y_y_y_GPLK10_10kV3x185Al_c1_single.csv Update expected temperature solution snapshot after discretization change.
test_results/test_compute_temperature_solution/n_n_y_y_n_GPLK10_10kV3x185Al_c1_single.csv Update expected temperature solution snapshot after discretization change.
test_results/test_compute_temperature_solution/n_n_y_n_y_GPLK10_10kV3x185Al_c1_single.csv Update expected temperature solution snapshot after discretization change.
test_results/test_compute_temperature_solution/n_n_y_n_n_YMeKrvaslqwd12_20kV1x630Alrm+as50_c1_trefoil_right.csv Update expected temperature solution snapshot after discretization change.
test_results/test_compute_temperature_solution/n_n_y_n_n_YMeKrvaslqwd12_20kV1x630Alrm+as50_c1_trefoil_left.csv Update expected temperature solution snapshot after discretization change.
test_results/test_compute_temperature_solution/n_n_y_n_n_GPLK10_10kV3x185Al_c1_single.csv Update expected temperature solution snapshot after discretization change.
test_results/test_compute_temperature_solution/n_n_n_y_y_GPLK10_10kV3x185Al_c1_single.csv Update expected temperature solution snapshot after discretization change.
test_results/test_compute_temperature_solution/n_n_n_y_n_GPLK10_10kV3x185Al_c1_single.csv Update expected temperature solution snapshot after discretization change.
test_results/test_compute_temperature_solution/n_n_n_n_y_GPLK10_10kV3x185Al_c1_single.csv Update expected temperature solution snapshot after discretization change.
test_results/test_compute_temperature_solution/n_n_n_n_n_YMeKrvaslqwd12_20kV1x630Alrm+as50_c1_trefoil_right.csv Update expected temperature solution snapshot after discretization change.
test_results/test_compute_temperature_solution/n_n_n_n_n_YMeKrvaslqwd12_20kV1x630Alrm+as50_c1_trefoil_left.csv Update expected temperature solution snapshot after discretization change.
test_results/test_compute_temperature_solution/n_n_n_n_n_GPLK10_10kV3x185Al_c1_single.csv Update expected temperature solution snapshot after discretization change.
Comments suppressed due to low confidence (1)

tests/cable/test_cable.py:1

  • The test currently calls the instance method via the class (Cable._construct_surface_area_grid(DummyCable(...))). While this works, it’s non-idiomatic and makes it easier to miss issues if the method is overridden. Prefer calling it as an instance method on the dummy instance (e.g., DummyCable(radii_grid)._construct_surface_area_grid()) to better reflect real usage.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cable_thermal_model/model/cables/cable.py Outdated
Comment thread cable_thermal_model/model/cables/cable.py
Comment thread cable_thermal_model/model/cables/cable.py
Signed-off-by: BramVloedgraven <bram.vloedgraven@dep.nl>
Signed-off-by: BramVloedgraven <bram.vloedgraven@dep.nl>
Signed-off-by: BramVloedgraven <bram.vloedgraven@dep.nl>
@BramVloedgraven
BramVloedgraven merged commit 71767fb into main Aug 5, 2026
7 checks passed
@BramVloedgraven
BramVloedgraven deleted the fix/fd-method-non-linear-radii-grid branch August 5, 2026 07:36
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.

3 participants