diff --git a/process/sctfcoil.py b/process/sctfcoil.py index 3016edf86a..9a751d742f 100644 --- a/process/sctfcoil.py +++ b/process/sctfcoil.py @@ -534,7 +534,7 @@ def supercon_croco(self, aturn, bmax, iop, thelium, output: bool): po.ovarre(self.outfile, "Critical current (A)", "(icrit)", icrit, "OP ") po.ovarre( self.outfile, - "Actual current (A)", + "TF coil leg current per turn (A)", "(cpttf)", tfcoil_variables.cpttf, "OP ", @@ -3932,7 +3932,7 @@ def stresscl( # WP effective insulation thickness (SC only) [m] # include groundwall insulation + insertion gap in tfcoil_variables.thicndut - # inertion gap is tfcoil_variables.tfinsgap on 4 sides + # insertion gap is tfcoil_variables.tfinsgap on 4 sides t_ins_eff = thicndut + (tfinsgap + tinstf) / n_tf_turn # Effective WP young modulus in the toroidal direction [Pa] @@ -4793,16 +4793,22 @@ def outtf(self, peaktfflag): po.osubhd(self.outfile, "TF winding pack (WP) geometry:") po.ovarre( self.outfile, - "WP cross section area with insulation and insertion (per coil) (m2)", + "WP cross section area with insulation and insertion gap (m2)", "(awpc)", sctfcoil_module.awpc, ) po.ovarre( self.outfile, - "WP cross section area (per coil) (m2)", - "(aswp)", + "WP cross section area without insulation and insertion gap (m2)", + "(awptf)", sctfcoil_module.awptf, ) + po.ovarre( + self.outfile, + "WP structure area (m2)", + "(aswp)", + tfcoil_variables.aswp, + ) po.ovarre( self.outfile, "Winding pack radial thickness (m)", @@ -4861,12 +4867,6 @@ def outtf(self, peaktfflag): "(aswp/awpc)", tfcoil_variables.aswp / sctfcoil_module.awpc, ) - po.ovarre( - self.outfile, - "Insulation WP fraction", - "(aiwp/awpc)", - tfcoil_variables.aiwp / sctfcoil_module.awpc, - ) po.ovarre( self.outfile, "Cable WP fraction", diff --git a/process/uncertainties/hdf_to_scatter_plot1.py b/process/uncertainties/hdf_to_scatter_plot1.py new file mode 100644 index 0000000000..0b5ec79b77 --- /dev/null +++ b/process/uncertainties/hdf_to_scatter_plot1.py @@ -0,0 +1,107 @@ +""" +script for reading and display HDF5 files as pdf scatter plots + +Alexander J Pearce +05/03/22 +CCFE + +""" + +import argparse +import pandas as pd +import matplotlib.pyplot as plt +from pylab import figure, savefig + + +def parse_args(args): + """Parse supplied arguments. + + :param args: arguments to parse + :type args: list, None + :return: parsed arguments + :rtype: Namespace + """ + parser = argparse.ArgumentParser( + description="Program to read and " "plot PROCESS hdf5 output." + ) + + parser.add_argument( + "-i", + "--inputfile", + default="uncertainties_data.h5", + help="input hdf5 file (default=uncertainties_data.h5)", + ) + + parser.add_argument( + "-v", + "--vars", + default="None", + nargs="*", + help="Select the output variables (default = None) \n More than one output can be plotted eg: -v 'var1 var2'\n A separate plot will be created in matrix for each inputs combination", + ) + + parser.add_argument( + "-sf", + "--save_format", + nargs="?", + default="pdf", + help="Output format (default='pdf') ", + ) + + parser.add_argument( + "-p", + "--print", + action="store_true", + help="(print the PROCESS data to comannd line. default=False) ", + ) + + return parser.parse_args(args) + + +def main(args=None): + """reads inputfile and creats figure as outputfile + + :param args: None + :return: None + """ + args = parse_args(args) + + data_set = pd.read_hdf(args.inputfile) + if args.print: + print(data_set) + + output_names = args.vars + + # Select only the converged runs for creating KDF plots + # see if we can only use if ifail = 1 for the KDF + + # TO DO make separate list of converged and failed runs + # find way to display both to look at margins + # we want to colour red for ifail = 2-6 and blue for ifail = 1 + ioptimz = data_set["ioptimz"][0] + if ioptimz == -2: + data_set_converge = data_set + else: + data_set_converge = data_set[data_set["ifail"] == 1.0] + + figsize = (8, 8) + figure(figsize=figsize) + # kde or hist (hs) in the diagonal below + Axes = pd.plotting.scatter_matrix( + data_set_converge[output_names], alpha=0.19, diagonal="kde" + ) + + # y ticklabels + [plt.setp(item.yaxis.get_majorticklabels(), "size", 6) for item in Axes.ravel()] + # x ticklabels + [plt.setp(item.xaxis.get_majorticklabels(), "size", 6) for item in Axes.ravel()] + # y labels + [plt.setp(item.yaxis.get_label(), "size", 6) for item in Axes.ravel()] + # x labels + [plt.setp(item.xaxis.get_label(), "size", 6) for item in Axes.ravel()] + + savefig("uncertainties." + args.save_format) + + +if __name__ == "__main__": + main() diff --git a/process/utilities/errorlist.json b/process/utilities/errorlist.json index 7aa7d672be..98b86e3b8a 100644 --- a/process/utilities/errorlist.json +++ b/process/utilities/errorlist.json @@ -8,7 +8,7 @@ "comment2": [ "Increment n_errortypes if an error is added to this list" ], - "n_errortypes": 281, + "n_errortypes": 286, "errors": [ { "no": 1, @@ -1353,7 +1353,7 @@ { "no": 269, "level": 3, - "message": "CHECK: Impossible to set the TF turn/cable size with the integer turn option (i_tf_turns_integer: 1) " + "message": "CHECK: Impossible to set the TF turn/cable size with the integer turn option (i_tf_turns_integer: 1)" }, { "no": 270, @@ -1414,6 +1414,31 @@ "no": 281, "level": 3, "message": "CHECK: Cannot have i_tf_bucking >= 2 when tf_in_cs = 1" + }, + { + "no": 282, + "level": 3, + "message": "CONSTRAINTS: Cannot have constraint icc == 77 fcpttf with iteration value ixc == 60 cpttf" + }, + { + "no": 283, + "level": 3, + "message": "CHECK: Cannot have iterated itv ixc == 60 cpttf with i_tf_turns_integer == 1" + }, + { + "no": 284, + "level": 3, + "message": "CHECK: Cannot have iterated itv ixc == 60 cpttf with t_turn_tf input or t_cable_tf is input" + }, + { + "no": 285, + "level": 2, + "message": "WARNING: cpttf is calculated when t_turn_tf or t_cable_tf is input when i_tf_turns_integer == 0" + }, + { + "no": 286, + "level": 2, + "message": "WARNING: default value of cpttf used which is 70000.0 (A) " } ] } diff --git a/source/fortran/constraint_equations.f90 b/source/fortran/constraint_equations.f90 index c8d75d7724..7730c8f1db 100755 --- a/source/fortran/constraint_equations.f90 +++ b/source/fortran/constraint_equations.f90 @@ -260,7 +260,7 @@ subroutine constraint_eqns(m,ieqn,cc,con,err,symbol,units) case (76); call constraint_eqn_076(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units) ! Equation for maximum TF current per turn upper limit case (77); call constraint_eqn_077(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units) - ! Equation for Reinke criterion, divertor impurity fraction lower limit + ! Equation for Reinke criterion, divertor impurity fraction lower limit case (78); call constraint_eqn_078(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units) ! Equation for maximum CS field case (79); call constraint_eqn_079(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units) diff --git a/source/fortran/initial.f90 b/source/fortran/initial.f90 index ad86dc1e20..9620e17ec8 100755 --- a/source/fortran/initial.f90 +++ b/source/fortran/initial.f90 @@ -271,8 +271,9 @@ subroutine check tfinsgap, rcool, dhecoil, thicndut, i_cp_joints, t_turn_tf_is_input, & t_turn_tf, tftmp, t_cable_tf, t_cable_tf_is_input, tftmp, tmpcry, & i_tf_cond_eyoung_axial, eyoung_cond_axial, eyoung_cond_trans, & - i_tf_cond_eyoung_trans, i_str_wp + i_tf_cond_eyoung_trans, i_str_wp, cpttf_max, cpttf,cpttf_max_is_input use stellarator_variables, only: istell + use constraint_variables, only: fcpttf use sctfcoil_module, only: initialise_cables use vacuum_variables, only: vacuum_model use, intrinsic :: iso_fortran_env, only: dp=>real64 @@ -439,6 +440,59 @@ subroutine check ! --------------- + ! exclusions for constraint O77 fcpttf + if (any(icc == 77)) then + ! If constraint O77 fcpttf has been selected it cannot be an iteration value as well + if (any(ixc == 60)) then + ! ITV == 60 iteration value cpttf TF coil leg current per turn (A) + call report_error(282) + endif + endif + + ! exclusions for iteration itv 66 cpttf + if (any(ixc == 60)) then + ! cpttf is calculated if i_tf_turns_integer == 1 so cannot be iterated. + ! any value of cpttf will be overwritten by the calculated value. + if (i_tf_turns_integer == 1) then + call report_error(283) + endif + ! if cpttf is being iterated then t_turn_tf or t_cable_tf can not be selected + if (t_turn_tf_is_input .eqv. .true. .or. t_cable_tf_is_input .eqv. .true. ) then + call report_error(284) + endif + endif + + ! + if (i_tf_turns_integer == 0) then + ! if cpttf has been input then t_turn_tf or t_cable_tf cannot be used as cpttf is + ! calculated with these options which will just overwrite cpttf. Warn that this has happened. + if ( cpttf >0 .and. ((t_turn_tf_is_input .eqv. .true.) .or. (t_cable_tf_is_input .eqv. .true.))) then + call report_error(285) + + ! cpttf = 70000 is the default value and warn that the default value has been used for cpttf + ! a default variable might be better to be use i.e. cpttf_default = 70000.0 + else if (cpttf == 70000.0 .and. ((t_turn_tf_is_input .eqv. .false.) .or. (t_cable_tf_is_input .eqv. .false.))) then + call report_error(286) + endif + end if + + + ! Impossible to set the turn size of integer turn option + if ( t_turn_tf_is_input .and. i_tf_turns_integer == 1 ) then + call report_error(269) + end if + + ! Impossible to set the cable size of integer turn option + if ( t_cable_tf_is_input .and. i_tf_turns_integer == 1 ) then + call report_error(269) + end if + + ! Impossible to set both the TF coil turn and the cable dimension + if ( t_turn_tf_is_input .and. t_cable_tf_is_input ) then + call report_error(271) + end if + + ! Cannot use Psep/R and PsepB/qAR limits at the same time if(any(icc == 68) .and. any(icc == 56)) then call report_error(178) @@ -820,34 +874,7 @@ subroutine check end if end if - ! Setting t_turn_tf_is_input to true if t_turn_tf is an input - if ( abs(t_turn_tf) < epsilon(t_turn_tf) ) then - t_turn_tf_is_input = .false. - else - t_turn_tf_is_input = .true. - end if - - ! Impossible to set the turn size of integer turn option - if ( t_turn_tf_is_input .and. i_tf_turns_integer == 1 ) then - call report_error(269) - end if - - ! Setting t_cable_tf_is_input to true if t_cable_tf is an input - if ( abs(t_cable_tf) < epsilon(t_cable_tf) ) then - t_cable_tf_is_input = .false. - else - t_cable_tf_is_input = .true. - end if - - ! Impossible to set the cable size of integer turn option - if ( t_cable_tf_is_input .and. i_tf_turns_integer == 1 ) then - call report_error(269) - end if - ! Impossible to set both the TF coil turn and the cable dimension - if ( t_turn_tf_is_input .and. t_cable_tf_is_input ) then - call report_error(271) - end if ! Checking the SC temperature for LTS if ( ( i_tf_sc_mat == 1 .or. & diff --git a/source/fortran/input.f90 b/source/fortran/input.f90 index 8cc0ce9c1c..e62d297328 100644 --- a/source/fortran/input.f90 +++ b/source/fortran/input.f90 @@ -341,7 +341,8 @@ subroutine parse_input_file(in_file,out_file,show_changes) i_tf_turns_integer, n_rad_per_layer, b_crit_upper_nbti, t_crit_nbti, & i_cp_joints, n_tf_turn, f_t_turn_tf, t_turn_tf_max, t_cable_tf, & sig_tf_wp_max, eyoung_cond_trans, i_tf_cond_eyoung_axial, i_tf_cond_eyoung_trans, & - str_wp_max, str_tf_con_res, i_str_wp, max_vv_stress, theta1_coil, theta1_vv + str_wp_max, str_tf_con_res, i_str_wp, max_vv_stress, theta1_coil, theta1_vv, & + t_turn_tf_is_input, t_cable_tf_is_input, cpttf_max_is_input use times_variables, only: tohs, pulsetimings, tqnch, t_fusion_ramp, tramp, tburn, & tdwell, tohsin @@ -1520,6 +1521,11 @@ subroutine parse_input_file(in_file,out_file,show_changes) case ('cpttf_max') call parse_real_variable('cpttf_max', cpttf_max, 1.0D0, 1.0D6, & 'Maximum allowable TF coil leg current per turn (A) (constraint equation 77)') + if (cpttf_max == 0.0D0) then + cpttf_max_is_input = .false. + else if (cpttf_max > 0.0D0) then + cpttf_max_is_input = .true. + end if case ('sig_tf_case_max') call parse_real_variable('sig_tf_case_max', sig_tf_case_max, 1.0D6, 1.0D11, & @@ -1752,6 +1758,11 @@ subroutine parse_input_file(in_file,out_file,show_changes) case ('t_turn_tf') call parse_real_variable('t_turn_tf', t_turn_tf, 0.0D0, 0.1D0, & 'TF turn square dimensions (m)') + if (t_turn_tf == 0.0D0) then + t_turn_tf_is_input = .false. + else if (t_turn_tf > 0.0D0) then + t_turn_tf_is_input = .true. + end if case ('f_t_turn_tf') call parse_real_variable('f_t_turn_tf', f_t_turn_tf, 0.0D0, 1.D0, & 'f-value for TF coils WP trurn squared dimension constraint') @@ -1761,6 +1772,11 @@ subroutine parse_input_file(in_file,out_file,show_changes) case ('t_cable_tf') call parse_real_variable('t_cable_tf', t_cable_tf, 0.0D0, 0.1D0, & 'TF coil cable square/rounded dimensions (m)') + if (t_cable_tf == 0.0D0) then + t_cable_tf_is_input = .false. + else if (t_cable_tf > 0.0D0) then + t_cable_tf_is_input = .true. + end if case ('thicndut') call parse_real_variable('thicndut', thicndut, 0.0D0, 0.1D0, & 'Conduit insulation thickness (m)') diff --git a/source/fortran/tfcoil_variables.f90 b/source/fortran/tfcoil_variables.f90 index f227d0fcf5..1f3eb2df99 100644 --- a/source/fortran/tfcoil_variables.f90 +++ b/source/fortran/tfcoil_variables.f90 @@ -102,7 +102,7 @@ module tfcoil_variables !! If the t_turn_tf is non zero, cpttf is calculated logical :: t_turn_tf_is_input - !! Boolean switch to activated when the user set the TF coil turn dimensions + !! Boolean switch to be activated when the user set the TF coil turn dimensions !! Not an input real(dp) :: f_t_turn_tf @@ -125,7 +125,7 @@ module tfcoil_variables !! If the t_cable_tf is non zero, cpttf is calculated logical :: t_cable_tf_is_input - !! Boolean switch to activated when the user set the TF coil cable dimensions + !! Boolean switch is activated when the user set the TF coil cable dimensions !! Not an input real(dp) :: acs @@ -147,6 +147,10 @@ module tfcoil_variables real(dp) :: cpttf_max !! Max TF coil current per turn [A]. (for stellarators and `i_tf_turns_integer=1`) !! (`constraint equation 77`) + + logical :: cpttf_max_is_input + !! Boolean switch is activated when the user sets the max value of cpttf_max + !! Not an input real(dp) :: dcase !! density of coil case (kg/m3) diff --git a/tests/regression/scenarios/large-tokamak/ref.MFILE.DAT b/tests/regression/scenarios/large-tokamak/ref.MFILE.DAT index 26e80f720d..6b93850c21 100644 --- a/tests/regression/scenarios/large-tokamak/ref.MFILE.DAT +++ b/tests/regression/scenarios/large-tokamak/ref.MFILE.DAT @@ -3,14 +3,14 @@ # PROCESS # # Power Reactor Optimisation Code # PROCESS_version_number__________________________________________________ (procver)_____________________ "3.0.2 R" - Date_of_run_____________________________________________________________ (date)________________________ "08/02/2024" - Time_of_run_____________________________________________________________ (time)________________________ "10:56" - User____________________________________________________________________ (username)____________________ "timothyn" + Date_of_run_____________________________________________________________ (date)________________________ "18/03/2024" + Time_of_run_____________________________________________________________ (time)________________________ "17:00" + User____________________________________________________________________ (username)____________________ "cgriesel" PROCESS_run_title_______________________________________________________ (runtitle)____________________ "Generic large tokamak - PROCESS_tag_number______________________________________________________ (tagno)_______________________ "v3.0.2-7-gec9530fb1" - PROCESS_git_branch_name_________________________________________________ (branch_name)_________________ "3033-inequality-constraint-for-injected-power-coded-with-the-wrong-signbug" - PROCESS_last_commit_message_____________________________________________ (commsg)______________________ "Merge branch |main| into 3033-inequality-constraint-for-injected-power-coded-with-the-wrong-signbug - Input_filename__________________________________________________________ (fileprefix)__________________ "/private/var/folders/2c/5k4t0wm94jxdmnqwdvn_h59r0000gq/T/pytest-of-timothynunn/pytest-56/test_scenario_large_tokamak_0/IN.DAT " + PROCESS_tag_number______________________________________________________ (tagno)_______________________ "v3.0.2-27-ga422025" + PROCESS_git_branch_name_________________________________________________ (branch_name)_________________ "724-cpttf-and-cpttf_max-error-catching-integer-turns-option" + PROCESS_last_commit_message_____________________________________________ (commsg)______________________ "Exclude nviter from regression test comparison" + Input_filename__________________________________________________________ (fileprefix)__________________ "/mnt/c/Users/cgriesel/WIP/large_tokamak_test/IN.DAT " # Numerics # VMCON_error_flag________________________________________________________ (ifail)_______________________ 1 # PROCESS found a feasible solution # @@ -19,9 +19,9 @@ Optimisation_switch_____________________________________________________ (ioptimz)_____________________ 1 Figure_of_merit_switch__________________________________________________ (minmax)______________________ 1 Square_root_of_the_sum_of_squares_of_the_constraint_residuals___________ (sqsumsq)_____________________ 1.8713E-04 OP - VMCON_convergence_parameter_____________________________________________ (convergence_parameter)_______ 0.0000E+00 OP + VMCON_convergence_parameter_____________________________________________ (convergence_parameter)_______ 4.0865E-09 OP Normalised_objective_function___________________________________________ (norm_objf)___________________ 1.6000E+00 OP - Number_of_VMCON_iterations______________________________________________ (nviter)______________________ 0 OP + Number_of_VMCON_iterations______________________________________________ (nviter)______________________ 8 OP beta____________________________________________________________________ (itvar001)____________________ 3.3648E-02 beta_(final_value/initial_value)________________________________________ (xcm001)______________________ 1.1216E+00 beta_(range_normalised)_________________________________________________ (nitvar001)___________________ 3.2681E-02 @@ -157,32 +157,32 @@ dr_tf_wp________________________________________________________________ (itvar045)____________________ 5.0416E-01 dr_tf_wp_(final_value/initial_value)____________________________________ (xcm045)______________________ 1.0083E+00 dr_tf_wp_(range_normalised)_____________________________________________ (nitvar045)___________________ 6.5100E-02 - Beta_consistency__________________normalised_residue____________________ (normres001)__________________ 6.5770E-07 - Global_power_balance_consistency__normalised_residue____________________ (normres002)__________________ 1.2292E-07 - Radial_build_consistency__________normalised_residue____________________ (normres003)__________________ -7.3085E-11 - Density_upper_limit_______________normalised_residue____________________ (normres004)__________________ 1.6272E-08 - Neutron_wall_load_upper_limit_____normalised_residue____________________ (normres005)__________________ 1.4241E-07 - Fusion_power_upper_limit__________normalised_residue____________________ (normres006)__________________ 2.6565E-07 - Burn_time_lower_limit_____________normalised_residue____________________ (normres007)__________________ -1.2011E-04 - L-H_power_threshold_limit_________normalised_residue____________________ (normres008)__________________ -3.0891E-07 - Injection_power_upper_limit_______normalised_residue____________________ (normres009)__________________ 2.4418E-07 - Net_electric_power_lower_limit____normalised_residue____________________ (normres010)__________________ 1.5045E-05 - Beta_upper_limit__________________normalised_residue____________________ (normres011)__________________ 2.4702E-07 - Peak_toroidal_field_upper_limit___normalised_residue____________________ (normres012)__________________ 2.5809E-09 - CS_coil_EOF_current_density_limit_normalised_residue____________________ (normres013)__________________ -8.4245E-08 - CS_coil_BOP_current_density_limit_normalised_residue____________________ (normres014)__________________ 1.9393E-09 - I_op_/_I_critical_(TF_coil)_______normalised_residue____________________ (normres015)__________________ -3.8375E-07 - Dump_voltage_upper_limit__________normalised_residue____________________ (normres016)__________________ -1.5214E-04 - J_winding_pack/J_protection_limit_normalised_residue____________________ (normres017)__________________ -2.9894E-07 - TF_coil_temp._margin_lower_limit__normalised_residue____________________ (normres018)__________________ -1.0631E-06 - CS_temperature_margin_lower_limit_normalised_residue____________________ (normres019)__________________ 8.0251E-08 - taup/taueff_______________________normalised_residue____________________ (normres020)__________________ -1.8772E-08 - Dump_time_set_by_VV_stress________normalised_residue____________________ (normres021)__________________ -1.0026E-07 - CS_Tresca_yield_criterion_________normalised_residue____________________ (normres022)__________________ -1.6044E-07 - ne0_>_neped_______________________normalised_residue____________________ (normres023)__________________ -1.9637E-08 - Upper_Lim._on_Psep_*_Bt_/_q_A_R___normalised_residue____________________ (normres024)__________________ 4.9789E-07 - TF_coil_case_stress_upper_limit___normalised_residue____________________ (normres025)__________________ -4.6757E-07 - TF_coil_conduit_stress_upper_lim__normalised_residue____________________ (normres026)__________________ -4.1375E-07 + Beta_consistency__________________normalised_residue____________________ (eq_con001)___________________ 6.5770E-07 + Global_power_balance_consistency__normalised_residue____________________ (eq_con002)___________________ 1.2292E-07 + Radial_build_consistency__________normalised_residue____________________ (eq_con011)___________________ -7.3085E-11 + Density_upper_limit_______________normalised_residue____________________ (eq_con005)___________________ 1.6272E-08 + Neutron_wall_load_upper_limit_____normalised_residue____________________ (eq_con008)___________________ 1.4241E-07 + Fusion_power_upper_limit__________normalised_residue____________________ (eq_con009)___________________ 2.6565E-07 + Burn_time_lower_limit_____________normalised_residue____________________ (eq_con013)___________________ -1.2011E-04 + L-H_power_threshold_limit_________normalised_residue____________________ (eq_con015)___________________ -3.0891E-07 + Injection_power_upper_limit_______normalised_residue____________________ (eq_con030)___________________ 2.4418E-07 + Net_electric_power_lower_limit____normalised_residue____________________ (eq_con016)___________________ 1.5045E-05 + Beta_upper_limit__________________normalised_residue____________________ (eq_con024)___________________ 2.4702E-07 + Peak_toroidal_field_upper_limit___normalised_residue____________________ (eq_con025)___________________ 2.5809E-09 + CS_coil_EOF_current_density_limit_normalised_residue____________________ (eq_con026)___________________ -8.4245E-08 + CS_coil_BOP_current_density_limit_normalised_residue____________________ (eq_con027)___________________ 1.9393E-09 + I_op_/_I_critical_(TF_coil)_______normalised_residue____________________ (eq_con033)___________________ -3.8375E-07 + Dump_voltage_upper_limit__________normalised_residue____________________ (eq_con034)___________________ -1.5214E-04 + J_winding_pack/J_protection_limit_normalised_residue____________________ (eq_con035)___________________ -2.9894E-07 + TF_coil_temp._margin_lower_limit__normalised_residue____________________ (eq_con036)___________________ -1.0631E-06 + CS_temperature_margin_lower_limit_normalised_residue____________________ (eq_con060)___________________ 8.0251E-08 + taup/taueff_______________________normalised_residue____________________ (eq_con062)___________________ -1.8772E-08 + Dump_time_set_by_VV_stress________normalised_residue____________________ (eq_con065)___________________ -1.0026E-07 + CS_Tresca_yield_criterion_________normalised_residue____________________ (eq_con072)___________________ -1.6044E-07 + ne0_>_neped_______________________normalised_residue____________________ (eq_con081)___________________ -1.9637E-08 + Upper_Lim._on_Psep_*_Bt_/_q_A_R___normalised_residue____________________ (eq_con068)___________________ 4.9789E-07 + TF_coil_case_stress_upper_limit___normalised_residue____________________ (eq_con031)___________________ -4.6757E-07 + TF_coil_conduit_stress_upper_lim__normalised_residue____________________ (eq_con032)___________________ -4.1375E-07 # Final Feasible Point # # Power Reactor Costs (1990 US$) # First_wall_/_blanket_life_(years)_______________________________________ (fwbllife)____________________ 6.1566E+00 @@ -557,7 +557,7 @@ # Times # Initial_charge_time_for_CS_from_zero_current_(s)________________________ (tramp)_______________________ 5.0000E+02 Plasma_current_ramp-up_time_(s)_________________________________________ (tohs)________________________ 1.6631E+02 - Heating_time_(s)________________________________________________________ (theat)_______________________ 1.0000E+01 + Heating_time_(s)________________________________________________________ (t_fusion_ramp)_______________ 1.0000E+01 Burn_time_(s)___________________________________________________________ (tburn)_______________________ 7.2035E+03 OP Reset_time_to_zero_current_for_CS_(s)___________________________________ (tqnch)_______________________ 1.6631E+02 Time_between_pulses_(s)_________________________________________________ (tdwell)______________________ 1.8000E+03 @@ -695,8 +695,9 @@ Inboard_leg_case_inboard_"nose"_thickness_(m)___________________________ (thkcas)______________________ 2.8216E-01 ITV Inboard_leg_case_sidewall_thickness_at_its_narrowest_point_(m)__________ (casths)______________________ 5.0000E-02 External_case_mass_per_coil_(kg)________________________________________ (whtcas)______________________ 5.5456E+05 OP - WP_cross_section_area_with_insulation_and_insertion_(per_coil)_(m2)_____ (awpc)________________________ 5.7486E-01 - WP_cross_section_area_(per_coil)_(m2)___________________________________ (aswp)________________________ 5.1696E-01 + WP_cross_section_area_with_insulation_and_insertion_gap_(m2)____________ (awpc)________________________ 5.7486E-01 + WP_cross_section_area_without_insulation_and_insertion_gap_(m2)_________ (awptf)_______________________ 5.1696E-01 + WP_structure_area_(m2)__________________________________________________ (aswp)________________________ 2.3886E-01 Winding_pack_radial_thickness_(m)_______________________________________ (dr_tf_wp)____________________ 5.0416E-01 ITV Winding_pack_toroidal_width_1_(m)_______________________________________ (wwp1)________________________ 1.1904E+00 OP Winding_pack_toroidal_width_2_(m)_______________________________________ (wwp2)________________________ 1.0901E+00 OP @@ -704,7 +705,6 @@ Winding_pack_insertion_gap_(m)__________________________________________ (tfinsgap)____________________ 1.0000E-02 Steel_WP_cross-section_(total)_(m2)_____________________________________ (aswp*n_tf)___________________ 3.8217E+00 Steel_WP_fraction_______________________________________________________ (aswp/awpc)___________________ 4.1550E-01 - Insulation_WP_fraction__________________________________________________ (aiwp/awpc)___________________ 4.7934E-02 Cable_WP_fraction_______________________________________________________ ((awpc-aswp-aiwp)/awpc)_______ 5.3656E-01 Turn_parametrisation____________________________________________________ (i_tf_turns_integer)__________ 0 Number_of_turns_per_TF_coil_____________________________________________ (n_tf_turn)___________________ 1.4739E+02 OP @@ -1769,6 +1769,9 @@ fcuohsu = 0.70 * ITER Nb3Sn parameterisation isumatoh = 1 +* Fraction of JxB force supported by PF coil case +sigpfcf = 0.666 + * TF Coil * *********** diff --git a/tests/regression/scenarios/large-tokamak/ref.OUT.DAT b/tests/regression/scenarios/large-tokamak/ref.OUT.DAT index e6db546705..aa0dfd0d18 100644 --- a/tests/regression/scenarios/large-tokamak/ref.OUT.DAT +++ b/tests/regression/scenarios/large-tokamak/ref.OUT.DAT @@ -26,14 +26,14 @@ Program : Version : 3.0.2 Release Date :: 2024-01-25 - Tag No. : v3.0.2-7-gec9530fb1 - Branch : 3033-inequality-constraint-for-injected-power-coded-with-the-wrong-signbug - Git log : Merge branch |main| into 3033-inequality-constraint-for-injected-power-coded-with-the-wrong-signbug - Date/time : 8 Feb 2024 10:56:40 +00:00(hh:mm) UTC - User : timothynunn - Computer : L0268-iMac - Directory : /Users/timothynunn/process - Input : /private/var/folders/2c/5k4t0wm94jxdmnqwdvn_h59r0000gq/T/pytest-of-timothynunn/pytest-56/test_scenario_large_tokamak_0/IN.DAT + Tag No. : v3.0.2-27-ga422025 + Branch : 724-cpttf-and-cpttf_max-error-catching-integer-turns-option + Git log : Exclude nviter from regression test comparison + Date/time : 18 Mar 2024 17:00:41 +00:00(hh:mm) UTC + User : cgriesel + Computer : K1370 + Directory : /mnt/c/Users/cgriesel/WIP/large_tokamak_test + Input : /mnt/c/Users/cgriesel/WIP/large_tokamak_test/IN.DAT Run title : Generic large tokamak Run type : Reactor concept design: Pulsed tokamak model, (c) CCFE @@ -71,9 +71,9 @@ Optimisation switch (ioptimz) 1 Figure of merit switch (minmax) 1 Square root of the sum of squares of the constraint residuals (sqsumsq) 1.871E-04 OP - VMCON convergence parameter (convergence_parameter) 0.000E+00 OP + VMCON convergence parameter (convergence_parameter) 4.087E-09 OP Normalised objective function (norm_objf) 1.600E+00 OP - Number of VMCON iterations (nviter) 0 OP + Number of VMCON iterations (nviter) 8 OP PROCESS has successfully optimised the iteration variables to minimise the figure of merit MAJOR RADIUS. @@ -162,7 +162,7 @@ PROCESS has successfully optimised the iteration variables to minimise the figur 11 Beta upper limit < 5.7842E-02 1.4288E-08 2.4702E-07 12 Peak toroidal field upper limit < 1.4000E+01 T -3.1431E-08 T 2.5809E-09 13 CS coil EOF current density limit < 3.6485E+07 A/m2 -3.0737E+00 A/m2 -8.4245E-08 - 14 CS coil BOP current density limit < 3.5294E+07 A/m2 6.8446E-02 A/m2 1.9393E-09 + 14 CS coil BOP current density limit < 3.5294E+07 A/m2 6.8447E-02 A/m2 1.9393E-09 15 I_op / I_critical (TF coil) < 3.5688E+07 A/m2 9.8245E+00 A/m2 -3.8375E-07 16 Dump voltage upper limit < 9.5837E+00 V 3.9754E-01 V -1.5214E-04 17 J_winding pack/J_protection limit < 2.5694E+07 A/m2 0.0000E+00 A/m2 -2.9894E-07 @@ -587,7 +587,7 @@ PROCESS has successfully optimised the iteration variables to minimise the figur Confinement : - Confinement scaling law: b'IPB98(y,2) (H)' + Confinement scaling law: IPB98(y,2) (H) Confinement H factor (hfact) 1.189 ITV Global thermal energy confinement time (s) (taueff) 3.204 OP Ion energy confinement time (s) (tauei) 3.204 OP @@ -653,22 +653,22 @@ PROCESS has successfully optimised the iteration variables to minimise the figur scaling law confinement time (s) H-factor for for H = 1 power balance - IPB98(y) (H) 3.370 0.950 + IPB98(y) (H) 3.370 0.951 IPB98(y,1) (H) 3.351 0.956 - IPB98(y,2) (H) 2.695 1.188 + IPB98(y,2) (H) 2.695 1.189 IPB98(y,3) (H) 2.765 1.159 IPB98(y,4) (H) 2.778 1.153 ISS95 (stell) 1.881 1.703 ISS04 (stell) 3.285 0.975 DS03 (H) 3.963 0.808 - Murari et al NPL (H) 1.998 1.603 - Petty 2008 (H) 4.831 0.664 + Murari et al NPL (H) 1.998 1.604 + Petty 2008 (H) 4.831 0.663 Lang et al. 2012 (H) 1.688 1.897 Hubbard 2017 - nom (I) 0.065 49.025 - Hubbard 2017 - lower (I) 0.037 86.152 + Hubbard 2017 - lower (I) 0.037 86.153 Hubbard 2017 - upper (I) 0.115 27.898 NSTX (Spherical) (H) 6.634 0.483 - NSTX-Petty08 Hybrid (H) 4.831 0.664 + NSTX-Petty08 Hybrid (H) 4.831 0.663 ******************************************** Current Drive System ******************************************** @@ -714,7 +714,7 @@ PROCESS has successfully optimised the iteration variables to minimise the figur Initial charge time for CS from zero current (s) (tramp) 500.000 Plasma current ramp-up time (s) (tohs) 166.312 - Heating time (s) (theat) 10.000 + Heating time (s) (t_fusion_ramp) 10.000 Burn time (s) (tburn) 7.203E+03 OP Reset time to zero current for CS (s) (tqnch) 166.312 Time between pulses (s) (tdwell) 1800.000 @@ -820,14 +820,14 @@ PROCESS has successfully optimised the iteration variables to minimise the figur Materal stress of the point of maximum shear stress (Tresca criterion) for each layer Please use utilities/plot_stress_tf.py for radial plots plots summary Layers Steel case WP Outer case - Radial stress (MPa) 4.884866930978646e-14 -154.10797132124506 6.139837762674028 - Toroidal stress (MPa) -487.2423067398094 -378.60773239841564 -363.13729205135877 - Vertical stress (MPa) 260.28266961754434 260.28266961754434 145.1023378952434 - Von-Mises stress (MPa) 657.2464240520554 556.449381760471 453.44839992512834 - Shear (Tresca) (MPa) 747.5249763573538 638.8904020159599 508.2396299466021 + Radial stress (MPa) 4.884866930978646e-14 -154.1079713210408 6.13983776267713 + Toroidal stress (MPa) -487.24230674002666 -378.6077323985523 -363.1372920515427 + Vertical stress (MPa) 260.28266961759306 260.28266961759306 145.10233789527098 + Von-Mises stress (MPa) 657.2464240522969 556.4493817606353 453.448399925325 + Shear (Tresca) (MPa) 747.5249763576197 638.8904020161453 508.2396299468137 - Toroidal modulus (GPa) 205.0 47.92593615557546 205.0 - Vertical modulus (GPa) 205.0 125.55717175726056 367.72630989666305 + Toroidal modulus (GPa) 205.0 47.925936155601484 205.0 + Vertical modulus (GPa) 205.0 125.5571717572879 367.72630989666203 WP transverse modulus (GPa) (eyoung_wp_trans*1.0d-9) 4.353E+01 OP WP vertical modulus (GPa) (eyoung_wp_axial*1.0d-9) 1.151E+02 OP @@ -864,9 +864,9 @@ PROCESS has successfully optimised the iteration variables to minimise the figur by a straight segment and elliptical arcs between the following points: point x(m) y(m) - 0 3.625333332748652 4.5506 - 1 7.466666666666667 7.584333333333333 - 2 14.526636547620939 0.0 + 0 3.625333332748652 4.550600000000001 + 1 7.466666666666667 7.584333333333335 + 2 14.526636547621086 0.0 3 7.466666666666667 -8.818217164127494 4 3.625333332748652 -5.290930298476496 @@ -888,8 +888,9 @@ PROCESS has successfully optimised the iteration variables to minimise the figur TF winding pack (WP) geometry: - WP cross section area with insulation and insertion (per coil) (m2) (awpc) 5.749E-01 - WP cross section area (per coil) (m2) (aswp) 5.170E-01 + WP cross section area with insulation and insertion gap (m2) (awpc) 5.749E-01 + WP cross section area without insulation and insertion gap (m2) (awptf) 5.170E-01 + WP structure area (m2) (aswp) 2.389E-01 Winding pack radial thickness (m) (dr_tf_wp) 5.042E-01 ITV Winding pack toroidal width 1 (m) (wwp1) 1.190E+00 OP Winding pack toroidal width 2 (m) (wwp2) 1.090E+00 OP @@ -900,7 +901,6 @@ PROCESS has successfully optimised the iteration variables to minimise the figur Steel WP cross-section (total) (m2) (aswp*n_tf) 3.822E+00 Steel WP fraction (aswp/awpc) 4.155E-01 - Insulation WP fraction (aiwp/awpc) 4.793E-02 Cable WP fraction ((awpc-aswp-aiwp)/awpc) 5.366E-01 WP turn information: @@ -1075,14 +1075,14 @@ PROCESS has successfully optimised the iteration variables to minimise the figur Geometry of PF coils, central solenoid and plasma: - coil R(m) Z(m) dR(m) dZ(m) turns steel thickness(m) + coil R(m) Z(m) dR(m) dZ(m) turns - PF 0 5.57e+00 9.36e+00 1.27e+00 1.27e+00 4.45e+02 1.22e-01 - PF 1 5.57e+00 -1.06e+01 1.37e+00 1.37e+00 5.12e+02 1.38e-01 - PF 2 1.67e+01 2.67e+00 1.13e+00 1.13e+00 1.93e+02 7.87e-02 - PF 3 1.67e+01 -2.67e+00 1.13e+00 1.13e+00 1.93e+02 7.87e-02 - PF 4 1.52e+01 7.47e+00 8.08e-01 8.08e-01 1.30e+02 6.39e-02 - PF 5 1.52e+01 -7.47e+00 8.08e-01 8.08e-01 1.30e+02 6.39e-02 + PF 0 5.57e+00 9.36e+00 1.27e+00 1.27e+00 4.45e+02 + PF 1 5.57e+00 -1.06e+01 1.37e+00 1.37e+00 5.12e+02 + PF 2 1.67e+01 2.67e+00 1.13e+00 1.13e+00 1.93e+02 + PF 3 1.67e+01 -2.67e+00 1.13e+00 1.13e+00 1.93e+02 + PF 4 1.52e+01 7.47e+00 8.08e-01 8.08e-01 1.30e+02 + PF 5 1.52e+01 -7.47e+00 8.08e-01 8.08e-01 1.30e+02 CS 2.27e+00 0.00e+00 5.76e-01 1.59e+01 4.63e+03 1.49e-01 Plasma 8.00e+00 0.0e0 5.33e+00 9.87e+00 1.0e0 @@ -1521,16 +1521,16 @@ PROCESS has successfully optimised the iteration variables to minimise the figur htpmw_blkt 0.00 0.00 Shield: - 1.4137531918967596 0.0 1.4137531918967596 + 1.413753191896546 0.0 1.413753191896546 0.0e0 0.0e0 0.0e0 0.0e0 0.0e0 0.0e0 - 0.007068765959483798 0.0 0.007068765959483798 + 0.0070687659594827305 0.0 0.0070687659594827305 Divertor: - 149.05655107316005 0.0 149.05655107316005 - 163.0278573758872 0.0 163.0278573758872 - 26.04378234075923 0.0 26.04378234075923 - 1.6906409539490324 0.0 1.6906409539490324 + 149.0565510731375 0.0 149.0565510731375 + 163.02785737588755 0.0 163.02785737588755 + 26.043782340748514 0.0 26.043782340748514 + 1.690640953948868 0.0 1.690640953948868 TF coil: ptfnuc 0.00 0.03 @@ -1544,7 +1544,7 @@ PROCESS has successfully optimised the iteration variables to minimise the figur pradhcd 0.00 0.00 0.0e0 0.0e0 0.0e0 - 2011.0769671840444 0.025118361005325503 2011.1020855450497 + 2011.0769671837068 0.0251183610053086 2011.102085544712 Total power leaving reactor (across vacuum vessel boundary) (MW) 2011.127 OP @@ -1636,41 +1636,41 @@ PROCESS has successfully optimised the iteration variables to minimise the figur Pulse timings [s]: - tramp tohs theat tburn tqnch tdwell + tramp tohs t_fusion_ramp tburn tqnch tdwell ----- ---- ----- ----- ----- ------ - Duration 500.0 166.3120681875048 10.0 7203.474744374382 166.3120681875048 1800.0 + Duration 500.0 166.31206818750422 10.0 7203.474744374325 166.31206818750422 1800.0 ------ ----- ---- ----- ----- ----- ------ Continous power usage [MWe]: - System tramp tohs theat tburn tqnch tdwell + System tramp tohs t_fusion_ramp tburn tqnch tdwell ------ ----- ---- ----- ----- ----- ------ - Primary cooling 190.53422680544705 190.53422680544705 190.53422680544705 190.53422680544705 190.53422680544705 190.53422680544705 - Cryoplant 36.56608942770081 36.56608942770081 36.56608942770081 36.56608942770081 36.56608942770081 36.56608942770081 + Primary cooling 190.53422680541243 190.53422680541243 190.53422680541243 190.53422680541243 190.53422680541243 190.53422680541243 + Cryoplant 36.56608942769101 36.56608942769101 36.56608942769101 36.56608942769101 36.56608942769101 36.56608942769101 Vacuum 0.5 0.5 0.5 0.5 0.5 0.5 Tritium 15.0 15.0 15.0 15.0 15.0 15.0 - TF 10.433515098277292 10.433515098277292 10.433515098277292 10.433515098277292 10.433515098277292 10.433515098277292 - Facilities 55.48967873773938 55.48967873773938 55.48967873773938 55.48967873773938 55.48967873773938 55.48967873773938 + TF 10.433515098270766 10.433515098270766 10.433515098270766 10.433515098270766 10.433515098270766 10.433515098270766 + Facilities 55.489678737738146 55.489678737738146 55.489678737738146 55.489678737738146 55.489678737738146 55.489678737738146 ------ ----- ---- ----- ----- ----- ------ - Total 308.5235100691645 308.5235100691645 308.5235100691645 308.5235100691645 308.5235100691645 308.5235100691645 + Total 308.5235100691124 308.5235100691124 308.5235100691124 308.5235100691124 308.5235100691124 308.5235100691124 ------ ----- ---- ----- ----- ----- ------ Intermittent power usage [MWe]: - System tramp tohs theat tburn tqnch tdwell + System tramp tohs t_fusion_ramp tburn tqnch tdwell ------ ----- ---- ----- ----- ----- ------ - H & CD 0.0 240.0 240.0 160.28589054271148 240.0 0.0 - PF 45.20992933087412 -55.440256398044795 0.0 2.1404795879536165 -173.19180638996582 0.0 + H & CD 0.0 240.0 240.0 160.28589054261923 240.0 0.0 + PF 45.209929330878644 -55.440256398074816 0.0 2.1404795879551624 -173.19180639001584 0.0 ------ ----- ---- ----- ----- ----- ------ - Total 45.20992933087412 184.5597436019552 240.0 162.4263701306651 66.80819361003418 0.0 + Total 45.209929330878644 184.5597436019252 240.0 162.42637013057438 66.80819360998416 0.0 ------ ----- ---- ----- ----- ----- ------ Power production [MWe]: - tramp tohs theat tburn tqnch tdwell avg + tramp tohs t_fusion_ramp tburn tqnch tdwell avg ----- ---- ----- ----- ----- ------ --- - Gross power 0.0 0.0 0.0 870.0576139139499 0.0 0.0 - Net power -353.7334394000386 -493.0832536711197 -548.5235100691646 399.1077337141203 -375.33170367919865 -308.5235100691645 + Gross power 0.0 0.0 0.0 870.0576139138029 0.0 0.0 + Net power -353.733439399991 -493.0832536710376 -548.5235100691124 399.1077337141162 -375.33170367909656 -308.5235100691124 ------ ----- ---- ----- ----- ----- ------ @@ -2280,6 +2280,9 @@ fcuohsu = 0.70 * ITER Nb3Sn parameterisation isumatoh = 1 +* Fraction of JxB force supported by PF coil case +sigpfcf = 0.666 + * TF Coil * ***********