Skip to content

Commit

Permalink
🐛 Fix TF resistive power calc that used the total TF current instead …
Browse files Browse the repository at this point in the history
…of that for an individual coil
  • Loading branch information
chris-ashe committed Dec 2, 2024
1 parent ae742c4 commit 89f6c1e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
3 changes: 1 addition & 2 deletions process/sctfcoil.py
Original file line number Diff line number Diff line change
Expand Up @@ -1888,8 +1888,7 @@ def tf_res_heating(self):
# TF outer leg resistive power (TOTAL) [W]
tfcoil_variables.p_tf_leg_resistive = (
tfcoil_variables.res_tf_leg
* tfcoil_variables.ritfc**2
/ tfcoil_variables.n_tf_coils
* (tfcoil_variables.ritfc / tfcoil_variables.n_tf_coils)**2
)
# ---

Expand Down
16 changes: 8 additions & 8 deletions tests/unit/test_sctfcoil.py
Original file line number Diff line number Diff line change
Expand Up @@ -929,8 +929,8 @@ class TfResHeatingParam(NamedTuple):
expected_rhocp: Any = None
expected_rhotfleg: Any = None
expected_vol_cond_cp: Any = None
expected_tflegres: Any = None
expected_presleg: Any = None
expected_res_tf_leg: Any = None
expected_p_tf_leg_resistive: Any = None
expected_prescp: Any = None
expected_pres_joints: Any = None
expected_a_cp_cool: Any = None
Expand Down Expand Up @@ -1143,8 +1143,8 @@ def test_res_tf_internal_geom(restfinternalgeomparam, monkeypatch, sctfcoil):
expected_rhocp=2.1831760869565221e-08,
expected_rhotfleg=2.1831760869565221e-08,
expected_vol_cond_cp=12.020160732580297,
expected_tflegres=6.1387543007600344e-06,
expected_presleg=332643748.67243439,
expected_res_tf_leg=6.1387543007600344e-06,
expected_p_tf_leg_resistive=27720312.38936953,
expected_prescp=470083798.99090022,
expected_pres_joints=1944336.7995005273,
expected_a_cp_cool=0.00068328705812121333,
Expand Down Expand Up @@ -1193,8 +1193,8 @@ def test_res_tf_internal_geom(restfinternalgeomparam, monkeypatch, sctfcoil):
expected_rhocp=2.1831760869565221e-08,
expected_rhotfleg=2.1831760869565221e-08,
expected_vol_cond_cp=11.545770024935592,
expected_tflegres=6.2969005770928158e-06,
expected_presleg=341213300.02121693,
expected_res_tf_leg=6.2969005770928158e-06,
expected_p_tf_leg_resistive=28434441.66843475,
expected_prescp=475710489.56122422,
expected_pres_joints=1944336.7995005273,
expected_a_cp_cool=0.00068328705812121333,
Expand Down Expand Up @@ -1318,10 +1318,10 @@ def test_tf_res_heating(tfresheatingparam, monkeypatch, sctfcoil):
)

assert tfcoil_variables.res_tf_leg == pytest.approx(
tfresheatingparam.expected_tflegres
tfresheatingparam.expected_res_tf_leg
)

assert tfcoil_variables.p_tf_leg_resistive == pytest.approx(tfresheatingparam.expected_presleg)
assert tfcoil_variables.p_tf_leg_resistive == pytest.approx(tfresheatingparam.expected_p_tf_leg_resistive)

assert tfcoil_variables.prescp == pytest.approx(tfresheatingparam.expected_prescp)

Expand Down

0 comments on commit 89f6c1e

Please sign in to comment.