diff --git a/process/models/pfcoil.py b/process/models/pfcoil.py index d738c4670..2d570a985 100644 --- a/process/models/pfcoil.py +++ b/process/models/pfcoil.py @@ -22,7 +22,10 @@ NPTSMX, ) from process.models import superconductors -from process.models.superconductors import SuperconductorMaterial, SuperconductorModel +from process.models.superconductors import ( + SuperconductorMaterial, + SuperconductorModel, +) from process.models.tfcoil.base import TFCoilShapeModel logger = logging.getLogger(__name__) @@ -872,21 +875,21 @@ def pfcoil(self): self.data.pf_coil.j_pf_wp_critical[i], _jstrand, jsc, _tmarg = ( superconpf( - bmax, - self.data.pf_coil.f_a_pf_coil_void[i], - self.data.pf_coil.fcupfsu, - self.data.pf_coil.j_pf_coil_wp_peak[i], - self.data.pf_coil.i_pf_superconductor, - self.data.tfcoil.fhts, - self.data.tfcoil.str_pf_con_res, - self.data.tfcoil.tftmp, - self.data.tfcoil.bcritsc, - self.data.tfcoil.tcritsc, - self.data.tfcoil.b_crit_upper_nbti, - self.data.tfcoil.t_crit_nbti, - self.data.superconducting_tfcoil.dr_tf_hts_tape, - self.data.superconducting_tfcoil.dx_tf_hts_tape_rebco, - self.data.superconducting_tfcoil.dx_tf_hts_tape_total, + b_pf_peak=bmax, + fhe=self.data.pf_coil.f_a_pf_coil_void[i], + fcu=self.data.pf_coil.fcupfsu, + j_pf_wp=self.data.pf_coil.j_pf_coil_wp_peak[i], + isumat=self.data.pf_coil.i_pf_superconductor, + fhts=self.data.tfcoil.fhts, + strain=self.data.tfcoil.str_pf_con_res, + temp_pf_peak_field=self.data.tfcoil.tftmp, + bcritsc=self.data.tfcoil.bcritsc, + tcritsc=self.data.tfcoil.tcritsc, + b_crit_upper_nbti=self.data.tfcoil.b_crit_upper_nbti, + t_crit_nbti=self.data.tfcoil.t_crit_nbti, + dr_hts_tape=self.data.superconducting_tfcoil.dr_tf_hts_tape, + dx_hts_tape_rebco=self.data.superconducting_tfcoil.dx_tf_hts_tape_rebco, + dx_hts_tape_total=self.data.superconducting_tfcoil.dx_tf_hts_tape_total, ) ) @@ -3510,10 +3513,10 @@ def ohcalc(self): self.data.pf_coil.j_cs_conductor_critical_flat_top_end, tmarg1, ) = superconpf( - self.data.pf_coil.b_cs_peak_flat_top_end, - self.data.pf_coil.f_a_cs_void, - self.data.pf_coil.fcuohsu, - ( + b_pf_peak=self.data.pf_coil.b_cs_peak_flat_top_end, + fhe=self.data.pf_coil.f_a_cs_void, + fcu=self.data.pf_coil.fcuohsu, + j_pf_wp=( abs( self.data.pf_coil.c_pf_cs_coils_peak_ma[ self.data.pf_coil.n_cs_pf_coils - 1 @@ -3522,17 +3525,17 @@ def ohcalc(self): / self.data.pf_coil.a_cs_cable_space ) * 1.0e6, - self.data.pf_coil.i_cs_superconductor, - self.data.tfcoil.fhts, - self.data.tfcoil.str_cs_con_res, - self.data.pf_coil.temp_cs_superconductor_operating, - self.data.tfcoil.bcritsc, - self.data.tfcoil.tcritsc, - self.data.tfcoil.b_crit_upper_nbti, - self.data.tfcoil.t_crit_nbti, - self.data.superconducting_tfcoil.dr_tf_hts_tape, - self.data.superconducting_tfcoil.dx_tf_hts_tape_rebco, - self.data.superconducting_tfcoil.dx_tf_hts_tape_total, + isumat=self.data.pf_coil.i_cs_superconductor, + fhts=self.data.tfcoil.fhts, + strain=self.data.tfcoil.str_cs_con_res, + temp_pf_peak_field=self.data.pf_coil.temp_cs_superconductor_operating, + bcritsc=self.data.tfcoil.bcritsc, + tcritsc=self.data.tfcoil.tcritsc, + b_crit_upper_nbti=self.data.tfcoil.b_crit_upper_nbti, + t_crit_nbti=self.data.tfcoil.t_crit_nbti, + dr_hts_tape=self.data.superconducting_tfcoil.dr_tf_hts_tape, + dx_hts_tape_rebco=self.data.superconducting_tfcoil.dx_tf_hts_tape_rebco, + dx_hts_tape_total=self.data.superconducting_tfcoil.dx_tf_hts_tape_total, ) # Strand critical current calculation for costing in $/kAm # = superconducting filaments jc * (1 - strand copper fraction) @@ -3560,10 +3563,10 @@ def ohcalc(self): self.data.pf_coil.j_cs_conductor_critical_pulse_start, tmarg2, ) = superconpf( - self.data.pf_coil.b_cs_peak_pulse_start, - self.data.pf_coil.f_a_cs_void, - self.data.pf_coil.fcuohsu, - ( + b_pf_peak=self.data.pf_coil.b_cs_peak_pulse_start, + fhe=self.data.pf_coil.f_a_cs_void, + fcu=self.data.pf_coil.fcuohsu, + j_pf_wp=( abs( self.data.pf_coil.c_pf_cs_coils_peak_ma[ self.data.pf_coil.n_cs_pf_coils - 1 @@ -3572,17 +3575,17 @@ def ohcalc(self): / self.data.pf_coil.a_cs_cable_space ) * 1.0e6, - self.data.pf_coil.i_cs_superconductor, - self.data.tfcoil.fhts, - self.data.tfcoil.str_cs_con_res, - self.data.pf_coil.temp_cs_superconductor_operating, - self.data.tfcoil.bcritsc, - self.data.tfcoil.tcritsc, - self.data.tfcoil.b_crit_upper_nbti, - self.data.tfcoil.t_crit_nbti, - self.data.superconducting_tfcoil.dr_tf_hts_tape, - self.data.superconducting_tfcoil.dx_tf_hts_tape_rebco, - self.data.superconducting_tfcoil.dx_tf_hts_tape_total, + isumat=self.data.pf_coil.i_cs_superconductor, + fhts=self.data.tfcoil.fhts, + strain=self.data.tfcoil.str_cs_con_res, + temp_pf_peak_field=self.data.pf_coil.temp_cs_superconductor_operating, + bcritsc=self.data.tfcoil.bcritsc, + tcritsc=self.data.tfcoil.tcritsc, + b_crit_upper_nbti=self.data.tfcoil.b_crit_upper_nbti, + t_crit_nbti=self.data.tfcoil.t_crit_nbti, + dr_hts_tape=self.data.superconducting_tfcoil.dr_tf_hts_tape, + dx_hts_tape_rebco=self.data.superconducting_tfcoil.dx_tf_hts_tape_rebco, + dx_hts_tape_total=self.data.superconducting_tfcoil.dx_tf_hts_tape_total, ) self.data.pf_coil.j_pf_wp_critical[self.data.pf_coil.n_cs_pf_coils - 1] = ( @@ -4444,21 +4447,21 @@ def peak_b_field_at_pf_coil( def superconpf( - bmax, - fhe, - fcu, - jwp, - isumat, - fhts, - strain, - thelium, - bcritsc, - tcritsc, - b_crit_upper_nbti, - t_crit_nbti, - dr_tf_hts_tape, - dx_tf_hts_tape_rebco, - dx_tf_hts_tape_total, + b_pf_peak: float, + fhe: float, + fcu: float, + j_pf_wp: float, + isumat: int, + fhts: float, + strain: float, + temp_pf_peak_field: float, + bcritsc: float, + tcritsc: float, + b_crit_upper_nbti: float, + t_crit_nbti: float, + dr_hts_tape: float, + dx_hts_tape_rebco: float, + dx_hts_tape_total: float, ): """Routine to calculate the PF coil superconductor properties. @@ -4476,13 +4479,13 @@ def superconpf( Parameters ---------- - bmax : float + b_pf_peak : float peak field at conductor (T) fhe : float fraction of cable space that is for He cooling fcu : float fraction of cable conductor that is copper - jwp : float + j_pf_wp : float actual winding pack current density (A/m2) isumat : int switch for conductor type @@ -4497,7 +4500,7 @@ def superconpf( radiation damage, fatigue or AC losses strain : float Strain on superconductor at operation conditions - thelium : float + temp_pf_peak_field : float He temperature at peak field point (K) bcritsc : float Critical field at zero temperature and strain (T) (isumat=4 only) @@ -4507,11 +4510,11 @@ def superconpf( upper critical field of GL_nbti t_crit_nbti: float critical temperature of GL_nbti - dr_tf_hts_tape: float + dr_hts_tape: float Mean width of tape (m) - dx_tf_hts_tape_rebco: float + dx_hts_tape_rebco: float thickness of REBCO layer in tape (m) - dx_tf_hts_tape_total: float + dx_hts_tape_total: float thickness of tape, inc. all layers (hts, copper, substrate, etc.) (m) Returns @@ -4523,19 +4526,27 @@ def superconpf( Temperature margin (K) (tmarg) """ # Find critical current density in superconducting strand, jcritstr - if isumat == 1: + if isumat == SuperconductorModel.ITER_NB3SN: # ITER Nb3Sn critical surface parameterization - bc20m = 32.97e0 - tc0m = 16.06e0 + bc20m = 32.97e0 # [T] critical field at 0 K and 0 strain + tc0m = 16.06e0 # [K] critical temperature at 0 T and 0 strain # j_crit_sc returned by superconductors.itersc is the critical current density in the # superconductor - not the whole strand, which contains copper - j_crit_sc, _, _ = superconductors.itersc(thelium, bmax, strain, bc20m, tc0m) + j_crit_sc, _, _ = superconductors.itersc( + temp_conductor=temp_pf_peak_field, + b_conductor=b_pf_peak, + strain=strain, + b_c20max=bc20m, + temp_c0max=tc0m, + ) # j_crit_cable = j_crit_sc * non-copper fraction of conductor * conductor fraction of cable j_crit_cable = j_crit_sc * (1.0e0 - fcu) * (1.0e0 - fhe) - elif isumat == 2: + # ================================================================= + + elif isumat == SuperconductorModel.BI2212: # Bi-2212 high temperature superconductor parameterization # Current density in a strand of Bi-2212 conductor @@ -4545,78 +4556,125 @@ def superconpf( # composition that does not require a user-defined copper fraction, # so this is irrelevant in this model - # jwp / conductor fraction of cable - jstrand = jwp / (1.0e0 - fhe) - j_crit_cable, tmarg = superconductors.bi2212(bmax, jstrand, thelium, fhts) + # j_pf_wp / conductor fraction of cable + jstrand = j_pf_wp / (1.0e0 - fhe) + j_crit_cable, tmarg = superconductors.bi2212( + b_conductor=b_pf_peak, + jstrand=jstrand, + temp_conductor=temp_pf_peak_field, + f_strain=fhts, + ) # j_crit_cable / non-copper fraction of conductor j_crit_sc = j_crit_cable / (1.0e0 - fcu) - elif isumat == 3: + # ================================================================= + + elif isumat == SuperconductorModel.OLD_LUBELL_NBTI: # NbTi data - bc20m = 15.0e0 - tc0m = 9.3e0 - c0 = 1.0e10 - j_crit_sc, _ = superconductors.jcrit_nbti(thelium, bmax, c0, bc20m, tc0m) + bc20m = 15.0e0 # [T] + tc0m = 9.3e0 # [K] + c0 = 1.0e10 # # [A/m²] + j_crit_sc, _ = superconductors.jcrit_nbti( + temp_conductor=temp_pf_peak_field, + b_conductor=b_pf_peak, + c0=c0, + b_c20max=bc20m, + temp_c0max=tc0m, + ) # j_crit_cable = j_crit_sc * non-copper fraction of conductor * conductor fraction of cable j_crit_cable = j_crit_sc * (1.0e0 - fcu) * (1.0e0 - fhe) - elif isumat == 4: + # ================================================================= + + elif isumat == SuperconductorModel.USER_DEFINED_NB3SN: # As (1), but user-defined parameters bc20m = bcritsc tc0m = tcritsc - j_crit_sc, _, _ = superconductors.itersc(thelium, bmax, strain, bc20m, tc0m) + j_crit_sc, _, _ = superconductors.itersc( + temp_conductor=temp_pf_peak_field, + b_conductor=b_pf_peak, + strain=strain, + b_c20max=bc20m, + temp_c0max=tc0m, + ) # j_crit_cable = j_crit_sc * non-copper fraction of conductor * conductor fraction of cable j_crit_cable = j_crit_sc * (1.0e0 - fcu) * (1.0e0 - fhe) - elif isumat == 5: + # ================================================================= + + elif isumat == SuperconductorModel.WST_NB3SN: # WST Nb3Sn parameterisation - bc20m = 32.97e0 - tc0m = 16.06e0 + bc20m = 32.97e0 # [T] + tc0m = 16.06e0 # [K] # j_crit_sc returned by superconductors.itersc is the critical current density in the # superconductor - not the whole strand, which contains copper j_crit_sc, _, _ = superconductors.western_superconducting_nb3sn( - thelium, bmax, strain, bc20m, tc0m + temp_conductor=temp_pf_peak_field, + b_conductor=b_pf_peak, + strain=strain, + b_c20max=bc20m, + temp_c0max=tc0m, ) # j_crit_cable = j_crit_sc * non-copper fraction of conductor * conductor fraction of cable j_crit_cable = j_crit_sc * (1.0e0 - fcu) * (1.0e0 - fhe) - elif isumat == 6: + # ================================================================= + + elif isumat == SuperconductorModel.CROCO_REBCO: # "REBCO" 2nd generation HTS superconductor in CrCo strand - j_crit_sc, _, _, _ = superconductors.jcrit_rebco(thelium, bmax) + j_crit_sc, _, _, _ = superconductors.jcrit_rebco(temp_pf_peak_field, b_pf_peak) # j_crit_cable = j_crit_sc * non-copper fraction of conductor * conductor fraction of cable j_crit_cable = j_crit_sc * (1.0e0 - fcu) * (1.0e0 - fhe) - elif isumat == 7: + # ================================================================= + + elif isumat == SuperconductorModel.DURHAM_NBTI: # Durham Ginzburg-Landau critical surface model for Nb-Ti bc20m = b_crit_upper_nbti tc0m = t_crit_nbti - j_crit_sc, _, _ = superconductors.gl_nbti(thelium, bmax, strain, bc20m, tc0m) + j_crit_sc, _, _ = superconductors.gl_nbti( + temp_conductor=temp_pf_peak_field, + b_conductor=b_pf_peak, + strain=strain, + b_c20max=bc20m, + t_c0=tc0m, + ) # j_crit_cable = j_crit_sc * non-copper fraction of conductor * conductor fraction of cable j_crit_cable = j_crit_sc * (1.0e0 - fcu) * (1.0e0 - fhe) - elif isumat == 8: + # ================================================================= + + elif isumat == SuperconductorModel.DURHAM_REBCO: # Durham Ginzburg-Landau critical surface model for REBCO bc20m = 429e0 tc0m = 185e0 - j_crit_sc, _, _ = superconductors.gl_rebco(thelium, bmax, strain, bc20m, tc0m) + j_crit_sc, _, _ = superconductors.gl_rebco( + temp_conductor=temp_pf_peak_field, + b_conductor=b_pf_peak, + strain=strain, + b_c20max=bc20m, + t_c0=tc0m, + ) # A0 calculated for tape cross section already # j_crit_cable = j_crit_sc * non-copper fraction of conductor * conductor fraction of cable j_crit_cable = j_crit_sc * (1.0e0 - fcu) * (1.0e0 - fhe) - elif isumat == 9: + # ================================================================= + + elif isumat == SuperconductorModel.HAZELTON_ZHAI_REBCO: # Hazelton experimental data + Zhai conceptual model for REBCO - bc20m = 138 - tc0m = 92 + bc20m = 138 # [T] + tc0m = 92 # [K] j_crit_sc, _, _ = superconductors.hijc_rebco( - thelium, - bmax, - bc20m, - tc0m, - dr_tf_hts_tape, - dx_tf_hts_tape_rebco, - dx_tf_hts_tape_total, + temp_conductor=temp_pf_peak_field, + b_conductor=b_pf_peak, + b_c20max=bc20m, + t_c0=tc0m, + dr_hts_tape=dr_hts_tape, + dx_hts_tape_rebco=dx_hts_tape_rebco, + dx_hts_tape_total=dx_hts_tape_total, ) # A0 calculated for tape cross section already # j_crit_cable = j_crit_sc * non-copper fraction of conductor * conductor fraction of cable @@ -4628,44 +4686,44 @@ def superconpf( # Critical current density in winding pack jcritwp = j_crit_cable - # jwp / conductor fraction of cable - jstrand = jwp / (1.0e0 - fhe) + # j_pf_wp / conductor fraction of cable + jstrand = j_pf_wp / (1.0e0 - fhe) # jstrand / non-copper fraction of conductor jsc = jstrand / (1.0e0 - fcu) # Temperature margin (already calculated in superconductors.bi2212 for isumat=2) # Find temperature at which current density margin = 0 - if isumat in {1, 3, 4, 5, 7, 8, 9}: - if isumat == 3: + if isumat != SuperconductorModel.BI2212 or SuperconductorModel.CROCO_REBCO: + if isumat == SuperconductorModel.OLD_LUBELL_NBTI: arguments = ( isumat, jsc, - bmax, + b_pf_peak, strain, bc20m, tc0m, - dr_tf_hts_tape, - dx_tf_hts_tape_rebco, - dx_tf_hts_tape_total, + dr_hts_tape, + dx_hts_tape_rebco, + dx_hts_tape_total, c0, ) else: arguments = ( isumat, jsc, - bmax, + b_pf_peak, strain, bc20m, tc0m, - dr_tf_hts_tape, - dx_tf_hts_tape_rebco, - dx_tf_hts_tape_total, + dr_hts_tape, + dx_hts_tape_rebco, + dx_hts_tape_total, ) - another_estimate = 2 * thelium + another_estimate = 2 * temp_pf_peak_field t_zero_margin, _root_result = optimize.newton( superconductors.superconductor_current_density_margin, - thelium, + temp_pf_peak_field, fprime=None, args=arguments, tol=1.0e-06, @@ -4676,7 +4734,7 @@ def superconpf( full_output=True, disp=False, ) - tmarg = t_zero_margin - thelium + tmarg = t_zero_margin - temp_pf_peak_field return jcritwp, j_crit_cable, j_crit_sc, tmarg diff --git a/process/models/tfcoil/superconducting.py b/process/models/tfcoil/superconducting.py index e49df0c4a..3eb0d2f6b 100644 --- a/process/models/tfcoil/superconducting.py +++ b/process/models/tfcoil/superconducting.py @@ -2831,7 +2831,7 @@ def tf_cable_in_conduit_superconductor_properties( # ================================================================= # ITER Nb3Sn critical surface parameterization - if i_tf_superconductor == 1: + if i_tf_superconductor == SuperconductorModel.ITER_NB3SN: # Peak field and temperature at zero strain bc20m = 32.97e0 # [T] tc0m = 16.06e0 # [K] @@ -2872,7 +2872,7 @@ def tf_cable_in_conduit_superconductor_properties( # ================================================================= # Bi-2212 high temperature superconductor parameterization - elif i_tf_superconductor == 2: + elif i_tf_superconductor == SuperconductorModel.BI2212: # Current density in a strand of Bi-2212 conductor # N.B. jcrit returned by superconductors.bi2212 is the critical # current density in the strand, not just the superconducting portion. @@ -2903,16 +2903,16 @@ def tf_cable_in_conduit_superconductor_properties( # ================================================================= # NbTi data - elif i_tf_superconductor == 3: + elif i_tf_superconductor == SuperconductorModel.OLD_LUBELL_NBTI: bc20m = 15.0e0 # [T] tc0m = 9.3e0 # [K] - c0 = 1.0e10 # [A/m2] + c0 = 1.0e10 # [A/m²] j_superconductor_critical, _ = superconductors.jcrit_nbti( temp_conductor=temp_tf_coolant_peak_field, b_conductor=b_tf_inboard_peak, c0=c0, - b_c20m=bc20m, + b_c20max=bc20m, temp_c0max=tc0m, ) @@ -2933,7 +2933,7 @@ def tf_cable_in_conduit_superconductor_properties( # ================================================================= # ITER Nb3Sn parameterization, but user-defined parameters - elif i_tf_superconductor == 4: + elif i_tf_superconductor == SuperconductorModel.USER_DEFINED_NB3SN: bc20m = bcritsc # [T] tc0m = tcritsc # [K] @@ -2969,7 +2969,7 @@ def tf_cable_in_conduit_superconductor_properties( # ================================================================= # WST Nb3Sn parameterisation - elif i_tf_superconductor == 5: + elif i_tf_superconductor == SuperconductorModel.WST_NB3SN: bc20m = 32.97e0 # [T] tc0m = 16.06e0 # [K] @@ -3010,7 +3010,7 @@ def tf_cable_in_conduit_superconductor_properties( # ================================================================= # "REBCO" 2nd generation HTS superconductor in CrCo strand - elif i_tf_superconductor == 6: + elif i_tf_superconductor == SuperconductorModel.CROCO_REBCO: raise ProcessValueError( "sctfcoil.supercon has been called but data.tfcoil.i_tf_sc_mat=6" ) @@ -3018,7 +3018,7 @@ def tf_cable_in_conduit_superconductor_properties( # ================================================================= # Durham Ginzburg-Landau Nb-Ti parameterisation - elif i_tf_superconductor == 7: + elif i_tf_superconductor == SuperconductorModel.DURHAM_NBTI: bc20m = data.tfcoil.b_crit_upper_nbti # [T] tc0m = data.tfcoil.t_crit_nbti # [K] @@ -3046,7 +3046,7 @@ def tf_cable_in_conduit_superconductor_properties( # ================================================================= # Durham Ginzburg-Landau critical surface model for REBCO - elif i_tf_superconductor == 8: + elif i_tf_superconductor == SuperconductorModel.DURHAM_REBCO: bc20m = 430 # [T] tc0m = 185 # [K] @@ -3087,7 +3087,7 @@ def tf_cable_in_conduit_superconductor_properties( # ================================================================= # Hazelton experimental data + Zhai conceptual model for REBCO - elif i_tf_superconductor == 9: + elif i_tf_superconductor == SuperconductorModel.HAZELTON_ZHAI_REBCO: bc20m = 138 # [T] tc0m = 92 # [K] diff --git a/tests/unit/models/test_costs_1990.py b/tests/unit/models/test_costs_1990.py index 10c987c60..6b3820515 100644 --- a/tests/unit/models/test_costs_1990.py +++ b/tests/unit/models/test_costs_1990.py @@ -6,6 +6,9 @@ import pytest from process.models.engineering.pumping import CoolantType +from process.models.superconductors import ( + SuperconductorModel, +) @pytest.fixture @@ -2177,7 +2180,7 @@ class Acc2222Param(NamedTuple): ), order="F", ).transpose(), - i_pf_superconductor=3, + i_pf_superconductor=SuperconductorModel.OLD_LUBELL_NBTI, m_pf_coil_structure_total=2695737.563343476, c_pf_cs_coils_peak_ma=np.array( np.array( @@ -2239,7 +2242,7 @@ class Acc2222Param(NamedTuple): ), order="F", ).transpose(), - i_cs_superconductor=5, + i_cs_superconductor=SuperconductorModel.WST_NB3SN, fcupfsu=0.68999999999999995, fcuohsu=0.70000000000000007, f_a_pf_coil_void=np.array( @@ -2373,7 +2376,7 @@ class Acc2222Param(NamedTuple): ), order="F", ).transpose(), - i_pf_superconductor=3, + i_pf_superconductor=SuperconductorModel.OLD_LUBELL_NBTI, m_pf_coil_structure_total=2510424.9065680322, c_pf_cs_coils_peak_ma=np.array( np.array( @@ -2435,7 +2438,7 @@ class Acc2222Param(NamedTuple): ), order="F", ).transpose(), - i_cs_superconductor=5, + i_cs_superconductor=SuperconductorModel.WST_NB3SN, fcupfsu=0.68999999999999995, fcuohsu=0.70000000000000007, f_a_pf_coil_void=np.array( @@ -2569,7 +2572,7 @@ class Acc2222Param(NamedTuple): ), order="F", ).transpose(), - i_pf_superconductor=3, + i_pf_superconductor=SuperconductorModel.OLD_LUBELL_NBTI, m_pf_coil_structure_total=2510424.9065680322, c_pf_cs_coils_peak_ma=np.array( np.array( @@ -2631,7 +2634,7 @@ class Acc2222Param(NamedTuple): ), order="F", ).transpose(), - i_cs_superconductor=5, + i_cs_superconductor=SuperconductorModel.WST_NB3SN, fcupfsu=0.68999999999999995, fcuohsu=0.70000000000000007, f_a_pf_coil_void=np.array( diff --git a/tests/unit/models/test_pfcoil.py b/tests/unit/models/test_pfcoil.py index 1bf393f0e..c828b55bf 100644 --- a/tests/unit/models/test_pfcoil.py +++ b/tests/unit/models/test_pfcoil.py @@ -29,6 +29,9 @@ rsid, superconpf, ) +from process.models.superconductors import ( + SuperconductorModel, +) @pytest.fixture @@ -2500,8 +2503,12 @@ def test_pfcoil(monkeypatch, pfcoil): monkeypatch.setattr(pfcoil.data.pf_coil, "f_j_cs_start_end_flat_top", 2.654e-1) monkeypatch.setattr(pfcoil.data.pf_coil, "r_pf_coil_inner", np.full(22, 0.0)) monkeypatch.setattr(pfcoil.data.pf_coil, "r_pf_coil_outer", np.full(22, 0.0)) - monkeypatch.setattr(pfcoil.data.pf_coil, "i_pf_superconductor", 3) - monkeypatch.setattr(pfcoil.data.pf_coil, "i_cs_superconductor", 1) + monkeypatch.setattr( + pfcoil.data.pf_coil, "i_pf_superconductor", SuperconductorModel.OLD_LUBELL_NBTI + ) + monkeypatch.setattr( + pfcoil.data.pf_coil, "i_cs_superconductor", SuperconductorModel.ITER_NB3SN + ) monkeypatch.setattr(pfcoil.data.pf_coil, "m_pf_coil_conductor_total", 0.0) monkeypatch.setattr(pfcoil.data.pf_coil, "fcupfsu", 6.900e-1) monkeypatch.setattr(pfcoil.data.pf_coil, "j_cs_pulse_start", 1.693e7) @@ -2580,7 +2587,9 @@ def test_ohcalc(monkeypatch, reinitialise_error_module, cs_coil): monkeypatch.setattr(cs_coil.data.pf_coil, "f_a_cs_void", 3.0e-1) monkeypatch.setattr(cs_coil.data.pf_coil, "jcableoh_bop", 1.069e8) monkeypatch.setattr(cs_coil.data.pf_coil, "fcuohsu", 7.000e-1) - monkeypatch.setattr(cs_coil.data.pf_coil, "i_cs_superconductor", 5) + monkeypatch.setattr( + cs_coil.data.pf_coil, "i_cs_superconductor", SuperconductorModel.WST_NB3SN + ) monkeypatch.setattr(cs_coil.data.pf_coil, "f_z_cs_tf_internal", 0.9) monkeypatch.setattr(cs_coil.data.pf_coil, "a_cs_poloidal", 1.039e1) monkeypatch.setattr(cs_coil.data.pf_coil, "p_pf_coil_resistive_total_flat_top", 0.0)