diff --git a/process/core/io/in_dat/base.py b/process/core/io/in_dat/base.py index f63095034..1ac910e67 100644 --- a/process/core/io/in_dat/base.py +++ b/process/core/io/in_dat/base.py @@ -159,7 +159,6 @@ def is_array(name): try: return "array" in dicts["DICT_VAR_TYPE"][name] except KeyError: - # print("Warning:", name, "is not in DICT_VAR_TYPE") return False @@ -685,12 +684,6 @@ def add_parameter(data, parameter_name, parameter_value): else: data[parameter_name].value = parameter_value - # def __delitem__(self, key): - # del self.__dict__[key] - - # def keys(self): - # return self.__dict__.keys() - def remove_parameter(data, parameter_name): """Function to remove parameter from the IN.DAT data dictionary diff --git a/process/core/io/plot/sankey.py b/process/core/io/plot/sankey.py index 9b44ca4db..dcd4eb487 100644 --- a/process/core/io/plot/sankey.py +++ b/process/core/io/plot/sankey.py @@ -880,7 +880,6 @@ def plot_sankey( # Munipulating the positioning of the branch labels # -ve to left and down; +ve to right and up - # pos[0] = x-axis; pos[1] = y-axis for d in diagrams: for y, t in enumerate(d.texts): pos = tuple(np.ndarray.tolist(d.tips[y])) diff --git a/process/core/io/plot/scans.py b/process/core/io/plot/scans.py index 323cde2e2..a1a8d8f5a 100644 --- a/process/core/io/plot/scans.py +++ b/process/core/io/plot/scans.py @@ -652,7 +652,6 @@ def _format_lists(inp, output_names): loc="lower center", fontsize=legend_size, bbox_to_anchor=(0.5, -0.5 - (0.1 * len(output_names))), - # bbox_to_anchor=(0.5, -1.4), fancybox=True, shadow=False, ncol=len(input_files), diff --git a/process/core/io/plot/summary.py b/process/core/io/plot/summary.py index 261cd8dd5..cfa497734 100644 --- a/process/core/io/plot/summary.py +++ b/process/core/io/plot/summary.py @@ -3378,7 +3378,6 @@ def plot_system_power_profiles_over_time(axis: plt.Axes, mfile: MFile, scan: int axis.legend() axis.set_yscale("symlog") - # axis.set_xscale() axis.minorticks_on() axis.grid(True, which="both", linestyle="--", linewidth=0.5, alpha=0.2) @@ -10663,7 +10662,10 @@ def plot_tf_stress(axis: plt.Axes, mfile: MFile): tresca_smeared_stress.append([]) bound_tresca_smeared_stress.extend([ - max(abs(radial_smeared_stress[ii][0]), abs(toroidal_smeared_stress[ii][0])) + max( + abs(radial_smeared_stress[ii][0]), + abs(toroidal_smeared_stress[ii][0]), + ) + vertical_smeared_stress[ii][0], max( abs(radial_smeared_stress[ii][n_radial_array_layer - 1]), diff --git a/process/models/blankets/hcpb.py b/process/models/blankets/hcpb.py index 88ea58f56..faa2ed0b5 100644 --- a/process/models/blankets/hcpb.py +++ b/process/models/blankets/hcpb.py @@ -236,13 +236,6 @@ def run(self, output: bool = False): f_geom_cp * physics_variables.p_neutron_total_mw - fwbs_variables.pnuc_cp_tf ) - # Old code kept for backward compatibility - # --- - # p_div_nuclear_heat_total_mw is not changed. - # The energy due to multiplication, by subtraction: - # p_blkt_multiplication_mw = p_fw_nuclear_heat_total_mw + p_blkt_nuclear_heat_total_mw + p_shld_nuclear_heat_mw + p_tf_nuclear_heat_mw + p_div_nuclear_heat_total_mw - p_neutron_total_mw - # --- - # New code, a bit simpler fwbs_variables.p_blkt_multiplication_mw = ( (fwbs_variables.f_p_blkt_multiplication - 1) diff --git a/process/models/build.py b/process/models/build.py index 36cd13769..1f79af962 100644 --- a/process/models/build.py +++ b/process/models/build.py @@ -861,36 +861,6 @@ def divgeom(self, output: bool): triu = physics_variables.triang tril = physics_variables.triang - # Old method: assumes that divertor arms are continuations of arcs - # - # Outboard side - # build_variables.plsepo = poloidal length along the separatrix from null to - # strike point on outboard [default 1.5 m] - # thetao = arc angle between the strike point and the null point - # - # xpointo = physics_variables.rmajor + 0.5e0*physics_variables.rminor*(kap**2 + tri**2 - 1.0e0) / # (1.0e0 - tri) - # rprimeo = (xpointo - physics_variables.rmajor + physics_variables.rminor) - # phio = asin(kap*physics_variables.rminor/rprimeo) - # thetao = build_variables.plsepo/rprimeo - # - # Initial strike point - # - # yspointo = rprimeo * sin(thetao + phio) - # xspointo = xpointo - rprimeo * cos(thetao + phio) - # - # Outboard strike point radius - normalized to ITER - # - # rstrko = xspointo + 0.14e0 - # - # Uppermost divertor strike point (end of power decay) - # anginc = angle of incidence of scrape-off field lines on the - # divertor (rad) - # - # +**PJK 25/07/11 Changed sign of anginc contribution - # yprimeb = soleno * cos(thetao + phio - anginc) - # - # divht = yprimeb + yspointo - kap*physics_variables.rminor - # New method, assuming straight legs -- superceded by new method 26/5/2016 # Assumed 90 degrees at X-pt -- wrong# # @@ -932,16 +902,10 @@ def divgeom(self, output: bool): zspi = zxpt - build_variables.plsepi * np.sin(thetai) # Position of outer strike point - # build_variables.rspo = rxpt + build_variables.plsepo*cos((pi/2.0e0)-alphad) - # zspo = zxpt - build_variables.plsepo*sin((pi/2.0e0)-alphad) build_variables.rspo = rxpt + build_variables.plsepo * np.cos(thetao) zspo = zxpt - build_variables.plsepo * np.sin(thetao) # Position of inner plate ends - # rplti = rspi - (build_variables.plleni/2.0e0)*sin(divertor_variables.betai + alphad - pi/2.0e0) - # zplti = zspi + (build_variables.plleni/2.0e0)*cos(divertor_variables.betai + alphad - pi/2.0e0) - # rplbi = rspi + (build_variables.plleni/2.0e0)*sin(divertor_variables.betai + alphad - pi/2.0e0) - # zplbi = zspi - (build_variables.plleni/2.0e0)*cos(divertor_variables.betai + alphad - pi/2.0e0) rplti = rspi + (build_variables.plleni / 2.0e0) * np.cos( thetai + divertor_variables.betai ) @@ -956,10 +920,6 @@ def divgeom(self, output: bool): ) # Position of outer plate ends - # rplto = build_variables.rspo + (build_variables.plleno/2.0e0)*sin(divertor_variables.betao - alphad) - # zplto = zspo + (build_variables.plleno/2.0e0)*cos(divertor_variables.betao - alphad) - # rplbo = build_variables.rspo - (build_variables.plleno/2.0e0)*sin(divertor_variables.betao - alphad) - # zplbo = zspo - (build_variables.plleno/2.0e0)*cos(divertor_variables.betao - alphad) rplto = build_variables.rspo - (build_variables.plleno / 2.0e0) * np.cos( thetao + divertor_variables.betao ) diff --git a/process/models/costs/costs.py b/process/models/costs/costs.py index a0528dcf4..ce5aafa7d 100644 --- a/process/models/costs/costs.py +++ b/process/models/costs/costs.py @@ -127,17 +127,6 @@ def output(self): ) po.osubhd(self.outfile, "Power Generation Costs :") - # TODO: Convert fortran format to Python - # if ((annfwbl != annfwbl) or (annfwbl > 1.0e10) or (annfwbl < 0.0e0)) : - # write(outfile,*)'Problem with annfwbl' - # write(outfile,*)'fwallcst=', fwallcst, ' blkcst=', self.data.costs.blkcst - # write(outfile,*)'crffwbl=', crffwbl, ' fcap0cp=', self.data.costs.fcap0cp - # write(outfile,*)'feffwbl=', feffwbl, ' fwbllife=', fwbllife - - # write(outfile,200) # anncap,coecap, # annoam,coeoam, # anndecom,coedecom, # annfwbl,coefwbl, # anndiv,coediv, # anncp,coecp, # anncdr,coecdr, # annfuel,coefuel, # annwst,coewst, # annfuelt,coefuelt, # anntot,coe - - # 200 format( # t76,'Annual Costs, M$ COE, m$/kWh'// # 1x,'Capital Investment',t80,f10.2,10x,f10.2/ # 1x,'Operation & Maintenance',t80,f10.2,10x,f10.2/ # 1x,'Decommissioning Fund',t80,f10.2,10x,f10.2/ # 1x,'Fuel Charge Breakdown'// # 5x,'Blanket & first wall',t72,f10.2,10x,f10.2/ # 5x,'Divertors',t72,f10.2,10x,f10.2/ # 5x,'Centrepost (TART only)',t72,f10.2,10x,f10.2/ # 5x,'Auxiliary Heating',t72,f10.2,10x,f10.2/ # 5x,'Actual Fuel',t72,f10.2,10x,f10.2/ # 5x,'Waste Disposal',t72,f10.2,10x,f10.2/ # 1x,'Total Fuel Cost',t80,f10.2,10x,f10.2// # 1x,'Total Cost',t80,f10.2,10x,f10.2 ) - if self.data.costs.ifueltyp == 1: po.oshead(self.outfile, "Replaceable Components Direct Capital Cost") po.ovarrf( @@ -387,16 +376,6 @@ def output(self): self.data.costs.c2214, ) po.ocosts(self.outfile, "(c2215)", "Divertor cost (M$)", self.data.costs.c2215) - # TODO: Convert fortran format to Python - # if (self.data.costs.ifueltyp == 1) : - # po.oblnkl(self.outfile) - # write(self.outfile,20) - # 20 format(t2, 'First wall, total blanket and divertor direct costs',/, t2,'are zero as they are assumed to be fuel costs.') - # elif (self.data.costs.ifueltyp == 2) : - # po.oblnkl(self.outfile) - # write(self.outfile,31) - # 21 format(t2, 'Initial First wall, total blanket and divertor direct costs',/, t2,'are in capital and replacemnet are in cost of electricity') - po.oblnkl(self.outfile) po.ocosts( self.outfile, @@ -512,16 +491,6 @@ def output(self): "Vacuum vessel assembly cost (M$)", self.data.costs.c2223, ) - # TODO: Convert fortran format to Python - # if ((physics_variables.itart == 1)and(self.data.costs.ifueltyp == 1)) : - # po.oblnkl(self.outfile) - # write(self.outfile,30) - # 30 format(t2, 'Centrepost direct cost is zero, as it ', 'is assumed to be a fuel cost.') - # elif ((physics_variables.itart == 1)and(self.data.costs.ifueltyp == 2)) : - # po.oblnkl(self.outfile) - # write(self.outfile,31) - # 31 format(t2, 'Initial centrepost direct cost in included in capital ', 'cost and replacements are assumed to be a fuel cost.') - po.oblnkl(self.outfile) po.ocosts( self.outfile, @@ -2919,32 +2888,6 @@ def coelc(self): * sqrt_p_plant_electric_net_mw_1200 ) - # Additional cost due to pulsed reactor thermal storage - # See F/MPE/MOD/CAG/PROCESS/PULSE/0008 - # - # if (i_pulsed_plant.eq.1) : - # if (istore.eq.1) : - # annoam1 = 51.0e0 - # elif (istore.eq.2) : - # annoam1 = 22.2e0 - # else: - # continue - # - # - # Scale with net electric power - # - # annoam1 = annoam1 * heat_transport_variables.p_plant_electric_net_mw/1200.0e0 - # - # It is necessary to convert from 1992 pounds to 1990 dollars - # Reasonable guess for the exchange rate + inflation factor - # inflation = 5% per annum; exchange rate = 1.5 dollars per pound - # - # annoam1 = annoam1 * 1.36e0 - # - # annoam = annoam + annoam1 - # - # - # Cost of electricity due to operation and maintenance self.data.costs.coeoam = 1.0e9 * annoam / kwhpy diff --git a/process/models/power.py b/process/models/power.py index b6069d0b7..788e9e9a4 100644 --- a/process/models/power.py +++ b/process/models/power.py @@ -2442,8 +2442,6 @@ def tfcpwr( "OP ", ) # MDK Remove this as it leads to confusion between (a) total inductance/n_tf_coils, or (b) - # self-inductance of one single coil - # po.ovarre(outfile,'Inductance per TF coil (H)','(lptfcs)',lptfcs, 'OP ') po.ovarre(self.outfile, "TF coil charging voltage (V)", "(tfcv)", tfcv) po.ovarre(self.outfile, "Number of DC circuit breakers", "(ntfbkr)", ntfbkr) po.ovarre(self.outfile, "Number of dump resistors", "(ndumpr)", ndumpr) diff --git a/process/models/stellarator/coils/calculate.py b/process/models/stellarator/coils/calculate.py index 42eced11f..6365becb7 100644 --- a/process/models/stellarator/coils/calculate.py +++ b/process/models/stellarator/coils/calculate.py @@ -542,7 +542,6 @@ def calculate_casing(): """ # [m] coil case thickness outboard distance (radial) tfcoil_variables.dr_tf_plasma_case = tfcoil_variables.dr_tf_nose_case - # dr_tf_nose_case = case_thickness_constant/2.0e0 # [m] coil case thickness inboard distance (radial). # [m] coil case thickness toroidal distance (toroidal) tfcoil_variables.dx_tf_side_case_min = tfcoil_variables.dr_tf_nose_case diff --git a/process/models/tfcoil/base.py b/process/models/tfcoil/base.py index 8e481b078..01f79848a 100644 --- a/process/models/tfcoil/base.py +++ b/process/models/tfcoil/base.py @@ -648,7 +648,8 @@ def outtf(self): if tfcoil_variables.i_tf_sup == TFConductorModel.WATER_COOLED_COPPER: po.ocmmnt( - self.outfile, " -> resistive coil : Water cooled copper (GLIDCOP AL-15)" + self.outfile, + " -> resistive coil : Water cooled copper (GLIDCOP AL-15)", ) elif tfcoil_variables.i_tf_sup == TFConductorModel.SUPERCONDUCTING: po.ocmmnt(self.outfile, " -> Superconducting coil (SC)") @@ -1400,12 +1401,6 @@ def outtf(self): "(1-f_a_tf_turn_cable_copper)", 1 - tfcoil_variables.f_a_tf_turn_cable_copper, ) - # TODO - # po.ovarre(self.outfile,'Conductor fraction of winding pack','(tfcoil_variables.a_tf_wp_conductor/ap)',a_tf_wp_conductor/ap, 'OP ') - # po.ovarre(self.outfile,'Conduit fraction of winding pack','(tfcoil_variables.n_tf_coil_turns*tfcoil_variables.a_tf_turn_steel/ap)',n_tf_coil_turns*tfcoil_variables.a_tf_turn_steel/ap, 'OP ') - # po.ovarre(self.outfile,'Insulator fraction of winding pack','(tfcoil_variables.a_tf_coil_wp_turn_insulation/ap)',a_tf_coil_wp_turn_insulation/ap, 'OP ') - # po.ovarre(self.outfile,'Helium area fraction of winding pack excluding central channel','(tfcoil_variables.a_tf_wp_extra_void/ap)',a_tf_wp_extra_void/ap, 'OP ') - # po.ovarre(self.outfile,'Central helium channel area as fraction of winding pack','(tfcoil_variables.a_tf_wp_coolant_channels/ap)',a_tf_wp_coolant_channels/ap, 'OP ') ap = ( tfcoil_variables.a_tf_wp_conductor + tfcoil_variables.n_tf_coil_turns * tfcoil_variables.a_tf_turn_steel @@ -1950,8 +1945,6 @@ def outtf(self): # TF coil radial build po.osubhd(self.outfile, "Radial build of TF coil centre-line :") - # po.write(self.outfile,5) - # 5 format(t43,'Thickness (m)',t60,'Outer radius (m)') radius = build_variables.r_tf_inboard_in po.obuild(self.outfile, "Innermost edge of TF coil", radius, radius) @@ -3565,12 +3558,6 @@ def stresscl( ): raise ProcessValueError("r_tf_inboard_in is ~= 0", 245) - # TODO: following is no longer used/needed? - # if tfcoil_variables.a_tf_turn_cable_space_no_void >= 0.0e0: - # tcbs = numpy.sqrt(tfcoil_variables.a_tf_turn_cable_space_no_void) - # else: - # tcbs = 0.0e0 - # LAYER ELASTIC PROPERTIES # ------------------------ # Number of bucking layers diff --git a/process/models/tfcoil/superconducting.py b/process/models/tfcoil/superconducting.py index 7eb09416b..0b6947fe4 100644 --- a/process/models/tfcoil/superconducting.py +++ b/process/models/tfcoil/superconducting.py @@ -674,7 +674,6 @@ def calculate_superconductor_temperature_margin( full_output=True, disp=True, ) - # print(root_result) # Diagnostic for newton method temp_tf_superconductor_margin = t_zero_margin - temp_tf_coolant_peak_field tfcoil_variables.temp_margin = temp_tf_superconductor_margin